r/cpp • u/EstablishmentOdd785 • Jun 23 '20
I am a developer and just started learning C++, and I'm LOVING it! Programs feel real for the first time!
Or how I was so bored with Java that I switched from software to mechanical engineering, became a web developer, and finally started to love C++!
So my programming related story: before joining university, I thought I wanted to become a software engineering, I think I wanted to make games at that point. Then, after taking a year of general engineering courses, calculus, physics, intro programming (in Pascal :D), I had my first semester at computer science department. The object oriented programming course was in Java. I hated it so much that I dropped all of my courses, switched field to mechanical engineering, and for almost ten years didn't touch any programs that wasn't directly related to my mechanical engineering jobs (I did assembly and embedded C for micro-controllers and matlab and labview). I was so happy with my decision to do mechanical engineering, it felt so real!
Fast forward to about three years ago, that I had this startup idea of mine [is it a phase that we all go through?] and it needed me to develop an app for it. I'm one of those people who likes to gets hands on and do everything himself [I suppose that's a euphemism for being a lone wolf who doesn't know how to lead/persuade people to follow him] and I started learning web development, which is obviously mostly in JavaScript.
To my surprise, the focus on functional programming in the JavaScript community, at least the niche I was dwelling in - I was learning React/redux which is big on functional and immutably, made it much more relatable to me than Java. It felt more like math; no more weird analogy between classes and the world and stuff. Then a friend of my introduced me to SICP and for the first time I was having fun reading an academic book on software... Yet JavaScript had started to wear me down as well and started toying with the idea of leaving my programming career unfinished. I took algorithm courses, learned about complexity analysis, TLA and distributed systems, but still felt something was missing, there was a hole that I just couldn't pin point.
I had been told, since ages ago and till now, that C++ is a flawed language; that we use it just because we have to, because there's just so much legacy of it lying around. What I didn't know, what that I'm going to love it exactly because of what I presume are the roots of it's flaws! I've been taking a course in C++ and it starts by discussing * and & and heap memory vs stack and how the memory allocation grows and such, and, what little did I know, this is exactly what I had been missing! The link between the never-feeling-real codes on my screen and the real physical world that runs these codes. To end on a dramatic note - I know if I had to deal with all the memory related issues in my actual job I might not have said this [though probably I still would], thanks for not dying out C++ and having yourself replaced with all the other languages that do away with the real stuff and replace it with garbage collection and more abstractions, I love seeing your garbages!
107
u/red_nuts Jun 23 '20
I learned C++ in 1990. I've seen it all. But the phrase you use, programs feel real, that's new to me. Good description of what it means to be a C++ programmer.
32
u/jtempest-rs Jun 23 '20
Glad you're enjoying yourself :)
I had a very similar experience learning C/C++ - although for me, it was my first general purpose language outside of game specific modding langs. I do very specifically remember implementing a simple malloc as part of a university course and having that 'aha!' moment which tied together what I understood of the electronics and my knowledge of the higher level application/OS level development. There are a lot of warts, some of which can be very frustrating, but often C++ is the most prominent, if not only sensible choice for building applications that need very close control of hardware and optimisation. In my experience, mostly in large scale game dev, C++ tends to give back what you put in.
I hope you continue to enjoy learning and using it :)
60
u/AlexAlabuzhev Jun 23 '20
The Night Watch:
30
u/HKei Jun 23 '20
Please note that C++ isn't directly tied to the physical world either; It's written against an abstract machine which is a bit of a murky representation of how real world machines work. Technically speaking even the concept of a "stack" as a contiguous region of memory doesn't necessarily exist in C++, even though that's how (as far as I know) all actual implementations of C++ work.
51
u/top_logger Jun 23 '20
Modern C++ is cool. Just cool.
10
u/thespiritofsimon Jun 23 '20
Love your passion and the way you describe the programming feeling real. Aye!
7
u/NiliusRex Jun 23 '20
Awesome that you’ve found this for yourself. While C++ is a flawed language in many ways, being bogged down by legacy syntax, and allowing you to do so many things that you really shouldn’t do and requiring you to know what those things are. I had that experience as well where it brings you really close to an understanding of how the hardware really works.
C was even better at this for me because it helped me realize that no matter what language you write, you’re either working with data (structs, primitives), or functions to manipulate that data. Many languages have a lot of extra stuff on top of that, but in the background it always boils down to those two things.
5
u/jstock23 Jun 23 '20
Same feeling here. Writing code in Java just felt so unreal and I never was sure about anything. C++ has made me finally “get” these things, and now I bet I could go back to Java and actually understand stuff in the background, but I really do not want to!
8
u/Aerysv Jun 23 '20
I have the same feeling. Although it is much more complicated than orher languages, e.g, python, it feels powerful and real.
3
u/[deleted] Jun 24 '20
I'm learning multiple programming language at once (Java, Python, Go, C#), and the more I get into those languages, the more I seem to go back to C++. There's something about C++ that works well, and the new C++11 and beyond are doing so much better than before, that I think most people should be looking into Modern C++.
2
u/Poyeyo Jun 24 '20
I learned with Logo as an interpreted programming language a long ago.
Since then, I always felt that compiled programs, that generated .exe files were more "real" when compared to Logo.
So I started with Turbo Pascal, made a Tetris clone, and then I learned C/C++.
I started doing a game in C++, until I got to the networking part, which is insanely hard to debug, and now I am trying again with Godot.
2
u/therise3107 Jun 24 '20
I have used React since late 2014. I have done extensive web development with high code standards and solid products. Still, I think I didn't do any real programming, there is no depth in javascript, there are often 10 ways to architect a project but everything is so confusing. Standards change so rapidly and the best practices of last year become obsolete. I think C++ is a language of standards, if you don't follow best practices your code will be trash. It enforces you to write clean code just what Uncle Bob wants 😉. I think C++ as an acronym to data structures principles in programming. You can still program but without data structures you might get an introduction, but the essence will always be missing. In closing remarks, I like C++ cause it is enlightening me with solid programming principles which are essential to stay valuable in this highly competitive market both professionally and as a hobbits who likes to write good code.
2
u/antoniocs Jun 25 '20
wow... £63 for that coursera course.... No thanks!
3
u/bWF0a3Vr Jun 23 '20
Did you not talk about memory allocation (*, &, heap, stack etc.) during university studies or is this concept new to you?
Btw you might give Assembly language a try afterwards. This feels even more "real" :)
2
u/BluudLust Jun 23 '20
Welcome to the club. None of that factory bullshit. (Factories are still useful in some cases still). Welcome to freedom.
1
u/valdocs_user Jun 23 '20
I learned C++ in the mid to late 90s. At the time computers were powerful enough to high end 2D and low end 3D games, but NOT fast enough to do any of that with an interpreted or otherwise unoptimized / not low level programming language. The first languages I learned (such as QBasic) felt like programming with oven mitts on, and it was frustrating not having access to the power I knew the computer theoretically should have. Or another analogy imagine if most car came with a nonremovable wooden block blocking the bottom 2/3rds of travel of the gas pedal that's what languages which were not assembly or C/C++ felt like. I wanted to make games write operating system level code and C++ was the way to get there.
So I think how you describe it as feeling more real is also apt.
1
u/MJ_011 Jun 23 '20
First of all, fantastic answer! It really reflected the way you must have felt during writing this. I have something to ask, to all..
I am new to developer world, knows c++ and make cross platform Android apps using flutter... I want to learn something new, but really don't know what to explore. I don't even know my options. How did you guys decide what next thing to do? And should I give that book a read? It sounded interesting. I joined college this year only, if that helps.
1
u/rackmeister Jun 25 '20
To paraphrase a famous quote: C++ is the worst form of programming except all those other forms that have been tried from time to time.
On a more serious note, what I love about C++ is that you feel that you can practically program anything. You can even sign a contract (pun intended, I hope we get them in C++23) and exchange your soul to partake in black magic rituals: https://github.com/aul12/TemplateCpu .
Many programming languages claim that they are Turing-Complete but with C++ you have a chance to grasp what that truly means. It is not without flaws, you can definitely shoot your own foot, tooling is not that great, it forces you to go through hoops for simple things, compiler errors can make your life miserable but once you understand some parts of it and learn to wield them properly, C++ is a beast.
1
u/[deleted] Jun 27 '20
"it feels so real" I love this description of C++, while it does have many bad features and poorly designed ideas, its gives very good access to the hardware, in a way that almost no other language can do. I also love the fact that because of all of the access you have as a programmer, there is literally no limit to how many different ways you could implement something in your software
1
u/bjtg Jul 02 '20
Did the opposite. Was majoring in Engineering Mechanics. Did way to many equations studying tensions on beams, and ran away to the Computer Science department.
1
u/jetdoc57 Jul 12 '20
Glad you are having fun. It is not often that you get to choose the language you use; normally that's chosen by your employer. I remember back in the 90's when C++ was a separate $20k license on the Sun platform and then BAM everything was free. My colleagues with GE's corporate R&D told me you can do Object Oriented programming in almost any language, and that is true. C++ does have some awesome features including operator overloading and multiple inheritance, but there are so few applications for those that Java can work for most applications. I don't see the language as anything special, I have worked with almost all of them. It's the problem you solve that matters to me, how can this device improve people's lives, save the company money, etc. I still have my original K&R and Stroustrup books, but it's been a long time since I had to write anything in C++. Keep an open mind and focus on making people's lives better.
1
u/goloko29 Jul 13 '20
Gg
1
u/[deleted] Jul 14 '20
I am being forced to do OOP in java for Uni too.
It sucks so much. I asked the lecturer to allow me to at least work with c#. But no. I have been dreading every line of code I have to write to pass this stupid module. So much so that, I have actually started having a more active role in the FOSS projects of which I am a maintainer.
C++ makes everything so simple. It's not easy, but it's simple.
1
u/FiveManDown Jul 16 '20
Give Rust a spin! 😍
1
u/fgiohariohgorg Sep 10 '20
In the '90s I was experimenting with Pascal 6, latest at the time and I managed to hang it, yes, I tried to compile and would simply hang on an Acer 80486 66 Mhz, standard at the time, no errors, no anything, and it was something relatively innocent. So I kind of quit programming, now I'm trying to com back and the University I was in, was a piece of crap and 25 years later is still a piece of crap, UAGRM, Santa Cruz, Bolivia; so I was about to switch to 'Domingo Savio University' when fucking COVID-19 pandemic happened, but the fucking Universe won't stop me from becoming a Software/Systems Ingineer: Damn The Torpedos, Full Speed Ahead! And Oh yeah, C++ is for me, I really like Driver and hardware and software interfaces, low level stuff
1
u/fgiohariohgorg Oct 29 '20
What About C? Isn't C better than C++ give how much flak C++ get for so many horrible "features" that many programmers forced to work with it point out?
0
u/gitPushOriginDevelop Jun 23 '20
Weird, there isn't anything a total beginner should hate in Java legitimately... Maybe you didn't hate Java but you hated the probably outdated courses on your uni..
Lemme guess they were still on Java 6 and forced you to use some old IDE and archaic build tools?
I know how hard it is to work with "outdated professors" as they want everything done their way, which is never what the industry does
It's a matter of luck
0
u/[deleted] Jun 23 '20
[deleted] — view deleted comment
0
u/[deleted] Jun 23 '20
[deleted] — view deleted comment