Тёмный

Switching to C - One Year Later 

Nick Walton
Подписаться 6 тыс.
Просмотров 59 тыс.
50% 1

One year ago I switched from C++ to C as my main programming language. Was it worth it? And am I switching back to C++?
Ben Eater's video series about building a 6502-based computer: • Build a 65c02-based co...

Игры

Опубликовано:

 

16 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 426   
@mavhunter8753
@mavhunter8753 4 года назад
"If you understand computers C makes sense" - Linus Torvalds
@LemonChieff
@LemonChieff 3 года назад
That only works if you understand C. Which you don’t. Otherwise you’d be writing a compiler for it. (Likely in c++)
@rhighsss
@rhighsss Год назад
@@LemonChieff That hurts
@danielthirtle666
@danielthirtle666 Год назад
@@LemonChieff you've clearly never actually done anything in C. C is such a simple language to learn and understand, way simpler than C++.
@defnlife1683
@defnlife1683 Год назад
I’ve taken online courses for several languages and even took a university course using python. It wasn’t until I started taking a course on C that I fell in love with programming. I’m an attorney not a programmer, but now I’m in love with computing and I’ve been able to incorporate a lot of things into my own practice as an attorney. I just wish I had learnt it earlier It feels trivial to write scripts in several languages. It’s just a wonderful experience overall once you understand with the computer does.
@nightfox6738
@nightfox6738 4 года назад
Assembly is a wonderful language for learning about the underlying hardware and improving your C code and can also be very useful for some low-level math libraries. Also pretty much necessary for GPU coding and embedded systems in general. In most cases though Assembly is just too verbose and it takes far too long to do anything, which is where a language like C really shines. It has the added control of Assembly but isn't bloated and over-abstracted like C++.
@cookiecan10
@cookiecan10 3 года назад
Why would assembly be needed for GPU coding? I've used OpenGL with C++ a little bit, but none of the tutorials mentioned anything about assembly.
@nightfox6738
@nightfox6738 3 года назад
​@@cookiecan10 opengl is an interface that allows you to not have to do GPU coding. It abstracts it away to make things easier. But if you're the one doing it, you're using assembly. Using opengl is not technically "Gpu coding" That being said, you can feed shaders written in assembly into opengl which offers better control and performance than shaders compiled from c++ so just because you're using opengl also doesn't mean you're not using assembly. However it can be beneficial and perhaps even necessary sometimes to bypass opengl altogether in order to acheive better perfomance and control. In those cases assembly is a must.
@hmdz150
@hmdz150 3 года назад
Dude I was just like you, and even assembly couldn’t satisfy me. So I started studying electronics engineering and went down below bare metal (to the silicon and semiconductors!). Now After 6 years, I am ready to get back to C++!
@jamiewalkerdine3705
@jamiewalkerdine3705 Год назад
@@actualwafflesenjoyer that's all? I went down to LQG and string theory!
@AvantGrade
@AvantGrade 4 года назад
In 4 years : switching to quantum mechanics and playing with electrons
@roch3586
@roch3586 3 года назад
LOL
@kothekarswaraj
@kothekarswaraj 3 года назад
next year he will be switching to assembly and then to gates
@hanelyp1
@hanelyp1 3 года назад
As best I can figure, quantum computing will be plagued by never knowing if the calculation was done right until checking the result with a conventional computer.
@AndresFH7233
@AndresFH7233 4 года назад
Nice video!, recently I'm re-learning C and it is great, C awakes that inner geek.
@perenganitodelta8625
@perenganitodelta8625 3 года назад
Hi! Which resources used or recommends me?
@souptenderpanini3106
@souptenderpanini3106 3 года назад
@@perenganitodelta8625 derek banas can help you get started if you have *some* programming knowledge already
@thisguyisnotable
@thisguyisnotable Год назад
your humor is amazing and your reasons are great, (im learning c and most of your reasons are similar to why i started learning it) which makes for a beautiful and entertaining video! great job man, keep the good work up :D
@oliverlenz7300
@oliverlenz7300 4 года назад
Nice video! I came from the other direction - I started in the 80s with Z80 and 6502 assembly, then went on to C. Later I switched to C++. But like you said in the first video, I dislike the artificial abstraction resulting in a lot of code with no real use. So I do C for 20 years now.
@WarpRulez
@WarpRulez 4 года назад
Why do 90% of people complain about what _other people do_ with C++? "I don't like C++ because of how other people use it."
@christiangonzalez6945
@christiangonzalez6945 3 года назад
@@WarpRulez ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-0Nz8YrCC9X8.html
@drygordspellweaver8761
@drygordspellweaver8761 Год назад
@WarpRulez Because “other people” adopting and pushing a shitty paradigm forces shitty programs on everyone. Games run slower, industry biases get created, bad coding practices become standardized. It drags everyone down.
@deltakid0
@deltakid0 3 года назад
Ben Eater 8-bit building computer videos taught me what assembly programming actually was and reading those comments one can find programmers from the 80's admiring the explanation and even discovering things they didn't know back then so that is the best starting point to become a skilled programmer, then, the next best thing seems to be C language since highly skilled programmers like John Carmack, Linus Torvalds, Rebecca Heinneman and others prefer it to do the job as you also explained before. I have used C# for 12+ years and now I'm also pursuing a C programmer career since it's not only simple, predictable on the assembly output but also very fast on the machine it's running on. I'm glad I'm not the only one thinking like that, thank you.
@timothywright4509
@timothywright4509 4 года назад
I switched over to all my personal projects in C two years ago and I've had the same experience. I think it is interesting how this kind of thing has to be a personal journey. Any of my fellow programmers who I tell think I'm crazy. Seems like the only way to understand is to do it. Thanks for the video!
@wiktorwektor123
@wiktorwektor123 4 года назад
The only crazy thing is to try abstract everything from hardware that runs code. It's like saying "don't worry about gravity it doesn't apply to you" i real world. If you are totally disconnected from the world you are trying to program, you don't know how to do it in the first place. This brings consternations. What is "object"? Why to use it and how it behaves? CPU, GPU, HDD, SSD doesn't have objects. They understand bits, bytes and arrays. They don't give a damn about "people", "animals", "enemies", "shots", "levels" etc... Why forcing people to think about data as "objects" and forcing them to implement this on hardware that have absolutly no idea about it, is beyond me.
@SaidMetiche-qy9hb
@SaidMetiche-qy9hb 4 года назад
@@wiktorwektor123 True haha, C can be way more powerful when you understand it, assembly is powerful as well, but if C had some other features and different ones it could be perfect forever
@moestietabarnak
@moestietabarnak 2 года назад
@@wiktorwektor123 same, I always find it funny that every initiation to an object oriented language book I read start with 'object is intuitive'.. then proceed with 4-5 chapter on why it is so...
@brandyskills8447
@brandyskills8447 4 года назад
I really liked hearing about this! I was initially a little frustrated that my uni didn't have entry-level subjects for C++ or C#, and only C. I actually found that I'm learning the information at a much more intuitive level, and I'm understanding WAY more about what every line of my code is doing. I entirely get your frustrations where you felt you didn't understand what you were doing in C++ and wanted to understand why, and I think C is a much better alternative to start out to learn those base concepts before diving straight in the deep end. Great video, thanks for your insight :)
@calebwait510
@calebwait510 4 года назад
Consider yourself lucky! my uni taught us java(basically c#) and c++, and they never taught us about c, i wish it went java -> c -> c++ as this seems like a logically progression when you think about it
@SaidMetiche-qy9hb
@SaidMetiche-qy9hb 4 года назад
@@calebwait510 C -> C++, forget Java it's shit lol
@zytr0x108
@zytr0x108 Год назад
@@SaidMetiche-qy9hb C -> C, forget C++ it’s shit lol
@BogdanSerban
@BogdanSerban 4 года назад
For me C and Python are the to-go languages. C because I work with embedded and Python for when I need to write programs that are over the OS level of abstraction, even cross platform.
@emanuelclur2811
@emanuelclur2811 4 года назад
Python used as interpreter of C/C++ bindings (rlly usefull for non-programmers such as scientists). But when you are a programmer and you know what are you doing the only one benefit is that you can "implement" more faster. In other hand... slow run-time, slow interpreter, it's complete unuseful in production of a real aplication. You can say "Oh, but google use it", and i can response with "but google also created go-lang, and tensorflow is on low level writted on C". IBM doesn't use it at all.
@renatosardinhalopes6073
@renatosardinhalopes6073 3 года назад
Me, but I use Python and C++. Plus web dev languages because college requires it. If I want speed, I use c++. If I'm solving silly problems or just want to chill code I'll just use python, with simple programs the compile time wouldn't even matter anyway.
@SaHaRaSquad
@SaHaRaSquad 2 года назад
I think knowing C or Assembly is important as it gives you an intuition about performance and efficiency in software, even in many other languages. Knowing what an allocation is can help in e.g. Python or Java as well. Though in the end I favor Rust, it has a good balance between still being transparent about what happens in the background while providing more convenience. And the compiler is just so good at finding potential issues.
@TheCocoaDaddy
@TheCocoaDaddy 4 года назад
Thanks for posting this follow-up!
@djpenton779
@djpenton779 3 года назад
I am retired now, but was a software developer for many years. As a young man, I thought that I was a good programmer. Most young programmers think this. Upon retirement I decided to do a master's degree in software engineering, with a focus on programming languages. I learned quite a lot in the course of doing the degree. First, I learned that I am, and always was, at best average in my programming abilities. Second, I learned that I detest fan boy devotion to this or that language. I spent a lot of time around people obsessed with functional programming and haskell. This was a pain in the ass. The most important thing that I became convinced of is this: a tool (software or otherwise) is ok if you or anyone can do useful things with it. Not "perfect" things. I have for years completely detested Microsoft Word, even though I had to use it at work to write documentation. I prefer LaTeX. (Yes, I'm serious.) But millions of people have written tons of important stuff using Word,. Good on them. Same goes for programming languages, operatiing systems, and so on. If you like it, use it. If it turns out you are just an average programmer, or even a pretty lousy one, so what. Carry on. I love to use various PLs for various purposes. My favourite is Common Lisp, but Lisp can't compare to more recent languages for great libraries. So I happily use python, matlab, and R. (Of course matlab is not just a PL.) I also like C for lots of stuff. The PL crowd bleats on about C not having well-defined semantics. So fucking what. I tried C++ very early on, and quickly gave up on it. I don't have any defensible reason for this other than I FUCKING HATE IT, and have since the time I purchased Soustrup's very first published book on it. Just like I detest kale, lima beans, and bro country music.
@drbjbpog9956
@drbjbpog9956 2 года назад
Such high quality for a smaller channel! Nice vid
@UltimaN3rd
@UltimaN3rd 2 года назад
Cheers mate, my wife did the illustrations 👍
@chandlerlewis3309
@chandlerlewis3309 4 года назад
Bro I watched you and OPNerd back in like 2014. Good times! Great video!
@UltimaN3rd
@UltimaN3rd 4 года назад
Yeah those were good times :) It's too bad OP disappeared, hopefully he'll pop up again to grace us with his goatee one day.
@stevenunderwood9935
@stevenunderwood9935 Год назад
Man, you are dead on about all this stuff, imo. I'm in love with the idea of learning what my computer can do. I'm interested in learning more about software-to-hardware stuff, because it seems more knowledgeable. Keep creating!
@UltimaN3rd
@UltimaN3rd Год назад
Cheers mate! In terms of learning how the hardware works, I recommend the book, Code: The Hidden Language of Computer Hardware and Software by Charles Petzold, and also learning some assembly language is a good idea. You don't have to be proficient but a dabble has great benefits to understanding. No specific book recommendations in that department yet.
@emilengler198
@emilengler198 4 года назад
I really like your decision. The reason I switched to C was that I know exactly what the conputer does, nothing more and nothing less. This is my problem with the huge standard library overhead of lots of other languages. Of course C also has a standard library but it is kept so simple and transparent that you can writing your own isn’t that hard.
@indigo0086
@indigo0086 4 года назад
Just simply running gcc with the proper args will give you a better lesson than some of the stuff going on with the build tools in higher languages. I am doing some stuff to start off in C. Coming from a functional programming language it is a bit hard to get past since I prefer that, but want to go back to doing some low level stuff and really get an understanding of those concepts they allow you to discover.
@phillippotter1359
@phillippotter1359 4 года назад
Really enjoyed hearing about your reasoning in this video and the others. I've had much the same reaction to C++ as well. I feel that there is just too much to it, too over engineered, and people can pry C from my cold dead fingers!
@Pokabbie
@Pokabbie 4 года назад
Glad it worked out for you! I agree with having a better understanding of under the hood; I feel like having an appreciation for what CPU instructions you're actually generating and what your footprint in memory is like is so useful for these lower level languages :) Have you thought about jumping back into hardware rendering at all? Vulkan or DX12 seems like it would satisfy you a lot if you enjoy the inner workings. Though it can be quite difficult to get a clear answer on best practises at times
@UltimaN3rd
@UltimaN3rd 4 года назад
Yes, I've considered using GPU rendering and certainly will when I make something 3D again, or with complex graphics and effects. Right now I'm actually making a 2D tile-based software rendering library for my next game :P
@XeroKimorimon
@XeroKimorimon 2 года назад
Coming over from your "Why I'm switching to C in 2019" video and watching your conclusion, I'm glad to see at the very least even after 1 year of using C, and probably longer since this is a 2020 video, you don't come off as hating the C++. As someone who uses C++ and explored how to use it, I ignored almost anything the internet says about how you should be coding and instead dive into my own projects, exploring the features and see how it affects my thinking and how I should architecture my code, and forming my own opinion in whether what said person on the internet was correct, or just saying it because "that's how they learned it". Through my journey, it has made me appreciate a lot of features that exist in C++ that I wouldn't fathom to bother going to C and then hand roll those features.... The 3 things I'd miss the most in C++ are destructors, templates, and namespaces. My thinking when it comes to writing function has started to revolve a lot around destructors as if I ever need to have something run at the end of a scope, you just create an class that runs said code on destructor, I'll never forget to write that line of code ever. Templates are self explanatory if you understand why they exist, and even more if you truly understand most of it's features, so it's not something that I can explain well, only, less copy pasting of abstractions, be it functions or classes, that you can prove that it works for every or a set of types that you would otherwise have to copy paste, which would be the case with C but can somewhat be mimiced with macros. Lastly namespaces. I tend to rely on it to organize my code, and also to navigate my library by abusing intellisense, so if you code without intellisense, it's much less of a helpful thing, but prefixing your C functions and types just isn't the same since everything is still in the global namespace. Now my kind of critics for C based on what you said in your video. You say that you know what every piece of code you make in C translates to for compute instructions. I have no experience to say this, but I do remember from hearing from a talk that people in C tend to use no optimizations a lot, which makes it obvious what a set of C code will do. Is this the case for you? Because C++ will do the same with no optimizations, as soon as optimizations are turned on though, hats off to figuring out what your code will actually generate, but they are guaranteed to be faster and / or smaller in size, both for C and C++ code. I personally haven't ran into single lines of code that would generate a 100s of lines of assembly, the closest thing would be trying to use std::cout, which does add a lot into the binary, but normal every day code, do some assignment here and there, call some member functions, I would see that they wouldn't generate that much more code that a normal C function would create, unless you're calling a virtual function. I'm a beginner when it comes to reading assembly, but through this tool called called compiler explorer, you can post snippets of C++ code and it'll translate and highlight the instructions that the C++ code compiled into, it's a very nice tool. You can access it here at godbolt.org/ . Knowing how to use C++ abstractions in mind, I don't think I generate code that is any way worse than the equivalent C code. They are just better in a sense there is less of a mental burden when thinking about the code. Which is what a good abstraction should be. Teachings how people should create their abstractions though in C++... Now my critics for C++.... Firstly I'll apologize for your poor experience with the C++ community, not that one person's apology means much. I'm honestly no different when it comes to scorning people because I do that to my friend as well even though he's learning mostly on his own as well in a similar approach to my own, but I mostly scorn at his poor design decisions (ones which I've personally made myself) as well as him constantly re-doing his projects, but making the same poor decisions. But my biggest gripe for C++ is the abundance poor teaching material. Now I'm no expert in C++, I just happen to make projects that I never complete because they then turn into experiments of trying to explore a C++ feature. So in terms of actual working project experience, well I have none, but I will claim to understand a good lot of their features and the good and the bad, and when they should be used or not, and.... teaching C++ is hard... IMO, to use C++ correctly is to learn to use every major feature correctly, OOP, templates, STL. ETC and it's a lot.... You aren't learning one language... you're learning at least 3. Game Dev tutorials are the worst though since they're always poor attempts to teach OOP and only OOP. From a C++ enthusiast
@marcs9451
@marcs9451 Год назад
Since C++17 I've gave up on the language and I use a small subsection of it (I go against a lot of "idiomatic" C++). This has been great, I only use a smaller section of the standard library and use my own containers that are friendly to custom allocators without OOP madness.
@drygordspellweaver8761
@drygordspellweaver8761 Год назад
@XeroKimorimon “ So in terms of actual working project experience, well I have none” Well that explains perfectly why you haven’t seen the light yet lol
@daipayanbhowal8914
@daipayanbhowal8914 3 года назад
I have been working in C for 8 years, still i had to read compiler construction, UNIX OS design and Computer architecture to gain expertise in C & Embedded domain, C is incomplete without UNIX, Plus read many books as C is vast.
@pasdenom.9062
@pasdenom.9062 4 года назад
I use Crystal professionally, it's really good. In the future I will use more and more Haskell, which IMHO is great and underestimated. Both are not just "C with extra steps", but really allow way a better productivity. Zig has high chances to be the right replacement for C, I do hope it will get stable soon so I can rewrite my current C code base. Besides those 3 languages, I'm really not hyped by anything these days.
@nontraditionaltech2073
@nontraditionaltech2073 Год назад
This video and the comments here were refreshing! I’ve been in industry for 4 years and have done a few different things, spending time in C, C++, Java and C#. Honestly, C# is my least favorite language and C has been my fave by far. C# is too complex, mainly bc I spend most of my time drowning in libraries and crap. I enjoy what C allows you, which is to focus on the HW and the problem at hand. I’m currently a .net guy (professionally) but am chomping at the bit to get back to low level coding in C, professionally as well. I’ve recently started coding utilities like a web server and emulator from scratch and will hopefully add a compiler and language implementation in the future 😎
@DevlogBill
@DevlogBill Год назад
Hi John, I am curious about both C and C++. I program as a hobby, and I am trying to get a job but I am in no rush because I focus on having fun with coding and not rush it so I tend to try different things along the way to see what I like. I mostly learned from JavaScript and some Python. I tried out PHP, Java, C# C and recently C++. This year I started by creating a backend with Django I already have a couple of months experience and now Im learning kotlin for Android to create a full crud app, I've been programing now for about close to 1 year and 6 months now. But I am very curious about low level stuff which sounds interesting and most youtubers really don't speak about these things. Question? I know you are a C# developer but what do you find interesting about low-level programming? I am very curious, and I would like to try it out a bit and I would appreciate some ideas on what you do. love the idea about an emulator, thanks.
@torarinvik4920
@torarinvik4920 3 года назад
"1 second compilations" I love it too! I believe Delphi has the fastest compiler of them all.
@ccgb92
@ccgb92 4 года назад
I'd give Crystal a shot. I use it for my online arpg gameserver (several thousand lines of code and growing). Love it
@IronKing24
@IronKing24 4 года назад
started to learn programming in the past 1.5 yr using C# planning on moving to a lower language C++ > C > assembly and you just gave me the motivation to start, thank you
@UltimaN3rd
@UltimaN3rd 4 года назад
Best of luck mate!
@alexkha
@alexkha 4 года назад
Iron King, indeed, a lot of people try to dive into higher level programming languages knowing very little about digital circuits or even binary logic. Similarly, I can't appreciate Bovet's Récital 22 Grand Récital watch because to me it would be just is a burden that needs to be carried on the wrist and in addition, it needs to be wound up on a regular basis :-)
@IronKing24
@IronKing24 4 года назад
@@alexkha I wouldn't say that C would be the solution for everythin when learnt just another tool if i want to make a mobile app or sonthing similar C# and hogh level, if I want to make a compiler for custom script or performance sensitive process then C/C++
@cory.p
@cory.p Год назад
I just getting back to C as well. I'm right working on a Life Development Cycle with C language. Unit Test and Code Coverage reports. Once I had the process finish I'll start a library or a software of my own for Linux.
@asdasdnghyhhy
@asdasdnghyhhy 4 года назад
In 2 years, why I’m switching from assembly to verilog
@UltimaN3rd
@UltimaN3rd 4 года назад
I am actually very interested in learning FPGA programming!
@anjalibhatt56
@anjalibhatt56 4 года назад
@@UltimaN3rd Can you share the tutorials for C or how should someone advance in C..
@thefadingone89
@thefadingone89 4 года назад
@@anjalibhatt56 Personally I'd suggest simply getting yourself a copy of K&R (aka "The C programming language") and just working through that. The latest edition doesn't cover anything past ANSI-C (iirc) but that's really not that big of a deal and the quality of the code at hand easily makes up for that. In my eyes K&R doesn't only teach you C but also good coding practices and how to write clear and concise code.
@anjalibhatt56
@anjalibhatt56 4 года назад
@@thefadingone89 Thank you for your suggestion. I will switch to K&R once I'm done with Stephan's Programming in C.
@Aaronb2245
@Aaronb2245 2 года назад
Code in Java for my job and decided to learn C. I love C!! Has made me a MUCH better developer in all languages. Great video!
@user3679a
@user3679a 4 года назад
I love c and c++ and I know where you coming from, might try to do more in c again, but I alway look for the best solution and I don’t know if writing all by myself is the best way.... need to think about it.
@Mankindux
@Mankindux 2 года назад
I was die hard C++ lawyer until C++23 where I finally gave up trying to choose which feature should I use to design a code part. Honestly in C++ you spend more time selecting the appropriate way to write a thing rather than implementing it. My last favorite version of C++ was 2017, then I just hate what happened. So i've switched back to my first language again, C and just re-loved its simplicity, build times, clean symbol tables and no magical black boxes.
@Waldganger64
@Waldganger64 3 года назад
Thanks for this wholesome video.
@yahyahassan3430
@yahyahassan3430 4 года назад
Now you might make a video on what resources/books you used to get up to speed with c.. Thx.
@chrismr3972
@chrismr3972 4 года назад
One of the big coding issues for me is maintainability (which also means readability). You can use any language to write code, but how long does it take to find issues / add features? For me, C is in the sweet spot where it's high level enough, so that you can get the bigger picture, and low level enough, so that you can see what's really going on relatively quickly. It's abstracted high enough so that it can be ported onto any processor (even tiny little ones). With assembly you don't get to chose which processor your code runs on. Someone told me years ago "when you write code you are God, you understand everything, but only when you are writing it. Once you leave it for a while you go back to being mortal".
@richardlighthouse5328
@richardlighthouse5328 4 года назад
Can't wait for C to assembly video! After that you will probably do assembly to machine code.
@romangeneral23
@romangeneral23 4 года назад
Then Machine code to the actual electrical impulses on the hardware. LOL
@richardlighthouse5328
@richardlighthouse5328 4 года назад
@@romangeneral23 Then electrical impulses to quantum machine code
@rty1955
@rty1955 4 года назад
Actually assembler is a 1:1 to machine code. Every line of assembler creates one op code and required operands. The assembler does not add any extra codes rather it "assembles" your source to machine code a line at a time
@richardlighthouse5328
@richardlighthouse5328 4 года назад
@@rty1955 Akthually.... I know that assembly means 1:1 machine code, but machine code is lower level, because you now need to know what each instruction opcode is. Which is harder.
@rty1955
@rty1955 4 года назад
@@richardlighthouse5328 no its not "lower level" its at the same level..... I can hand assemble a mnemonic to an opcode that dont make it "lower level" What IS lower level programming is microcode. I have written both Hope that clears it up for ya
@TheBennux
@TheBennux 4 года назад
I Program in very many languages, and I like a lot C on the standar C99. One of the reason for that is im enable to compile a debug binary very fast with TinyC Compiler and are really fast!... then when i need a optimized binary come gcc with the needed optimizations.
@izkovatchev
@izkovatchev 4 года назад
It's weird that I haven't seen other mention this, but the Jai (codename!) programming language is my recommendation. It's being developed by Jonathan Blow and Thekla Inc. and I see it as the way forward for many programmers who want the power of C, the higher-level (what does that even mean!?) functionality of C++ as well as other improvements. It's currently in closed beta, as of 1 Jan 2020, so hopefully a release will come out sometime within the next year or two. I will bet good money on it being more popular that Rust within 5-10 years of it's release. For now, I'm also sticking to C and trying to learn as much Jai as I can so that I'm ready to be productive once it's live.
@alefratat4018
@alefratat4018 4 года назад
Do you have any pointers / resources for Jai ? I am also interested.
@alefratat4018
@alefratat4018 4 года назад
@Kevin thx !
@xormak3935
@xormak3935 Год назад
I find it fascinating that i practically had the opposite experience with C. Learning about lower level coding and understanding the principles behind the abstractions of higher level languages was definitely useful, no doubt about it but every time i had to or wanted to work with C it felt great to start a project but as soon as any complexity got introduced, it became a hard-to-manage nightmare. People complain about library hell in other languages but at some point it'll be the same for C. C# for example definitely has a problem with bloat but when you just need to get something done, you can actually just get it done. Personally i found a nice middle ground in languages like D and (Free) Pascal. They're low level enough to not feel bloated while being full of sensible QoL features.
@UltimaN3rd
@UltimaN3rd Год назад
Thanks for your perspective mate 😊 I can understand seeing things that way
@long-live-linux
@long-live-linux 10 месяцев назад
Zig is getting better and better, though it's not v1.0 yet. Zig will be my go-to when it's finally stable.
@reubenfrench6288
@reubenfrench6288 3 года назад
As someone who started with C++ and a bit of C in university, it was very easy to see that most C++ features are just a thin wrapper over C functionality. I'd be curious to hear more about what made it difficult for you to understand how C++ features translate to hardware operations. There are a few (like exceptions and rtti) that aren't immediately obvious, but once you know, it's pretty easy to understand.
@davannaleah
@davannaleah 3 года назад
If you want an 8 bit processor that is a delight to program in assembler, HC11 or 6809 are my pick. 6502 is too limited, especially the stack, fixed at 0x100 and only 256 bytes in length.
@Aemilindore
@Aemilindore 4 года назад
Great video
@rty1955
@rty1955 4 года назад
I have learned 13 different languages in my life, however programming in assembly since 1970 on a mainframe, it turned on a light in my head and everything made sense. I have been in electronics since 1960 and compilers never made sense to me as it took away the "nuts and bolts" of the computer. When i learned assembly things made total sense to me. I got a job as an computer operator and worked my way up to Sr. systems programmer. I can do things in assembly Lang that other programmers that dont know assembler can only dream of! I wrote a COMPLETE accounting system that included A/P, A/R, G/L, PAYROLL & INVOICING on a mainframe with only 48k of memory that was shared by the o/s!! If you wrote the typical "hello world" program in C and look at the executable size it winds up to be about 4k. In assembly it would take maybe 20 bytes of executable code. yes I said 20 bytes! Ask yourself WHY??? if you can write the same application in 20 bytes imagine what you can do in 4k!!! Mainframes are in a class by itself as some of my code I wrote in 1976 are STILL in use today! To me there is no better teacher than a mainframe. I now write in assembler on microcontrollers for TI and PIC. (I prefer TI) I hope once you learn assembler the light will go on as well and you will never look back. Assembler is not my only language I use, but its my fav language.
@alexkha
@alexkha 4 года назад
sometimes a C/C++ compiler can write faster code by unrolling loops, inlineing functions, using obscure processor features. Bigger code can be a performance boost. And you don't have to write separate code for AMD, Intel, ARM processors - it's worth a while...
@rty1955
@rty1955 4 года назад
@@alexkha I dont know your experience or if you know assembly lang or not, but if you dob write the "hello world" program in C and tell me what the executable size is...
@alexkha
@alexkha 4 года назад
@@rty1955 what OS? What processor? Also, even if I know z80 assembly and AMD x86-64 assembly (more or less), but that does not mean I know anything about ARM assembly!
@rty1955
@rty1955 4 года назад
@@alexkha pick one that you like....
@alexkha
@alexkha 4 года назад
@@rty1955 k, i compiled this example in 64-bit linux and it's 8488 bytes, compared to C++'s std::cout
@kulturmedium6847
@kulturmedium6847 3 года назад
Thanks for sharring...
@yasserarguelles6117
@yasserarguelles6117 2 года назад
I accidently switched to C for like one project then got into a zen and haven't gone back to C++ in maybe like a year
@DK1PL
@DK1PL 3 года назад
At 1992 I switched from C to C++ and I was happy. 8 years later I was so tire and frustrated that I decided to go to Java. 15 years later as Java mutated to “21 century Cobol” I returned back to C++ (C++11) but soon after that I switched to back to C, because I like purity and simplicity of this language.
@Walkingdeadman1991
@Walkingdeadman1991 2 года назад
Loved the video. Any advice on the best best online resources for learning advanced C coding? I’d love to be able to code something like the game you created.
@UltimaN3rd
@UltimaN3rd 2 года назад
Cheers mate! Tbh in my mind, "advanced C coding" isn't something to directly learn, rather it arises from a deep understanding of computer hardware - particularly the CPU, and knowledge of the whole C language, which is not all that large. A great beginning to intermediate resource to learn about CPUs is this book: www.charlespetzold.com/code/ It can be found for free online. Of course K & R The C Programming Language is required reading. Also Michael Abrash's Graphics Programming Black Book is a great advanced CPU and programming book. After those, there are various old books about Ray tracing and other performance intensive tasks programmed in C which can provide direct examples and explanations of high performance code.
@UltimaN3rd
@UltimaN3rd 2 года назад
Oh I forgot to mention, I've just finished a series of "C Programming on Windows" tutorials which are leading in to a series on programming a full game in C. The first video in that series is coming soon 👍
@Walkingdeadman1991
@Walkingdeadman1991 2 года назад
@@UltimaN3rd Cheers man I cannot thank you enough for all this!! I will have a look at each and every one of the resources you mentioned. I started C about 6 months ago and have a decent understanding of it, but I really want to take that extra step into programming non-trivial desktop applications (and not have to rely on Java, for example, for creating GUIs). As you said, I really have to understand computers better at the hardware level! In any case, thanks again, and I'll stay tuned for the upcoming tutorials! + I'm your newest subscriber :P
@UltimaN3rd
@UltimaN3rd 2 года назад
@@Walkingdeadman1991 Cheers mate
@rockinray6197
@rockinray6197 3 года назад
Optima++, and Power++ are tools which write C++ code for some adapted library + compiler. One of those ide's available amazon etc. The tutorials include a big ball that bounces around ponging the screen edges. Personally, it seems necessary to have a style to program. Im learning expert systems, and distributed COM or just http. Seems to be that it doesnt come naturally. C lang is not modern. Its for utilities. It can generate data sets and frames to play them in. But its not graphical
@victorsarkisov4480
@victorsarkisov4480 2 года назад
As an avid C programmer, I’ve been planning on writing a new language that takes the low level and very clear style of C and addressing some of the downsides as well as adding a few improvements without compromising the core features of C and adding too much abstractions.
@zytr0x108
@zytr0x108 Год назад
Any updates?
@merlingrim2843
@merlingrim2843 3 года назад
Yep … I learned to code in 79’ starting with machine code on an intel 8008 cpu then z80 assembler, followed by 8088 assembler, then 360 assembly, then COBOL, then FORTRAN, then Turbo pascal, then HP Pascal, then C, then LISP, then C++, then Objective C, then C#, then SQL, JavaScript, then Java, then typescript, then Swift, then started learning rust a couple weeks ago. My solutions span server, desktop, embedded, edge, and mobile so I don’t have the luxury to do just one language. If I did, it would be C++ (as superset of C).
@The1Jebrim
@The1Jebrim Год назад
Check out ISPC, which is closer to modern hardware than C since it better leverages cache alignment, SIMD, and prefetch capabilities of CPUs.
@UltimaN3rd
@UltimaN3rd Год назад
Thanks, I'd never heard of ISPC. Whenever I get deeper into SIMD I'll be sure to try ISPC too.
@qiao8031
@qiao8031 3 года назад
Have you experimented with Lisp? What are your opinions on that?
@zytr0x108
@zytr0x108 Год назад
I would love to see an update on your opinion on Zig
@UltimaN3rd
@UltimaN3rd Год назад
I've been keeping an eye on it, but I'm still waiting for a 1.0 release pretty much.
@zytr0x108
@zytr0x108 Год назад
@@UltimaN3rd makes sense
@michaellewis7758
@michaellewis7758 3 года назад
I would recommend learning a FP language like Haskell. As for C/C++, I think for me the issue with C++ is less the language itself and more OO, which I think can lead to algorithms and data structures being hidden and overblown hierarchies introduced. In that regard, things like boost/stl are ok - in that they don't resemble some horrible Java-like lib where most things are obfuscated behind some huge hierarchy of types.
@taulguedi637
@taulguedi637 2 года назад
What is the best way to learn C and Assembly? What tutorials/books are out there? Thank you
@UltimaN3rd
@UltimaN3rd 2 года назад
Sorry for the late reply, I missed your comment. In my opinion the best way to understand C programming is to start with computer science and work your way up. The book, "Code: The Hidden Language of Computer Hardware and Software" by Charles Petzold is a great place to start. From there ideally you'd study old computer hardware a bit, like through Ben Eater's videos, do enough assembly programming to understand the workings of CPUs and from there moving to C will be very easy to understand.
@Phytolizer
@Phytolizer Год назад
C11 didn't introduce templates, _Generic is more like function overloading in C++. You'll still need to use macros or void pointers to implement generic data structures.
@alexkha
@alexkha 4 года назад
Nick, what library do you use for simple data structures like vector, linked list, hash tables? I'm curious, because every time I'm asked to write in C I have to look for a decent alternative to C++'s Standard Templates Library...
@UltimaN3rd
@UltimaN3rd 4 года назад
I've been writing those myself as I need them. It's turned out to be very educational and much less challenging and time consuming than I expected
@alexkha
@alexkha 4 года назад
@@UltimaN3rd I used to be obsessed with all that, but with time i started to appreciate stress-tested, time-proven, community-reviewed, well-maintained libraries like Apache Portable Runtime, which is hard to beat if you want memory pools. But nothing beats C++' STL in its flexibility - it's a true godsend. I hope one day you will learn to separate C++ from OOP and embrace its strong sides.
@alexkha
@alexkha 3 года назад
@FichDichInDemArsch Whatewer you do in programming, you will have to learn all life long anyway. I've seen some code on Rust or Go - it's ugly af. They are supposed to look nice and clean, but once you go one step beyond Hello World examples it gets even messier than C or C++...
@onman999
@onman999 4 года назад
I have a scientific degree in software engineering and developed in multiple languages amongst which C and C++. The main differences between the two are the code reusability and code readability. The readability comes mainly from the naming (a name is context specific, e.g. Program.Stop() and Car.Stop() ) and operator overloading (e.g. you can add or subtract complex objects, instead of calling a Add() method). Reusability mainly comes from inheritance. For smaller projects and projects maintained by only 1 or 2 people these benefits are not much of an issue, so both languages are equally well. For large projects, worked on by many people C++ definitely is the preferred one. Just the C++ language itself is (almost) as easy to learn as C. However, the different C++ libraries are almost like learning a new programming language. This is the reason why large/huge C++ applications benefit from software designers. Many people can program, but only a few can do technical software design which includes class design, class interaction and source code layout (amongst other things)
@GegoXaren
@GegoXaren 3 года назад
Namespacing is something you can do in C... It is called coding conventions. typedef struct MyFoo { .... } MyFoo; MyFoo my_foo_new () { ... } void my_foo_free (MyFoo * self) { ... } void my_foo_set (MyFoo * self, char * str) { ... } And so on. The namespace is "My" and the "class" is "Foo". Have a look at GLib, Gtk, and other GObject based libraries.
@tceffect2353
@tceffect2353 4 года назад
Templates are the reason C++ takes forever to compile. The compiler is invoked to compile each translation unit(TU). Each .cpp file is a along with all the headers it imports is a TU. Each TU needs to compile all the headers it imports. In C this is not that much of a problem since each the headers usually only contain declarations of functions, data types, and extern variables (all of which are super quick&easy to parse). The code is always in the .c file (except for inline functions which can also be in the .h). In C++ the templates are (usually) in the headers. This means that the compiler needs to compile all the code in all the template classes and functions (even if they are not used), and worse yet it has to do this once per class which includes the header. This is why C++ is slow. Once you include the headers many C++ TUs have more than 100k - 200k LOC from the included headers.
@timhofstetter5654
@timhofstetter5654 Год назад
Unexpectedly well spake.
@gudneighbour
@gudneighbour Год назад
c++ is the one I have always returned to,but who knows one day I might download c compiler and try it.
@PanDownTiltLeft
@PanDownTiltLeft 3 года назад
The first language I ever used was machine language. Toggling a program into memory through a front panel. Going to assembler was a huge jump. Going C was another big jump. Going to Java and C-sharp was a mixed bag. Ultimately I think languages like Java and C-sharp are doomed because of their intermediate Code generation that we do not need anymore. For me the C language is the best compromise but assembler will always be my favorite. OOP never came through on all of its promises.
@zytr0x108
@zytr0x108 11 месяцев назад
I wrote 2 small games in C with SDL for my highschool graduation project and for the most part it wasn’t a problem. However I had to give up when thinking about ECS, since I figured I needed generic data structures for making one, which C doesn’t have. Sure, I could just use macros and explicitly generate all the necessary procedures for each data type via a macro function, but that’s quite tedious (I created generic dynamic arrays like that as an experiment later on, the pre processor syntax with all its \ is just too ugly and inconvenient). I ended up just using a fixed size array to store all my entities in and iterating over them each frame. For that game it worked flawlessly, but I only really had one type of entity and a more complex game with multiple entity types would probably need a real ECS architecture. How would one go about implementing one, without using a premade one like flecs. Is it necessary to use macro functions? Currently I’m (re)learning C++ for the third game, since there are data structures built in and it seems to be safer and faster to develop in in general, while being about as fast as C. At the very least there are templates, which make rolling your own data structures more convenient. And also there are classes, which I didn’t really miss during my time with C, but I can see, how they can be useful, by grouping data and functions that operate on them together and accessing them through an object. In the end I’m still torn about whether c++ is the right choice and whether I should use modern C++ or classical C++. It seems more intuitive to me to use the features modern C++ offers, since many improve on C/old school C++. References and smart pointers for example improve on raw pointers, so why not just use them? But at the same time SDL kind of dictates a C-style approach and even Dear ImGui uses a very old school C++, so maybe it’s easier to just adapt to those libraries?
@UltimaN3rd
@UltimaN3rd 11 месяцев назад
It sounds like you approached C programming with some preconceptions about how you wanted to write your code, and found some friction. C as a language basically exposes the operation of the CPU and lets you do whatever you want with it, whereas higher level languages abstract that away and present you with different tools to use. If you're comfortable with C++ or any other language then I encourage you to enjoy them :) Just about ECS: I'm currently making a 2D platformer with several different enemy and object types and have had no need of it. ECS solves the problem of having a massive diversity of game objects with shared traits, and makes some large game ideas possible. But it comes with a cost of implementation and code complexity which will bog down the development of smaller games.
@zytr0x108
@zytr0x108 11 месяцев назад
@@UltimaN3rd Thank you for your answer! I watched the talk you mentioned in your video about data oriented design. I think I’ll give C another shot and try to think with the hardware in mind. I’ll not bother with an ECS for now. But just out of curiosity: would you actually need generic data structures and macros for that?
@UltimaN3rd
@UltimaN3rd 11 месяцев назад
@@zytr0x108 So far I haven't needed any generic data structures. I'm making a full series of tutorial videos on how to make this game from scratch in C, but just to give you an idea of one way to design stuff... Currently I'm handling my enemies with a structure like this: typedef struct { enemy_type_e type; vec2i_t position; // Other common elements here union { struct { // Data specific to goombas } goomba; struct { // Data specific to koopas } koopa_troopa; // etc }; } enemy_t; With that structure you can keep all your enemies in an array of enemy_t, which you can iterate over for various things like collisions and rendering. Then you can handle unique behaviours of each enemy type just by doing: switch (enemy.type) { case goomba: { // Goomba unique code } break; case koopa_troopa: { // Koopa unique code } break; } Oh and just to clarify, my game is not a Mario clone :P What I wrote above is just an example. Cheers.
@zytr0x108
@zytr0x108 11 месяцев назад
@@UltimaN3rd that approach is very elegant. I’ll definitely steal it ;)
@arifkasim3241
@arifkasim3241 3 года назад
I agree. C is straight forward. But it seems running plain C on modern 64 bit processors and Windows is very cumbersome. Can you tell me how to setup a good C compiler that feels native to the new os like win7 or win10 running on i5 or i7 processor. The only way I know is using some old compiler like Turbo C++ on DOSBox and I find it very cumbersome. I miss programming easily on C like in the DOS days. Do you have any advice for a good compiler setup?
@UltimaN3rd
@UltimaN3rd 3 года назад
The best way I've found to compile c on Windows is to install visual studio, but then just use the “developer console x64” which should come up with a search in the start menu. I wrote a tutorial about getting a window open in c with sdl which includes the compilation command you need here: croakingkero.com/tutorials/opening_a_window_with_sdl/
@technologyondemand4538
@technologyondemand4538 4 года назад
For learning C I highly recommend "C Programming: A Modern Approach" by K. N. King
@technologyondemand4538
@technologyondemand4538 4 года назад
It would have been nice if there was a K&R 3rd edition that covers C89 or C99. But I believe King did a great job.
@UltimaN3rd
@UltimaN3rd 4 года назад
Thanks, I'll take a look :)
@cranknlesdesires
@cranknlesdesires 4 года назад
Have you tried out forth, it's another low level language but it predates C by a while.
@morfey8740
@morfey8740 3 года назад
What do you think about Haskell?
@darkzeroprojects4245
@darkzeroprojects4245 Год назад
Trying to use both C/C++ for my general stuff. Starting with Python then will C then c++.
@UltimaN3rd
@UltimaN3rd Год назад
Best of luck mate 😊👍
@zvxcvxcz
@zvxcvxcz 3 года назад
I do use C++... but mostly the C subset, so my compile times are fine :P
@lorensims4846
@lorensims4846 4 года назад
I curious about C++, but I'm all in on C. I was taking a look at BrainFuck and found it oddly attractive. I realized it reminded me of writing 6502 Assembler (though the 6502 has a much richer instruction set!) which I did for years after I discovered just how slow 8K Atari Basic really was. I started looking more into x86 Assembler but after seeing some line-by-line comparisons with C (and doing a few of my own) I decided to stick with what I've often heard described as 'the cross-platform Assembler', C. I also discovered Ben Eater at this time, but I don't really want to go back to programming the 6502. There are pain points in every programming language and there's always a better one--the grass is always greener on the other side of the fence, but there aren't very many that can do more things than C and there's almost nothing faster, which is what I'm mostly looking for. Keep It Simple, Simon. Oh, the O'Reilly book "21st Century C" encouraged me greatly. karadev.net/uroci/filespdf/files/21st-century-c-o-reilly-ben-klemens.pdf He talks about how other languages have all these great libraries, but C does also, they're just more widely scattered. He talks about how to write and distribute your own libraries to help in the effort and even shows how to do object-oriented programming in C. It involves pointers to pointers to structures of pointers to functions which just makes my head hurt, but shows there really isn't much of anything you cannot do in C. I mean all the compilers and interpreters for these other languages are written in C for portability, even C++ started by outputting C code that then had to be compiled into an executable program.
@rty1955
@rty1955 4 года назад
The thing that Ben did was to have people understand how microprocessors work and can be programmed. I think his videos are brilliant and fun to watch. I built my own computer back in 1972 with ICs (not a full microprocessor like the 4004 or 8008 or even the 8080) The 6502 and Intel chips are brain dead. To me they are just toys. They are extremely limited as to what they can do. I think the 68000 was a much better processor, but Motorola couldn't deliver the qty that Intel could. Even IBM makes thier own chips, but could never feed the masses, this is why Intel was chosen.
@lorensims4846
@lorensims4846 4 года назад
roy Yung, Yes, I agree the 680X0 was the best. This convinced be to follow Atari to the ST and from there to the Mac. I never cared for PCs with their backward-looking CPUs. I also much prefer what they call “AT&T syntax” I learned when learning to program the 68000. The “Intel syntax” reminds me too much of the bad old days of programming the 6502. Now Mac are all Intel (my wife is spinning in her grave) and I’m looking at X86 assembly language, looking forward to the long rumored transition to ARM. C will easily take us there as well. It’s the original cross-platform language (well COBOL was first, but I think C did it best). Zig looks like fun too, but maybe later…
@rty1955
@rty1955 4 года назад
@@lorensims4846 I programmed in COBOL-D, F & ANSI. D had no perform statements! But I LOVE assembly lang. I did things in assembler that are still running today!!
@rty1955
@rty1955 4 года назад
@@lorensims4846 I agree. The Intel mine is so brain dead and limited. When I coded on a mainframe in assembly (switched from wordy COBOL) everything made sense. I build my own computer somilar to Bens, but I tried to mimic the mainframe. I finally used the 8080 processor and thought "how cute this is just a toy" then i changed it to use the 6800 and it was much better but still a toy. I also wrote microcode for the mainframe as well and created an op code to clear memory in one instruction :) later it was added to the 370 series of mainframes. I find only 3 registers (A, B, C) extremely limiting in the Intel line. Along with thier silly "special purpose" registers and stack pointer. Never needed that on a mainframe. The mainframe has 16 general purpose registers which greatly improves performance if you knew how to code well. You didnt need a whole lot of memory to get amazing things done. The mainframe was a great teacher as a programmer you could not crash it, no matter what you did. The o/s was rock solid too. This comment is bot about a mainframe v. Micro, rather its about how micros never evolved laat a you stage, which is a shame.
@wiskasIO
@wiskasIO 3 года назад
I heard you buddy. I'm sticking with Scratch and I'll be happy!😊
@Isaac-ht7pu
@Isaac-ht7pu 3 года назад
What resources did you use to make the 3d engine in C? Any book indications?
@UltimaN3rd
@UltimaN3rd 3 года назад
Tricks of the 3D Game Programming Gurus was the main book I used and I highly recommend it to learn how to write a software rasterizer and how 3D graphics works.
@Isaac-ht7pu
@Isaac-ht7pu 3 года назад
@@UltimaN3rd thanks man
@ibrahim1ibrahim2
@ibrahim1ibrahim2 4 года назад
any language is a tool that abstract the hardware to a degree, the questions are : 1- how far away from the hardware ? 2- how language X done that abstraction well, keeping in mind that more abstraction leads to more edge cases that may be the reason not to use that language i.e gc stopped causing end or freeze of the universe syndrome or whatever
@synthoelectro
@synthoelectro 4 года назад
I made this game that looks like 8-bit Blocks in 3D called voxels, and people love it, did I mention it was written in Java? - Paraphrasing Notch - Minecraft
@darchendon7926
@darchendon7926 3 года назад
from a beginner's perspective, I'm wanting to learn C instead of ++, even though I like games, just so I can have a greater understanding of what I'm doing but also javascript, because I assume web dev is the easiest type of development to get into and goddamn do i need a job
@____uncompetative
@____uncompetative 3 года назад
If you haven't already, try reading Douglas Crockford's book: _JavaScript: The Good Parts._ Good luck with the job hunt.
@s_2_k117
@s_2_k117 3 года назад
For game dev how to learn c?
@sergehulne
@sergehulne 3 года назад
Odin is like C with the addition of templates and defer..
@mlima22
@mlima22 3 года назад
You should try VHDL
@gamedevlog
@gamedevlog 4 года назад
I'm switching to a more "sane" c++ subset and I'm curious about other people approach to the returning to a sane programming syle. Are you still using a C++ compiler with just a subset of c++ language or did you fully changed to plain C ? In case of you are still using some c++ features please share what changed about your coding style and what feature do you still use. Namespaces ? RAII ? Exceptions ? Costructurs/Destructors ? Any naming convention changes ? Also there are already many people adopting this mindset as you can see here flohofwoe.blogspot.com/2013/06/sane-c.html and here gist.github.com/bkaradzic/2e39896bc7d8c34e042b just to link a few examples.
@UltimaN3rd
@UltimaN3rd 4 года назад
Thanks for the links, I'll check them out :) For now I'm using plain old C.
@jorgesoross127
@jorgesoross127 3 года назад
Try forth next. You'll get greatly simplified metaprogramming compared to C++ with a language that somehow manages to be even lower level than C. The downside is there aren't as many optimizers for it that approach C and the ones that do exist cost money.
@xr.spedtech
@xr.spedtech Год назад
You know that Angus fog guy ... Now I have to use C++ ...
@hannessteffenhagen61
@hannessteffenhagen61 Год назад
To anyone who wants something like C but better I’d recommend giving Ada a look. Its one downside is that it’s a bit wordy, but other than that it’s pretty much just that.
@adanjsuarez
@adanjsuarez 2 года назад
C is amazing!
@MrAbrazildo
@MrAbrazildo 3 года назад
C++ has everything you said, plus a higher level communication. It's the best for all perspectives. 0:54, had you ever heard about "straightforward OO"? Directly to the hardware. Seek a presentation of C++ for Commodore 64.
@kmdsummon
@kmdsummon 3 года назад
The only couple of problems of c are: No proper collections libraries. In c++ or Java you have efficient priority queues, hash maps, tree maps and basic algorithms on collections. I tried just now to find some heaps or priority queues implementations in C and found some small unmaintained GitHub gists or unused dead GitHub repos which is ok for side projects, but not ok for production, unless you sure in that lib. Meanwhile in c++ or Java you have them built in. And the second issue with c is lack of raii destruction where you can’t just return from function, but you need to repeat the same stuff again and again on every return, or implement some state machine in every such function to understand what had been initialised in you function to clean up all in one space. C is fun to program as a hobby, where you have some limited functionality, don’t have to be portable across random machines. But it is nightmare when it is your full time job and your job is not building the OS or driver, but some business logic.
@UltimaN3rd
@UltimaN3rd 3 года назад
Re RAII, that should incline you to avoid unnecessary slow dynamic allocations
@kmdsummon
@kmdsummon 3 года назад
@@UltimaN3rd Actually I don’t need and don’t want to be inclined by language to anything. If your program is critical importance and you need go use stack only, you can run linter in your project that will check that no one use our hypothetical C RAII construction (like non portable Gcc attribute cleanup) if it has some developers who is not following your project rules.
@tylovset
@tylovset 3 года назад
Have a look at my templated container library: github.com/tylov/STC
@FeelingShred
@FeelingShred 4 года назад
Wow! Cool stuff! If you have spare time and is looking for "a problem to solve" (being that you have experience in building a 3D engine now...) would you someday take a look at what the hell is happening inside of the gzDoom source code? (it seems to have C++ for the majority of it, from what I could gather in a 5 minute research) As you might know already, Doom was conceived at '93 to run in 486 processors, but for some reason some people are reporting that they have performance problems when running gzdoom in their core i5 (if you want I can even paste links for people complaining about performance issues on core i7's too, and much more...) ... There are many people out there that are being removed from the possibility of enjoying Doom mods because of questionable practices from this small group of "developers" (mainly they stole the foundation of their work from other projects of the past, with small additions over time... it's one of the perils of this open-source world we are living...) ... The reason for asking this in particular is that people (with these same old hardware) don't have ANY issues whatsoever to run Quake source-ports, and as you might know already Quake is a MUCH more demanding engine since it's full-3D and having advanced particle and lighting effects. Something truly awful is happening at the core of zDoom/gzDoom and I'm intrigued to find out what it is. (apparently some guy went down this rabbit hole before and I still can't figure out if these Quake ports are using C or C++, some weird stuff going on there apparently... but even then they manage to have better performance than gzDoom) forums.xonotic.org/showthread.php?tid=7530
@FeelingShred
@FeelingShred 4 года назад
This is merely a suggestion of an "interesting" subject if you're bored, that's all. Kudos :)
@UltimaN3rd
@UltimaN3rd 4 года назад
@@FeelingShred Thanks mate, sounds like an interesting subject to look into. If I were to do a deep dive into something like a doom source port I'd be more likely to make my own. If I do get around to that I'll be sure to look at the modding framework used in gzdoom and see about being compatible with it. Don't count on me getting around to such a project though, it's in the ”one day” folder for now ;)
@FeelingShred
@FeelingShred 4 года назад
Ok, it's confirmed. From what I was able to find, it seems indeed like the Quake ports still use pure C and that gzDoom is the one using C++. This can be used as a case study for how bad C++ performance is compared to C. Or for how it encourages over-engineered code.
@FeelingShred
@FeelingShred 4 года назад
This other guy compiled a list of issues that demonstrate some of the more concerning issues that apparently have no reason to happen (all these things still happen by the way) i.imgur.com/znBPDNz.jpg And just to prove that I was not lying making stuff up before, here's the guy that can play GTA V on his machine but apparently gzDoom is too heavy for it. I'm telling ya, there's something real crazy buried down there, and I can imagine is fairly easy to "purposely obfuscate" C++ code so other people from the outside become unable to fix the problem themselves. i.imgur.com/QPq8nab.png As a recent example, took mere 15 years for these guys to implement "make the game paused while in the background or minimized" feature. (you can test this by comparing recent versions with versions from beginning last year, again to prove that I'm not making stuff up, because these things are so silly they sound like lies indeed)
@Lordodragonss
@Lordodragonss 3 года назад
Hello! How's your game going? I was SOOO loking foward it!
@UltimaN3rd
@UltimaN3rd 3 года назад
Thanks dude :) I remember your comments on my Notemon videos. I'm still working on game dev but I don't want to make anything public until it's basically ready to go. With Notemon it was really cool to get so much feedback and in a magazine and Clemmy's videos, but I also found it really difficult to admit that I needed to restart making the game from scratch because of all the pressure I brought upon myself by being public. I'm still planning on completing and releasing Notemon, but you won't hear anything about it until it's pretty much done.
@Lordodragonss
@Lordodragonss 3 года назад
@@UltimaN3rd Aww take your time! Im still loving the idea of simple monster catcher! If you will ever make demo- contact Gym leader Ed. I recently stumbled on him. And boy he is great to promote your stuff! Good luck
@UltimaN3rd
@UltimaN3rd 3 года назад
@@Lordodragonss Cheers mate :)
@pfever
@pfever 4 года назад
Why would you need templates when you have void* and function pointers?
@UltimaN3rd
@UltimaN3rd 4 года назад
I'd like strict type checking on my generic functions to prevent errors. Too bad the C++ implementation takes longer to compile than just debugging those errors!
@MrSamkots
@MrSamkots 4 года назад
@@UltimaN3rd have you heard of modules in C++20?
@MrSamkots
@MrSamkots 4 года назад
@pumpfever because templates allow you to create, for example, generic data structures whose elements are the objects themselves and not pointers to them. Less levels of indirections == more efficiency.
@AGUNGKAYA
@AGUNGKAYA 3 года назад
I learned Pascal, gwbasic, C++, C, java, JavaScript, PHP, QuickBasic, etc etc. But somehow, I just come back to C..... This language has its own magic to make you back and start coding again...
@Err-G
@Err-G Год назад
I switched to Forth for my main programming language.
@yarpenzigrin1893
@yarpenzigrin1893 2 года назад
Everyone should try a bunch of languages and find out which one they enjoy using the most. I personally don't care about hardware and don't want to care about hardware so C on an advanced level is just a lot of effort for little gain. And one has to be a genius to avoid all the memory leaks and security issues when writing anything complex in C.
@drygordspellweaver8761
@drygordspellweaver8761 Год назад
“Advanced” meaning? The gain from C is huge btw: performance, readbility, maintainability. Other languages simply hide the very real problems that exist in reality. You can’t call yourself a programmer if you don’t understand hardware. Maybe a “coder”,or “web dev”.
@yarpenzigrin1893
@yarpenzigrin1893 Год назад
@@drygordspellweaver8761 Advanced meaning writing Linux kernel. Even Linus Torvalds switched to Rust. Programming is my job, not my life. I like to make my job easier and spend less time fixing bugs.
@drygordspellweaver8761
@drygordspellweaver8761 Год назад
@@yarpenzigrin1893 Have you been paying attention to what has happened to Linux over the last 20 years? Linus cautiously allowing Rust into the code base doesn't mean much. Fun fact: original Unix was 20,000 lines of C. You can't tell me the 30,000,000+ monstrosity that linux has become is remotely comparable in quality. It has become an utter disaster and bringing in Rust will make it even worse. If you program professional then it is your literal job to not make crap software. Being lazy is no excuse.
@glee21012
@glee21012 4 года назад
I went from C, then C++; I will never go back unless all there is available is standard C.
@animalibera4326
@animalibera4326 4 года назад
C's the best among the bests!!
@scalesconfrey5739
@scalesconfrey5739 4 года назад
Have you checked out Handmade Hero? Found at: handmadehero.org or even ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Ee3EtYb8d1o.html for day 1 of the stream archives. A guy by the name Casey Muratori made a video game in C (with occassional c++) from scratch basically just using OS libraries. He worked at MicroSoft back when they were a "small" company in the 90s, and he talks about code from the hardware perspective like you mentioned. I haven't gone very far through the stream archives, but the entire journey is recorded, and he explains what he's doing along the way. I know this is more of a "if you have time" thing, but it sounds up your alley, and I've heard from people learning game development that quote him as a resource (including me). Also, it's nice to know other people are having similar experiences in coding. Thank you for sharing your perspective!
@asafcohen3562
@asafcohen3562 4 года назад
Have you actually written your own graphics library
@UltimaN3rd
@UltimaN3rd 4 года назад
For the 3D software rendering I didn't fully make it into a portable library - I'll do that if I end up reusing the code. I try not to make things into libraries if in not sure I'll use the code more than once.
@mskiptr
@mskiptr 4 года назад
I would love to also hear your opinion on the the exact opposite: very high level and far from any hardware! Please try Haskell
@mskiptr
@mskiptr 4 года назад
(if you enjoy algorithms, clever unusual solutions and the more mathematical part of computer science, you will love it - powerful type system, laziness, functors|applicatives|monads|…, IO, etc. are great)
@mskiptr
@mskiptr 3 года назад
@FichDichInDemArsch Yeah, Idris looks pretty neat. Even basic things like holes are awesome! Only idk if it is accessible enough when one doesn't have prior experience with other functional stuff. I mean introducing syntax as "Haskell - laziness + :: and : swap" or "we have an ` : IO a` type" isn't the best approach for newcomers ; )
@jugnu361
@jugnu361 2 года назад
If u r into hardwares . C is the way to go
Далее
Premature Optimization
12:39
Просмотров 771 тыс.
C++ vs Rust: which is faster?
21:15
Просмотров 382 тыс.
New model rc bird unboxing and testing
00:10
Просмотров 6 млн
If Programming Was An Anime
3:26
Просмотров 10 млн
Why I'm switching to C in 2019
5:12
Просмотров 261 тыс.
Why C is so Influential - Computerphile
10:50
Просмотров 1,9 млн
Multi-Threaded Game Framework in C
6:56
Просмотров 5 тыс.
Should you learn C++?? | Prime Reacts
20:29
Просмотров 331 тыс.
Forbidden C++
33:07
Просмотров 1 млн
Linus Torvalds "Nothing better than C"
1:28
Просмотров 1,3 млн
the TRUTH about C++ (is it worth your time?)
3:17
Просмотров 640 тыс.
GCC/MinGW on Windows Quick Setup Guide
2:25
Просмотров 77 тыс.
skibidi toilet multiverse 039 (part 2)
8:58
Просмотров 5 млн