From notebook code to the actual program with C++

Maybe. That does not narrow it down too much: LISP of course, Python, Forth, Haskell… can all provide a REPL.

I remember the ill-fated Jupiter Ace (around the time of the Sinclair ZX81) which had Forth as its basic language. I had one and my fellow computer fan buddies & I got quite proficient at Forth.
Not a terribly useful skill these days, but it was fun at the time!

They’re more complex languages than BASIC. BASIC was designed specifically to be easy to learn and use without much knowledge of computers or programming. For a professional software developer there is much to learn about the computers at the low level, but there aren’t many people working at that level compared to those who are developing applications and shouldn’t need to know the details of underlying hardware. Unfortunately software development didn’t reach the level where data typing, memory usage, and interconnectivity procedures were any concern for an application programmer. But that’s a matter for another thread.

Echoing the question to @Gateway regarding their end goal: do you have a project in mind? A specific job? I don’t think the question is answerable without some more information.

If the goal is a generic desire to learn about “programming” that’s great too, although in my experience coming up with a specific project to implement is a great way to focus the mind.

That said, there are some high level considerations. My career background is way back when I started as a Java programmer but have been working primarily in C++ for > 10 years. In the last 6 months I’ve been working on a project that adds a lot of Rust into the C++ mix.

C++ was the right call for our big product where “close to the metal” performance matters, and we have enough mature product specific infrastructure in place such that the typical scary things about C++ are not a big part of our day-to-day lives.

I’m not as opposed to using C++ to learn programming as others in this thread, at least concerning the language syntax and semantics. Basic procedural and object orientated concepts probably won’t trip you up too bad compared to other languages. And there is some value in being exposed to manual memory management issues if your end goal is an embedded style project, etc.

That said, for a generic “learn coding” goal it might be best to go where the people are and where the “it just works out of the box” tools are. I don’t know much about Python (we use it for scripts, etc. but its not appropriate for our main product) but my instinct is that it has a lot of community support and libraries that “just work” without a lot of low level understanding. That might be the right choice if you want to concentrate on learning new coding logic concepts without a lot of setup distractions.

I don’t know if I’d start with Rust even though professionally I’m really liking it a lot. I know it is not technically a functional language but its lifecycle management, encouragement of non-mutation, pattern matching, etc. make it kind of look like one if you squint, and I think that’s a tough lift for a complete beginner. “Do something, then do something else, etc.” is more basic, especially at the beginning when you probably want to spit out a bunch of actions or output so you can see what your program is actually doing. More “sequence of easy to see tasks”, less mathematical.

I’d stick to something more procedural and/or object orientated: Java, Python, C++, etc. Once you have a little bit of experience under your belt you may want to go broad, at least for a little while, and try a number of languages. Speculating a bit, but that might give you some good instincts about what are more intrinsic, common programming concepts and what are merely peculiarities of a specific language.

I might suggest installing bazel as a build system on your machine. I’ve found it to be fairly straightforward, and it comes with installation instructions for a number of platforms and a build tutorial for C++.

If the goal is to do some programming with a minimum of fuss.
Play around in PowerShell ISE. Comes standard installed in windows, can do just about everything right out of the box.
(Write a little script to automate installing a C++ compiler :wink: )

BASIC is essentially a way to learn every bad scripting habit and algorithm design practice all in one place. The primary utility was that you could find a BASIC compiler on virtually any consumer-grade computer through the ‘Nineties, but it essentially served to ruin a generation of would-be programmers who had to be untaught everything they had learned so they could learn correct procedural or functional methodology in Pascal, Lisp, C, or other more useful languages. Learning BASIC today is scarcely more useful than learning to program in Logo.

There are a vast array of options to learn programming today but if you are picking a language to start out on there is little reason to look at anything other than Python unless you have a specific need for a particular application. Python does have its detractors who hate any dynamically typed language (although Python now has built-in type checking to provide type declarations and reinforce consistent variable assignment) and the enforced whitespace paradigm (although I personally think it forces easier code legibility) but there is very little that cannot be done using Python and its standard and readily available for libraries unless you are getting into real time embedded systems or high performance programming, and even then it often provides for easily documented and maintainable ‘glue code’ for your FORTRAN or C/C++ workhorse code. There are frameworks and libraries for doing everything from dynamic website front ends and database management to heavy data science and ‘Big Data’ access, and it is a great tool for doing tasks that scientists and engineering often use Matlab for such as signal analysis, regression and statistics, data visualization, bioinformatics, as well as making dashboards and creating wrappers around other code.

C++ is legitimately criticized and it can be very difficult to grasp but it is also in such broad use that you would be well served to become at least familiarized with it after you have mastered the essentials of procedural and object oriented programming (again, with Python or something else that is easier to learn like Go). However, if I were starting a large project and wanted to apply a modern interpretation of object oriented methodology, I would almost certainly go with Rust. I also wouldn’t bother using Java; if you want a language implementation that will generate bytecode to run on the Java Virtual Machine, I’d skip Java and go to Scala which is a far better constructed language to do essentially the same thing.

Stranger

I always loved being able to set watches and breakpoints in IDEs. Not being able to do that means you have to basically pop up/display values at runtime, and then remember to go back and disable all that diagnostic stuff before you put it into production.

And yeah, @HMS_Irruncible is right- start with something else. I agree about Java or Python being the most likely first choices that are actually useful. Many of us learned on Pascal, which is expressly a educational language for procedural programming, but it’s not terribly useful in the real world otherwise.

C++ is very much one of those things that was a cobbled-together mess where they tried to make C object oriented, but just made it all a huge mess. Java is so much more sensible, and I’ve actually taken and passed university programming courses in C, C++, and Java.

I’m pretty far out of the professional programming game, so I don’t have much opinion on Rust or Scala, unfortunately.

I wouldn’t say Rust or Scala are good choices for beginners. A beginner will not have ever faced problems with concurrency or memory safety. If you’re facing language complexity without understanding how it helps you, then you’ll probably just get frustrated and write bad code.

That’s why I recommend Python. It’s about as clear as a language can be, there’s one obvious way to do everything. You can be productive quickly without having to grapple with under-the-hood details.

What C++ enables, that almost no other language has a claim to, is zero cost abstractions. Templates, in particular, enable writing generic code that pays no performance cost over specialized code. And that’s why C++ underpins just about all of your favorite languages. And the (somewhat) new constexpr functionality allows moving runtime computation to compile time, which is even better.

Scripting languages are a hundred times slower and bytecode languages like Java or C# are still not at the same level. Rust is pretty close, but it’s still a very new language and has its own difficulties.

All the new AI stuff has thrust CUDA into the limelight as well, and guess what–it’s basically C++ with some extensions (well, it has support for Fortran as well, but please don’t go there).

Anyway, one easy way to get started is with online tools. Godbolt is a favorite of mine:

Just type in the program and it’ll compile it and run it for you. It’s mainly good for short programs and testing code fragments, but if you’re learning to code that’s exactly what you want.

Since you’re on Windows, grab Visual Studio Community Edition for when you graduate to longer programs. It’s free and by far the best IDE out there.

That’s what gdb is for! The nice thing about the GNU toolset is that it is available on a wide variety of platforms. Rather than a specific IDE which tends to be tied to a particular environment.

My computer is an HP Laptop 14 - dq0xxx. The operating system is Windows.
I want to learn C++ because I hear that is a major language to get into game design. Technically, I also have interest in robotic programming, general app development (akin to photoshop or an animation program), computer operating systems, and cyber security, but if I am going to pick one out of the bunch it is game design.
I followed the link at gcc.gnu.org, but couldn’t find where to actually download the compiler.
It seems that an “IDE” is a compiler plus hints and tips that pop up when you’re actually trying to write your code, no?
Also, I am trying to find a compiler to download (vs a website compiler), so I can simply have the program directly on my computer.

So basically that being said, I am at the point where I am trying to figure out: What is a reliable compiler, and then once it is situated on my desktop, how to “hit the compile command,” and transmute the simple text file into the program.

Thank you all so far and in advance…

IDE is a “development environment” - Editor, project manager, complier, linker, debugger.
Usually the editors have some very nice features designed for programming - things like coloring different types of data elements different colors, and being able to show function definitions and call trees, and lots more.

It is much more than that.

The I in IDE is integrated.
The entire life cycle of code development lives inside the IDE.

Not just editing, but the IDE will compile run and provide symbolic debugging of significant power.
You can edit the code, then as it runs, directly interrogate the state of the program from the same view of the code. Set breakpoints to stop the running code at any place, and once you get good at it, create very powerful ways of watching what goes on.
Learning is going to be much faster and development similarly faster. Very rare for any professional developer not to use an IDE.

Most IDEs will integrate into the version control system you use. So you can directly view the revision history of the code, and if you want, just use the IDE as a veneer into you chosen versioning system.

The gcc toolchain has been mentioned many times. That contains all the basics, but to some extent you have your feet planted in the 1980’s with it. Nothing wrong with that - plenty of good code has been written using it. To some extent things have moved on. LLVM and Clang provide a more modern compiler system.

Personally I would get the Jetbrains CLion IDE. This a commercial system, so needs to be paid for. But it is ridiculously cheap for what you get, and you can get a 30 day trial. If you are going to put some effort into learning, it will be money well spent.

However, I do still caution about trying to learn C++ as your first ever foray into programming. It is a harsh mistress. There is a lot of cruft that you need to get your head around that isn’t germane to the task of learning to code. Stuff that only makes sense when you have got quite a way into understanding what is going on. This is especially true if you don’t have someone helping you learn.

The question would be, how much of a background do you have in the underpinnings of any of these? Robotic and related control systems really require some mathematics - control theory to start with. Then expect understanding of real-time and embedded operating systems. Operating systems is a wide subject, and takes you from deep in the hardware right up though concurrency, algorithm design, performance, security, and the nature of interface design. Cyber security is a game onto itself, and covers everything from code security, encryption, protocol design, to human factors and human frailty. Most of these are taught at about third year university level.

There is a real level of learning walk before you try to run. Just get your head around the nature of programs and code, and the common paradigms. Choosing a language and system to learn in that doesn’t get in the way is IMHO provides the better chance of advancing. If you have the basics, learning a new programming language shouldn’t be hard. So, I would still suggest starting with Python and downloading the community edition (free) of PyCharm.

While it is good to have goals, these are very broad and diverse areas that all require significantly more knowledge and background than just being able to write C++ code (or any other language). Although having a strong base in C++ will make you a potentially attractive candidate for gaming companies, “game design” is far more than coding and you will need a lot of other skills depending on what role(s) you seek to perform including physics, graphics, memory and GPU management, et cetera even if you aren’t working on the art and story side of game design.

Robotics is a massively multidisciplinary field incorporating controls, sensory processing, mechanics, electronics, computer vision, machine learning, and all of the mathematics underpinning these (linear algebra, differential equations, vector and tensor calculus, discrete math, statistics, set theory, et cetera). You are essentially going to need an engineering or hard science degree—likely at the graduate level—to get very deep into robotics.

Operating systems (applied) and applications are somewhat more focused areas, and with some modest amount of C/C++ background you can write a simple OS (with a command line or text graphics interface and implementing a standard file system and peripheral interfaces) or a basic application (not suitable for commercial use but enough to have a working example) but to go far or get a job is going to take far more than just coding. Cyber security doesn’t actually have all that much to to with writing code except st the implementation level; it’s far more about understanding the architecture of application and system security, and where vulnerabilities arise, both in the code and user. Having C++ (and other languages like Python, PHP, JavaScript. Perl, et cetera) is certainly very valuable but scarcely sufficient.

I don’t mean to sound discouraging ir in any way dissuade you from learning to program, but understand that you are going to need a lot more than just bssic fluency in C++ (or any other programming language) to get hired and advance in these fields. And frankly, as it sounds like you have little coding experience at present, I wouldn’t start with C++ because of the enormous learning curve and inherent complexity of the language and its standard libraries. C++ is like a machine shop filled with powerful but often arcane tools that require a lot of experience to use safely and effectively, and despite the advocacy you’ll read from people who really love the language and claims of how it is the one and only language which can do this or that, there are relatively few applications where C++ is your only or even best choice. If you are coming into application-level programming with little prior experience, you want tp start with the coding equivalent of wood shop; something like Python (my recommendation) or Go.

And as you get on and figure out what you want to do, you may find C++ isn’t all that useful or has been made obsolete in your intended field by a more robust and modern language, forcing you to unlearn habits and techniques specific to implementing efficient and safe algorithms in C++ in into a newer language like Rust. Better to start out learning fundamentals in an easier to learn language and then figure out what you really need for your chosen field.

Stranger

I’m an embedded programmer who has worked at the device driver and OS level of consumer devices for 25 years, and in pure Unix (not Linux) before that. For example, I worked for two major cell phone manufacturers for almost 15 years. I work almost exclusively in C.
Some of my current co-workers come from the game industry. They work almost exclusively in C++.

I refuse to review their code, because C++ allows for so many tricks and other things that are just unknowns to my C oriented brain. I simply can’t tell if I understand a given set of code well enough to judge it, because I’ve been bitten too many times by “Oh, in C++ we can do this pattern, which actually makes this other thing happen…”

It’s all very valid code, and they do pretty cool stuff. But it’s also very, very different from my world.

With that said, I agree with others that C++ is a hard place to start. You definitely need to get a grounding in some basics. There are a lot of things done in Python, and the people on my team who know it at least well enough to write moderately complex Python code have added value. Learning it would unlikely to be wasted effort - more so, it may be an important differentiator for future jobs.

Good luck!

C++ was rejected for the Linux kernel (in 1997), but Rust is, at least for now, in, just to give a data point re. OS and device drivers.

Thank you all for your replies.
I would like to refine my input in this thread…
An IDE is interesting, but as far as basics, if I’m going to be a coder, I don’t even know how to do it without the extra help. Not as far as code, but as far as just using a straight compiler (my concept is that an IDE may be nice, but I don’t know how to do it straight… just the barebones code to compile to program shot…
I checked the website looking for something to download at gcc.gnu.org, but wasn’t able to navigate it in terms of finding the actual download.
For the moment I want to stick with C++ and see where it leads (haven’t even really tried it yet due to the compiling issue…)
And thank you all tons for your helps so far. thumbs up thumbs up

Thats a perfectly reasonable decision, just be aware you’re going to have to deal with a lot of command line commands and build scripts. Which is fine if you are already comfortable with running commands and scripts on the command line, but if not you’ll have to learn all that before actually doing any coding. The IDE will do all that for you and you can start coding right away, and Visual Studio Community Edition is free.

Also not Clang has supplanted GCC as the default command line C compiler nowadays . There is a precompiled windows version on the GitHub site:

It seems like one would be pretty advanced before having to worry about differences in different compilers’ intermediate representation and code output.