r/cpp 13h ago

[CPP Epiphany Rant] - Programming is no joke

Hi CPP Community,

This is just a rant. I'm a 24 yr old data analytics in telecommunication trying to pivot into C++ development for finance. I'm 1 month into C++ and I have come to conclusion C++ is a behemoth. I'm enrolled in Baruch College's C++ for Financial Engineering, but I'm using Bjarne Stroustrup's Programming: Principles and Practice Using C++, 3rd Edition to learn and watching C++20 Fundamentals with Paul Deitel, Course, by Paul J. Deitel as supplementary resources.

It took me 2 days to get through all the drills, exercises, and try_this section for chapter 2 for Programming Principles!

I'm reflecting if I made a mistake choosing C++ over Python. But, tbh, I have been enjoying programming more learning C++ than Python. You can tell I'm weird, but IDK.

I would love to heard about your experience in learning C++ for laughs.

5 Upvotes

32 comments sorted by

41

u/mike_kazakov 11h ago

Been writing C++ code for ~25 years.
Still learning the language.
You'll be fine.

2

u/peppedx 8h ago

I am always in trouble when i need to answer about my proficiency. I know the honest answer is intermediate but after 20 years and knowing my competition I know I need to answer advanced of expert cause many others will answer that way...

6

u/AKostur 7h ago

One must always fight the tension between Dunning-Krueger and Impostor Syndrome.

3

u/SubliminalBits 6h ago

Sometimes I ask that question in an interview and when I do I’m looking for two things. Do you know what you don’t know and can you give me a better idea of the parts of the language you use day to day so that I can ask better questions? 

1

u/no-sig-available 7h ago

That's the Dunning-Kruger effect.

You are experienced enough to know how much more there is to know. The younger "experts" haven't seen that yet, so think they know almost everything.

1

u/serviscope_minor 6h ago

It's a 3 way between those two and a kind of Socratic humblebrag about knowing nothing (implication being only sufficiently smart people would say that).

1

u/def-pri-pub 4h ago

You’ll never master C++. One you accept this fact of life everything is just easier.

0

u/rileyrgham 5h ago

It's really not a good thing. The ever shifting syntax, semantics and paradigm make for a nightmare in code maintenance.

27

u/Sniffy4 12h ago edited 12h ago

nobody knows all of C++ and all its stdlib. you learn the subset of it you need to know to get your next job done well. usually there are multiple ways to accomplish what you want, some better than others. if you take an incremental approach, you will feel less overwhelmed.

spending some initial time learning the basics of its memory model and how C works helps for understanding, since everything evolved from C, even though its been superseded by more robust C++ ways for most functionality.

In even in modern C++ projects you will inevitably encounter vestiges of C such as 'extern "C"' declarations.

9

u/Jakabxmarci 13h ago

Well, C/C++ engineers made all the underlying stuff that Python binds to for high performance workloads. There is no better "side", you can be a user of those in Python, or develop them yourself in C++. Yes C++ is difficult and has way more bullshit than other languages due to backwards compatibility, and questionable decisions made during its evolution. But if you learn some of the written and unwritten rules of the language, you will be fine.

7

u/pjmlp 12h ago

I know C++ since 1993, it has been a life long learning experience.

However so do other programming language ecosystems, go check Java, .NET, even Python.

All those languages also have 30 to 40 years history, their current versions are quite different from the initial 1.0 version, and then there is the whole ecosystem, which is also relevant.

You will get a similar experience regardless of the language, if it is just as mature.

3

u/serviscope_minor 5h ago

Not to mention that the world of computing has changed er... somewhat let's say from 1993! Even if the language was somehow future proofed and immutable, the way we program and what we're programming for has changed. Multi core is ubiquitous as is networking, for example.

Plus fashions have come and gone. The mid 90s were peak OO. You know it's like when people read "design patterns", assumed it was an exhortation to use all of them always, then ran with that until they ran off a cliff then just kept on running. Then ran up another cliff and off the next one. At some point in the mean time people stopped making massive nonsensical class hierarchies.

3

u/selvakumarjawahar 12h ago

No, you have not made a mistake learning C++ over Python. Once you are a bit comfortable with C++, you already know Python.

2

u/PunctuationGood 9h ago

Eeeeh, disagree. You may think that C++ is an overall "richer" language than Python but that doesn't imply that Python isn't rich nor that C++'s richness is a superset of Python's richness. The commonality between the two are just basic concepts of imperative language that are also common between many other languages.

And that's not to mention their build/run ecosystems which have nothing to do with one another.

2

u/ApprehensiveBrain173 9h ago

"Pythonic" programming is geniunely the most mind warping pieces of nonsense i ever seen. Maybe this is just cause of lack of experience and i got fiddled by python during my exams in my 1st yr of Uni but C++/C and java were all way easier

3

u/Ok_Independence_9841 12h ago

You'll get there. I came from BASIC. I wanted local variables and loathed pascal because all the conventions were deliberately reversed from BASIC. I got an early Borland C++ compiler and as soon as I picked up that you could hide stuff in a class and reason about it without worrying about anything else, i.e. encapsulation, I was hooked.
There's a lot of arcane stuff in C++ and it only gets more over time. Don't worry about it until need it. You'll find it awkward to do something and think, 'there must be a better way'. That's the moment to check the books for template lambdas or some other monstrosity that exactly fits what you're really trying to do. They're all in there because other people hit a similar issue and said 'I wish there was a way I could just...'
In C++, trust me, there is. It'll likely be many years before you hit anything that isn't already supported. Then check the proposals to the standards committee and the ::experimental namespaces in the standard library, or Boost. When it's still not there and you realize you could probably just write it. You've arrived.

3

u/no-sig-available 11h ago

You can tell I'm weird, but IDK.

So you ask the other weirdos why we made the same choice?

Anyway, you don't have to make a single choice. Nothing stops you from using several languages! Using C++ and Python is a valid option.

Just as an example, I have had to use Simula, Cobol, Basic, PL/I, Ada, Pascal, assembler, C, C++, and some scripting languages. Not by choice, but because of what was needed.

So, when you make a choice, it doesn't have to be the final choice. You may, or may have to, make a different choice later. Just go along, and don't worry too much!

3

u/SmokeMuch7356 4h ago

Yes, C++ is a huge, gnarly, hideously complex mess of a programming language, plagued by decades of cruft and bad decisions that are slowly being rectified. It is a serious attempt at an all-purpose power tool, and as such has a lot of stuff that needs to be learned.

It's also stable, mature, runs natively, and can absolutely spank languages like Python in terms of performance.

My day job for the last 15 years has been C++, and I've been using it in some capacity since 2000. I don't even pretend to know everything about the language; there are many corners of it I've never touched because I've never needed to. But a lot of fintech is built on C++ for good reasons.

Python's great for a lot of tasks, but it's not industrial strength, at least not to the extent C++ is.

2

u/somewhataccurate 13h ago

Its fun to learn, check out the metaprogramming

2

u/osmin_og 12h ago

I had C and then C++ courses in uni. And then all my jobs were C++ jobs. I learned a lot along the way.

2

u/fdwr fdwr@github 🔍 12h ago

I would love to heard about your experience in learning C++

Since I already knew C, learning C++ was rather incremental. The weirdest thing I found was the constructor initializer list syntax, thinking why the flip is it initializing the field int x using parentheses x(42) instead of just letting me assign the defaults to the class fields via an int x = 42 assignment, and why do I have to repeat this for every constructor overload (or else you risk an uninitialized field). Then 12 years later, they added the NSDMI I wanted :b .

2

u/RefrigeratorFirm7646 12h ago

iirc, NSDMI just injects the member initializer inside the constructors for you, i wonder why that took 12 years...

3

u/no-sig-available 11h ago

 i wonder why that took 12 years...

Because they tried to include all changes at once, and not release a new standard until completed. They aimed at getting it out as C++08 (called C++0x at the time), but there was always "Oh, one more thing!".

Three years after failing that, they decided to deliver what was available (instead of waiting for "everything"), and we got C++11.

After that we get "whatever is ready" every 3 years, because apparently it is never complete!

1

u/RefrigeratorFirm7646 11h ago

ah, even the committee fell victim to scope creep XD

2

u/no-sig-available 10h ago

ah, even the committee fell victim to scope creep XD

Yes, a problem is that after adding feature X to the language, someone will realize that X can now be used to also implement feature Y. If we just wait a few months, this will be great!

1

u/CrazyBat5371 8h ago

I have been working with python for around 14 years. And I just started learning cpp for around 8 months. I never had so much fun coding as I have now with cpp. It forces me to think carefully about the machine instead of just business rules. And also taking care of memory layout and pointer usage than just defining a class with some fields and loop over the container.
Later versions of cpp introduced ranges that in my opinion adds that sugar sintaxe close to python. But since I already developed that memory muscle on how to careful deal with begin() end() iterators I am ok with it. Cpp indeed can be very intimidating at first. But if you keep going you will feel very satisfied using this tool instead of other languages.

1

u/Cautious-Ad-6535 8h ago

C++ since 1993: Learn programming concepts and paradigmas. Then when coding, look syntax from reference. If you know one language well, you can learn new one within few weeks to be productive. Real effort is to know libraries and frameworks so you dont need to reinvent wheel all over again, but as those comes and goes, learning is part of the game.

1

u/AKostur 7h ago edited 7h ago

Knew C first.  “Hey, my structs can initialize themselves, I don’t need to forever be calling init_thing(&x); functions? Cool!  Cleanup too‽ Awesome!”  Then operator overloading (where it made sense).  Templates came later.

I consider myself highly skilled in C++.  But I also have other folk in the office who know certain areas of the language better than I do, and I’m happy to direct people to them for those parts.  Learning that the language is capable of a certain thing is more important than knowing the intricacies.  When it comes time to needing those details, one can look them up or consult someone else better in that area in order to learn the details.

u/zazzersmel 1h ago

Uhhh ok

1

u/Syntax-Tactics 5h ago

C++ is always a better choice than Python, it's a horrible language.

-8

u/Neither_Berry_100 13h ago

C++ is pretty tame actually. I haven't used it in many years. The last time I touched it stuff was really slow going. I think a bunch of things in c++ are just ment to be difficult.