Тёмный

Why I'm switching to C in 2019 

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

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: • CppCon 2014: Mike Acto...
CORRECTION: Flibitijibibo has never worked at Valve.

Игры

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

 

6 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1,6 тыс.   
@UltimaN3rd
@UltimaN3rd 4 года назад
It's been a year since I switched to C so I made a follow-up video about my experience using C this year: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IEbrwh5ghMQ.html
@whotyjones
@whotyjones 4 года назад
Interesting arguments and I agree with a lot of what you're saying, but one thing that stood out to me is that it sounds like maybe you had a bad introduction to C++? When I was learning it, I didn't even come close to classes until much later. We essentially started out with all the C stuff then when we got to certain "limitations", classes were introduced as a way to solve those "problems". I use quotes because it was more of a conceptual limitation around handling things in a more human-centric intuitive way if that makes sense.
@srccde
@srccde 4 года назад
@@whotyjones I think many people are taught C++ from a Java-like perspective (as that has been THE standard language for universities etc.) and Java requires you to have a class just to run a "Hello, world"-program.
@sdwone
@sdwone 4 года назад
Moving on from coding in Basic, Blitz Basic, Amos and some 6502 assembly on 8 and 16 bit machines as a kid, and after taking a Long Coding Hiatus obtaining a couple of Physics degrees and pursuing a career as a teacher... I finally decided to come back to coding around 20 years ago and started this journey learning C. I swiftly moved onto C++ afterwards and immediately fell at ease and in love with both languages. After dabbling in MFC (which I hated!) as an 'easier' alternative to Win32 API programming, I then jumped straight into C# and found myself loving that language too... Indeed, I've been using C# in my role as a Full Stack .NET Developer for the last 7 years... And Deeply miss my C and C++ roots! Anyway, along this journey, I've realized that it doesn't really matter what language you use! Just use one that you like and have an interest in. The most important thing, is not to use the myriad of countless features that a language might provide, but to learn common language concepts, structures and syntax to enable you to master further languages down the road if required. And yes... Just because a language might offer you a 'kool' feature, does not automatically mean that you must use it... Ask yourself Why first! And once you've established that, you can get on with the How! Learning to solve problems in multiple ways, evaluating each solution, so that you can hone in on the 'correct' solution is a very technically intuitive skill that you can only develop via trial and error. And that takes Time... But eventually, you will learn what to use, and what not to use as you master a particular language, and indeed, reach the conclusion that in the Software World... Less is Definitely More!
@rty1955
@rty1955 4 года назад
@@sdwone as a person that can code in 13 different languages (now a CIO) I can honestly say there is no "one language fits all" its good to have a few languages under your belt and choose rhe right one that fits the problem. As for me I will always love assembler Lang. Assembler language to a programmer as a blank canvas is to an artist.
@merlingrim2843
@merlingrim2843 3 года назад
Been programming in C and C++ off and on for >30 years. Both are wonderful languages. Last 15 years has been mostly C#, Java, Swift, JavaScript. Dabbled in Klingon (a.k.a. Objective C), and RUST. For me, none feel as natural as C and C++. I guess that’s because I still think like a computer and whenever something doesn’t work, I know I can always figure it out from the ground up.
@tunichtgut5285
@tunichtgut5285 4 года назад
Programming languages come and go. C stays.
@KhalilEstell
@KhalilEstell 4 года назад
One could say the same about C++.
@tetst_54546
@tetst_54546 4 года назад
Java :D
@AdrieKooijman
@AdrieKooijman 4 года назад
While you mention it, imho Go is (or could be) coming.
@pow9606
@pow9606 4 года назад
@@AdrieKooijman It could be going...😣🤣
@zrotsin6899
@zrotsin6899 4 года назад
K5 ___ bruh, just let code people in Java. Stop being such an elitist. I've used java, and like c++ more, but you're a dick for judging people coding in their coding language.
@brettyoung4379
@brettyoung4379 4 года назад
2050: why I’m switching to Sanskrit
@UltimaN3rd
@UltimaN3rd 4 года назад
And all my code will be written on papyrus scrolls ;)
@II_xD_II
@II_xD_II 4 года назад
that was actually a subject for me from 6th to 8th grade lol
@omshree2448
@omshree2448 4 года назад
@@II_xD_II same
@orangeshoes
@orangeshoes 4 года назад
@@omshree2448 we could guess that from your name! XD
@akarshsharma1266
@akarshsharma1266 4 года назад
@@II_xD_II same XDDDDDD
@duke222222
@duke222222 4 года назад
This time next year I predict the same video but C to assembly
@digital_underground
@digital_underground 4 года назад
And then from Assembly to Brainfuck
@michabiegaj1612
@michabiegaj1612 4 года назад
@@digital_underground Assembly to binary
@digital_underground
@digital_underground 4 года назад
@@michabiegaj1612 I figured it would be Brainfuck to binary
@danielmateuscardona2528
@danielmateuscardona2528 4 года назад
HAHAHAHAHAHA
@simsanutiy
@simsanutiy 4 года назад
Well, this year we've been studying masm in our university, and I find it more logical and easy to understand than C. Of coure, unless I have to work with float point numbers or output something to console, this is where C is useful
@pyxelpub8251
@pyxelpub8251 4 года назад
As someone who is literally starting learning C for the main purpose of making something on the N64 (and also the possibility of PS1), it is extremely uplifting to find out that I'm not alone in this crazy desire.
@Youda00008
@Youda00008 4 года назад
It's not a shame to use small languages for small tasks. The advantages of languages like C++ start to shine in big project with a lots of code, with many people working on it. If you use C++ for your small hobby project and it's even your first programming language, then it's gonna end up as a disaster for sure.
@johnbrooks5752
@johnbrooks5752 4 года назад
how are you going to make a game? Are you going to make an engine from scratch?
@Youda00008
@Youda00008 4 года назад
@@mrjonnoma It's not a fault of the language, it was a fault of a terrible terrible management. If they used C, they would have ended up the same.
@Caluma122
@Caluma122 4 года назад
@@Youda00008 I agree, I know of a project that want to move away from C to C++ because it's too complicated in C. But I would argue it's just poorly designed. I'm not saying C++ is bad, just that I believe they would end up the same way if they used C++. The key is to keep it simple and clean.
@HermanWillems
@HermanWillems 4 года назад
@@mrjonnoma Nice story, but nothing to do with C++. I think you can build great systems with C and both C++.
@glee21012
@glee21012 4 года назад
I like the term C-styled C++, a new language called "C+". Best of both worlds.
@loukitmyname
@loukitmyname 4 года назад
C-styled C++, also called C
@BrunodeSouzaLino
@BrunodeSouzaLino 4 года назад
C-styled C++...So, you essentially want C++ to go back to what it originally was, also known as "C with Classes". Linus Torvalds uses C with a structure very similar to C++. Tons of macros and things like that.
@abram730
@abram730 4 года назад
It already exists and is called Orthodox C++
@rodneyleadbeater5410
@rodneyleadbeater5410 4 года назад
No need. Just use a C++ compiler and you can mix and match C and C++! The only issue is style. And you'll only run into style issues when you start work coding at a new establishment. You'll then have to do what they want or spend all your time arguing the toss with them at code reviews.
@BrunodeSouzaLino
@BrunodeSouzaLino 4 года назад
@@rodneyleadbeater5410 If you "mix and match C and C++", you're essentially going to pre-C++98 "C with classes".
@marxfan1509
@marxfan1509 4 года назад
*"Linus Torvalds liked that."*
@BigBahss
@BigBahss 4 года назад
I want to like this but it's sitting a "nice" 69 likes so I can't do it.
@sablesanctum
@sablesanctum 4 года назад
From a non-coder who wants to learn, c seems far more understandable and readable than c++ to me.
@Otomega1
@Otomega1 4 года назад
to everyone. but learn both
@michaeljordon8298
@michaeljordon8298 4 года назад
The only good part of C++ is data structures, like lists.
@defeqel6537
@defeqel6537 4 года назад
@@michaeljordon8298 I hope you mean vector
@m8onethousand
@m8onethousand 4 года назад
C++ is literally the programming language with the steepest learning curve in human history. So yeah, C is childs play in comparison to C++.
@seankayll9017
@seankayll9017 4 года назад
@@michaeljordon8298 Agreed. C would be near perfect if it had strings, vectors and maps. And auto-for loops.
@G33KN3rd
@G33KN3rd 5 лет назад
I like C more than C++ but only because of these reasons: 1. Even though you can develop a program faster in C++ using its abstractions, C++'s cost is that it's easier to make unmaintainable code AND debugging is alot more difficult than in C. C's lack of abstractions means that there's no hidden code or execution etc so it's easier to maintain and alot easier to debug. 2. C is a very simple and minimal language. It's alot easier to master than C++. I could argue that being a C expert would take at least 5 years minimum but C++ would take significantly longer. 3. If I wanted to make an API that can be used by other languages, you have to use C or you need to make a C interface for your C++ code. You could either make your C++ API and then make the C interface, or just implement the library in C. 4. C will force you to learn about the overall system and how computers work, which will overall make you a more powerful programmer.
@taragnor
@taragnor 4 года назад
The only one I question on that list is the maintainability. It seems to me that OOP is a lot easier to maintain than typical C code, as is having features like smart pointers that auto-delete themselves.
@EpicSnakes
@EpicSnakes 4 года назад
So assembly is even more easier because there is no abstraction at all. C++ is far more maintenable with good pratice. I remade C code in C++. It's far more readable (less code, more expressible, more strongly type,..) without losing any performance. No more memory leak thanks to RAII. You don't have to invent the wheel every time thanks to stl. C++ is not only C with objects. The problem of C++ is you have a lot of experience to be efficient but you code faster and better. It's easy to make shitty code because of old features and forced compatibiliy with C.
@debtpeon
@debtpeon 4 года назад
@@taragnor C++ is much harder to maintain primarily due to metaprogramming. At this point it make more sense to write apps with a higher level language that's easier to use and to use C for low level and system level APIs. It much better to escape the complexities of C++ for easier to use languages.
@ciphertester1147
@ciphertester1147 4 года назад
I like C too, but most of these language debate are ridiculous. From an engineering stand point there are only two things that matter the input and the output. If you're program is good enough doesn't matter if you wrote it in what ever language ultimately it get down to machine code. What's better Erlang or Javascript; does it matter each has its place and as good programmers we should be agnostic to programming languages.
@MrSunrise-
@MrSunrise- 4 года назад
@Vendicar Kahn "...is essentially unusable." Except, perhaps, for writing operating system kernels, the task for which it was originally design and apparently still rocks.
@drwisdom1
@drwisdom1 5 лет назад
I programmed in C from 1982 until 1989 when I changed over to C++. Object-oriented is the programming holy grail, but even if you never use classes, C++ is the way to go. If you examine my code you would say it is C more than C++. There is nothing in C++ that requires you do everything the object-oriented way. If you want to write in C then you still should use C++ for two features - default arguments and the ability to declare variables where you first use them rather than at the top of scope. It makes life so much easier and safer to tie declaration to initialization. It makes it simple to rearrange code and prevents access of a variable before it is resolved. Sometimes you decide to add an argument to a call, with C++ default arguments all you have to do is recompile. With C you have to find and correct every existing occurrence. So feel free to write in C, just compile with C++.
@MrSunrise-
@MrSunrise- 4 года назад
Thank you, well explained!
@mariand82
@mariand82 4 года назад
I think the feature that you miss, is on C from about 1999
@Caluma122
@Caluma122 4 года назад
Variables should always be declared at the top of the scope. The amount of memory leaks I have to deal with because someone declares a malloc'd variable halfway through a function which was too long to begin with, to then never free it! If you need to declare a variable part way through your function, then it sounds like it's doing to much and needs to be refactored. That's my opinion anyway. As the other comment says, C99 allows you to declare variables anywhere. I like to see all variables declared at the top of the function, so you know exactly what that function is dealing with. With the exception of i,j,k where you can declare those in a loop for(int i=0;;;)
@bostic8683
@bostic8683 4 года назад
@@mariand82 🤣🤣🤣🤣
@c.j.wagenius1514
@c.j.wagenius1514 4 года назад
Variables should be declared in the top of the scope, so that you instantly know what you're dealing with. You can often guess a functions behavior that way; if made with good variable names. They're also easy to find if needed and you immediately get aware when your variables gets too many and it's time to refactor. If you need to add variables to functions so often and in such a way that it becomes a problem, you're doing something wrong. C forces you to do better than that by cognitive behavior therapy. Goodies often spoils you for the worse.
@jscorpio1987
@jscorpio1987 3 года назад
Regardless of which language you use, you’re always going to get a million know-it-alls that tell you don’t do that! You should ! And they never tell you why they think that would be the better way to do it. They just want to show you what “programming gods” they think they are when they actually just started to study programming last month. Or they are just parroting something they were told by somebody else without understanding it. Either way, they’re just trolls not worth your attention, that are most likely trying to compensate for their own insecurities.
@TroenderTass
@TroenderTass 3 года назад
Prolem is you meet these minds in the industry and you are forced to adapt to their overengineered garbage.
@reiniertl
@reiniertl 4 года назад
The argument in favor or against most languages is usually pointless. I program in C and C++ and I do not hate nor love any one in particular. If you ask me what to use for a microcontroller I would chose C if you ask me to write a complex application that makes extensive use of abstract data types were elements in lists or arrays can take on different types and such, then C++ and the STL are the way to go. There is no perfect technology out there a wise developer should chose the best fit for each application.
@lazarus6983
@lazarus6983 4 года назад
This is the only correct answer to the " vs vs ..." debate
@rodneyleadbeater5410
@rodneyleadbeater5410 4 года назад
Excellent comment. Of course, one can program in C and compile with a C++ compiler. And I bet it isn't long before an #include line is added to the code.
@mswvette
@mswvette 4 года назад
Stealing a comment from Tom Kyte (ORACLE) if the only tool in your toolbox is a hammer, every problem needs to be a nail.
@nialltracey2599
@nialltracey2599 4 года назад
I wish it was that simple. Every language out there is a kludge of some kind that forces you into one way of thinking and one way of programming. If a language tries not to force you into anything, it degenerates into a sort of dialectisation -- the old joke is "which C++ do you know?" not referring to specific standards but the fact that various coders know different subsets of the language, which is a problem for maintenance in the long run. I think the real problem is that languages are not generally abstract enough -- we are still too "imperative" in our programming. For example, look at Unity's move to ECS. The main impetus for that is that OO is inefficient, and results in too many cache misses and hence fetches for code. But if the OO was an abstraction in programming, and *not* in object code, then this would be a non-issue. If I write a routine that has to be executed on every object/entity of type X, why do I have to write it completely differently in order to say it should be run against all in a batch rather than in a random order?
@nialltracey2599
@nialltracey2599 4 года назад
@@mswvette That's Maslow's hammer, and even Maslow wasn't necessarily the first person to say it. It can be considered a proverb now.
@Varstahl
@Varstahl 4 года назад
It might be due to the fact that I've been academically trained to C/C++, but your argument seems meh at best. You're free to do whatever you want with whatever compiler you want, but I thought I'd share my opinions built from 30 years of coding: 1. You don't OOP because it's C++, you do OOP if you need OOP. If you need to keep/change the position of a player, you make a struct, if you have to handle 300 NPCs + players, maybe a more structured representation (classes with inheritance) is a better solution to avoid code duplication and enhance maintainability at scale. 2. "I don't like the tutorials I've used" or "I don't understand the language fully" screams of "find better sources". This comes ofc from my personal experience, as in 6 months as a junior in college I've learnt everything there was to learn about C99 and C++. Having the basics I never really had to use any online source, but I refuse to believe there's no better alternative. Of course, learning the pitfalls of the languages requires slow and "unrewarding" learning, which is why a lot of the poorly written material is just "copy/paste this and have your character move and jump and such in an evening". Fast rewarding paths don't make for good learning. Speaking of modern capabilities, I always suggest the book "Effective modern C++", it's a great source of learning. 3. The reason to use std::vector instead of a C style array[] is because you can't really mess up with a vector, while a typo or a perfectly working but badly designed code can completely wreck your life. A huge amount of OOB exploitation comes from poor array management. If you want to learn how to counter poor design go even lower, rather than stop at C. Using int[] instead of std::vector because it's "simpler", it's quite silly. It still has a place, mind you, but for dynamically allocated resources, not so much. 4. The reason to use std::chrono instead of an #include , is that std::chrono is platform independent. Want to use the best resolution possible whether you're compiling for Win or Linux? Use standard libraries, instead of reinventing the wheel. 5. The dev that responded "because it's idiomatic C++" is an idiot in my book, just like people following fugly practices because it's "more pythonic". I agree with you there, wholeheartidely. "You should do it like that because we do it like that, over here"… yeah, nah. 6. Just like in point 5, the fact that several C devs consider C++ as inferior, or vice versa, is stupid elitism. Facts matter over exclusivism. Linus is not the only one there, one of a major players in the secdev industry claimed that "we don't need C++ to replace C99 for security, we need better people to write better code", while claiming that he was an enlightened C99 dev who could write good code. Funny part is, that he has quite the number of exploitable code he personally written and committed, even post-talk. C is an inherently limited and more vulnerable language. But that doesn't matter if you don't have a C++ toolstack for the platform you're targeting, like NDS or PSX or whatever, so there's that. 7. There is *nothing wrong with C style C++*. Anyone who tells you otherwise is, well, wrong. In fact, the majority of code I wrote over the years could be considered C style C++. But with C++ you have the possibility to use everything you had in C99, better scoping, a better and stricter compiler, plus all the modern features you may use if you feel like it, such as std::string, just to name one. 8. Jumping to C99 when C++ modules are finally in sight feels wrong to my soul. I can't wait to drop the header+import+implementation and jump straight into modules (although I already head-started with in dev builds). 9. You can still code in assembly in both :P I realise this is almost a year old video, and that the CTA hook at the end is just that, a hook, but since the YT algo brought me here I thought I'd share my view regardless, some younger kids/devs might find it interesting. Or not. You do you.
@UltimaN3rd
@UltimaN3rd 4 года назад
Thanks for the insight mate :)
@ELFanatic
@ELFanatic 3 года назад
The arguments in his video were very much "I wanna be elitist"
@nebularain3338
@nebularain3338 3 года назад
@@ELFanatic Yeah, becasue stating a preference is "elitist", SMH.
@trueriver1950
@trueriver1950 4 года назад
C styled C++ is the only legitimate one. The ++ operator comes after the language identifier, so you don't update your style till after you have finished writing. That's just elementary syntax
@quazar-omega
@quazar-omega 4 года назад
Time to make ++C then
@robswan5765
@robswan5765 4 года назад
When the inventor of a language (Stroustrup, C++) says he doesn't expect most programmers to know ALL the language, I'm inclined to think that the language is just 'dangerous' because it becomes increasingly difficult to understand all the code you may come across and the consequences (side effects) of all the code you write yourself. Knowing all of C is much easier.
@BenderdickCumbersnatch
@BenderdickCumbersnatch 3 года назад
Dude he is only talking about knowing the entire (vast) standard library, such as being aware of all algorithms available to you to save you time (not having to reinvent the wheel, if you know that the algorithm you want is already built-in). The language syntax itself is easy. There is no way you are gonna come across "code you don't understand because you have never seen that code style before". You speak like someone who doesn't know what they are talking about. :-P
@ilgibadominanto
@ilgibadominanto 3 года назад
As for me, I've studied a bachelor's degree in videogame design and development specialized in programming and finished like 3 years ago. One could say I've been using Object Oriented programming languages for almost 5 years, and it hasn't been until now that I realized how much unnecessary abstractions and superfluous ideas have been forced into my head. Recently I've switched to pure C (trying to apply Data Oriented Programming principles) making me realize how much easier it is when you think in terms of what your computer needs to do. At the end of the day, code is read by humans but bytecode is executed by a machine, never forget that guys! P.S: thanks to Mike Acton CppCon 2014 talk.
@MikaelIsaksson
@MikaelIsaksson 4 года назад
I have been coding for 36 years. C is by far my favorite. I have used C, C++, Asm for various systems, Basic, Pascal, AMOS, more scripts languages than I can remember, and so on. I think there are more than 50 languages if I count them all. No language hits that sweet spot quite like C does. A really good choice switching to it.
@insoft_uk
@insoft_uk 4 года назад
Mikael Isaksson I prefer Asm but still pick C to write in. Something about Assembly that gives you that 1 to 1 with the machine.
@tarasov9794
@tarasov9794 4 года назад
@@mikeo844 C can do all jobs, but it's nicer and cleaner, nice try.
@tarasov9794
@tarasov9794 4 года назад
@@mikeo844 oh I sure will. You make it sound like it's a big deal, but millions of lines of code isn't much at all, when it is written with a brain and refined programming methodology. Have fun learning a "new" language every year for every new use-case that arises from evolving tech.
@Zellonous
@Zellonous 4 года назад
@@mikeo844 I had no idea programming had this many trolls. it's like one guy with 10 accounts is blasting everyone in this comment section. Get over yourself, ya fuck.
@tarasov9794
@tarasov9794 4 года назад
@@mikeo844 I've dealt with you "professionals" enough to know how exaggeratedly / baselessly arrogant and fundamentally foolish you people tend to be. Save it fake analyst.
@uzimonkey
@uzimonkey 5 лет назад
There are very few things I missed after switching from C++ to C for my small personal projects. Type safety is a big one, C likes to see a lot of things as ints and just treats them all as equivalent types so when I accidentally pass COMPONENT_VELOCITY_MASK instead of COMPONENT_VELOCITY_ID (which are both from separate enums, BTW) I get nothing. No error, no warning, it just sees them both as compatible int types. I ended up wrapping a lot of functions in macros so I pass COMPONENT_VELOCITY and the macro adds _MASK or _ID as necessary. Or I wrap things in structs since structs are always distinct types. But all of that is busywork to make up for C's weak type system, and that's not fun at all. Operator overloading is one that is not necessary but makes things a whole lot more expressive. In particular, when writing my physics engine I had a bug where I was doing the math right on paper, but in unrolling that into an inside-out sequence of function calls I made a mistake. It's not a mistake that would have occurred if C had overloaded operators and I could just add or scale vectors like in C++. It's not a huge problem and it's something you can work around, but again it's more work to overcome a shortcoming in an archaic language. Also, while I'm not a big fan of object-oriented programming with huge class hierarchies and the headaches that entails I think we can all agree that encapsulation is a good thing. Whether you call them classes or modules, having an easy way to limit the ways something outside a module can modify what's inside the module is a fundamental principle of sane programming. If you can make no assumptions about the state of your program because anything can modify anything else then things get so tedious. I've done this in C by providing a set of public functions in the header file and a second set of private functions only available to compilation units that define a symbol like SOME_MODULE_INTERNAL before including it. However, that doesn't prevent code outside the module from modifying struct members themselves which kinda defeats the purpose. I know one time I just defined a pointer to that struct as void* when outside the module and the real pointer type when inside the module which works for pointers, but for things you want to pass around as values then things get more complicated. You would have to make an equivalent type with the same size and guarantee it's the same size, and things get more complicated if you want both public and private members. That sounds like a lot of work I don't want to do. So trying to solve this problem in C in a way where you can make hard assumptions about your code like you can in C++ ends up feeling like fighting an archaic language again. So if I were to start up those types of projects again I definitely would not use C and instead use a narrow subset of C++. I guess it all comes down to the philosophies behind the compilers. C assumes the programmer knows what they're doing, but C++ strives to make programs correct at compile-time. That just seems like the C compiler is working against me and the C++ compiler with me.
@chbrules
@chbrules 6 месяцев назад
Check out the Zig language. It's a superset of C. It's not production ready just yet, but it is very promising.
@official_noself
@official_noself 3 года назад
I have resonated with this video so much that i cant explain in words honestly. I'm myself a self taught programmer for 15 years now, and a cs grad aswell, have been always struggling in between when to go cpp or c, I mean I could do both but I honestly feel the same shit about what's been said in the video about cpp, there's always never ending modern features to keep yourself up to date and feels like you can never 'make happy' those overlord cpp programmers, or get even yourself happy and satisfied with cpp . C looks like very minimalistic yet extremely powerful language that its power comes from the simplicity and mini-city? of the language
@RickTimmis
@RickTimmis 3 года назад
I love this video Nick, and I think you're bang on with your perspective.
@yapdog
@yapdog 3 года назад
I've been programming in C for nearly 30 years, and during that time I've made several forays into different languages including C++. I abhor C++. Sure, it has some conveniences, but I've found that I prefer the bare-bones simplicity of C. I feel like I'm in complete control of my code. While there's generally a hiccup mostly due to the occasional misplaced pointer or memory leak, but, if you're as meticulous a coder as I, these problems are usually very easy to track down. So, BOOOOO @ C++.
@tremon3688
@tremon3688 3 года назад
The thing is that when you write c code you know that you are programming a computer. You know what the computer will internally do with your code. This sensation is totally lost with java or modern c++ or python or whatever. That's why I like c
@Lambda_Ovine
@Lambda_Ovine 3 года назад
I first learned how to program in Java at college. Looking to expand my horizons, I was recommended to learn C by one of the professors at college. I loved it. I loved the way the language gets things done, how you express your ideas with, the idea of structures, it's simplicity and clarity, but most importantly, I loved how it showed me and taught me to think more like a machine, to be aware of what state my program is and will be, and to be aware at a deeper level of static memory, heap, stack fame, and all that good stuff. I jumped to C++ thinking that I was going to love it as well, after all, C++ is just a super-set of C, right? Not quite. I didn't like it. I don't like how it seems to want to be able to do anything so there are a bizillion ways to do the same thing and a bunch of features that you might not need ever in your life, and I didn't like how at every point of the learning process I couldn't shake the thought of "this could be achieved with structural programming in C and be less cluttered" or the thought "if I really needed to use classes, why bother with all this crap and not just use Java or C#?" C++ felt like an awkward transition between C and any other higher level OO language like Java or C# or even Python.
@qaulwart
@qaulwart 3 года назад
I'm a simple man, I like simple languages. Seriously, though. I might be a programmer, but I'm not very smart. The complexity of C++ had my head spinning. Plus, coming from Java, I love OOP, but I also like to understand the implications of my code. C++ hides too much. With C, I understand what my code does.
@qaulwart
@qaulwart 3 года назад
@JuuzouSusuyaScythe TwoHandedGsKing Thank you for your kind words of support.
@qaulwart
@qaulwart 3 года назад
@JuuzouSusuyaScythe TwoHandedGsKing copy constructors, custom assignment operators, operator overloading, virtual, pure virtual, move semantics, rule of three, rule of five, member initializers, name hiding, etc etc - C++ simply is much more complex than C. You can understand all the basic concepts of computer science and data structures and write perfectly fine programs in C, yet be confused or oblivious to all the specifics that you need to write (good) C++ code. Doesn't necessarily make you an idiot. Although I might still be one. ;)
@jamespong6588
@jamespong6588 5 лет назад
I now use c++ almost like c, I agree with you
@rawrxd1566
@rawrxd1566 4 года назад
I'm using c++ because it seems easier to me. It is really about personal option what you like more.
@BenRangel
@BenRangel 4 года назад
Looking back at my time with C++ (and C#) I feel like I spent way too much time thinking about classes. Sometimes I couldn't help myself - if I found the same props in multiple classes I felt an urge to create a shared inheritance. Now that I'm mostly working in JS without classes I feel like I'm way more productive. When I built a function in C++ and just needed to throw together some one-off objects I often found myself spending way too much time creating and refactoring classes which slowed me down in terms of getting to the meat of the actual logic. And looking back I feel like it rarely made my code easier to read. Now, this isn't a pro-JS post. I'll admit JS is not a good language. But when it comes to workflow and readability I feel like my JS projects are superior to my C++ / C# projects. This came as a shock to me a few years ago, as I had loathed dynamically typed languages before. Yeah, sometimes I do miss the lack of strong typing - especially for compile time error checking. But I do love how much time I can save by not doing overthinking trying to figure out clever classes.
@BeatXFire
@BeatXFire Год назад
Good thing there is typescript now. But I agree with you being constrained with classes especially when you just want to experiment with an idea break my flow, it's kind of distraction to the main problem.
@imodium438
@imodium438 5 лет назад
C: I have struct variable named Chair. I can sit on the Chair with the function sit(). C++: I have an object of a Chair class derived from the abstract base class Furniture, with a virtual method called action() that I override to sit on the chair and it's being managed by the ChairHandler class. Jokes aside, I agree with this video for much the same reason. There are some features I wish C had that aren't there for historical reasons, but for me it's never been worth the additional baggage that C++ brings. C prides itself on minimalism, portability & performance yet it's quite expressive given how small of a language it is. To me it isn't really obvious C++ do things better, just differently (and in a way I personally don't like) so I've never felt compelled to use it for those reasons.
@valizeth4073
@valizeth4073 5 лет назад
If you're using abstractions in C++ without true purpose, you do not know C++.
@WouterStudioHD
@WouterStudioHD 4 года назад
Should be a C++ class called Chair, derived from Furniture, but the sit() function should be in the Chair class only. An action() function in the base class is completely stupid, since it doesn't make a lot of sense to have general actions for all furniture. Now it makes the code much better, because when you code the living room, you don't need variables for your Chair class and another one for your Sofa. You can just have an array of Furniture pointers(or unique_ptr's so lifetime is handled automatically). Now when you want to call sit(), you just use a dynamic_cast to make a Chair pointer of your Furniture pointer. I don't know, to me that makes things so much more organized than having all these structs without any clear connections or relations between them. Everyone has their own preference of course. About the getters and setters: yeah, I don't really understand the use of that either.
@codingwalnuthindi6984
@codingwalnuthindi6984 4 года назад
The features you wish C had can be found in frameworks, that's what they are for! If you haven't tried any C framework then I recommend you "Cello", it's a minimal framework with a lot of syntactic hacks. If you don't like Cello then there are other options too, you just need to look for them.
@gabriellasso8808
@gabriellasso8808 4 года назад
Give a look at nim. It is a modern language that compiles to C, you can choose to use a garbage collector or to manualy manage memory, and is not object oriented
@codingwalnuthindi6984
@codingwalnuthindi6984 4 года назад
@@gabriellasso8808 really? I thought that it's a self compiling language. If Nim is programmed Nim but compiles to C then what would it be called? Surely not a transpiler!
@Pokabbie
@Pokabbie 5 лет назад
Maybe I'm just in the minority then but I'm quite a fan of C++. There a definitely things which I don't like about (I'm looking at you compile times!), but I don't think I'd switch to anything else in place of it. Maybe because I started with Java I was just so use to object oriented code that I do it without even thinking; I also think I probably mesh with C++ more because I have quite a mathematical background, and the balance of control and convenience is hit quite nicely in my opinion.
@dawkot6955
@dawkot6955 4 года назад
* I also think I probably mesh with C++ more because I have quite a mathematical background* So?
@johnfedorov8089
@johnfedorov8089 4 года назад
@@dawkot6955 C is for low IQ peasants. C++ is for computer scientists.
@turanamo
@turanamo 3 года назад
@@johnfedorov8089 Low IQ peasants such as Linux Torvalds, Richard Stallman, Ingo Molnar, ..... ??? ok!
@toastBOMBable
@toastBOMBable 5 лет назад
Agree 100%. Only C++ stuff I like is function overloading (strictly for math functions) and raw string literals which are useful when typing out opengl shaders.
@jannishoffmann7186
@jannishoffmann7186 5 лет назад
Do you know about type generic function selection macros introduced in C11? Since C99 there is a header called tgmath.h and since C11this functionality is available to anyone. Hope this addresses your first point. Cheers.
@Mike.Garcia
@Mike.Garcia 5 лет назад
I'm a PS1 programmer also, I did some stuff with it in 2001 and in 2016. You can code C++ with it.. but it all depends on the toolchain. Nice vid man!
@UltimaN3rd
@UltimaN3rd 5 лет назад
I didn't know that; I've only found the C compiler for it. Can you direct me to the C++ compiler for psx? I'm interested in seeing what you made for psx too :)
@Mike.Garcia
@Mike.Garcia 5 лет назад
@@UltimaN3rd I'm not sure what you use.. but here's a modern GCC - www.psxdev.net/forum/viewtopic.php?f=75&t=1641 for FOS PSXSDK LIB I blog mostly: mgarcia.org/Blog/NetYaroze
@animalibera4326
@animalibera4326 4 года назад
One other downside of C++ is its community... There are not much C++ questions on forums that are answered by C++ programmers without having them fight during pages, because they all disagree on the right feature to use (the Correct one, the Modern one) among 100 different features that C++ offers (thanks to all the layers of updates it has been through..... - _-)
@sebsefyu
@sebsefyu 5 лет назад
Great video. I wanna pick up my first p language and contemplating between C and Rust. Thoughts on both? I can't find great book for beginners on Rust. I think i have great book on C, C Programming A Modern Approach & Absolute Beginner's guide to C. I feel since Rust is probably the future due to memory safety and it begin high level language?, but learning material for Rust is still not good enough i feel. Syntax for Rust resembles more of Python with fewer lines of code, another plus. If i get stuck with bad book i will probably lose interest. Any suggestions and recommendations?
@jeffpotts6187
@jeffpotts6187 4 года назад
I started programming professionally around the time of DOS 1.0. I've gone from 4GL (now defunct), to Pascal, C, COBOL, C++, and now work in C#. There are lots of other languages along they way that I used to develop code (JavaScript / Typescript, Java, blah, blah, blah...). If I want efficiency without going to assembler (yes I can do that too), then it's C. If I want structure: C#. Use the right tool for the job. The problem isn't OOP, or even C++. The problem is the fact that OOP / C++ is so powerful, it has become a dumping ground for grand ideas and frameworks that essentially suck. And since software development has "evolved," development processes demand this grandiosity. Not everything needs to be reused. The term "keep it simple" has been lost.
@fermatwasright
@fermatwasright 4 года назад
Well concluded! Still remember peripheral interchange program. DOS just copied VAX 11/7XX or PDP-11. At least CP/M had originaity. Just curious what happened to the guy whom Gates/Allen/et al bought the OS out right from, and re-licensed to IBM.
@jeffpotts6187
@jeffpotts6187 4 года назад
@@fermatwasright He's probably still kicking himself, living or dead.
@lxathu
@lxathu 4 года назад
I've got used to saying "C++ (and C# and Java, of course) is aloe vera of programming: it's good for everything and it is what's good for anything".
@turbopro10
@turbopro10 4 года назад
>> Use the right tool for the job. I was going to reply, but you said it for me.
@HermanWillems
@HermanWillems 4 года назад
@ThePrivateJoker The problem with C++ is that you have many styles of different ages. It's a weakness and a strength. You can use OLD huge frameworks together with modern style C++. It's just that you continously need to switch context. Or write a wrapper around the old style. You have so many styles in C++. Also even you have the newest compiler with C++20 you can still use old bad practises. The advantage is that your old code still compiles as back compatibility is great. Most downsides of C++ is because there is also a good side about it. Otherwise it wouldnt exist. For writing modern C++ you really need to discard old C++ style. And for learning purposes it's also dangerous as a beginner that you learn the old C style C++ which is not really handy with the modern C++ programming.
@mimichio33
@mimichio33 4 года назад
I've also been learning how to program for the Playstation 1, hell, it's why I even started using C in the first place. Since starting that project I've slowly been preferring C more and more over the C++ and C# I've been using for years.
@decrodedart2688
@decrodedart2688 4 года назад
This is a really great video dude. Thanks for being honest and objective.
@UltimaN3rd
@UltimaN3rd 4 года назад
Cheers mate :)
@aymensekhri
@aymensekhri 4 года назад
I like to know and expect the generated executable machine code so i prefer C rather than C++
@Xeverous
@Xeverous 5 лет назад
Big props for saying that the vid is not trying to convince anyone and that it's more of your subjective reception. Now regarding the tutorial comments: It's fine to start with a C-style C++ when learning. No beginner will immediately understand std::copy(arr.begin(), arr.end(), std::ostream_iterator(std::cout, " ")); vs a simple printf() in a loop. Claiming differently is like blaming 5 yo kid for not understanding and remembering all of the English grammar rules. I'm a fan of modern C++ and it's newer features but I do not push for overcomplication, especially for beginners - language is already complex enough and constructive criticism is justified. While it has a large power, you must first get that level of expertise to equip that weapon. Also no C++ project uses all of it's features. OOP is never required. Just because language offers virtual functions and unlimited multiple inheritance it does not mean it's always the right thing to do. I'm writing a C++ tutorial by myself and have already made some "insurance" in case of any crtiticism. Meta tutorial FAQ and lesson design decisions rationale - I start with very simple "C part of C++" and slowly move upwards while at the same time listing all pros/cons of each introduced feature. A lot of modern C++ stuff is really good, but you need first to learn it's C fathers in order to understand what's the purpose.
@MadPumpkinGames
@MadPumpkinGames 5 лет назад
Well put.
@stellatoweett1201
@stellatoweett1201 5 лет назад
Thank you
@UltimaN3rd
@UltimaN3rd 4 года назад
I (and likely others here) would love to see your tutorial :)
@ekremdincel1505
@ekremdincel1505 4 года назад
@@UltimaN3rd yees
@isodoubIet
@isodoubIet 4 года назад
The problem is that the C part of C++ is often the ugliest, most difficult, more error prone, and the source of most inconsistencies. C-style arrays look simple but then they decay when you pass them to a function, and something else that was expecting a ref to a C-array won't compile. Why? Because we have to be backwards compatible. Meanwhile C++ gives you std::array which with a few extra keystrokes does what you expect. You _want_ an array with a size you won't know until runtime, so you have to set up a pointer, write malloc, remember to write free, constrain your functions to have only one exit and entry point to minimize the chance you'll forget etc and _still_ you'll probably have a leak somewhere. Meanwhile C++ gives you vector which grows as needed, and also won't decay. You don't have to go full STL-generic programming to program C++ in a style that is far easier and safer than what is possible with C.
@daveayerstdavies
@daveayerstdavies 4 года назад
I made the transition from C to C++ in a team environment more than 20 years ago. What I discovered was that if C++ was to be marginally more of a benefit than a ball and chain, the people using it had to operate within almost impossibly tight programming standards. In my opinion 'OO' stands for Opportunity to Obfuscate.
@jimmiller5891
@jimmiller5891 4 года назад
So in your mind OOP == C++ ? Many people have argued that C++ is not OOP at all. Be that as it may definitely there is nothing in C++ that forces you to do OOP. As to C versus C++ the STL alone is enough to switch to C++ and no OOP insight.
@daveayerstdavies
@daveayerstdavies 4 года назад
By modern standards, C++ is only primitively object orientated. By the standards of 1990 it was most definitely accepted as OO and was intended to be so.
@daveayerstdavies
@daveayerstdavies 4 года назад
@Vendicar Kahn Janitor processes are not a normal feature of compiled languages.
@doublepinger
@doublepinger 3 года назад
I appreciate that you openly said that while you were using C++ you didn't know enough about it so wanted to try C. I "started" with C89, and when I look at a lot of other languages, I can understand computer-science-wise why they'd want this or that opportunity that C (C89) doesn't offer or offers poorly, but at the same time, *I* have *my* limitations. There is still work that can be done in C, and other "more primitive" languages, which I find suitable for how I want things to go, and I am good in those. Sometimes it's not a case of fluency or disagreements, just a matter of taste and what we find ourselves compatible with!
@pissmilker2313
@pissmilker2313 4 года назад
At least you aren't switching to java
@UltimaN3rd
@UltimaN3rd 4 года назад
MFW I was coding in Java this morning to brush up for programming job interviews -_-
@Hajdew
@Hajdew 4 года назад
@@m4l490n Oof
@chrissmith1152
@chrissmith1152 4 года назад
@@m4l490n do you mean the 2nd most used language? go out, get some help
@kuchenzwiebel7147
@kuchenzwiebel7147 4 года назад
@@chrissmith1152 Python fanboy spotted. Legal forces engage! Python is giving programming a bad name.
@chrissmith1152
@chrissmith1152 4 года назад
@@kuchenzwiebel7147 12 yo youtube troll. Go outside and make friends instead of trolling on youtube and being shit
@Youda00008
@Youda00008 4 года назад
The problem is how C++ is being taught. Lot of the tutorials often skip the basics and go straight to the advanced things. But it isn't always fault of the teacher, sometimes it's also the students to blame. They want to skip the basics, because they find them boring and want to go straight to programming computer games, which is one of the most difficult thing in software engineering. My recommendation: Start with C, learn something about computer architecture and hardware, write yourself some really low level code like for Arduino, AVR or other small embeded CPU. Then try to write some bigger more complex program and experience the problems with a lot of code. Then start with C++, but not the most modern C++ standard, C++98, and learn how its additions help you maintain larger code base, what are classes good for, what is inheritance and polymorphism, what are templates. Then study C++03, C++11, C++14, C++17, .... It will take you a shitload of time, but that's the only way to properly understand all of it. C++ is not a quick-start language, it cannot be learned in 10 days, remember this joke i.redd.it/1fl5yi6bbpzz.png When you start with C++ as your first language and you go straight to the most modern standard, of course your head will blow up and you will search other language to escape to.
@catpurrfect
@catpurrfect 4 года назад
I don’t have any experience in C or C++ however when looking for potential learning sources I ran into the issue of finding material that was up-to-date (C++17), targeted towards beginners, and one that explains the history and evolution of C++. The biggest issue was trying to find up-to-date C++17 tutorials aimed at beginners. I’m not sure if that’s because you’re expected to learn earlier revisions then work your way up or if it’s just because I’m not looking hard enough. I know there are plenty of C++17 references, but I’m looking for a learning guide/tutorial. Secondly, it would be great if when creating a beginner’s guide, the author explains the changes to C++ and why he is doing things this way vs that way, etc. Since, I like a bit of insight as to why this is the way I should be doing things. I’d say that these are the biggest issues plaguing C++. It’s not necessarily the actual language itself, even though it might have a lot of valid criticism. It is the learning material in my opinion. That’s what makes people so attracted to Python, because not only is it extremely well documented and supported, but there are certain “pythonic” ways of doing things that make it easy for a beginner to focus learning and writing good programs instead of having to worry about if the way their doing it is the “right” way. There are substantially less pitfalls and traps you have to worry about. Once you are proficient in C++, I’m sure you will be enjoying yourself with the “syntactic sugar” and many benefits object oriented design brings. However, it’s getting to that point that I’m sure turns many people off and leaves them scratching their heads. The biggest contributor to this would probably be the emphasis of backwards compatibility and the constant introduction of new features. C++ is a very old language and has been growing since day one. It’s full of a lot of unnecessary things that have either been superseded or have been found to be bad practice. C++ should continue to evolve and improve, and hopefully they might be able to simplify some things in the future.
@Fiddleron
@Fiddleron 4 года назад
Please reformat into paragraphs, I am not reading that.
@anythingeverything2659
@anythingeverything2659 4 года назад
I was thinking about learning c or ++. Since i dont care about 3d gfx or gaming, but computing for infrastructure and mission critical operations use, i think c would be best.
@unclesam997
@unclesam997 4 года назад
I find it so much more fun to write code in C than C++. C is simple and powerful. You have the control of writing assembly with just enough abstraction that you don’t hate your life.
@alakani
@alakani 4 года назад
@Vendicar Kahn Pointers work fine in C unless you're talking about a protected mode OS. Which assembly language isn't magically going to change, you still need the kernel APIs no matter what language you use
@crt3275
@crt3275 4 года назад
@bean most of my compiler errors when writing C are typos, forgetting to save a file, accidentally mixing up -> and ., forgetting to update a variable name
@FiRe-mb5zc
@FiRe-mb5zc 4 года назад
You can create a pointer to something whenever you want. int *x = 0x12345678 And - if you know your stuff - it's always clear if you use a pointer or the value. Regarding security... It's indeed difficult to formally proove your code. You'll most likely proove the result of your compilation, which indeed is your loved assembler. But there are already certified c compilers and toolchains like the IAR Workbench. If you pay a little. Testing c code is easy as well, at least if you stick to your known development rules and structures. But hell, most programers dont even seem to know what a statemachine is, just to a simple example. C has it's limitations in the ordinary sense, but you can - with more or less huge amounts of work - even implement your own extensions like OOP and its inheritance... Not in a cpp sense, but in handling.
@unclesam997
@unclesam997 4 года назад
Vendicar Kahn Yeah, I do OS and compilers research. I write a fair bit of C and assembly. You sound like you don’t know what you’re talking about. For many cases, as someone else said here, you would still need to syscall because assembly doesn’t magically give you much more power. The specific cases where it does typically require utilizing privileged instructions aren’t necessary for the applications that most users write because, if there’s not some syscall, some library already function probably has already been written for you. In the other cases you can just inject the assembly into your C code.
@leeduhart105
@leeduhart105 4 года назад
I've been working with C for the past 10 years, in the past year I've been working on python and you wouldn't believe it. I keep going back to C.
@yernaraldabergenov3470
@yernaraldabergenov3470 4 года назад
okay.
@ferix.98
@ferix.98 4 года назад
I can relate to this...
@AdrieKooijman
@AdrieKooijman 4 года назад
@ trying to program something safe in python is not an issue at all: it's virtually impossible. Nathan Murthy explains it way better than I can do in medium.com/@natemurthy/all-the-things-i-hate-about-python-5c5ff5fda95e
@ekremdincel1505
@ekremdincel1505 4 года назад
@@AdrieKooijman what did you mean really?
@mostafaammar81
@mostafaammar81 3 года назад
Please I am a beginner in programming, I want to ask can I use c to make GUI programs?
@gabriellasso8808
@gabriellasso8808 4 года назад
Give a look at nim. It is a modern language that compiles to C, you can choose to use a garbage collector or to manualy manage memory, and is not object oriented
@goku14139268520
@goku14139268520 4 года назад
Gonna have to +1 this one. Nim is one of my favorite languages.
@worldshaper1723
@worldshaper1723 2 года назад
A year into programming. I've wrote Js, C++, and C. I prefer C for now.
@jonesbbq307
@jonesbbq307 3 года назад
I can see how OOP can be more close to real life but I just hate it when they ask you to do everything with it. It’s so verbose.
@StefanReich
@StefanReich 4 года назад
I just stopped using getters and setters in my Java code for 99% of the cases. That kind of encapsulation is usually useless.
@ekashpersky
@ekashpersky 4 года назад
The only purpose of g/s is ability to debug with breakpoint on single line 👍🏻
@timothemalahieude5076
@timothemalahieude5076 4 года назад
That's why I prefer C# and swift/kotlin. You don't create getters and setters if you don't need to. And if later you finally want to encapsulate them, you just declare the getters/setters in the attribute definition and the methods will be called behind the scene each time you type myclass.attribute
@ekashpersky
@ekashpersky 4 года назад
@@timothemalahieude5076 i'd probably forgotten to mention it's not obvious if there's a g/s, important one. But i can't disagree, it's very useful. UPD: you'd
@trongnguyenvan1618
@trongnguyenvan1618 4 года назад
If you use getter and setter, you can ensure that only one way for other class to change the value of class property. I see that it's useful when I read the code or debugging. Ofcourse you don't need to use this for every class.
@Kaizzer
@Kaizzer 4 года назад
Getters, and even more setters, are a complete ANTI-PATTERN for encapsulation! If you need to change the internal state of an object in the application, you need a METHOD that DOES SOMETHING, e.g. Player::move(delta_x, delta_y). If you need to change the internal state of an object for testing, you can use different patterns, e.g. friend classes, decorator-to-public, or other nasty stuff to inspect code. If you got bothered by access management (public/package/private), and you feel like you're an adult sorrounded by adults, just go for the Python way.
@ParabulaMan
@ParabulaMan 4 года назад
i love C you really get a feel for what the computer is doing with C.
@waoneill
@waoneill 3 года назад
After BASIC I graduated directly to machine code in ‘82. My Z80 machine had 2k usable RAM and I couldn’t even afford the space for a Hex Loader... Once I got access to an Archimedes in ‘90, I ran a comparative test between ARM Assembly, FORTH, Pascal, and C. The optimizing C compiler destroyed even my hand-tuned assembler code! C++ allows you to de-optimize your pure C when it makes sense, but I still think in C!!!
@SasLuca
@SasLuca 4 года назад
I was already using C++ as a Better C but now Im starting to write more code in C to see if the advantages of C++ are really worth it.
@misana77
@misana77 4 года назад
C++ is neither "Better C" nor "C with classes". Its totally different language with different philosophy. Writing in C++ as if it was plain C doesn't make your code C++ C is just an old simple language with some features they've added in C11 and C18
@SasLuca
@SasLuca 4 года назад
@@misana77 I think it's funny when people try to say "C++ is this not that". For C++ that ship sailed a long time ago, the committee changes their mind about a lot of things pretty often, so claiming C++ is one thing when even the committee can't decide on that thing is not realistic.
@andrebotelho7135
@andrebotelho7135 4 года назад
So there are a ton of misconceptions in this video and in the comment section, as an avid c++ programmer I'd like to access them: 1 - OO programing is bad - this is partially true, the OO approach does incentivize new programmers to write bad enterprise code, but just because you can eat tide pods, doesn't mean you should! Use the language features when you should, not when you can, this decisions are your job as a software engineer/ computer scientist. 2 - C++ "idioms" are nothing but syntax sugar and aren't better than the equivalent c code - this is false, when using this abstractions, not only are you using code that has been written and re-written by a lot of really dedicated coders, but also, it helps the compiler when optimizing your code. (The std string library, for example, isn't just a wrapper around char*, it does a lot of small string optimizations that would take a lot of function calls in c, but are implicit in c++) 3 - There is no hidden code execution in C - partially true, C++'s abstractions may have hidden run-time costs if used incorrectly, and these aren't well documented, but in C there is also hidden code being executed that most people don't know about. Did you know that malloc isn't a kernel call? 4 - C is minimal and easier to master - true, C++ is really complex (some would say bloated but I don't think so), and because of this it isn't uncommon to look at standard C++ and not understand what the code is doing. But I'd also say that if you aren't able/ willing to learn new tech, then this really isn't a profession for you. :( 5 - You need C to make an API to talk to other languages - Partially true, C++'s OO approach makes it easier to interface with high level languages, and if you really want/ need the c bindings, is as easy as putting your functions inside an "extern C" block. 6 - C will force you to learn how computers work making you a better programmer - false, If you really want to learn about "how computers work" program in assembly, there's a reason we don't do that... Multi-threads are a nightmare in C, making it easier in C++ doesn't make you a worst programmer, just makes you a more efficient one, high level abstractions aren't an excuse to not learn about your hardware. 7 - C works on all OS - true, but so does C++, fun fact: C++ used to be transpiled to C, a language can work in all OS as long as there is a compiler for them, and there is one for C++ on most OS. 8 - Debugging in C is better as there is no hidden code - false, in C++ (and in C as well) you should be sure that the "hidden code" (either from a library or the std) doesn't have any errors so there is no need to debug it (you wouldn't debug malloc for example). If the code you are referring to was written by you, then it isn't hidden and you can very easily jump into it. As a side note I'd like to say that just because people miss use inheritance that doesn't mean that it's inherently bad (pun intended), most of the time, you shouldn't be using it, but when you should it is really useful and makes your code base easier to maintain. Also, if you have setters and getters who only set and get a variable (without any additional steps like setting a flag for example) those variables can and should be made public. Another example of bad enterprise coders, and miss informed RU-vid tutorials being confused with a language flaw...
@louis-vincentboudreault8283
@louis-vincentboudreault8283 4 года назад
@P Mason I will tackle the points on OO: Saying OO is bad without real arguments is really weak. I have seen spaghetti code in all the languages I used : Haskell, Js, Java, C#, C++, C, lisp, Rust, etc.. OO isn't bad, it's you who never mastered it. Of course, beginners will use it badly like any other paradigm. OO is simply polymorphic message sending due to its subtype polymorphism (which would be a chore to do it by hand). Implementation Hiding is good and you should rely on interfaces, this principle applies to any paradigm even procedural C. Since when abstraction is bad? Did you benchmark it? what is the last time you entered in debug mode for any library code you used? If OO machinery is too costly for you, maybe this is just not the right tool for your problem. Moreover, with newer CPU architecture most programs can use high-level abstraction with low to no cost most of the time. Finally, we know OO is not how the CPU represents data and that is the point! We want to abstract away these cumbersome details when we are writing a Web app, a desktop app, etc. Otherwise, we would write in x86_64 assembly... Not every one of us programs for a real-time embedded system... You have a very "religious" way of thinking about your favorite technology. However, OOP has been studied and used in countless ways that you can't even imagine. In academics we have a very rigorous way of doing OO for real encapsulation (it's really unpleasant), we have dynamic/static versions of OO even both at the same time! We have OO for distribute system, we have really elegant and powerful languages like BETA, Eiffel, CLOS, AmbientTalk, Strongtalk (and many more derivatives of Smalltalk). This paradigm is studied since the 80s and what you use in the industry or what you know about this paradigm is only a fraction of the reality. We even got languages we good multiple inheritances. Every paradigm has something to offer and if you use to most fucked language of a paradigm (say C++ or Java for OO) as a base to discriminate its potential, of course, you will win... You just choose easy targets to generalize over a large and nicely engineered paradigm.
@pt8306
@pt8306 4 года назад
I fully agree with you on all but one thing - C++ is definitely bloated. This largely stems from having "Modern C++" and "old C++". A non-bloated version of the language would only have the modern stuff, if it replaces the older stuff. I understand it's necessary for compatiblity, I am mainly thinking in the context of if you were to redesign the language from scratch with nothing to support from the past. The biggest problem with the bloat isn't really the fact that the language has too much stuff in it - that's fine, you can just not use it. The big problem is that it crops up in libraries or in codebases, and especially in tutorials, so you need to know how it works and why it was replaced to really get why you should be using the new stuff, how to work with the old stuff and new stuff together (if that's even possible), and what the differences are.
@pt8306
@pt8306 4 года назад
@P Mason Design a proper interface and OO is amazing. Design a crappy interface and OO is just about the worst thing you can use and is 100% guaranteed to make a mess. Use OO when it makes sense, don't use it when you're writing a simple, basic code. C++ allows both and any competent programmer should know when to use both, although most of the time if you're not using OO you're doing it wrong since it's so ubiquitous. If your creating an unmaintainable mess in OO, perhaps you should analyse your interfaces and your design rather than blaming the language.
@louis-vincentboudreault8283
@louis-vincentboudreault8283 4 года назад
@P Mason I didn't do data oriented design, I'm aware of these principles, I have worked mainly with functionals/OOP and some procedural. As I said before, if you really need performance and every penny counts, OOP might not be the tool for you, virtual method will induce overhead (1 indirection). I'm aware of the cost of OO, but the cost doesn't justify how bad you are seeing it. If your field requires high performance, good for you. But they are many other fields in computing that frankly don't require that much of performance. Still, your arguments against OOP is : "its bad and isn't effective" but that means nothing. Why is it bad? what are the real justifications? The C language has a lot of flaws too. However, I know it has pros too. It's just the way you are expression yourself about something you don't really master or you are not totally aware of its capabilities is bs. You may don't like OOP, but OOP if properly implemented is really nice and offers a ton of practical advantages over C. Again, I know it is not compatible with how the computer represent data, I'm not stupid. Over a long period a time and a good compiler for OO language, this cost becomes negligible for most applications. Even some papers show how modern CPU helps high-level languages.
@louis-vincentboudreault8283
@louis-vincentboudreault8283 4 года назад
@P Mason Friend classes, business events through messaging and glue code are not bad per se. If they modelized correctly your domain then they are ok. However, if they are used in a bad way then it's just bad programming. Friend classes, for example, are great for modelizing tightly coupled entities like a collection and its iterator. Since both need implementation details of each other. These domain entities require to bend the rules of implementation hiding and "encapsulation" (encapsulation not in the sense of ownership) to be properly designed. Same thing with messaging and glue code. Again, if you use glue code, messaging and friend class too much it's just bad programming. OO isn't simple and it comes down to the programmer experience and expertise. Maybe your domain doesn't fit really well with OOP, in this case, its up to you to use an alternative. But the examples you gave do not describe any flaw in OO and are too general since a good domain comprehension should not induce bad programming.
@maxmustermann-hx3fx
@maxmustermann-hx3fx 4 года назад
Just got The C Programming Language as a gift for my Birthday 😊
@seankayll9017
@seankayll9017 4 года назад
The programming bible. Read and digest.
@jphanson
@jphanson 4 года назад
One of my favorite books of all time. Do all the exercises, they’re really fun!
@maxmustermann-hx3fx
@maxmustermann-hx3fx 4 года назад
@@jphanson OK I will try my bets ;)
@jphanson
@jphanson 4 года назад
max mustermann Send me an email if you need help: oneplsd @ gmail
@maxmustermann-hx3fx
@maxmustermann-hx3fx 4 года назад
@@jphanson OK thank you very much
@andreicharpentierquesada4530
@andreicharpentierquesada4530 5 лет назад
hello i saw interesting you r video. im i have a doubt im electrical/electronic engineer. the unique thing that i know is assembler and c. and i use it to program microcontrollers and microproccesors. But which other uses have c in the programming universe? saluts
@UltimaN3rd
@UltimaN3rd 5 лет назад
The Linux kernel is wrotten in C and most games before 2000 were written in C. Games generally require extremely high performance making C a good choice
@valizeth4073
@valizeth4073 5 лет назад
@@UltimaN3rd Though the reason why C++ is used more freqvently in game development is because it's a lot easier to maintain a huge project which is more abstract. Fine, you don't see all the code and some is gonna be hidden, but that's the thing, the graphics programmer don't really need to see the implementation of the physics functions, they just need to know what it's doing on an abstract level. In 2019 the speed difference between C and C++ is really minimal since the abstraction overhead is slim.
@pc2753
@pc2753 4 года назад
Subbed! Because I agree with you. I know that's the worst reason ever but I agree with you so strongly it makes me think you might be equally enlightened on other topics 😁
@UltimaN3rd
@UltimaN3rd 4 года назад
Haha I'm sure at some point I'll say something that flies in the face of your opinions, but thanks :P
@lean.drocalil
@lean.drocalil 4 года назад
You surely have a point there! I quite often search for solutions and ideas online, and whenever there's that straightforward, easy-to-read Cish treatment for the problem, there's always someone saying "well, hey, don't use this, you can just cast this and that instead blah blah". I'm more than usually tempted to think about why people think that kind of coding is better, since it makes things way harder to understand and debug. I might be wrong, but I believe programmers that are more connected to the "bare metal" way of things find it slightly harder to deal with abstractions as their way to go...
@jtgdyt2
@jtgdyt2 5 лет назад
Most of what C++ does for me I can do myself in C, and with a lot less aggravation. One thing that seemed magic about C++ was the way the throw-catch would destruct and clean up as it goes up the stack. Now that I've discovered the talloc library I see it can be done with setjmp-longjmp. talloc is amazing for keeping memory clean. I had programmed C++ for years before I discovered Scott Meyers' books. It blew my mind that I had been writing C++ without that huge body of knowledge. But that is C++'s big negative. If you have to memorize *that much* stuff just to be an effective C++ programmer, that reflects poorly on the language. The opposite of elegance. I feel much more at peace, and omnipotent, writing C.
@zoomemes4336
@zoomemes4336 4 года назад
The only reasons I use C++ is STL and that it handles strings better than C. Are there any STL alternatives in C?
@inginx747
@inginx747 4 года назад
Start with C and now write mainly in C++. Forgot about OOP, if ppl switch back to C then where is their standard library, dynamically allocated array, string, smart pointer? Do C has anything similar or do I have to re-invent the wheel?
@crt3275
@crt3275 4 года назад
>standard library #include >dynamically allocated arrays void* malloc(size_t size); >strings sds (simple dynamic strings) library >smart pointers You don't need them.
@Wen-ve8nx
@Wen-ve8nx 3 года назад
I'm very much tempted after listening to this to launch into a sermon about object orientation in general. I would never say that it is wrong to use OOP. After all, some problems actually lend themselves to a object oriented solution. The only problem is that far more problems lend themselves to a procedural/functional solution. I find that it is nearly impossible to explain this to diehard C++ programmers. Why? Most have very little notion of programming without an object oriented language. The problem here is just education. There are a few generations of coders out there who have been educated to think that a language like C is obsolete, because it is not an object oriented language. I have my own theory about why computer science education has lost it's way, but that would be too lengthy to get into here. Even Bjarne Stroustrup himself admits that he never intended that C++ would be used produce only object oriented solutions, but at the same time he keeps saying that C has been made obsolete by C++. I think he wants people to use C++ to do structured programming, using encapsulation as the primary organizing feature. Still, for me, what makes C stand out, is the same thing that made it stand out back in 1982 when I got my undergrad degree in computer science: When you are writing code with and understanding and concern for the underlying hardware, there is just no better language. Yes, such coding can be done in assembly language, but it's very hard to write assembly language that can be ported to other hardware configurations. OOP, in general, has failed to live up to it's promises, especially reusability. The famed "reusability" has never happened on a large scale. In fact, it seems that the only reusability that has really materialized is in language features themselves, container classes and the like. I think that this failure comes down to a simple problem: object orientation has a lot to do with how the programmer views the problem and it's solution, and this can be radically different from programmer to programmer. For me, there's little doubt that C++ is a powerful programming language, but two things are destroying it. (1) Complexity. The beauty of C is in it's simplicity, and with regular and copious help from the C++ Standards Committee, there is precious little of this simplicity to be found today, save for the saving grace that you can still write C-like programs in C++. This complexity also makes it more time consuming to learn, and because it is now so top heavy, it seems almost like programmers can code with radically different styles on the same project, which leads to difficulties. (2) Expense. There's little doubt that C++ is an expensive choice for a project. It seems that other languages are much better at trying to do it all.
@digimikeh
@digimikeh 3 года назад
Why I'm switching to Assembly in 2021 Comming soon.. stay tuned.
@smacl6301
@smacl6301 4 года назад
Started programming in the late 70s and early 80s with BASIC and 8 bit assemblers, moved to Pascal a few years later, then C, then C++ where I've been happily programming ever since. My initial C++ was very C like and to a small extent still is, though I do use templates a lot. What I like about C++ is that you can express much more in fewer lines of code and more readily manage the complexities of very big programs. Templates and inheritance for example let you neatly provide similar functionality without having to cut & paste chunks of code around the place. Less code means less maintenance. For short console applications I still use C as I find it is quicker to write in that scenario. For bigger stuff, C++ all the way. What's great is that you can mix and match to suit your needs. The other area where C like code wins is in GPU compute and shader languages (Cuda, DirectCompute, OpenCL, etc...) which are all pretty much C syntax without much OO.
@RAINE____
@RAINE____ 3 года назад
Watched this with a big smile on my face.
@winterhell2002
@winterhell2002 4 года назад
My take is the language itself doesn't matter *that* much compared to the libraries and dependencies you are using. All the modern day libraries have some absurd overheads and really bottleneck you when attempting to run at a high framerate or on bottom of the barrel hardware. Of course, if you just use all the abstractions and design patterns like the "big boys", you'll end up with mediocre performance as well. People don't remember how 20 years ago you could run the whole operating system, internet browser, icq and mIRC at the same time, and use only 32MB RAM on a 200MHz CPU. And the whole thing would fit on a 300MB HDD. Meanwhile Discord for example uses more than 300MB disk space and 300MB RAM. You can't tell me Discord is bigger than Windows 98. Chrome can't even open a blank window without taking 500MB. We live in a mess.
@abcxyz-nd6xh
@abcxyz-nd6xh 4 года назад
My friend, its a conspiracy of Wintel to promote "FATware" If they didnt encourage soft engr's to "ABUSE" h/w & s/w resources, they would go bankrupt (coz nobody upgrading their systems).
@pierrechevaliergeol
@pierrechevaliergeol 4 года назад
Love simplicity? Lightness? Give a look at Red language; Rebol inspiration. Fits on a 1.44Mb floppy disk. www.red-lang.org en.wikipedia.org/wiki/Red_%28programming_language%29?wprov=sfla1 en.wikipedia.org/wiki/Rebol
@ianzen
@ianzen 4 года назад
That's a tradeoff most people in the industry and most consumers are willing to make. "Bad programmers" and "bad coding" are the price paid for the rate of content production we have today. Think handcrafted artisian products vs mass manufactured.
@brodieevans2769
@brodieevans2769 4 года назад
I honestly hate how C++ gets such a bad rap for pretty stupid reasons.
@chigozie123
@chigozie123 4 года назад
@@valcaron honestly, you hit the nail on the damn head.
@jameshogge
@jameshogge 4 года назад
@@valcaron C++ Mentality: Metaprogramming so all the hard stuff is done at compile time One of the languages biggest critiques: It's slow to compile ... ...
@guxershmeg
@guxershmeg 4 года назад
@@jameshogge and have lots of fun debugging templates and macros
@michaelmorris2300
@michaelmorris2300 4 года назад
Well that's because they don't understand C++. This guy doesn't understand C++. He actually admitted it.
@Marius-ir1qn
@Marius-ir1qn 4 года назад
You should use metaprogramming only when necessary
@trickysoft
@trickysoft 4 года назад
I've been programming in C and assembler since the early 80s and c++ since the early 90s (and several other languages along the way). I generally use basic C++ (sort of c-styled) with templates where required for performance (macros would do the job, but would be even less understandable). I think that people underestimate the cost of training graduate programmers to use modern C++ and focus on "malloc is evil" instead.
@abdelazizkara2352
@abdelazizkara2352 3 года назад
Loved your reflexion.
@David-ws3rw
@David-ws3rw 5 лет назад
You don't like setters and getters? Don't use them! :) You don't like templates? Don't use them! :) You don't like multiple inheritance? Don't use it! :) None of those are mandatory features of C++! But let's be also honest here: once you'll have written your Point data structure and fast linear algebra functions to work with integers for pixels, and later on you code another game but with OpenGL, and you want to use floats, you'll wish you had written a Point. And why should anybody even be against RAII?
@JohnDavidDunlap
@JohnDavidDunlap 4 года назад
It's fine to say that you don't have to use certain language features. It's sounds good on the face of it. But once you start working on large projects with lots of different developers over a large period of time you'll start to realize that what CAN be done WILL be done.
@blallocompany
@blallocompany 5 лет назад
yeah, if way you are using c++ is very similar to c then it is best to use c directly, in particular if you don't like hidden code. C++ power comes from destructors, templates, compile times checks and the increased declarative style. if you don't like using those, or the people you are working with are not able to, then c is better.
@alexstone691
@alexstone691 5 лет назад
Im waiting for full blown compile-time code in c++, you can do most of the stuff currently but it is a lot harder to maintain
@909crime
@909crime 2 года назад
I honestly don't mind OOP stuff, but I see what you're getting at. I'm in the process of making games for the sega saturn and it's all C. I like it, but kind of wish I could do classes and objects as my projects get bigger.
@socialogic9777
@socialogic9777 3 года назад
I am shifting to C++ to program embedded systems. Any suggestions.
@tower866
@tower866 5 лет назад
Underrated
@MartinMacGill
@MartinMacGill 4 года назад
Yup, my preference is C. I wrote a few games in the late 90's and 00's, mostly in C.
@starc0w
@starc0w Год назад
Thanks! Awesome video!
@MadPumpkinGames
@MadPumpkinGames 5 лет назад
I've used both extremely extensively and I prefer C at every turn. There's 2 things that make C++ more or less objectively better and that's because templates are a semantic generic system, which makes them far better than the barely useful macros either language claims to support, and proper syntactically encodable namespaces. C namespacing is essentially "well just don't give it the same name or only make it useable from a library". But that does mean large enough projects or general enough libraries end up with a slew or Daisy chain of underscores if you are oike me and care about proper namespaces. I've also made the conscious switch to C a mor or less permanent decision and haven't had any issues. It has libraries offering all the same functionality as C++, and I'm currently in the process of writing a Lisp to replace the C macro system. It will compile before you compile C. Effectively removing my only complaints about C
@UltimaN3rd
@UltimaN3rd 5 лет назад
Thanks for the interesting insight :)
@MadPumpkinGames
@MadPumpkinGames 5 лет назад
​@@UltimaN3rd Could have had less typos and less absolute qualifiers, but I was typing on mobile at the time.
@broganking9830
@broganking9830 4 года назад
I don't really know either of these languages, but I enjoyed the video :)
@UltimaN3rd
@UltimaN3rd 4 года назад
Cheers mate :)
@broganking9830
@broganking9830 4 года назад
@@UltimaN3rd No worries mate. I'm confused though, your accent is kiwi af, but says you from Texas in your twitter. Whats going on? - nevertheless, subbing to a fellow NZ dev :D
@UltimaN3rd
@UltimaN3rd 4 года назад
@@broganking9830 Haha I was born and raised in NZ but moved to Texas a few years ago
@tensorproduct3666
@tensorproduct3666 4 года назад
Personally I find things like auto and templates to be useful so I use C++. Although I can understand why some people hate C++.
@architect8675
@architect8675 4 года назад
Perhaps you mean those compiling errors when you create your own template class. Because F**K in those moments I really hate C++ (when it works all is ok hahaha).
@petros_adamopoulos
@petros_adamopoulos 4 года назад
@@architect8675 You prefer compiling errors involving macros in C, maybe.
@bit2shift
@bit2shift 4 года назад
@@architect8675 there's this concept known as *_"modern compiler"_* that tackles the _obscure template error messages_ problem. You should give it a try.
@architect8675
@architect8675 4 года назад
@@bit2shift Which compiler, the Visual Studio compiler or the g++ ?
@bit2shift
@bit2shift 4 года назад
@@architect8675 Clang 6+ and GCC 8+.
@supersearch
@supersearch 4 года назад
Do you recommend using some specific library for containers and data structures in C or do you usually write your own code for that now that you are using C?
@UltimaN3rd
@UltimaN3rd 4 года назад
I've been using C as a learning experience so it's been highly beneficial to me to stay away from extra libraries and code all the data structures and whatnot myself. It's actually been quite easy so I don't see much of a reason to use a library for them, and can't recommend any since I've only coded them myself ;)
@Optimus6128
@Optimus6128 4 года назад
I'll just compile C++ most of the time and use whatever feature I prefer. If I like to write C style at places, I do so. If I like some C++ or newer C++ features, I might consider using them. What annoys me is the dogmatic approach of some C++ programmers, where you are not supposed to use certain things because they are considered deprecated. Also, in some oldschool platforms of course C is the only option, like when I code for 3DO and I have to use an old ARMC compiler. I don't mind as I keep my coding style not affected by dogmas and I use whatever tools I have in my posession.
@Optimus6128
@Optimus6128 4 года назад
@Vendicar Kahn I don't believe in the myth of unmaintainable code based on what tools you use, because I still find some modern C++ code annoyingly hard to read. Going from C to C++ didn't magically saved us from the problem of making the code easier to read, sometimes things are becoming more complex, instead of pointers and bit shifts, you have templates and many layers of inheritance, that gets so hard to debug too.
@ardvar2585
@ardvar2585 5 лет назад
A cool thing I learned from C is to write my code in a more elegant way instead of relying data structures provided by the STL
@muadrico
@muadrico 4 года назад
Example?
@dawkot6955
@dawkot6955 4 года назад
"""Elegant"""
@pimp2570
@pimp2570 4 года назад
In my opinion using STL data structures is very elegant.
@mihailmojsoski4202
@mihailmojsoski4202 4 года назад
For example: malloc(69)
@rvdboston9568
@rvdboston9568 4 года назад
Yeah, like inventing a bike, only with square or triangular wheels. STL is like a fine tuned versatile bike compared to your home brew vector or string abomination. Its a standard library most developers will understand, not your pet projects.
@defeqel6537
@defeqel6537 4 года назад
After working with C++ for a few years, and having been practicing it for over a decade, I love the static typing aspects of it, I like templates as well, but their usage in even a slightly bigger project quickly increases the compile times to a point where it becomes a pain. I'm definitely no paradigm priest though, object-oriented code is appropriate sometimes, but not all the time, especially multiple inheritance, or inheritance trees deeper than two, should be avoided for the most part imho. I have contemplated going C multiple times, as there are some benefits to it, especially if familiar with good practices, but honestly, Rust seems like the perfect fit, even if I still have a lot to learn about working with the borrow-checker, and sometimes around it.
@pictureus
@pictureus 4 года назад
This
@BruceBigby
@BruceBigby 4 года назад
Folks, you can write excellent abstractions in C, including OO abstractions. I've done it in the past. I've written a full OO library with single inheritance, exception-handling, and Design by Contract ala Eiffel, and it was all pure C. Programming in my C library was refreshing and robust, and as long as I used and built atop my core library, I never saw memory corruption. After building up a healthy core library of classes, new code would work often the first time. Sure, my programs might trigger assertion violations, because of the built-in runtime error checking, but the error-checking harness was extremely helpful in identifying errors, which I fixed quickly. My programs were very robust and easy to understand because of the clarity and care in how I wrote the code. Now, professionally, I've used C, C++, and Java, because I must deal with codebases in these languages. Use what's relevant. Write clear code whatever you use.
@scoreunder
@scoreunder 4 года назад
This sounds like C++ with extra steps
@BruceBigby
@BruceBigby 4 года назад
@@scoreunder Yes. Extra steps to build OO, but a simpler still C syntax, and more. There's not Design by Contract in C++, although you could build it into the libraries, and in my OO system, everything is an object like in Smalltalk. Thus, objects know their types. There are types, but the library has methods for converting types into objects and vice versa. You might as well have said that it sounds like [insert any OO language]. OO is NOT a language. It's a paradigm -- a model or approach to software design and development. You could do OO in assembler language just as well.
@EUPThatsMe
@EUPThatsMe 4 года назад
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.
@highecuador1873
@highecuador1873 4 года назад
Not using Lisp to do everything is an injustice.
@johndoe973azazaz
@johndoe973azazaz 4 года назад
Amen
@FlameSilver
@FlameSilver 5 лет назад
Eggsembly is the Best Language, hands down :P
@defeqel6537
@defeqel6537 4 года назад
I prefer Tampio.
@kfsone
@kfsone 4 года назад
25+ years programming in C++. Earlier this year I dug up a C project I'd written 35 years ago thinking to convert it to C++, but part way thru I decided to just try refactoring it in modern C -- note to C++ programmers: C++ is based on a specific dialect of C89 and is *not* a superset of C but a derivative, and each C++ standard has made the divide larger by trying to retcon newer pieces of C into C++. There was actually some significant learning involved in switching to C17. Working in C was delicious for a while, but was ultimately a satisfying reminder of where C++ promised to take us while underlining how badly it has gone wrong, so badly that folks like Scott Meyers wanted out. "Modern C++" has become a celebration of needless complexity and showmanship which relies entirely on idioms rather than simple expression, which is simply a posh way of saying: the language doesn't specifically support that, but if you sacrifice chickens the right way, it can be made to happen. What this leads to is a lack of statement of intent. C++ programs aren't hard to debug because they're hard to read, but because it's frequently hard-to-impossible to tell what the author intended. As a person who has promoted and taught companies to transition to C++11 and 14, I still want to kick someone for deciding on "std::move" as the way to express "I want an rvalue reference of this", I am so tired of having to explain to engineers "I know it says move, but it doesn't actually move it". One engineer replied "so it's more like a python decorator? C++ has functions that are decorators instead of functions?" and I didn't know what to say. What you should hate about C++ is it's templating DSL, hierarchical inheritance and aversion to 'invented elsewhere'. A huge portion of what's wrong with C++ festers from not having a way to describe purely functional contracts, because people call those interfaces and java did that. While not endorsing it as a replacement for C or C++, I would encourage anyone wanting to improve their C and/or C++ to learn enough GoLang to write a program that stretches the legs of their interface concept. I found myself bringing a lot of re-invigoration back from go to my C++ and C coding that quickly spread among my colleagues.
@danaadalaide5648
@danaadalaide5648 4 года назад
The reason for using classes with getters and setters is that if in the future you need to adjust a value or call some other action before each get or set, you can do that a lot easier than going through your entire codebase and finding each and every place where you do that and copying the same code all over the place. I only use getters/setters where i think i will need to override the function in some cases to calculate a value for certain subclasses instead of just reading the value..
@AdrieKooijman
@AdrieKooijman 4 года назад
Those are not language issues. It is very well possible to write similar spaghetti in c++ or java or any language. Writing maintainable code takes effort in any language.
@danaadalaide5648
@danaadalaide5648 4 года назад
@@AdrieKooijman Those *are* language issues when it comes to C++, as many of the code generation tools as well as classes associated with the language C++ used to teach those methods, and they were copied onto Java which is based upon C++ and actually written in C++. So what would you know about it?
@zanazakaryaienejad3361
@zanazakaryaienejad3361 4 года назад
C++ supports C. So, I can use the good features of both of them. So, I stay with C++.
@NomoregoodnamesD8
@NomoregoodnamesD8 4 года назад
C++ does not support modern C. C++ is only a superset of C89 at best, and even then there are caveats where valid C code will not compile for C++
@piotrj333
@piotrj333 4 года назад
The moment you mix both styles and both features at once without clever thinking, will be your doom.
@thedanebear
@thedanebear 4 года назад
Correct. Some C feathres are not supported by C++ such as anonymous unions. C++ is almost a superset of C
@zanazakaryaienejad3361
@zanazakaryaienejad3361 4 года назад
@@NomoregoodnamesD8 I didn't even know that there exists modern C!! I always thought that C99 was the last version of C. Thanks for informing me
@zanazakaryaienejad3361
@zanazakaryaienejad3361 4 года назад
@@piotrj333 I would be glad if you provide me an example or link showing the doomness of such case
@aoli1135
@aoli1135 4 года назад
there is a third low level lang called Rust
@danielrazulay
@danielrazulay 3 года назад
I think you'll find julia to be the real language of the future. It's going to get a lot of traction coming years and it's approach is really appealing. It's much more intuitive and easy to learn than Rust while not sacrificing performance to start with..
@Franx-bd8om
@Franx-bd8om 4 года назад
I use c++ only because string, map and queue are contained in standard library. (strings can change size as I push new chars in it while using *char I'd have to allocate space for new char array that is one byte bigger and copy the contents of original char array)
@NuntiusLegis
@NuntiusLegis 4 года назад
I just switched to Commodore Basic V2 in 2019, to write a program that will modernize the entire internet by making the overlap between PETSCII and Codepage 437 characters easily available for the web - if you have a C64. ;-)
@UltimaN3rd
@UltimaN3rd 4 года назад
Finally, computing can start moving in the right direction!
@systemx6603
@systemx6603 4 года назад
Just use what you find useful from each and let's be done with this already, seriously.
@cptechno
@cptechno 4 года назад
Why not move to Rust?
@D3ND
@D3ND 4 года назад
First thing, I'm a uni student, so I don't have that much experience outside the curriculum. Now, my personal favourite PL is C. But I find it easy to get very frustrated with it especially when dealing with system programming. What I find interesting in OOPL, is the hierarchy of systems that you can create, and I find myself kinda replicating that by creating libraries that look like classes. And in my option, instead of passing void pointers it is easier to overload a function or create an interface class. As a language I love C the most, and I find it the most intuitive (try working with lisp), but you can't deny that large projects with many modules that can be used interchangeably can benefit from OOP.
@traywor1615
@traywor1615 4 года назад
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.
@rolfmissing4554
@rolfmissing4554 4 года назад
I once expanded on the details of C++ and how it is often used to make perfectly functional C-code into gibberish in a job interview...they did not hire me as I showed a clear lack of understanding of the basics of programming :)
@yokozombie
@yokozombie 4 года назад
Writing a trash code was probably not what they wanted from you. You had to demonstrate you can do things right instead.
@codetech5598
@codetech5598 4 года назад
C++ encourages programmers to sweep things under the rug.
@emhean
@emhean 4 года назад
Something similiar happend to me. I was talking with the interviewer about compilers and memory management , I even straight out asked if the person was into programming and he said yes. He did not want to hire me.
@ThatBigGuyAl
@ThatBigGuyAl 4 года назад
I just write all my programs in assembly.
@pow9606
@pow9606 4 года назад
I don't need a program, do the calculation in my brain :)
@trueriver1950
@trueriver1950 4 года назад
Lightweight! Write your machine code in hex.
@syntaxerror8955
@syntaxerror8955 4 года назад
@@pow9606 I don't need a brain, do the calculation in my program :)
@arielvinda6624
@arielvinda6624 4 года назад
need to learn assembly for some stupid embeded projects I'm planning on doing... any good learning resource?
@ThatBigGuyAl
@ThatBigGuyAl 4 года назад
@@arielvinda6624 Yes, just open up your machine and examine the processor. You can also give it voice commands. Try, "Hi googles, " Let me know if you need any more help.
@raz1572
@raz1572 4 года назад
As a newer developer working in .NET, I have been learning functional programming in my free as it seemed to address a lot of the stuff I didn't like about OO. I may have to jump into C afterwards and see the other side.
@MrKeri1997
@MrKeri1997 4 года назад
My first semester of EE we learned C programming which I really enjoyed. It was easy to understand and dare I say intuitive (well after some practice). The second semester we learned C++ and the goal was to introduce us to OOP as a concept. Sparing you the details: I somehow managed to wrap my head around overloading operators, classes and inheritence. Where I threw in the towel was templates.. Is there anyone how can make use of them in a code? Because it gets so convoluted so fast that I don't think there is any one human being who can comprehend those god damn templates.
@simonhrabec9973
@simonhrabec9973 4 года назад
You dont need to make it complicated. C#, Java, Swift - all have teplates or generics in some way.
Далее
Java 21 Is Good?! | Prime Reacts
27:08
Просмотров 217 тыс.
Switching to C - One Year Later
4:43
Просмотров 58 тыс.
💜☀️✨
00:47
Просмотров 447 тыс.
skibidi toilet zombie universe 34 ( New Virus)
03:35
Просмотров 2,6 млн
How different are C and C++? Can I still say C/C++?
10:25
Should you learn C++?? | Prime Reacts
20:29
Просмотров 327 тыс.
Why C is so Influential - Computerphile
10:50
Просмотров 1,9 млн
The Hidden Cost Of GraphQL And NodeJS
28:35
Просмотров 184 тыс.
Why do developers hate Rust?
8:20
Просмотров 100 тыс.
2 Years Of Learning C | Prime Reacts
22:24
Просмотров 250 тыс.
Master Pointers in C:  10X Your C Coding!
14:12
Просмотров 286 тыс.