Close

My search findings on Learning C/C++ Programming and Using an IDE

My search findings on Learning C/C++ Programming and Using an IDE

Introduction

I’ll have to preface my search findings on these subjects, by mentioning that according to Risto S. Varanka’s Programming Languages mini-HOWTO: Programming Languages ;

C, Lisp and Perl are traditional hacking languages in the
GNU/Linux culture; Python, PHP, Java and C++ have gained new
ground recently

.
Furthermore, and mostly according to Veranka’s mini-HOWTO and to forum threads such as this one at ProgrammersHeaven.com/ ;
A. Perl is a great first programming language to learn for Beginners; Perl has the advantage of being an interpreted language instead of a language that requires a compiler and linker for creating binaries. Perl is an Object Oriented Programming (OOP) language that is especially powerful for handling text and strings. Perl is commonly used for scripting, for sysadmin-type tasks, and for web server tasks.

B. Python and Java are also great first programming languages for Beginners to learn; both Python and Java are modern up-to-date OOP languages used on web servers and for web-processing tasks. Python is especially useful for more general and application-specific scripting while Java is especially useful for cross-platform applications.

C. as appropriate 😉
C and C++ are apparently NOT languages for Beginners to first learn programming. Although executable binaries created from C or C++ generally run faster than interpreted source code, executable binaries (i.e., the actual applications) require the EXTRA steps of compilation and linking from original C/C++ source code, not to mention any necessary required debugging and optimization steps. Both C and C++ programming languages are especially useful for creating applications. C is more of a Procedural than an OOP language such as C++, and many describe C as being the MOST suitable for the system and in-depth OS tasks that Linux distros rely upon using the GNU Compiler Collection’s ‘gcc’.
* Note that “GCC” is the acronym for the overall GNU Compiler Collection whereas “gcc” is the specific acronym specifically for the GNU Compiler Collection’s C compiler itself.

From my own limited experience, I would probably place Perl and maybe Bash shell-scripting ahead of C and C++ for Beginners first learning how to program. I would guess that many of us who have already programmed using Perl and Bash shell-scripting could probably use a refresher or two in these :-).
A good “Perl tutorials” web search using the privacy-minded search engines ixquick and/or Startpage should yield worthwhile hits very similar to these handful :

grantbow has a collection of good Bash shell scripting tutorials and resources within his Learning the Command Line webpage, and also helpful in this regard is chapter 7 of the Rute User’s Tutorial and Exposition.

With all that being said, here are some working links I have found regarding learning and compiling C/C++ programs.

I. Tutorials to learn C/C++

II. Simple C/C++ Compilation

The simplest and probably the best initial manner of learning C/C++ programming in Linux using these tutorials on the command line is to:

  1. Type in and edit your C/C++ source code using whatever text editor you most prefer (e.g., vi/vim/nvi, nano/pico, gedit, nedit, leafpad, mousepad,…whatever else) and then save the file with the suffix `.c’ for C programs or one of the suffixes `.C’, `.cc’, `.cpp’, `.CPP’, `.c++’, `.cp’, or `.cxx’ for C++ programs.
  2. Compile and link your properly-suffixed source code file from the command line using the typical ‘gcc’ or ‘g++’ command+options for C and C++ respectively.
  3. Run the default executable file by entering ‘./a.out’.

For getting more familiar with using gcc and g++ in steps 2 and 3, there are:

  • Cprogramming.com’s aptly-titled gcc compiler and g++ compiler webpages.
    Quick, simple, and these provide appropriate mention of the GNU Debugger, ‘gdb’.
  • develvid’s YouTube video Compiling with GCC (probably should be “gcc” instead)
    This video shows sequence of command line screenshots using the vim editor and a few ways to use gcc to compile and run a pair of simple C programs. Covers the above steps 1 through 3 in a quick 4 1/2 minutes.
  • Brian Gough’s An Introduction to GCC for the GNU Compilers gcc and g++ with a Forward written by RMS.
  • The FSF gnu.org’s Invoking GCC – GCC Command Options.
    Given that the entire site, gcc.gnu.org/onlinedocs/gcc, is the gnu.org’s official guides to GNU compilers, this webpage is as fully complete and as up-to-date as the FSF can make it. It seems a bit too complex for Beginners to proceed very far beyond the basic ‘Invoking GCC – GCC Command Options’ though.
  • The gcc(1) and g++(1) man[ual] reference pages.
    Their SYNOPSES and DESCRIPTIONS sections seem to be the most useful, although their OPTIONS sections can be overwhelming with the vast number of listed options for both gcc and g++.

III. Using an IDE

Instead of creating and testing C/C++ programs through the three-step manual method just described above, I have also discovered a few Integrated Developmental Environments (IDEs) for Linux to handle C/C++ program development all the way from editing C/C++ source code to correcting syntax, compiling, linking, full debugging amd code optimizations.
Using a C/C++ IDE also goes a long way to relieving the need for Beginners to venture too heavily into the more Advanced-level programming processes of contimually running the gcc/binutils toolchain, ‘make’ and ‘gdb’ to create Linux system binaries.

 

____________________________________________________________

Good and better recommendations & suggestions regarding these are always welcome 🙂

—-
Go Open Source Software Bears!

9 thoughts on “My search findings on Learning C/C++ Programming and Using an IDE

  1. Pingback: LXer: My search findings on Learning C/C++ Programming and Using an IDE | Coders & Admins
  2. Good job on your article.

    I am an avid C/C++ developer. I think its a good place to start for some people that really want to learn the ins and outs of software development. However, if your learning style is to just create something quick and improve from there, then I would recommend Python. Perl would not be on the top of my list simply because the language seems to attract bad programming practices. I have seen more bad code written in Perl than any other language. It has been labeled as a “write-only” language, because a lot of Perl code is like a tangled mess of yarn. This *is* significant, because part of learning to program involves looking at other people’s code.

  3. Nice 🙂

    Although for beginners:

    +1 for Python
    -1 for Perl/Java

    Python is also what they teach over at MIT in “Introduction to Computer Science”. Perl is… well you can read the comments above 😉

  4. I code in Java professionally, and use the Eclipse. IMHO both are poorly fractured projects, filled with multiple tools to do any given task, and multiple tools which are more complicated that the problem they are trying to solve (Hibernate, Log4J)

    When I get time to code recreationally, I find great comfort is using c/c++, a few basic libraries (Boost, GTK, SDL (and it’s direct siblings), OpenGL, OpenAL), and the basic command line tools via an efficient, but featureful editor like Geany. There is something beautiful about a clean, simple makefile.

    I’ve only played with JBoss and ASP.net, but I’ve yet to find a sensible web application platform and toolkit. I have high hopes for Vala to combine the best of all languages.

  5. I code in C++ professionally. Qt Creator is the IDE of my choice. To my knowledge and believe it is the best tool I ever used for cross platform development.

Leave a Reply to Anonymous Cancel reply