Create PERFECT Docker Images
9:34
Creating C++ Executables With CMake
7:16
Пікірлер
@al8905
@al8905 Күн бұрын
I like the brainrot like crash bandicoot approach
@codingwithmat
@codingwithmat Күн бұрын
thanks, unfortunately the algorithm didn't 😂😂
@bobby9568
@bobby9568 3 күн бұрын
What does crash bandicoot has to do with this? 😂
@codingwithmat
@codingwithmat 2 күн бұрын
Had to fill half of the video ;) plus, it's a game full of memory bugs haha
@thisisatiles
@thisisatiles 5 күн бұрын
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?
@codingwithmat
@codingwithmat 8 күн бұрын
By "programmers who do C++ for 30 years" I really meant "me get it wrong all the time" 😂
@heavymetalmixer91
@heavymetalmixer91 11 күн бұрын
What do you think about the overhead that all smart pointers add? Is it a good trade-off?
@codingwithmat
@codingwithmat 9 күн бұрын
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 :)
@Colaholiker
@Colaholiker 11 күн бұрын
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...)
@codingwithmat
@codingwithmat 9 күн бұрын
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
@rockokechukwu3343
@rockokechukwu3343 12 күн бұрын
Can you share the GitHub repo? This is interesting
@Evilanious
@Evilanious 13 күн бұрын
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.
@bogdanfilimon2486
@bogdanfilimon2486 15 күн бұрын
Nice one, didn’t know about it
@codingwithmat
@codingwithmat 15 күн бұрын
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 :)
@codingwithmat
@codingwithmat 15 күн бұрын
How many of you knew about this one???
@BasilKepler
@BasilKepler 15 күн бұрын
Have you still been using that shitty soft? Really?
@Bingo901
@Bingo901 16 күн бұрын
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
@codingwithmat
@codingwithmat 9 күн бұрын
Hmm, I'll think about that. Using the id would be friendlier than the type name for hashing purposes for sure :)
@randdomnerd
@randdomnerd 17 күн бұрын
Thanks a lot for this video! It was really helpful and informative.
@JamesTJoseph
@JamesTJoseph 17 күн бұрын
The MS C/C++ extension doesn't support lldb except in mac. If you want to use lldb you need to use codelldb extension.
@codingwithmat
@codingwithmat 17 күн бұрын
Good point, I should have mentioned that in the video!
@JamesTJoseph
@JamesTJoseph 17 күн бұрын
@@codingwithmat btw, you may consider using devcontainer.
@JamesTJoseph
@JamesTJoseph 17 күн бұрын
@@codingwithmat btw, CMake and MS C/C++ extension works well except the need of gdb.
@codingwithmat
@codingwithmat 17 күн бұрын
​@@JamesTJoseph yes it works well out of the box! I just mentioned clangd/lldb to those on WSL/Linux because it works even better
@JamesTJoseph
@JamesTJoseph 17 күн бұрын
Use this instead of hardcoding your program. "program": "${command:cmake.launchTargetPath}"
@brockdaniel8845
@brockdaniel8845 17 күн бұрын
You can also install llvm-mingw from GitHub -> release ❤❤
@xD-saleem
@xD-saleem 17 күн бұрын
thanks so much for this video!
@codingwithmat
@codingwithmat 17 күн бұрын
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-saleem
@xD-saleem 17 күн бұрын
@@codingwithmat alright
@Veeq7
@Veeq7 17 күн бұрын
Shift+F5 runs in debug if you have cmake tools, Ctrl+F5 runs without debug. launch.json is not needed
@codingwithmat
@codingwithmat 17 күн бұрын
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!
@aiyolo2914
@aiyolo2914 17 күн бұрын
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?
@codingwithmat
@codingwithmat 17 күн бұрын
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 :)
@codingwithmat
@codingwithmat 18 күн бұрын
Did you manage to debug your own C++ code? If not, post below and we can help you out !
@Dawsatek22
@Dawsatek22 11 күн бұрын
can you maybe make a video on how to install headers files in cmake?
@TheMaykids
@TheMaykids 21 күн бұрын
Queria ficar monstrao em cpp tambem, algum curso ou livro que recomenda? btw, sua aula de vcpkg me ajuda ate hoje
@codingwithmat
@codingwithmat 21 күн бұрын
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
@codingwithmat
@codingwithmat 21 күн бұрын
For books I recommend "the c++ programming language" by Bjarne, teaches you the foundations of C++ very well
@paradoxicalcat7173
@paradoxicalcat7173 21 күн бұрын
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.
@paradoxicalcat7173
@paradoxicalcat7173 21 күн бұрын
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-my6di
@Prescott2400-my6di 26 күн бұрын
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.
@Redeam. 28 күн бұрын
Ez 100$ 😂😂
@nodarimosia6825
@nodarimosia6825 29 күн бұрын
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
@user-be8ud2qd2d Ай бұрын
same, thanks for the openness
@codingwithmat
@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
@mikkironsen4380 Ай бұрын
uwu
@xD-saleem
@xD-saleem Ай бұрын
same :)
@bobby9568
@bobby9568 Ай бұрын
Same
@codingwithmat
@codingwithmat Ай бұрын
It's difficult to be consistent my man, it's truly a skill very few people have :(
@sandakelum_priyamantha
@sandakelum_priyamantha Ай бұрын
it's super cool
@codingwithmat
@codingwithmat Ай бұрын
thanks, hopefully you can make an app with these frameworks too :)
@sandakelum_priyamantha
@sandakelum_priyamantha Ай бұрын
@@codingwithmat already started 🤗
@ghaddar0292
@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
@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
@gazapo Ай бұрын
The declined of java after 1.8 was after modules 😂😂 every new version c++ is more complicated and ugly
@codingwithmat
@codingwithmat Ай бұрын
Could we be witnessing the decline of C++? No one seems to be using modules :D
@codingwithmat
@codingwithmat Ай бұрын
To clarify: theyre both difficult to learn well. Still easy to get the basics out of bot
@victotronics
@victotronics Ай бұрын
As a beginner you don't look at std::forward. Case closed. Please find a better example.
@nesoaniagboso7287
@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
@codingwithmat Ай бұрын
popular algorithms, how data structures (trees, lists, hashmaps, etc) are implemented, extensive logic, etc.
@emitsec
@emitsec Ай бұрын
wise words pal
@codingwithmat
@codingwithmat Ай бұрын
Thanks my man
@AnotherDevelopersWorld
@AnotherDevelopersWorld Ай бұрын
So true! Foundations is the most important thing
@codingwithmat
@codingwithmat Ай бұрын
Yes Tom! People need to learn the basics properly before moving on to advanced frameworks for sure
@windwalkerrangerdm
@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
@codingwithmat Ай бұрын
Seemed like a good rant in the stream Al! People need to hear this anyway 😂
@jazzdestructor
@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
@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
@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
@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
@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
@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
@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
@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
@rnp.rudranarayanpanda Ай бұрын
@@codingwithmat cool, will try this approach
@bobby9568
@bobby9568 Ай бұрын
Awesome ❤🎉
@codingwithmat
@codingwithmat Ай бұрын
Thanks bobby! Hope you enjoyed learning about some C++ pointers
@Mustlight
@Mustlight Ай бұрын
Yoo, my man. Thanks for the video. ❤
@codingwithmat
@codingwithmat Ай бұрын
Thank you for watching my guy!
@jackanime-yn9by
@jackanime-yn9by Ай бұрын
can you make a tutorial video
@codingwithmat
@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
@jackanime-yn9by Ай бұрын
how do you get Dev kitpro setup for for DS app making
@laujimmy9282
@laujimmy9282 Ай бұрын
Typical documentation 😂
@gostan2718
@gostan2718 Ай бұрын
I like C++ module and I think there is a market for people only care about the latest C++ version
@codingwithmat
@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
@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
@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
@thialbuquerque Ай бұрын
The only C++ documentation is ISO C++ Standard, and it costs an eye