Had to fill half of the video ;) plus, it's a game full of memory bugs haha
@thisisatiles5 күн бұрын
man, now the project has some cmakePresets.json so, everything you started doing around minute 27 got me completely lost. Could you explain what you did there and how to apply it to the current source in github, please?
@codingwithmat8 күн бұрын
By "programmers who do C++ for 30 years" I really meant "me get it wrong all the time" 😂
@heavymetalmixer9111 күн бұрын
What do you think about the overhead that all smart pointers add? Is it a good trade-off?
@codingwithmat9 күн бұрын
It depends dude, for algorithms where you're dereferencing a lot pointers then yeah it's a tradeoff to think about. I think I remember Bjarne saying that the smart pointers add, on average, 10% overhead. for cases where you're just using pointers to hide forward declared things, PIMPL stuff, then it's worth it for sure :)
@Colaholiker11 күн бұрын
at 1:24:20, why don't you just take the result of the bitwise and, and then check if it is != 0? After all, this is just explicitly writing out what C/C++ would do internally. After the comparison, it is a boolean value. (And it is something I write in my C/C++ code all the time as I hate all that implicit crap going on there...)
@codingwithmat9 күн бұрын
If you think about the operations the compiler will need to compile, your method has two: the bitwise operation and then the equality. The way I did there is only really one: the more than check. Compilers tend to be pretty good at optimising code. I.e. in both cases (your suggestion and what I did), the operation boils down to checking whether the MSB is set, so the compiled code *could* be simply that if the optimiser works in that case. Reality is, the simpler the code is, the more likely the compiler is to find the right optimisation. Hence why I chose the more than, for less operations and less complexity to the optimiser. Can't tell you whether that was the right decision unless I look at the compiled code xD
@rockokechukwu334312 күн бұрын
Can you share the GitHub repo? This is interesting
@Evilanious13 күн бұрын
As a beginner I indeed do not understand what is happening there. Something about retaining the value category when being passed to a templated function. Of course it would help if I wasn't so damn fuzzy on what l-values and r-values actually are, or had done more templating. To the extend that I understand what this does I still don't know why I would want to do that. That said, I think we should understand that documentation can be learning material or reference material. Learning material is to bring beginners up to speed. Reference material is to fill in working professionals on arcane details they're not sure about. Learning material has to set up all the context a beginner would not know. Reference material has to be comprehensive and get to the point, which means assuming the basics are covered. This here looks like mostly reference material.
@bogdanfilimon248615 күн бұрын
Nice one, didn’t know about it
@codingwithmat15 күн бұрын
Thanks for watching dude! Yeah this always saves me so much time when doing multi-line commands. It's a life saver in the terminal :)
@codingwithmat15 күн бұрын
How many of you knew about this one???
@BasilKepler15 күн бұрын
Have you still been using that shitty soft? Really?
@Bingo90116 күн бұрын
Why dont you just use type_index ? Wouldn’t it easily solve the problem of getting all entities having a component of a certain type ? Just use it as the key for unordered list and have the value as list of entity ids
@codingwithmat9 күн бұрын
Hmm, I'll think about that. Using the id would be friendlier than the type name for hashing purposes for sure :)
@randdomnerd17 күн бұрын
Thanks a lot for this video! It was really helpful and informative.
@JamesTJoseph17 күн бұрын
The MS C/C++ extension doesn't support lldb except in mac. If you want to use lldb you need to use codelldb extension.
@codingwithmat17 күн бұрын
Good point, I should have mentioned that in the video!
@JamesTJoseph17 күн бұрын
@@codingwithmat btw, you may consider using devcontainer.
@JamesTJoseph17 күн бұрын
@@codingwithmat btw, CMake and MS C/C++ extension works well except the need of gdb.
@codingwithmat17 күн бұрын
@@JamesTJoseph yes it works well out of the box! I just mentioned clangd/lldb to those on WSL/Linux because it works even better
@JamesTJoseph17 күн бұрын
Use this instead of hardcoding your program. "program": "${command:cmake.launchTargetPath}"
@brockdaniel884517 күн бұрын
You can also install llvm-mingw from GitHub -> release ❤❤
@xD-saleem17 күн бұрын
thanks so much for this video!
@codingwithmat17 күн бұрын
Thanks for watching my man! Let me know if you have a chance to try the example project, will be improving it based on feedback.
@xD-saleem17 күн бұрын
@@codingwithmat alright
@Veeq717 күн бұрын
Shift+F5 runs in debug if you have cmake tools, Ctrl+F5 runs without debug. launch.json is not needed
@codingwithmat17 күн бұрын
Good shortcut, but if you want to pick up the right build + pass in args as an example, you're gonna need to dive into the launch.json!
@aiyolo291417 күн бұрын
thanks for your sharing. there is a lldb-dap extension on vscode, do you know how to configure it to debug cpp code on windows?
@codingwithmat17 күн бұрын
I've not personally used "lldb-dap", whenever I want to debug with LLDB I tend to use CodeLLDB. I'll try it out and will report on discord if I notice any benefits! Make sure to join us there :)
@codingwithmat18 күн бұрын
Did you manage to debug your own C++ code? If not, post below and we can help you out !
@Dawsatek2211 күн бұрын
can you maybe make a video on how to install headers files in cmake?
@TheMaykids21 күн бұрын
Queria ficar monstrao em cpp tambem, algum curso ou livro que recomenda? btw, sua aula de vcpkg me ajuda ate hoje
@codingwithmat21 күн бұрын
Valeu irmao! É pratica msm, tu tem que praticar bastante, ler as docs, e uns livros pra ajudar. Eu mais aprendo com prejetos msm. Entra la no discord que nois te ajuda
@codingwithmat21 күн бұрын
For books I recommend "the c++ programming language" by Bjarne, teaches you the foundations of C++ very well
@paradoxicalcat717321 күн бұрын
What is good code? One that makes intention clear. C++ sure as hell isn't that. Don't get me started on the "clean code" BS.
@paradoxicalcat717321 күн бұрын
C++ syntax is bad, and it's made worse by devs (mis)using it. Half of C++ is trying to avoid using raw pointers; the other half, memory. Time you all learned how to use pointers and memory management. I have 25 years experience writing C and assembler, and C++ just drives me nuts with its BS. There are some useful things (NOT classes), but most of it is syntax spaghetti.
@Prescott2400-my6di26 күн бұрын
codingwithmat, listen to me. OO languages is a mess. Prgramining in C is better then anything they got over there. The syntax might seem much sweeter Where objects and subtypes play But frills like inheritance Will only get in the way! Admire C's simple landscape Efficiently dangerous! No templates or fancy pitfalls like Java and C++! Program in C Program in C Pointers, assembly Manage your memory With malloc() and free()! Don't sink your app with runtime bloat Software in C will stay afloat Do what you want there Close to the hardware Program in C 🎶🎶🎶🎶🎶
@Redeam.28 күн бұрын
Ez 100$ 😂😂
@nodarimosia682529 күн бұрын
Also good to mention, if you want your browser to refresh the page on rebuilds, you can simply add this to your .air.toml file: [proxy] enabled = true app_port = 8080 proxy_port = 8090 This will take the output of the app_port, proxy it to proxy_port and any time the app_port updates, air will push those updates to proxy_port. If you connect to port 8090 in your browser (instead of 8080 as shown in the video), browser will automatically refresh the tab on changes.
@user-be8ud2qd2dАй бұрын
same, thanks for the openness
@codingwithmatАй бұрын
It's important to show people that it's normal to feel demotivated sometimes. Especially when all you see on KZbin is software engineers doing amazing things all the time - they too struggle
@mikkironsen4380Ай бұрын
uwu
@xD-saleemАй бұрын
same :)
@bobby9568Ай бұрын
Same
@codingwithmatАй бұрын
It's difficult to be consistent my man, it's truly a skill very few people have :(
@sandakelum_priyamanthaАй бұрын
it's super cool
@codingwithmatАй бұрын
thanks, hopefully you can make an app with these frameworks too :)
@sandakelum_priyamanthaАй бұрын
@@codingwithmat already started 🤗
@ghaddar0292Ай бұрын
Thanks for the video. I'm starting to learn how to implement an ECS system in C++ and this was definitely educational. I have two questions/concerns on the implementation. 1- Type info may return different results on different platforms or compiler or invocations of the program. Hence, I don't think it is reliable to use especially wheh dealing with serializing state from and to disk. 2- I may be mistaken, but creating a new vector of entities each time when get is called does not seem ideal as that will allocate new memory each time. I don't know how to implement yet, but returning an iterator to the entity ids which have the component may avoid this issue.
@codingwithmatАй бұрын
Hey @ghaddar0292 , thanks for watching! (1) you are correct, `typeinfo` will return different names and hashes between platforms. In this implementation, the ECS only uses the information internally to keep track where the vectors of entities are stored for each component. (2) This implementation changed quite a bit. There was actually some issues somewhere with the use of iterators in this implementation and memory sanitisers.If you take a look at the current state of the code, the entities are basically stored as a `std::variant<Ts...>`, and I now use a map of `{bitmask, component combo entities}` to store the data internally.
@gazapoАй бұрын
The declined of java after 1.8 was after modules 😂😂 every new version c++ is more complicated and ugly
@codingwithmatАй бұрын
Could we be witnessing the decline of C++? No one seems to be using modules :D
@codingwithmatАй бұрын
To clarify: theyre both difficult to learn well. Still easy to get the basics out of bot
@victotronicsАй бұрын
As a beginner you don't look at std::forward. Case closed. Please find a better example.
@nesoaniagboso7287Ай бұрын
What are the foundations? I just learnt C++ including advanced topics like move semantics, lambda expressions, Templates, enumeration etc. and I’m currently learning Data structures and Algorithms in C++. What foundations are my missing please?
@codingwithmatАй бұрын
popular algorithms, how data structures (trees, lists, hashmaps, etc) are implemented, extensive logic, etc.
@emitsecАй бұрын
wise words pal
@codingwithmatАй бұрын
Thanks my man
@AnotherDevelopersWorldАй бұрын
So true! Foundations is the most important thing
@codingwithmatАй бұрын
Yes Tom! People need to learn the basics properly before moving on to advanced frameworks for sure
@windwalkerrangerdmАй бұрын
Yeah I had a hunch you'd make a clip of this one. More people have to talk about this I'd say. Kudos on bringing it up.
@codingwithmatАй бұрын
Seemed like a good rant in the stream Al! People need to hear this anyway 😂
@jazzdestructorАй бұрын
Hey Mat , i am a js dev and wanted to learn a new backend language could you suggest me which would be better between Go and Rust? I am very confused here thought you might be able to help here as you know both
@codingwithmatАй бұрын
I'd say Go if you want a job, then Rust if you want to bet on future (and also learn a cool new language)! I personally enjoy coding in Rust more, but I'd struggle to do it professionally as there are very few Rust jobs 😢
@jazzdestructorАй бұрын
@@codingwithmat I was also thinking just do Go and Rust, but i am being lazy and wanted to choose just one, i sometimes feel like saying f*** it and do python for AI xD. but will target Go and Rust both and get a feel for it then might. PS: Thanks a lot for the reply man. Any tips on how you would start learning a new language? dont you get confused with syntax for 3 diff langs?
@codingwithmatАй бұрын
Hey, thanks for watching the videos! I mean, when I learn some new language I usually just practice it consistently, maybe start a project in it or something. Learn one at a time as you will confuse the syntaxes :D
@jazzdestructorАй бұрын
@@codingwithmat Absolutely will focus on one starting with Go and currently using your go urchin videos as reference , will definitely try and create some basic apps first and dive into urchin code base. Thanks for the reply. cheers 🍻
@rnp.rudranarayanpandaАй бұрын
Hi mat, Can you tell me how you plan your personal projects, bcz for me I plan them and when I start building there are modifications required in the earlier design, due to these kind of modifications I mostly fail to completely build it. Can you give some tips/ guide me?
@codingwithmatАй бұрын
Hey dude, thanks for watching! I tend to follow the MVP model, where I know what I mostly want to achieve in a project, but build like the minimum features needed to make this project work first, then add more features later on. I find it a lot simpler to work towards simple goals first, then iterate on them and increase the complexity of the project later on. You know, designing a whole system is difficult. Specially when people start with a lot of different requirements / goals and overwhelm themselves into not getting even the simple things working! So go for simple, then iterate on it :)
@danielgriffiths5901Ай бұрын
@@codingwithmatthis is really good advice and I think scope creep is the most common killer of personal projects. I’ve also found that when in doubt - leave it out is helpful for completing personal projects.
@rnp.rudranarayanpandaАй бұрын
@@codingwithmat cool, will try this approach
@bobby9568Ай бұрын
Awesome ❤🎉
@codingwithmatАй бұрын
Thanks bobby! Hope you enjoyed learning about some C++ pointers
@MustlightАй бұрын
Yoo, my man. Thanks for the video. ❤
@codingwithmatАй бұрын
Thank you for watching my guy!
@jackanime-yn9byАй бұрын
can you make a tutorial video
@codingwithmatАй бұрын
Installing devkitpro is quite easy, just look at the instructions on their page. After that, you can refer to this stream to get it setup with CMake :)
@jackanime-yn9byАй бұрын
how do you get Dev kitpro setup for for DS app making
@laujimmy9282Ай бұрын
Typical documentation 😂
@gostan2718Ай бұрын
I like C++ module and I think there is a market for people only care about the latest C++ version
@codingwithmatАй бұрын
I agree. Right now only people who care about the most modern versions of C++ are using it, so I had to revert back to source/includes for this project :(
@0xTheConsultantАй бұрын
For me its not just that some of the documentation is like that, its that some programmers ACTUALLY write confusing ass code that looks like that lol. I mean great, but now i have to spend the next couple of hours figuring out what the hell is going on /facePalm
@horvatj1973Ай бұрын
This page is *not* the documentation page of C++. (facepalm). Neither it is designed for beginners. (facepalm). Just buy a book or go to a tutorial pages or yt videos.
@thialbuquerqueАй бұрын
The only C++ documentation is ISO C++ Standard, and it costs an eye