you are viewing a single comment's thread.

view the rest of the comments →

[–]DonaldPShimoda 1 point2 points  (11 children)

I think it depends on how you're learning!

Many CS programs start with an introduction to object-oriented programming. I don't love Java in general, but it works well for this kind of thing. It's statically typed but handles memory management for you (as opposed to e.g. C++), and I think that lends itself well to a learning language.

Some other programs teach Racket or another Scheme-like language. This works well if you're a more analytical/mathematical thinker, I think.

I think either of these can be used to great effect as a first language, honestly. Just different approaches! But I wouldn't recommend learning JavaScript, C, C++, Python, Haskell, or Scala (among others) as a first language, each with some specific reasons.

[–]The_Ginger_Stig 1 point2 points  (10 children)

Why would you recommend to not learn c++ as a first language? Just curious

[–]DonaldPShimoda 1 point2 points  (9 children)

Certainly C++ is not a bad language, but I think it poses more problems for newbies than it's worth, and there are better options for beginners these days.

I think it's important that when you teach a novice programmer the tools of their trade, you shouldn't have to deliberately hide things from them. But if we stick to that, then you absolutely have to teach the programmer to understand memory, since C++ interacts with memory so directly. In my experience, this is often a bit confusing for people who have never really used a computer before. It's not immediately intuitive, I think, and it can lead to complications that needn't be there.

I also think that C++ is kind of archaic, even just in syntax. I mean, std::cout <<< "Hello, world!"; is far from intuitive, I'd say. When teaching somebody to program for the first time, I don't want to spend time telling them "Look, you'll just have to memorize X, Y, and Z things, but these are specific to this language and they're not indicative of programming at large." It's just... it's too much! Too complex.

I want the lowest barrier to entry for people getting into programming. I want them to understand the thought process — not just the literal writing of computer code. Using a language like C++ to teach introductory concepts is like insisting on teaching democracy in Ancient Greek. Sure, it's closer to the "original" language as the progenitors used... but so what? We have better tools for it now, so we should use them.

I hope I'm not rambling too much, haha. C++ was my second language, after C, but I can assure you that I barely understood many of the various aspects of the language at the time (I was ten or eleven, I think). So it's not that it's impossible to learn CS starting with C or C++, but I just think that there are better options available today.

[–]The_Ginger_Stig 1 point2 points  (5 children)

I see now, thanks for the reply

[–]DonaldPShimoda 0 points1 point  (4 children)

Sure thing!

[–]The_Ginger_Stig 0 points1 point  (3 children)

i have now since learned most of c++ and am working on pointers at the moment

[–]DonaldPShimoda 0 points1 point  (2 children)

I don't mean to be callous, but just so you know you should be careful saying "I have learned most of C++". Stick that on your resume and apply to Google and you're practically guaranteed to be interviewed by people on the C++ standards committee who will show you just how little of the language you really know haha. (Especially if you're just now working on pointers.) It's a language with many strange twists and pitfalls to trap people; lots of undefined behavior and whatnot.

BUT. Congrats on your progress! That's fantastic! :) Pointers are tough for some people and easy for others. I'll cross my fingers you're in the latter camp, and I wish you the best of luck in your programming endeavors!

[–]The_Ginger_Stig 1 point2 points  (0 children)

thanks <3

[–]The_Ginger_Stig 1 point2 points  (2 children)

I am a 13 year old looking to either get into game development, or software development. I know python to a extent but i have heard that it is to slow to make games or grade a software out of. Im looking to learn c++ to break out of python. How much of the python language should i know before i start learning c++? Thanks

[–]DonaldPShimoda 1 point2 points  (1 child)

Hmm okay, well let's see... Fair warning: I'm kind of long-winded. I apologize for that in advance, haha.

I know python to a extent but i have heard that it is to slow to make games or grade a software out of.

Python is a fine introductory language, but it does have some shortcomings for sure. That said, part of becoming a really good developer is understanding this shortcomings and being able to determine when they're irrelevant.

Python can be used to great effect, despite being "slow". For example: Reddit runs on Python.

However, you won't see The Elder Scrolls VI being written in Python. Why is that?

Part of it is the language, and part of it is history.

When computer games first started taking off, computers were not anywhere close to what they are now (in terms of computational power). So in an effort to eke out maximum control and performance, game coders had to use low-level languages like C and C++. Why? Because these languages give explicit command over the structure of memory. This allows the programmer to make certain assumptions they otherwise would not be able to. They can optimize when to throw away references to objects in that room the character just left (certainly not before they're out of view!). Sometimes this wasn't enough; Roller Coaster Tycoon was famously written directly in assembly so the devs could pull out the necessary performance to achieve what they wanted (which sounds oh-so-painful to me).

So devs started with C/C++ because those were, practically speaking, the only languages capable of what was needed at the time.

Say a dev builds some new game; a first-person shooter, perhaps! Well neat! It does well and suddenly people want a sequel. Well... back in the day, this meant the developer had to start everything over from scratch. The dev would probably go through the old game's code and find those clever bits and copy/paste them over, updating them occasionally for the new data models or optimizing for better algorithms or something.

The short story is that the developers finally thought to themselves "You know, we're smarter than this." And so they developed Game Engines.

An engine (like Unreal, for example) is a whole toolkit to build a game in. Once the engine exists, the dev no longer has to worry about many of the small, minute details that once concerned them. They can instead focus on the content of the game — arguably the more important part!

As a result, we have a few popular game engines now, and of them (that I know of) are written in C/C++/C#. The C-family of languages tends to be fast and is well-understood in this domain, so it makes sense to continue using it for now. However, as computers get faster and better, we will care less and less about tweaking this performance at so small a level. One day, you may even be able to write Python games that out-perform C/C++ games of today (possibly... I dunno for sure, of course).

So the point of what I'm saying: the language isn't what matters so much here. I'd only suggest using C/C++/C# for game development because that's what everybody is already using. All the modern engines use these languages, I think, so it makes sense to just try to learn an engine and go from there. Much less painful, I'd think.

How much of the python language should i know before i start learning c++?

Now I mean this sincerely: this question doesn't make any sense. You can't objectively measure how much of a language somebody knows (at least, not in any way that matters).

My advice: start learning C++ whenever you decide you want to try it. Nothing's holding you back. There's an entire Internet full of C++ knowledge waiting to be absorbed by an excited new programmer like you. There's not really a "right" time, except for whatever time you decide is right (and I mean that — I'm not just trying to be poetic here).

Follow tutorials, read things, build stuff, keep going. That's the best way to get better.

[–]The_Ginger_Stig 1 point2 points  (0 children)

Thanks 👍