I’m not much of a coder but C++ was the first language I messed with and I love everything about it. I’ll have to look into Rust, and Zig, after I learn a little more. I’m doing the freecodecamp courses and I’m learning JS right now and the basics of OOP and stuff

Reply to this note

Please Login to reply.

Discussion

That's awesome!! Great languages. I'm familiar with C++ but only just starting to get familiar with Zig, last time I coded for fun or for my own projects. Feeling inspired to get back into both!

Rust is C++ done right. C++ has a ton of problems stemming from how different features interact. E.g. function overloading and implicit casting. It's riddled with potential to get memory vulnerabilities.

Rust fixes all this and keeps many of the good aspects of C++. I loved C++ too but after years of coding in it I started to get annoyed by the bugs. Rust was a salvation. It may sound crazy but the type system also prevents many non-memory bugs to the point that compiled programs often work correctly the first time. You don't get this in any other popular language.

Also OOP is overrated. Some of the concepts are useful but the way traditional languages implement objects is inflexible (can't implement an interface/abstract class for non-class types) and the idea of inheritance has problems around leaking internal details and comprehension.

Composition is much better than inheritance. The only problem with composition is if you want to delegate many things it gets annoying. This is not very frequent problem though and can be worked around using macros.

So far the only thing I’ve used objects for was a Roman numeral converter. I stored a bunch of objects in an array, with each object having two keys, the Arabic numeral, and its Roman counterpart. Then I built a recursive function and iterated through the array to convert a number to a Roman numeral.

I mean I’ve used objects in the courses but that was the first time I’ve used them in a project. The courses haven’t even gotten to OOP, so idk if that’s actually OOP

I suppose there was no inheritance, in which case you could say it's "a sane version of OOP".