Learning Programming by Trying and Failing // Code Review

preview_player
Показать описание


🌏 LINKS

📚 CHAPTERS
0:00 - Hello
1:54 - Story time with Cherno
5:38 - Entity Component System (ECS)

💰 Links to stuff I use:

This video is sponsored by Brilliant.
Рекомендации по теме
Комментарии
Автор

Failing to learn or failing, to learn.

learningtoride
Автор

I don't think the object slicing remark is entirely correct. It has nothing to do with the objects being stack allocated. The issue would occur if you were to pass in a subclass type by value to a base class type. This could happen even with a heap allocated object if you were to dereference the subclass type when calling a function that takes a base type by value. The most important thing is everywhere where you take in a base class to take it in by pointer or reference... Which you should be doing normally anyways - don't make redundant copies :)

alexkhazov
Автор

Would love to see the implementation of ECS.

GB_Parametric
Автор

I really like these reviews, but I do feel like in a multi-episode series like this one it would have been nice to see what the thing actually does and maybe skim a sample project.

slgnssp
Автор

That was informative in a way I did not expect. I have never really thought about the deeper inner workings of how an ECS is structured and how it works.

Gastrostomi
Автор

Please make a diagram design structure how all these parts should be designed and make it visual .. from entity, to requiremnets for each entity.

mariwanj
Автор

Yes! Possible solutions would be a great follow up!

TheAxeForgetsTheTreeRemembers
Автор

Man, with how hard you're tearing into this, you should do a code review of the Source SDK for Source Engine. This code here, while having some questionable design decisions, is not that bad.

Spirrwell
Автор

Weather members will be stack or heap allocated is determined how you allocate them, not where you put them in the code. There is nothing wrong with use of polimorphism to make an ECS - and still you can put derived classes in their seperate memory buckets - nothing stops you from doing so. Personally I would not put any functionality in components - just the data. All of this continious memory effort is useless if you have to process logic that requires multiple component types at the same time - basically you will be fetchind data from different buckets all the time causing a lot of cache misses - but its true that some systems (rendering) may benefit from such arrangement.

lromaniuk
Автор

Great video as always Cherno, you're like the Bob Ross of programming in c++

gabrielciordas
Автор

If your child component need access to the parent and you store the parent pointer, it is usually a red flag.

tiagocerqueira
Автор

the dev : please roast me
the cherno :
for each (lines of code)
make a 30 minute video on why that line of code is bad

Theawesomeking
Автор

After listening to your channel a bunch, I realised what I really wanted to build is an engine and not an editor. My "Compositions" should just be known at compile time because I won't use an editor to build them. I ended up not having a entity component system at all. I know my classes will be next to each other in memory and won't cache miss.

gabrielbeaudin
Автор

Memory layout of components is an implementation detail of ECS, not a requirement for an ECS system.

sirpalee
Автор

Writing a custom arena allocator would be an interesting video topic

sinom
Автор

Really cool book reference! will definitely check it out!

the_gobbo
Автор

I actually enjoyed reading the architecture of s2d, because it's a fresh perspective on some things. (sometimes a dangerous perspective, see Object Slicing)
After >30 years of programming, I learn primarily not from reading "best" practices, I learn from good practices and even bad practices I observe in the field. :3

thygrrr
Автор

Multi threaded design patterns would be a great because as we start to scale the applications by adding more features the applications start to get slow so please 🙏 do teach us by giving some suggestions and stuff...

_blanka
Автор

It is simply about to study enough to get the knowledge that boosts your project, and to practice enough to learn, get results, and not to get frustrated becuse of the infnite available contents to study.

I feel this the most difficult part of software engineering, to make the optimal solution acquiring enough knowledge to reach it.
Do not just study programming and do not just make programs, find the optimal way to get things done.

informagico
Автор

1:35 It is not possible to "just build, not learning". My opinion.

mad_circuits