June 30, 2014

Command Line v. IDE

Filed under: Main — admin @ 12:01 am

For most grizzled programmers, the command line was where all the programming action took place. In fact, you’ve got to admire the dedication required to write some several-hundred thousand lines of code using a terminal, but they did it.

Command line programming is rough-and-tumble, just like Unix or DOS or any text mode-only operating system. That’s the way programming life was during the microcomputer era (starting about 1977) going up through the mid-1990s.

Now you have to understand that the programmers way back when actually enjoyed using a command prompt; text mode didn’t intimidate those guys. They relished the cryptic commands, most of which they knew by heart.

In fact, many text mode commands were developed to make programming easier.

The Integrated Development Environment, or IDE, eventually appeared, which made complex programs easier to manage. I remember using Borland’s IDE with TurboC back in the early 1990s. It was handy, but I continued to use the command line for coding some simple tool.

IDEs became a necessity with graphical operating systems. For such development, a programmer needed tools that would automate a lot of the routine drudge work with building a windowed program.

Sure, you can “hand code” a Windows program. I’ve done it. The source code file was about three pages long (assuming some 30 lines per page), and it merely popped-up a window. But with bitmaps, icons, and other graphical elements, using an IDE is preferable.

My C programming books strived to teach the language by using the command prompt, or these days a terminal window. I did that for two reasons.

First, it’s easier to code my books’ small, sample programs at the command prompt. An IDE offers complexities you don’t need to code a program that spews out the numbers 1 through 10 in text mode.

Second, it’s good to know one’s roots. The command prompt is still a viable tool, often quicker than using a mouse and graphical methods to accomplish the same task.

With my latest C programming book, Beginning Programming with C For Dummies, I chose an IDE, Code::Blocks (CB). While it does take longer to use CB to set up my examples, that’s the way the world is heading. Even so, I wrote all the book’s programs at the command prompt. Old habits die hard.

5 Comments

  1. Dan- You should have included an appendix section on how to run a program by the commandline in your new C book, its really important for people to understand that behind the scenes, a graphical IDE is still using the commandline for you. In fact I would suggest going farther than that, on your http://www.c-for-dummies.com site you should include a section on how to make your own make files, because thats all an IDE is, just an automated make file generator. People who are fooled into thinking their programs are “graphical” become totally lost when the get complicated compile and link errors and have no idea how to fix their IDE. One criticism I have about your old C books is that you do not include optimization and warning flags in the compile arguments. I compile with:
    gcc -Wall -W -O2 -o filename.c filename
    It is very important for a beginner to have warnings turned on. The microsoft C compiler always has warnings and optimization turned on by default.

    As for your comment about console editors being difficult to use, I agree for a beginner to learn something like vim or emacs is just added aggravation that will do nothing to help but will actually slow down the learning process. You cant appreciate how fast using hotkeys to manipulate the cursor is till you start making 1000+ LoC programs and then all of a sudden having to reach for the mouse every time you want to highlight, copy/paste/move text starts becoming a major burden.

    Comment by BradC — July 1, 2014 @ 12:51 pm

  2. You have a good point, and I will probably bring that up on my C blog.

    The early IDEs were merely automation, combining multi-window editors with an internal compile-and-link command. And, of course, all the options and settings for the compiler and linker are hidden in the IDE. Oh, I could go on and on…

    Comment by admin — July 1, 2014 @ 1:45 pm

  3. Dan- I do want to stress how important your explanations on how to compile on the console was for me. I believe it was 2004 or 2005 when I first read C-for-Dummies and at that time your book was the only C/C++ book that gave a detailed description on not just how to enter the console commands but what is going on behind all these crazy looking arguments and the processes they were running. If it wasnt for your book I would have remained baffled at all this cryptic nonsense and probably would have given up on it. I actually managed to install the Borland commandline compiler for another C book at that time and I can still remember how perplexed I was at why on earth you would have to type all this strange gobbledygook just to compile something. Of course all C/C++ books at that time expected that beginners would read the docs which was a circular argument since you had to understand the whole compile/link process to understand the docs. I am currently training to be a Javascript web developer, and the console is still key to doing just about everything in web development. I credit you to opening up the world of the console to me with not just how, but the why behind it all. Im glad you have a blog because I think its very important that I am able to communicate how important this issue is to the person who first taught me how important the console is.

    Comment by BradC — July 1, 2014 @ 2:24 pm

  4. Thanks.

    I did switch to an IDE for Beginning Programming with C For Dummies, my latest title. I will, however, cover command line programming on my C blog, over at http://www.c-for-dummies.com/

    I’ve also used javac at the command line. It works!

    Still, it’s sad that so few people know how it works.

    Comment by admin — July 1, 2014 @ 3:09 pm

  5. I learn’t(?) Pascal via the Borland Dos – IDE and had no idea of how my .pas became an .exe it was playing with C For Dummies and a copy of TurboC that came on a cover disk that taught me how .C became .EXE and made the whole thing of embedded programming less of a hurdle. I get the view that MS is trying to kill DOS (while a good proportion of Windows apps still use DOS) like Apple did with the terminal. I agree with BradC keep up with the blog!
    Glenn

    Comment by glennp — July 2, 2014 @ 1:38 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.


Powered by WordPress