Author Topic: General IDE to learn C++ on  (Read 17552 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
General IDE to learn C++ on
« on: December 24, 2021, 11:41:26 am »
I have "the book" "Programming principles and practice using C++" by Bjarne Stroustrup. It has example and exercises and he recommends visual studio but this was in 2005. Visusual studio or whatever it is called now it rather bloated for running a few lines of code. Anything else worth using?
 

Offline djsb

  • Frequent Contributor
  • **
  • Posts: 891
  • Country: gb
Re: General IDE to learn C++ on
« Reply #1 on: December 24, 2021, 12:14:59 pm »
I have that book also. Still got to start reading it though. You could try Notepad++



I have also tried WxDevC++ and Code Blocks. I started learning C by using LCC-WIN32 and have also tried PellesC as well.

Good luck.
David
Hertfordshire,UK
University Electronics Technician, London PIC,CCS C,Arduino,Kicad, Altium Designer,LPKF S103,S62 Operator, Electronics instructor. Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. Credited Kicad French to English translator.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: General IDE to learn C++ on
« Reply #2 on: December 24, 2021, 12:21:13 pm »
So does notepad++ handle calling the compiler etc or is it just an advanced text editor.
 

Offline Lindley

  • Regular Contributor
  • *
  • Posts: 195
  • Country: gb
Re: General IDE to learn C++ on
« Reply #3 on: December 24, 2021, 12:31:57 pm »
You cannot get much simpler than the free Arduino IDE .

Are you intending to use the Arduino chips/boards or some other micros ?
 

Offline djsb

  • Frequent Contributor
  • **
  • Posts: 891
  • Country: gb
Re: General IDE to learn C++ on
« Reply #4 on: December 24, 2021, 12:37:55 pm »
Notepad++ is an advanced text editor. It uses a plugin (NCCEXEC) that runs a script. The script invokes G++ (for c++ programs) using the system command terminal. You have to make sure you install the compiler first (explained in another video above)and make sure it can be run from a command prompt. It's all explained in the video I linked to.
David
Hertfordshire,UK
University Electronics Technician, London PIC,CCS C,Arduino,Kicad, Altium Designer,LPKF S103,S62 Operator, Electronics instructor. Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. Credited Kicad French to English translator.
 
The following users thanked this post: elecdonia

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Re: General IDE to learn C++ on
« Reply #5 on: December 24, 2021, 12:42:24 pm »
AFAIK Notepad++ is not an IDE.

For learning, I think everybody should start with just command line and the simplest possible editor.  No automation, no fancy coloring, nothing.  This will help a lot with understanding what a nice C++ IDE does under the hood.

The steps needed to turn a text source into executable binary are crucial to understand and keep in mind while writing code.

Once those steps are well understood, you can switch to something more comfortable than the command line.  The IDE I liked most was Visual Studio from Microsoft.  There is a free and open source version of it, for any OS.  The Linux one is called "VS Code".  One of the best IDE out there, can be used with any programming language.  I'm a hobbyist in terms of software, but many software devs I've seen doing code for a living were often using Visual Studio.

Eclipse is also an IDE I like for its comfort and features, thought many devs are complaining for it being heavy/slower.  Anyway, it's good to get familiar with it, because Eclipse+GCC is often used by various chip manufacturers in their proprietary IDEs for MCU and embedded.
« Last Edit: December 24, 2021, 01:57:09 pm by RoGeorge »
 
The following users thanked this post: newbrain, eti

Offline gamalot

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: au
  • Correct my English
    • Youtube
Re: General IDE to learn C++ on
« Reply #6 on: December 24, 2021, 12:58:07 pm »
Visual Studio or Visual Studio Code
 
The following users thanked this post: newbrain

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: General IDE to learn C++ on
« Reply #7 on: December 24, 2021, 05:39:19 pm »
You cannot get much simpler than the free Arduino IDE .

Are you intending to use the Arduino chips/boards or some other micros ?

No I want to follow the example in the book so embedded environments are out. as for simplest - whatever.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: General IDE to learn C++ on
« Reply #8 on: December 24, 2021, 05:40:09 pm »
Visual Studio or Visual Studio Code

Next time read the post!
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: General IDE to learn C++ on
« Reply #9 on: December 24, 2021, 05:41:25 pm »
I think this was kind of answered already in a thread asking for a free C or C++ compiler on Windows.

If the C++ code you want to work on as an exercise is purely command-line stuff, you can use any free or open-source C++ compiler available on Windows. This other thread mentions them (GCC, CLang...).
And if you absolutely insist on using a full-blown "IDE" just to compile small examples, well, to each their own. But I think IDEs were mentioned too. Codeblocks comes to mind, for instance.
https://www.codeblocks.org/downloads/
« Last Edit: December 24, 2021, 05:43:18 pm by SiliconWizard »
 
The following users thanked this post: T3sl4co1l

Offline gamalot

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: au
  • Correct my English
    • Youtube
Re: General IDE to learn C++ on
« Reply #10 on: December 24, 2021, 06:42:51 pm »
Visual Studio or Visual Studio Code

Next time read the post!

ok, Visual Studio Code
 
The following users thanked this post: newbrain, eti

Offline bill_c

  • Regular Contributor
  • *
  • Posts: 130
  • Country: us
Re: General IDE to learn C++ on
« Reply #11 on: December 24, 2021, 06:49:56 pm »
Have you tried Geany? https://www.geany.org/
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11882
  • Country: us
Re: General IDE to learn C++ on
« Reply #12 on: December 24, 2021, 07:12:01 pm »
Visual Studio or Visual Studio Code

Next time read the post!

I will second Visual Studio Code. But Visual Studio Community Edition is perfectly fine to install, especially if you just pick the C++ option when you install it. It really is one of the best options out there.
 
The following users thanked this post: newbrain

Offline DC1MC

  • Super Contributor
  • ***
  • Posts: 1882
  • Country: de
Re: General IDE to learn C++ on
« Reply #13 on: December 24, 2021, 07:27:04 pm »
++1 for Code::Blocks
 
The following users thanked this post: T3sl4co1l

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: General IDE to learn C++ on
« Reply #14 on: December 24, 2021, 07:27:49 pm »
VS may be fine but the OP explicitely stated that he didn't want it. This didn't look very hard to get. :popcorn:
VS community is a HUGE install, even if you selectively disable everything not strictly needed for basic C++ dev (which takes a while and you're not even sure what will be needed or not), because by default it's even more huge. Gigantic.
 

Offline Xupicor

  • Contributor
  • Posts: 11
  • Country: pl
  • Nasal Demon
Re: General IDE to learn C++ on
« Reply #15 on: December 24, 2021, 08:51:00 pm »
Even though you stated your reason for not wanting Visual Studio - it's still the industry standard.

VSCode is slimmed down, open source (well, the source is open under MIT license, but the MS branded executables you get from Microsoft are not, see VSCodium for actually MIT-licensed version if you're bothered with that) and multiplatform, I would at the very least keep in mind that there is such a thing, and it's a really good editor/IDE-light. I stress, really good. Also PlatformIO runs on it, if you're planning to get into microcontroller programming in the future.

There's Eclipse (CDT) and NetBeans which are available for free, support many languages (Java foremost) and are not bad at all - though being run on Java they (especially Eclipse, in my experience) tend to sag a bit. Might not be an issue for you if you're running a modern PC with an SDD, though, and it wasn't that bad even with HDD, but with bigger projects SDD does alleviate some issues with an occasional lag.

If you're just starting you probably won't be running big projects anytime soon. Projects that are one file, or just a couple of files big are perfectly manageable using just a fancy editor like Notepad++, Flo's Notepad2 (I use it as a general replacement for MS Notepad, basically replace notepad.exe with it. It's much snappier than many other programmer's editors mentioned here), Atom, Brackets, Sublime (to name a few newer tech editors), heck, use (G)Vim or Emacs if you're familiar with those, they'll do the job perfectly fine and give you that nineties vibe of linux devs as a bonus. ;)

All you need to do is install GCC/MinGW separately, make sure it works in the terminal. You can then just use the terminal to compile your stuff or use solutions built into the editors to do it for you, if they exist.

Make sure to learn how to use 'make'. It'll come in handy.

Not a fan of Code::Blocks, but it does indeed come bundled with GCC/MinGW (how old of a version though, I don't know) and it is an IDE, not just an editor, so it's also an option.

I'd stay away from Dev C++ IDE, even though it has been quite popular due to some youtube tutorials (and even some books, regrettably... though not all of them bad at all!) being based around it.

Advice:
Either in the terminal when compiling by hand, makefile, or project options/compiler options in your editor/IDE, be sure to add something akin to this in your compilation line: -pedantic -Wall -Wextra -std=XXXX
where XXXX is a standard revision, like so: -std=c++20. Forcing compliance with other (older) versions of the standard is possible as well. More info in the GCC manual.
This will enable a lot of useful warnings and disable some GCC specific extensions that you probably have no interest in using at the moment anyway (as they aren't strictly a part of the language). Those errors and warnings will keep you safe(r) and will help to guide your way. Use them to your benefit. Disable them at your own peril.
Maybe add -Wfatal-errors in there to stop compilation after the first error so that you don't have to wade through many lines of error messages which very well might disappear after the cause of the first error is taken care of. (Always start solving problems with the first error reported.)

Opinion:
I agree to an extent that it's good to start with barebones setup and then go on to see what goodies more advanced editors/IDEs bring, but I would say an editor WITH syntax highlighting is the minimum. There's really no need to torture yourself without this very useful feature. I mean maybe for an hour or so to see what people in the middle ages had to go through, but let's be civilized over here. ;)
Electronics is so fun. If only I understood any of it!
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 689
  • Country: gb
    • Electronic controls
Re: General IDE to learn C++ on
« Reply #16 on: December 24, 2021, 10:50:26 pm »
Nothing wrong with Visual Studio for C++.
I wrote a 500,000 line C++ program using it.
You can output stuff to message boxes so you can see the results of your code.
The community edition is free too.


 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: General IDE to learn C++ on
« Reply #17 on: December 25, 2021, 08:10:16 am »
Eventually I'll be doing C++ on embedded. But for the purposes of the book I need to go through the exercises on a PC. Visual studio "whatever" is just the now common microsoft pain in the butt! It wants a windows log in or something that at work won't work, it will want to constantly update, I have several gazillion types of projects I can start - yes my fault for getting ahead of myself - and even when I follow the instructions in the book carefully I get a big fat nothing plus issues that are IDE related. I want to learn to code, not how to drive microsoft's latest mess only for it all to change next week.

Maybe command line compiling is the best option for this sort of thing.

i have downloaded codeblocks. Was trying to remember if it's the mess that MPLABX is based on that is the only program on earth that is obstinate about being made to work on a 4k monitor rather than just doing as it's told like all other programs. But no that is notbeans.
 

Offline Gixy

  • Regular Contributor
  • *
  • Posts: 232
  • Country: fr
Re: General IDE to learn C++ on
« Reply #18 on: December 25, 2021, 08:17:51 am »
VS Code + PlatformIO, nothing more, nothing less. Much more simple than Eclipse.
 
The following users thanked this post: elecdonia, eti

Online IanB

  • Super Contributor
  • ***
  • Posts: 11882
  • Country: us
Re: General IDE to learn C++ on
« Reply #19 on: December 25, 2021, 08:26:05 am »
Maybe command line compiling is the best option for this sort of thing.

For small code snippets, you might want to look at one of the web compilers. There are various lists of these to give you an idea of what to look at, for example these ones:
https://www.techgeekbuzz.com/best-online-cpp-compiler/
https://arnemertz.github.io/online-compilers/

Compiler Explorer (Godbolt) is a good example, and is fun to use: https://godbolt.org/


 

Offline djsb

  • Frequent Contributor
  • **
  • Posts: 891
  • Country: gb
Re: General IDE to learn C++ on
« Reply #20 on: December 25, 2021, 08:46:57 am »
I have just compiled the "hello_world.cpp" example in Chapter 2 of the book using Code:blocks.
I started a new project of type "console application" in the "new from template" dialog and then completed all the entries in the wizard. Make sure you download the std_lib_facilities.h
header file by typing stroustrup com programming std_lib_facilities h in google. Then replace the header file in the main.cpp file of your project with #include "std_lib_facilities.h". You also have to add "std_lib_facilities.h" to your project by right-clicking on the "hello_world" project in the tree to your left and choosing "add files" and then pointing to where this header file is located.
You then click on the green arrow/cog icon (Build and run), and it should compile properly and produce a command window with the "hello world" message and then asks you to press any key to continue.
« Last Edit: December 25, 2021, 08:54:20 am by djsb »
David
Hertfordshire,UK
University Electronics Technician, London PIC,CCS C,Arduino,Kicad, Altium Designer,LPKF S103,S62 Operator, Electronics instructor. Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. Credited Kicad French to English translator.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Re: General IDE to learn C++ on
« Reply #21 on: December 25, 2021, 09:32:02 am »
https://www.eclipse.org/downloads/packages/

Download, unzip, and run.  No need to install.  There is another page if you want Eclipse with installer.  Another way is to configure your own Eclipse, but that might be tricky for a first time.  However, there are 2 "Eclipse" pre-configured for C/C++, one is for PC dev, the other for embedded dev, you can get them both:

https://www.eclipse.org/downloads/packages/release/2021-12/r/eclipse-ide-cc-developers
https://www.eclipse.org/downloads/packages/release/2021-12/r/eclipse-ide-embedded-cc-developers

Offline DC1MC

  • Super Contributor
  • ***
  • Posts: 1882
  • Country: de
Re: General IDE to learn C++ on
« Reply #22 on: December 25, 2021, 10:03:52 am »
Regarding Code::Blocks, I leave this here, as is not so wide known:
Like many other IDEs, it has it's own project definition file (readable XML, not some (semi)binary rubbish), some times it is necessary to give your project in buildable source and a Makefile will help with the "purists" that do not conceive anything else than Makefiles.

So we have https://github.com/mirai-computing/cbp2make that converts the project to a pretty easy to understand Makefile, if a bit too verbose and explicit for the purists that come with the dreadful one-liners for the leet, that are uses to job security and showin off.

 Cheers,
 DC1MC
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: General IDE to learn C++ on
« Reply #23 on: December 25, 2021, 10:09:38 am »
Regarding Code::Blocks, I leave this here, as is not so wide known:
Like many other IDEs, it has it's own project definition file (readable XML, not some (semi)binary rubbish), some times it is necessary to give your project in buildable source and a Makefile will help with the "purists" that do not conceive anything else than Makefiles.

So we have https://github.com/mirai-computing/cbp2make that converts the project to a pretty easy to understand Makefile, if a bit too verbose and explicit for the purists that come with the dreadful one-liners for the leet, that are uses to job security and showin off.

 Cheers,
 DC1MC

That made no sense to me at all. To restate for those running away with themselves:

1) i have a book
2) it has exercises that need to be compiled and run on a console
3) the IDE recomended does not really exist anymore
4) I need an IDE that will not do silly stuff like the book itself warns of VS of 2005 running the code you just wrote and then closing the console window so that you can't see the result and think you did it wrong despite it being fine.
5) I just need something that works without hours of learning it and how to make it not do it's own thing it thinks is what I want because ultimately I need to run on embedded so getting into the whole how this will compile a program for windowsn is not very relevant right now.
 

Offline djsb

  • Frequent Contributor
  • **
  • Posts: 891
  • Country: gb
Re: General IDE to learn C++ on
« Reply #24 on: December 25, 2021, 10:14:52 am »
Did you read my post above?
David
Hertfordshire,UK
University Electronics Technician, London PIC,CCS C,Arduino,Kicad, Altium Designer,LPKF S103,S62 Operator, Electronics instructor. Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. Credited Kicad French to English translator.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf