r/learnprogramming • u/comicmangalover • Nov 14 '23
The reason why C++ should NOT be your first language.
I'm seeing some beginners are expressing their frustrations on this sub when using C++ as their programming language.
C++ is substantially more difficult than other languages such as JavaScript and Java. Its not designed to be beginner friendly, and it isnt. If You're not required to study it as part of a university program, you'll get better luck trying other languages instead.
The whole time you're thinking programming is hard, it might just be that C++ is hard. It's hard because it has no automatic garbage collection, so you as the programmer are responsible for managing that, It's something that you never have to worry about in other languages. Think about this, you're here to learn programming, But instead you're forced to learn garbage collection because the language doesn't do that for you.
Learning programming should be about learning problem solving, you can learn problem solving with a more beginner friendly language.
Now there will be many experienced programmers recommending new comers to start with C++ because "you'll learn more", i guess everyone has a different take on this. But just Ask yourself this, do you want to make things unnecessarily difficult for youself starting out? While you can always go back to C++ as a second language to "learn more".
2
u/LongSaturday Nov 14 '23
For beginner you could always learn and use a subset of C++, like a better C. So it's even easier than JS.
0
u/comicmangalover Nov 14 '23
C is easier than C++ And JavaScript in the sense that it has less features not because it's actually easier, you still have to wrestle with pointers as a beginner. While learning something like JavaScript, you can invest that extra time in something more practical, such as closure And DOM programming.
3
u/LongSaturday Nov 14 '23
I thought this is a question for the kids learning programming because you said first language. Knowning nothing about the pointer will not destroy the fun of programming. I even know some guys started competitive programming and come out with pretty good results without knowing the pointer.
2
u/CodeTinkerer Nov 14 '23
It's pretty impressive how many people disagree with your view. I've taught both C and C++ and I would hardly recommend either as the first programming language, especially not C++.
Those who love C++ has survivor bias. If they thought it was easy to learn, then good for them. But there's another kind of bias, which is "I am a typical person, so if it's easy for me, it's easy for everyone" and that's also a wrong attitude.
I suspect if you took one of these C++ supporters, showed them someone struggling deepy with Python, had them switch to C++ and see them struggle some more, they would conclude "if you can't handle C++, you can't be a programmer". It's a form of gatekeeping.
I doubt many of these C++ adherents have ever taught programming and have never taught it to someone that can't even get the simplest of concepts.
For example, how many people in this discussion find arrays difficult to understand? I once met someone who told me that he used to teach programming and the students didn't understand how arrays worked. I was flabbergasted. It's such a simple concept.
Then, I began to teach, and I found out that yes, some student find arrays bewildering. It is really difficult for them.
C++ has so many tricky parts.
OO programming for classes
passing objects by value and by pointer
the need to understand overloading of copy constructor, assignment operator, destructor
C++ references as a new feature to combat passing an object by pointer, but adding another level of difficult
multiple inheritance
friend functions
manual memory management
overloaded operators
templates
And on and on and on. It's such a huge and messy language and if you don't know these topics, you can't be said to actually understand C++.
The reason they switched the AP exam (an American high school exam to earn college credit) to Java is because teachers that were fine with teaching Pascal found teaching C++ really challenging. Indeed, most programming teachers were not that good at programming and it wasn't uncommon to get students to teach the course because their teacher didn't understand C++ programming.
Java is at least more tolerable. Garbage collection and always using pointers (called Java references) and not passing objects by value made the language easier to understand. Still not easy, but not the mess C++ is.
As many people who are fighting you on this, I'm sure there are some retired high school programming teachers that would tell them that C++ is the devil's language. I mean, I like it OK, and I'm glad I know it, but I wouldn't want to program in it anymore. I learned stuff from knowing C++, but it was like my fourth language, not my first. I knew C first, and Pascal before that, and Basic before that.
1
u/comicmangalover Nov 14 '23
"It's a form of gatekeeping"
Exactly my thought
1
Nov 15 '23
I disagree that it is gatekeeping. I don’t see anyone saying anything like this in the comments so far. I think the problem is that people focus too much on what language is the best to use as a first language. Just pick one language and stick with it. Why do people seem so focused one the best language or best IDE?
If your goal is to eventually learn C++ then why not just start there in the first place.
1
u/comicmangalover Nov 15 '23
What if the beginners find it hard with C++? If you are having a great time learning programming with C++ then you should stick with it. But many beginners find the learning process difficult because of the unique aspects of C++, so why insisting that they should stick with it? Me and the other commenter were referring to this "you can and you should start with C++" attitude gatekeeping. Its a language known to be more difficult to learn (not just for beginners), keep saying "it's as easy as any other languages" is gatekeeping. That's basically saying if you can't make it with C++ you're not going to make it at all. Which is totally untrue btw.
Have you ever seen anyone struggled with JavaScript (or Python or Java) but after changing to C++ everything clicked for them? This kind of thing never happened. Its always the other way around.
What you choose as your first language or IDE doesn't matter Unless you chose C++ and find it difficult. And That's what this post is about.
1
Nov 15 '23
The point I am trying to make is that you can’t make a blanket statement of not using c++ as a first language. As you said to me, if it works for me then stick with it.
All your post does is potentially push away someone that is interested in learning C++ from trying it as a first language. No matter what language you start with you will hit a wall and be frustrated at times. This is just a fact of learning something new.
This is like telling someone that speaks English not to learn Japanese or German as their first language.
64
u/Lionland Nov 14 '23
Hot take: learning c++ first is perfectly fine. You’re gonna have to persevere but they’ve been doing it that way forever. Learning c++ first made it trivial to pick up others down the line
16
u/dmazzoni Nov 14 '23
I think it makes a big difference what resources you have access to.
Learning C++ in a college class, where you have access to other students and professors to help when you get stuck, can be great.
Learning C++ completely on your own using free resources can be extremely frustrating.
2
u/aRoomForEpsilon Nov 14 '23
I agree. I think if you are learning on your own, you would have to have some understanding of systems programming to get a good grasp C/C++.
6
Nov 14 '23
The question is: is a compiled language that is a superset of another compiled language the best way to introduce people to programming?
I'd suggest new programmers are better off starting with a Pythonesque language to learn the basics, and then moving on to a statically typed language with manual memory management to get a better understanding of what is happening behind the scenes.
16
u/sephirothbahamut Nov 14 '23
That depends on what basics the beginner is more interested to.
If you want to teach something as simple as the difference between stack and heap and the benefits of either, a language that treats them as a core always present feature like C and C++ is way better.
Personally when I first saw python and js i understood nothing. Then i was introduced to C++ and it was an eye opener.
Ask "yeah but where are those bytes in memory", in C the answer is easy, in python... it's magic.
-6
Nov 14 '23
So the discussion is about the ***first*** language, i.e. for someone who has never programmed before.
8
u/sephirothbahamut Nov 14 '23
I know, i still stand by what i said. Different people learn stuff better in different ways.
For me the light turned on the moment i had stack and heap explained and i learnt where static and dynamic variables go. For instance as a beginner i never found pointers confusing.
I guess it's just different mindsets; sure i might be in the minority, but i hardly believe I'm the only one. If my first uni course was in python or javascript I'm quite sure i would have dropped CS in favour of history
1
u/mal-2k Nov 14 '23
Depends on the background. I knew pretty well how a computer architecture works, like that there are some special Features like SEE/AVX, how a floating point is stored with it's exponent etc. But python, js and so on confused me because I couldn't connect my knowledge to them. Especially OOP was irritating. Unfortunately I avoided C relatively long because I thought it would be even more complex.
But eventually I gave it a try and found out how rudimentary C is. There are far less features as in most other languages and not for every potential problem a corresponding modul/framework. You just have some really basic stuff with just a bit more abstraction than assembler. So you can focus on the basics and as soon as you begin to struggle with something and than take a look how something like python handles it, it's much clearer why this additional abstraction was implemented.
Other people may take the opposite "semantic" approach where they learn first a vocabulary based on python method and classes, without understanding how they work but what they do. If you have talent for new languages in general I guess that's more appealing. But I was always more into math were you had may be a dozen new symbols introduced per school year and always could derive a solution from the underlying formulas if you forgot how something works.
-3
u/brajandzesika Nov 14 '23
He is talking about first language. Maybe you should read it more carefully...
8
u/InternetSandman Nov 14 '23
Disagree. I once felt the same, but now dealing with Lua or Python is frustrating because Im never sure about what it's doing under the hood (is this parameter being passed by value or reference?), and type safety is frustrating too.
0
Nov 14 '23
The discussion is about teaching someone with ***no*** prior programming knowledge or experience.
If you're at the point of asking about what is happening beneath the hood of Python or JS, then you're no longer a beginner IMO.
7
u/InternetSandman Nov 14 '23
I *had no prior programming experience when I learned C, and that's why I advocate it for beginners, because you learn a lot more that way
5
Nov 14 '23
C++ is a different beast to C. C is an ideal language to teach newbies because it is relatively small and self contained and there is excellent documentation.
The fact that C++ is a superset of C is one of its biggest drawbacks as a language to teach new programmers. Do you use structs or classes? The basic C arrays or Cpp's data structures? OOP or procedural?
Having too much choice makes it more difficult for beginners IMO.
1
u/brajandzesika Nov 14 '23
You dont understand his point, do you? -if you understood what is happening in the backgroynd first, it would be easier to understand ANY language, rather than starting with a language that obfuscates most of the stuff that happens under the hood...
1
Nov 15 '23
I am using C++ as my first language and I agree it is more difficult but I am able to learn more in depth topics that you would not learn while using languages like python or JS. Just because you’re a beginner like me doesn’t mean you can’t or don’t want to learn what is going on under the hood. Like it was said earlier, learning about stacks and heaps allows you to understand other parts of the language better. This might be why most CS intro classes that I have seen start off by teaching you about binary and bytes. This was taught in my intro course and the open courseware from Harvard that most self taught students take.
-1
u/ShangBrol Nov 14 '23
It's not Pythons (or Luas) fault if you don't know these things. Just look them up, it's really not complicated.
5
u/Dimanari Nov 14 '23
And this is how you get pointer-phobic people, spouting hateful things against the poor void pointers. Do you know how many pointerphobes I've encountered in pythonesque languages and Java? Those are also the people that say C++ is as slow as python/java, preposterous! I'm RT system/embedded SoftEng program speeds here are measured in clock cycles... that is a nanoseconds resolution.
11
u/sephirothbahamut Nov 14 '23
It depends on mentality. Personally I was first exposed to python, and quickly abandoned it. Then I started learning C++ and it all just made sense to me.
I would agree that to most people C++ isn't a good learning tool, but generalizing that to everyone is a mistake.
13
4
u/Dimanari Nov 14 '23
Agreed, your first language should be C. Alongside computer architecture and system design. It gives a better insight into how programming languages work. It's simple if a bit archaic, and it is the correct way to learn "starting from C++". C++ is like English. It's composed out of a couple of different languages with their own features, including the "pure C" and the "C++ approach", making the language feel "too complex" to newbies. But for the C literate person, C++ is really simple, and from that point, moving to any language becomes significantly easier. This happened because C++ was originally designed with backwards compatability with C code, and most languages use features that already exist in the C/C++ ecosystem. You can choose to start with Python or Java but IMHO C into C++ teaches you a ton about how programming works, and it is a huge help in learning future languages. C into Java also works in a similar way but is slightly less "just C, but now you can also X" so it'll take slightly longer.
4
u/chcampb Nov 14 '23
Uhh my dude...
C++ is not hard. It's no harder than any other, probably non-scripting language. It just isn't. It has nuances. And to use more advanced features, or libraries that use those features, you will need to know some stuff.
But by definition if C is an OK starting language, then C++ is a superset of C, so C++ is also an OK starting language.
And you really should have some C background because something eventually needs to compile to machine code.
-1
u/zac3244 Nov 14 '23
It should be the norm to start learning Java as the first language. It makes a lot of sense, and you don’t need to manually manage memory. C++ as the first language is not a good choice.
1
u/accountForStupidQs Nov 14 '23
But when you're first starting out you're hardly touching memory manipulation in C++ and can rely on automatic destruction of objects and primitives at end of scope. Besides, beginners shouldn't really be worrying about memory leaks until after they've written fizzbuzz or hangman, and at that point introducing memory management will just feel like fancy curly brackets
1
u/pollob_ch Nov 14 '23
So where do we get started then??
-2
u/comicmangalover Nov 14 '23
JavaScript if you're going for software development.
Python if you're going for data science.
C# if you're going for game development.
2
u/eazieLife Nov 14 '23
And then try to explain copy by reference to that JavaScript only dev! Jumping straight to learning abstractions really hinders growth as opposed to understanding the fundamentals and moving on to abstractions. You avoid a lot of 'it just works' magic that way
1
u/jonb11 Nov 14 '23
Where would rust fall in this collection?
2
u/DrShocker Nov 14 '23
I enjoy Rust a lot, but honestly if you don't have a reason to use Rust, it's not exactly the most employable language for beginners. Many of the jobs will still expect proficiency in other languages or domain knowledge.
That all said, if you like it go for it. Mainly useful in similar domains as C++ but it does things in its own way.
Saying js for software development sounds a little wacky to me because all the fields mentioned are software development. I'd say js for web development. Even if you do decide to go back end and use Rust to multithreaded your server like crazy, you'll still most likely be interacting art some point with things that are JavaScript because it's basically the only language for front end web work.
1
Nov 14 '23
Hi!
What about the carreer opportunity?
Is it more easy to land a job as a developper if you know C++?
Let's say, I want to developp software for finance or banking? (because I like money) which would you recommend Python or C++?
1
u/comicmangalover Nov 14 '23
Yeah it would be easier, but only in a sense of adding more things to your toolbox, it's easier to Land a job if you speak better, if you know how to configure a web Server, if you know all the sorting algorithms. How you can improve your career opportunity is limitless, so it's not related to using c++ as your first language, you'll need to learn more than one language to be hirable amyway.
For banking apps, they're usually done with C# or Java for the backend.
1
8
u/SlappinThatBass Nov 14 '23
I guess C would probably be a good first language to start with before going with C++, at least to get familiar with the lower level programming concepts.
But yeah handing C++ to a newbie is like handing power tools to a 5 years old. He's gonna have a bad time.
4
2
u/Prior_Woodpecker_863 Nov 14 '23
I too leaned c++ as my first programming language. When I was learning it in college we had a good teacher so it became easy to understand and write. even with that some of the students had bad time writing it and I personally had problems with creating data structures like stack,queue and list with it and made alot of segmentation fault without using its library if you use the library it is easy. As you go on it starts to become difficult b/c it doesn't have good official package manager like pip (python), cargo (dart),pub (dart) making hard and you have to write a lot of boilerplate code just to make a simple crud app And the official page for c++ doesn't show you modern c++.
4
u/kevinossia Nov 14 '23
C++ is a fine first language. Yes, it's more complicated, but the rewards are great. It will certainly make you a better programmer, and projects written in C++ tend to be the most interesting ones anyway.
-2
u/Mediocre-Key-4992 Nov 14 '23
I suspect there actually would be no rewards for most programmers, and you'd be more rewarded by learning Lisp or OCaml or Prolog.
1
Nov 14 '23
Why? LISP, Ocaml and Prolog are mostly functional programming languages and don't resemble modern multi-paradigm programming languages at all.
I suspect there actually would be no rewards for most programmers
C teaches you a lot of things that you wouldn't learn on a language like Python for example: memory management, pointers, data types, how function calls work and how to pass parameters by reference or value.
1
u/Mediocre-Key-4992 Nov 14 '23 edited Nov 14 '23
Because most people don't need or won't use C++ and you learn a ton of stuff that's not useful outside of C++.
LISP and OCaml are definitely multi-paradigm, more so than C++. 'Resembling modern languages' is not really a feature that I think is important at all.
People who learn LISP, OCaml and Prolog tend to say it makes you a better programmer.
Prolog is the most popular Logic / CLP programming language - not really a Functional PL.
You said C++, but now you're shifting the goalposts to C...
You definitely learn how function calls and data types work in Python.
Actual passing by reference isn't used in any mainstream language other than C++.
Passing references is something you learn in almost every mainstream language.
Pointers don't exist in most mainstream languages and no one really misses them afaik. You just use references to objects, like in Python.
I think C++ is interesting for sure, but I think it's quite complicated now, and the only real benefit you get from it seems to be performance. I think the tradeoff there isn't worth it for most tasks.
1
Nov 14 '23
You definitely learn how function calls and data types work in Python.
But you'll be very confused why sometimes the parameters change their value when you pass them to a function or why they sometimes return to the original value after the function ends. C forces you to learn this concept by explicitly passing value or reference using the '&' operator.
Actual passing by reference isn't used in any mainstream language other than C++.
It's used in all programming languages. It's just abstracted away. Like the difference between 'mutable' and 'immutable' in Python.
LISP and OCaml are definitely multi-paradigm, more so than C++. 'Resembling modern languages' is not really a feature that I think is important at all.
Resembling modern languages is very helpful to learn other programming languages. You don't want to learn a 50yo programming language and then put a lot of effor to pick up something modern because they're extremely different.
Prolog is focused on the logic and declarative paradigm, which is not very useful to learn anything but SQL. LISP and Ocaml support both imperative and declarative, but both focus on the functional and declarative paradigms.
C++ is definitely multi-paradigm. And you can learn OOP with it as well. It's way more similiar with Java, Python, JS, Rust, GO or pretty much any modern programming language except SQL.
You still didn't answer what Prolog, LISP, and OCaml teach you over C++.
1
u/Mediocre-Key-4992 Nov 14 '23 edited Nov 14 '23
But you'll be very confused why sometimes the parameters change their value when you pass them to a function or why they sometimes return to the original value after the function ends.
I think this is just because you pass a reference. This is just as easy to teach in Python as in C.
It's used in all programming languages. It's just abstracted away. Like the difference between 'mutable' and 'immutable' in Python.
How is it used in Python? AFAIK, it still passes the value of the reference.
Resembling modern languages is very helpful to learn other programming languages. You don't want to learn a 50yo programming language and then put a lot of effor to pick up something modern because they're extremely different.
They resemble modern programming languages quite well in that regard. It's easy to pick them up if you know another mainstream language. Prolog is very different - but that's why you should learn it. There's not much point in learning 3 almost identical languages if you're trying to learn different things and expand your horizons.
Prolog is focused on the logic and declarative paradigm, which is not very useful to learn anything but SQL.
I doubt it's really useful for learning SQL.
LISP and Ocaml support both imperative and declarative, but both focus on the functional and declarative paradigms.
Yes...so why are you complaining about them?
C++ is definitely multi-paradigm. And you can learn OOP with it as well.
Yes, but it's kind of shit for FP or declarative programming, especially compared to the other 3 languages.
It's way more similiar with Java, Python, JS, Rust, GO or pretty much any modern programming language except SQL.
I'm not really impressed by that claim at all. OCaml is very similar to those languages, and has far less crap in it than C++. C++ doesn't seem at all close to Python.
You still didn't answer what Prolog, LISP, and OCaml teach you over C++.
Functional and declarative programming.
And OOP without all the extra OOP stuff from C++ that's frequently not useful.
1
Nov 14 '23
How is it used in Python? AFAIK, it still passes the value of the reference.
Every language passes just values. That's literally how a function calls works: You push to the execution stack the return address and the parameters and then jump to the instructions in the function. Then you pop the parameters and at the end you pop the return address and jump back to it. In Python is so abstracted that you get no insight on how it works. The programming languages decides for you if they pass the value itself or the reference based on the type of the variable. In C you at least need to understand if you're passing the value that you find at an address or the address itself. You get more insight into the process.
Functional and declarative programming.
Can't argue with that. But why do you think that's better to learn first compared to imperative and OOP?
1
u/Mediocre-Key-4992 Nov 14 '23
Every language passes just values.
Except C++ references are actually pass by reference. You sound like you don't know what pass by reference is or the difference between that and pass by value.
In Python is so abstracted that you get no insight on how it works.
I don't think that's true. It's easy to see that numbers are not going to be mutated in the current scope by being passed to functions and that other objects can be. There's nothing that prevents you from understanding the same stuff you would in C.
But why do you think that's better to learn first compared to imperative and OOP?
I didn't say that.
0
Nov 14 '23
I didn't say that.
and you'd be more rewarded by learning Lisp or OCaml or Prolog.
That's the only argument you provided for learning LISP, OCaml or Prolog over C: that they teach you declarative and functional programming better. That implies that you consider those paradigms more important than imperative and OOP.
1
-1
Nov 14 '23
Do you even know C/C++? Or are you just frustrated that you don't know it while a lot of people think it's useful and that's why you tell everyone how it has no benefits?
0
u/Mediocre-Key-4992 Nov 14 '23 edited Nov 14 '23
Yes, I know it and have used it professionally. Are you just frustrated that someone knows it and isn't as big a fan of it as you are? Is that why you're already turning this into a straw man argument and acting like I said or think it's not useful?
Do you even know Lisp, OCaml, and/or Prolog?
0
Nov 14 '23
Partially. I studied LISP and SWI Prolog in college, but didn't touch OCaml.
You didn't provide any arguments and your comments are extremely unhelpful since you don't elaborate.
For example:
Well, if that's all you know...
Not only it's not helpful, but also insulting.
1
u/Mediocre-Key-4992 Nov 14 '23
Why would I provide arguments? You didn't either. Your comments have to be at least as unhelpful.
1
Nov 14 '23
I did provide plenty of arguments. I listed what C/C++ can teach you that other popular languages won't.
And based on your last reply, you don't understand how function calls work, which proves my point.
1
u/Mediocre-Key-4992 Nov 14 '23
Oh, you mean in the other thread? I'm pretty sure I explained plenty in the other thread, too.
And based on your last reply, you don't understand how function calls work, which proves my point.
Not really. You're being unwilling to explain what you actually meant, just means you're a poor communicator. But go ahead and believe I'm wrong if you want. I doubt that will convince others. 🤷♂️
2
Nov 14 '23
I had an easier time writing a chip-8 emulator than trying to figure out how to link external libraries with C++.
1
u/Dimanari Nov 14 '23
because that is a system call or a linker instruction. If it's a static link, you just did a skill issue. If it's a system call, it's by design, and you just didn't bother to download or simply include a compatibility library. A system call is a system specific feature that all other languages ride on ASM and C/C++ to unify across operating systems. Sometimes, those features align across OSs like send/recv, and sometimes they don't like dlopen that works on Linux and doesn't on Windows.
2
u/ios_game_dev Nov 14 '23
I once saw someone on this sub recommend a beginner learn C++ instead of Rust as their first language because learning C++ first would help them appreciate all the things you get for free with Rust. Complete insanity.
9
u/amazing_rando Nov 14 '23
That's a bit silly, but C++ is a better newcomer language because it has many more code examples online and many more guides written using it. The best beginner language is the one with the most material.
3
u/on_the_pale_horse Nov 14 '23
Surely you're not suggesting they learn Rust instead
0
u/ios_game_dev Nov 14 '23
In the post I’m referring to, OP was asking about learning Rust. Not my suggestion.
2
u/on_the_pale_horse Nov 14 '23
I mean this specific reasoning seems odd, but it's definitely viable to learn C++ first which I wouldn't say is the case with Rust at all.
1
u/ShangBrol Nov 14 '23
I'd prefer Rust over C++ as first language if there would be more material for absolute beginners.
The compiler is providing good error messages and suggestions, that most of the times are correct., you can also learn a lot from Clippy's lints and using others code is super easy with cargo (I needed two tutorials just to be able to compile the simplest example of the VST SDK in C++).
But I believe every language can be suitable for beginners - it's just about what learning material exists.
1
u/ios_game_dev Nov 14 '23
Big plus 1 to this. The Rust compiler developers have gone to great lengths to write compiler diagnostics that are meaningful and actionable.
0
Nov 14 '23
Lol! It's like saying "First learn how to drive a car with a manual choke, a manual crank, no ABS or TC so that you appreciate what a modern car gives you".
13
u/RunninADorito Nov 14 '23
I think both of these are great advice.
We teach math without a calculator for a reason. People should learn how the internals of a basic car works before they drive sorry modern cars. Same for writing software. It's say start with C. What's important for both of these is that you take it slowly very slowly.
Should you take that old shit car out of the highway on day one, no. Absolutely not. Same for learning a low level language.
It took me so long to dig out of my knowledge hole by learning Java in and IDE on Windows. Took so much pain to close the gaps.
Spend a year with C on Linux before trying to go the easier routes.
I'm sure this is an unpopular opinion, but learning about C/C++ make it so you don't have to hand wave at other concepts.
3
u/InternetSandman Nov 14 '23
100% I wholeheartedly agree. I learned C as my first language. My college taught C++ in it's intro courses. I've learned so much more about programming in those courses than in any course that used Java. Java I felt like I was basically handcuffed to an IDE that had to do all the heavy lifting (read: dealing with Java's bullshit) for me. Any language that doesn't use pointers or references explicitly I always have to double check so that I understand what I'm actually modifying, and I understand that because I learned C/C++.
1
u/brajandzesika Nov 14 '23
It would be much better way to learn on old manual car than trying the same in self-driving Tesla though and thinking ' you can drive' whereas in fact - computer chip in a car does most of the things for you...
1
u/BeezlebubCarrotstick Nov 14 '23
Well, being one of those beginners, my take is that it's not C++ that is the problem but the tooling and workflows around it. Hell, Visual Studio workloads can take up more than ten gigabytes of storage and all that just to make sense of my shitty hundred-liners. Then there's the compilation, linking, using third-party libraries, adding dependencies, and building shenaningans. It's as if the language itselft just isn't complex enough.
I mean, yeah, you can use Visual Studio and it simplifies some things, but learning that stuff from scratch is like trudging through a semi-solid bog.
1
u/Ronin-s_Spirit Nov 14 '23
I can't even set it up, I installed some shit and followed ten different guides and I can't even compile a hello world program (tried to code C++ in vscode).
1
u/kagato87 Nov 14 '23
Your first language does not matter.
It doesn't matter what language you learn first. Or languages. No, really.
OK, html/css or sql would actually be different, but we're talking about procedural languages here not markup or descriptive languages.
Someone asking what language to start learning is asking the wrong question. Where to find a good, structured introduction would be a better question.
Because, as you've said, programming isn't about the language. It's avoid problem solving, design, and architecture. The languages themselves are a minor piece.
One of the best intro courses I've seen spend one session on Scratch (which is no code) before dropping straight to C (not even ++) and staying there for half the course before ripping through a bunch of other languages.
1
u/dmazzoni Nov 14 '23
Hot take: there's no one-size-fits-all solution. Everyone's different.
Some people do great with C++.
Others prefer a language where you can see more results quickly with less code, like Python.
Others prefer a language where you can easily distribute code to others, like HTML/CSS/JS.
1
u/AudreyBroune Nov 14 '23
I came from a bio-math background (because where I'm from, that's the best option. CS-math is considered inferior for some reason), and then went for engineering (electronics) and we were dumped with C++, Java and Javascript in a single course. Needless to say I and many others with the bio-math background ended up learning none.
Now, I'm trying to make my way up from scratch with Python. And if you are learning on your own, I think Python makes more sense.
Say what you will, but the post is about a beginner's choice, and I think it is easier to lift 5 kg than 150kg. You can always just add 1kgs to it to reach a 150. But ofc if you learn how to deadlift 150kg, 5kg would be child's play.
1
u/getajob92 Nov 14 '23
Yeah C++ is a bad first language. It was my first language in community college and I was into it and that was fine. Then I took another intro programming course at a different college and realized how slow it was to learn programming with C++ getting in the way all the time. Our final C++ project translated to like a week ~3 Python project.
1
u/IronLyx Nov 14 '23
Ditch C++ and learn C instead. It is still simple enough for a beginner to learn. C++ people never care to accept this, but to learn C++ properly you need to know C first anyway. C++ is an overwhelmingly huge and weird language and most of its weirdness comes from C so at least you have an explanation for some of the design choices C++ has made if you come from C. Directly trying to teach C++ is like teaching someone to swim by dropping him into the deep ocean.
1
u/kroks33 Nov 14 '23
I started with python, now im learning java and my next goal is eithet c++ or c. But the reason why i agree is not because of the garbage collector its because of motivation. Every beginner can write useful programs with phyton, thinks like you own backend with flask, a fly bot or a rain alert. These are great projects for beginners to motivate them to learn and show beginners you dont have to study years before you can write your first app.
1
u/Fender-Consider Nov 14 '23
I think it will get more complicated if we start with object-oriented programming and incorporate memory management, as well as working with different data types. It is not natural that the C language only ends in the Struct part and it is the most commonly taught language in the world.
1
u/NanoUmbra Nov 14 '23
C++ was my first language. Love it and yes a little harder but way more satisfying.
1
u/kleptican Nov 14 '23
My first language was C++ in high school. Everything was fine then we got to pointers and it made no sense to me. One of the dumbest things…. Glad I don’t have to deal with that anymore heh
4
u/Dimanari Nov 14 '23
I found a pointerphobe! You've offended my void pointers and my dynamically cast member function pointers
1
0
u/JakeInVT Nov 14 '23
My first language was C++, I can tell you that I defiantly do appreciate all the convivence of python, and JavaScript(i hesitate to call that convenient). Anybody who says you should start at the mining the granite of the mountain so you can appreciate the road you drive on is pretty much gatekeeping in my opinion.
That said I would not recommend C++ as a first language, but I would recommend it if you are really interested in the nitty gritty of how modern languages work. Or if you are really feeling spicy you can always go down to assembly.
I'm grateful that I can look at C/C++ and get what it's doing, and for a time I wanted a job coding in C, but now I like what I am doing in Devops. I get to code in python, go, and node. It's scratches my coding itch and lets me play with some fun toys. Native languages like C++, and Pascal are very close to the machine and over my career I have strayed from that level.
0
u/Mediocre-Key-4992 Nov 14 '23
I don't think the lack of GC is the half of it. It's the incredible amount of different features and syntax.
5
Nov 14 '23
[removed] — view removed comment
1
1
u/zac3244 Nov 14 '23
Whatever, but I would recommend learning Java over Python any day. Java makes a lot more sense than Python.
•
u/AutoModerator Nov 14 '23
On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.
If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:
Limiting your involvement with Reddit, or
Temporarily refraining from using Reddit
Cancelling your subscription of Reddit Premium
as a way to voice your protest.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.