13

What is it with certain colleagues who "wanna write C, not C++"

Motherfucker if I see another malloc in the code I will physically asssault you.

Like damn we're failing to teach people C++ badly when a newcomer from university, who had 2 semesters of "C++" doesn't even understand RAII.

And how in gods name do software engineers with *decades* of experience get so stuck on old technologies?

Like I've seen them write 3 nested try-catch to make sure a delete is called or some mutex is unlocked....

If youre in the position of teaching others C++, please stop teaching C first.

Comments
  • 10
    BuT C++ iS JusT C wItH KlaSsEs!!1!1
  • 13
    Writing C is good so you know what it means to construct a std::String and destruct it. Malloc and free. I think it's good basic knowledge
  • 1
    @retoor i think its good to know this yes, but I dont think we should teach that stuff to beginners right away.

    And I much less want to see any of it in production. RAII solves this so much better
  • 4
    @LotsOfCaffeine Unis r always yrs behind the wild business... but their main purpose is to teach the basics and prepare u more or less for the jungle out there ;]... if I get ur point correctly ( web dev here )
  • 2
    People who are more acquainted with modern C++ are well employed in the industry or doing other stuff, older college professors only know "C with classes" and haven't updated themselves since.

    Although... C-style C++ is fine for *learning how to program*, and you can only focus on so much of the specifics of the language in such a course, so it must be left up to students to learn the language properly.

    At any rate, all of this is evidence (in my perception at least) that C is a much better language to teach in a college course. My suspicion is that C++ looks cooler to the kids, you hear about how video games are made in C++ and how C is this old language that "nobody uses anymore" (lies, but e.g. some web development people who have no idea that systems programming exists really believe that). Maybe another advantage of C++ is that standard input and output are perhaps more straightforward than printf and scanf.
  • 5
    Repeat after me you illiterate new age developers: Computer Science Degree Isn’t Code Bootcamp!
  • 3
    Job security? New programmers come on board, see the holy shit mess, and leave.

    This sounds like a useful strategy to me. Muahahahaha!

    I see a similar problem with new programmers being afraid of pointers. I even see articles saying you should avoid them. While some of the reasoning is useful I just don't see a way to avoid them in older code bases and libraries. Do these same people use frameworks like Qt ever?
  • 2
    @Demolishun about job security (and salary) check this interview: http://harmful.cat-v.org/software/...

    I think it's fake
  • 2
    @retoor fake or not it has it's points... but who am I again to talk about C & C++, when the only thing I've done there was to translate small C program to TurboPascal... I have to start learning it soon... I just don't like OOP ( in gaming it fits perfectly, but on the web I like it w/ less of it ). Now fight me if u wish ;}
  • 2
    @We3D I won't fight you because you had rough times in the past. I'm talking about programming Pascal. My nightmare. I wrote delphi professionally. The horror.

    Why Pascal? Who asked that?
  • 2
    @retoor none, I was poking everything I could find compiler 4 and even wrote an prolog interpreter to feel the power of the AI... long time ago... was lil kid still. and I dare to say made few indie games which was ok ( except for the aesthetics... )
  • 2
    @We3D I want to strongly emphasize that C++, from C++11 to 23, isn't an "object oriented language". It supports OOP but it is just one set of features/a paradigm you can use in C++.

    @nururururu the weirdest part is, I've seen fresh uni graduates, developers with a few years "C++" experience and developers with 2-3 decades of experience all succeed and fail at this at the same rate. I know devs in their 50s who are very well versed in "modern" C++, i.e. C++11 and beyond.

    I also know devs in their mid 20s who use try-catch blocks to unlock a mutex. They haven't been taught better and the others "have been doing it this way for years".
  • 2
    My point is though, it's better to teach beginners about thinking with objects (this doesn't mean OOP!), rather than throwing pointers and new[] at them on day one. C++ is such an easy language to use if you learn it the right way. Give a beginner a std::vector instead of C arrays and they'll have a much better learning experience.

    Of course if your goal is to learn C, then learn C. But I'm very much not sold on C++ courses that teach C for the first third and then go "actually forget about all of that pointer stuff we're doing RAII now".

    There's a great talk about this topic, highly recommend. I'm basically just repeating her points:

    https://youtube.com/watch/...

    Though as retoor said, it's good to have this foundational knowledge. An understanding of what's going on "under the hood", even a simple one, goes a long way. But it shouldn't be the first thing you teach to beginners. Not even to experienced programmers that come from other languages imo.
  • 3
    I had to learn C in 2022 using Borland Turbo C for DOS for a project, so i'm sure these people you're encountering are doing better than me.
  • 1
    @Parzi that sounds horrible I'm sorry you had to go through that
  • 1
    @LotsOfCaffeine But you can get compiler and dos for free. So it could be used for some embedded low budget projects. Linux is nicer though.
  • 3
    @Demolishun Fun fact: it was a spite project! no other "hey I made a modern <low-level language> toolchain and it's bootable!" projects worked on anything below a Pentium (or requires EFI to load an entire libc6 implementation before booting), which is annoying when you need to build another spite project that had to run on an 8086.
  • 3
    @Parzi wow and I thought my embedded department was using outdated technologies when many projects are running on x86 and only now ARM has been more and more relevant
  • 1
    @Parzi I learned assembler on an 8088. But that was in the 90s.
  • 1
    Oh, if you ever need a very small linux distro that is great for embedded look into http://tinycorelinux.net/

    It can run on usb flash and it won't write to disk unless you tell it to.
  • 2
  • 0
    @aviophile I do agree with that paragraph though I dunno what you're trying to say with this
  • 0
    @LotsOfCaffeine since this is a necro, I don’t either
  • 0
    @chaosesqueteam who the fuck even are you
  • 0
Add Comment