Why I'm switching to C in 2019


I’m not trying to convince anyone that C is better than C++. Switching to C is more to gain a greater perspective on programming languages and the many features more modern languages offer.

If you’ve got thoughts about C, C++ or even other languages you reckon might be better than C I’d love to hear about it in the comments!

The Mike Acton clip was from this excellent presentation on data-oriented design:

CORRECTION: Flibitijibibo has never worked at Valve.


Xem Thêm Bài Viết Khác:https://wijstaanvooronzegrondrechten.org/cong-nghe


  1. I switched from C++ coding to C style C++ coding, because recently i really understood why we use classes in the first place. Though I'm not sure, if i will switch to C in the future, because, well, I like how much the std library offers us and that i can attach functions to data types.

  2. I hate c++ because it hides memory allocations behind my back. All of a sudden you have a fragmented heap, lock contentions on heaps etc. etc.

    And you think -hey I really haven't done anything. I'm just concatenating strings.

  3. I always find it kind of funny when people talk about cpp and despising it, and then their argument "so I am going with c" that literally makes little to no sense. When the optimizers has done their thing, they are more often than not on equal footing. I would understand if he said "I am going with rust" or something similar, as it is exactly as low level as c, but has all the niceties of a high level language but not some of the "bad" things that for instance cpp suffers from (atm).

  4. I spent years trying (unsuccessfully) to learn C++ and it did my head in with the classes and polymorphism and inheritance. This year I still wanted to learn Programming, and am trying to learn Unity and C#, but at the same time I am learning C, and wow, C is sooooo good! Zero bullshit when it comes to knowing what to write to get done what you need to get done.

    I really enjoy it. I just have to stay on it and keep practicing.

  5. Most C++ haters hate the language because they don't actually know it. It's not just "c with classes" as it used to be in it's early days.

  6. I like idiomatic c++. And i don't mean writing classes for everything or throwing every library feature at once. Most things exist in c++ for a reason. Like RAII and smart pointers are a great solution to memory management. Or how iterators and stl algorithms provide an intuitive way to write fast and abstract code. Idiomatic C++ means using the language to it's full potential. Use classes as necessary or use templates and concepts to write meaningful abstractions. I really like where cpp is going with the new standards and can finally call it a mature language as of c++17 and 20.

  7. I did my best to scan through the majority of prior responses. I never made the jump to any object-oriented languages when they arrived. This means I’ve always had a bias towards C since it was the language I know and relied on the most with different flavors of UNIX (including device drivers). What amazes me is how (runtime) efficiency is NEVER brought up. I saw some remarks that favor assembler. If you’re still that much of a purist, it better be because you’re striving for the least amount of clock cycles to handle the objectives. Anyway, my exposure to object-oriented languages seemed to place code organization and portability in front of runtime efficiency. Like judging a car by its body & color instead of the engine & suspension, you can prefer C++ or C. But then again, if C++ can show its performance advantages for certain kinds of functionality, so be it. I just haven’t heard of any such cases of C++ being the winner in performance…….which is mainly why I stayed with C. I’ll end with the following question:
    How many operating systems are made with C++?

  8. Really nice video. It occured to me that you may be a fumctional programmer at heart as your comments about OO identify it’s limitations. Erlang/OTP, Elixir, etc might be more up your alley. Also, using C++ differently (functionally) might work – you have a lot invested, so leverage that and drop the OO aspect. Meryy Christmas to you and yours.

  9. I know this is a debate on C (started in 1985) vs C++ (started in 2007) which I've programmed for years, but my new favorite language for quick desktop and web applications is Python 3 with Qt Designer, PyQt5, and its many great open source libraries. And it's truly portable yet can be compiled in linux, windows, OS. MicroPython can run on small, cheap, but powerful microcontrollers like the ESP32 that perform well in telemetry, SCADA, security camera, etc And, although it's a dynamic typed interpretive language, the code allows for adding static 'c' like variable typing and can be compiled to run almost as fast as 'c' code.

  10. I get that you hate OO, making you hate C++. However, I feel like your reasons are not really "Why C is better" but more "why OO sucks". Why not give some modern, non-OO languages like some functional language a chance?

  11. I use Ruby styled C. By that I mean I use the same principles of OOP and blocks like in Ruby but in C which I think makes my code very readable and OOP. A decade of experience in Ruby helps. I use C because it directly translates to ASM and it fits software I am writing (very low-level and speed-oriented and cross-platform).

  12. Super blue pill to have your gf in your profile pic. Great way to get her to cheat on you is make her feel very secure about your affection for her. You want her to be uncertain and always worried that you could leave her, thats how she stays loyal to you.

  13. The crap with getters and setter came from the Java bean convention. Almost NOBODY ever overwrote a getter or setter (except in my current project).

    After the arrival of getters and setter came simplifications like properties in C# or creation of getters and setters by IDEs like Eclipse.

    15-20 years ago I would have told you to take a look at Java.
    A friend of mine hated C++ 25 years ago, but now loves Python and OO.

    Maybe you should really take a look at a modern and simple programming language. What about Swift and then doing games for Mac?

  14. I’d like to know how you will code without OOP. Is it just a bunch of functions and one big main method. How do you achieve modularity and code organization? I’d like to know since oop is how I code and I’m not familiar with an alternative way of coding.

  15. Lately i have been practicing C++ and its modern design methods like SOLID, factories, façades and many more. Last week i have been following a C course so i can be more proficient in the embedded field. In my opinion, C++ and C go hand in hand depending on what you want to accomplish. C will bring you closer to the "machine" where as C++ grands you many possibilities to develop complex and advanced software applications. Learning C++ is not just OOP or design principles, good practice is what people tend to neglect which will result into a disastrous mess of code. Giving context to code is something people don't do for reasons like "being that guy people have to go to when they run into a problem". If you consider to learn C++ i highly recommend to read AND USE the C++ Guide lines: https://github.com/isocpp/CppCoreGuidelines, and try to be not a pompous arse about your ability to write proper C++ code, because it simply cannot be achieved on your own (like the guy on reddit).

  16. In my opinion, C++ is faster to write, and can be difficult to read. C is slightly slower to write, but significantly easier to read.
    Which do you do more of? Hopefully, your answer is reading code.
    Readability is especially important when you come back to your code after a few weeks. I can get back up to speed much faster with C code I wrote than with C++ code I wrote.

  17. C++ is the first language I "learned", first when I was teeneager I read 4 books then in university relearning everything using boost and stuff as more experienced person.
    I don't like it that you have to keep it low level using defines/header files like in C, remembering orders and stuff and on top of that you have different kind of consts, different kind of templates, polymorphism, multi polymorphism(diamond problem), references, pointers, operators, lambda functions, different kind of constructurs… Then shared_pointers and things like boost. It's just all too messy. I prefer simplicity.

    I prefer languages like C#,python,javascript or just C. I'd like C with some additional features like builtin maps/sets, helper functions, or templates rather than writing macros when you want container for multitypes.

  18. You dont have enough experience to know what a maintenance nightmare pure functional programming is. Enforced encapsulation is a godsend.

  19. Don't like multiple inheritance? Don't use it. Don't like data encapsulation? Don't do it. Don't like strong typing? Use variants. C++ has features that allow engineering discipline to be enforced by the compiler. But no one is forcing you to use them. (Except maybe your employer?) If you don't like or feel you need the structure imposed by discipline, then C++ is probably not for you. But remember, the more people working on the code base the greater the value of structure and discipline.

  20. I'll be honest, the only reason why I sometimes use C++ is because of STL. C is still the most logical and simple (that doesn't mean it's easy) language around, with the possible exception of Assembly.

  21. Aren't you supposed to only use inheritance very, very sparingly in OOP ?
    (And especially not as the default technique, unless if you're programming UIs ?)

  22. this comment section alone would probably destroy any interest i could have in programming if i was just getting into it… lua with computercraft is probably my favorite programming environment just because it is actually fun… nothing in this comment section sounds like fun to be honest

  23. the only reason i got out of that was "because i like c more than c++"
    thats like the most retarded reason to talk 5 minutes about this shit

  24. I don't need a lot of what c++ and modern c++ offers, and what I do need, I can replicate it in c without the mumbo jumbo 900thousand iterdependent classes

  25. After 35+ years of programming in a 1/2 dozen language variants the vast majority of solid code I've built has been in C. Most currently a variant of Objective C where the first parameter of every "class method" function call is the data for the "object" instance.

  26. They want to want to make it hard for us to create useful software so they can maintain control. Define "they" for yourself. ???


Please enter your comment!
Please enter your name here