Why are APIs talked about on here?

Pages: 123
Do you honestly recommend not telling people who don't use an IDE how to compile their programs until they were ~50 pages into the book?
@ascii, a book should definitely not have detailed instructions of how to use any sort of compiler. This does not mean that the reader will not know how to compile. There should definitely be a section about what a compiler is, "hinting" that the reader should find one.

Tying the book to some certain set of tools will make it slightly more comfortable but soon obsolete (in some 10 years). Tying the book to command line tools might make it discouraging too. Hinting that there is a thing called "compiler" or "debugger" is an entirely different thing. Being a programmer you should know the joys of "loose coupling".
I'll pipe and answer that question with another question:

Do you honestly recommend beginners to use separate compiler, linker and text editing tools?

An out of the box IDE sounds to me like a better option for someone who doesn't know the difference between a while loop and an integer.

A C++ book's usually tries to focus on teaching the language. When you've finished "Hello World", you can usually just tell the student to hit "compile" and that will suffice for an IDE. If you want to also support command-line compiling, you're going to have to write another 10 pages describing make files, .obj files, and compiler-specific flags.

A good book/teacher understands that a student can only absorb so much information in a single session. They will will control the flow of information such that the student will only learn information pertinent to the objective of that class.
Perhaps I was misunderstood, but I didn't mean there should be an in-depth guide on how to compile from the command line. I believe books should include a section on compilers/IDE's at the beginning recommending various options for the three major OS's (Windows/OS X/Linux) and a quick explanation on how to use g++ main.cc -o exec, as well as a link to the gcc documentation. Obviously a full tutorial would be irrational and repetitive, but ignoring it altogether is almost as ridiculous as randomly injecting a tutorial ~50 pages in.

Tying the book to some certain set of tools will make it slightly more comfortable but soon obsolete (in some 10 years).

This happens on it's own anyways, doesn't it? Most people are wary of buying a 10 year old computer book.

Tying the book to command line tools might make it discouraging too.

No sane author would ever do this in a beginners book, and it's not what I mean to suggest. Mentioning briefly how to compile a single file program in gcc for non-Windows/OS X users shouldn't be discouraging and seems logical.

An out of the box IDE sounds to me like a better option for someone who doesn't know the difference between a while loop and an integer.

Sure, but most people running Linux or a BSD or a myriad of other operating systems (the people most likely to be compiling from the command line) should be more than capable of using gcc.

When you've finished "Hello World", you can usually just tell the student to hit "compile" and that will suffice for an IDE.

Sure, but not everyone wants to use an IDE.

If you want to also support command-line compiling, you're going to have to write another 10 pages describing make files, .obj files, and compiler-specific flags.

No, you don't.

Obviously a full tutorial would be irrational and repetitive, but ignoring it altogether is almost as ridiculous as randomly injecting a tutorial ~50 pages in.
Good point.

Sure, but not everyone wants to use an IDE.
I can't think of a single reason that any beginner would rather use command-line compile over a visual interface, except for the feeling of being l33t. In general, the reason for preferring a command-line compiler in a GUI environment escapes me. This might be a good point for someone to educate me - what is the appeal of a command-line compiler, exactly?

I was about to summarize my revised stance, but then I realized that I'm not even sure about what we're discussing anymore - we're just sorta' chaining opinions onto other peoples' statements. What are we talking about here?
Last edited on
It's not a matter of appeal it is a matter of some companies don't use IDEs and require them to use just text editors and command line. Tells you how much peoples point of view has changed though because all of my programming books had a section in the first chapter that did just what I said should be done.

Everyone seems to forget that almost all C++ programming books cover what the compiler is, what the linker is, the compilation process is so all they would have to do is cover the first example using gcc just so they can see. In fact Alex Allain's Jumping into C++ ebook does just that also.

I love watching the dev log videos they do for some game dev houses and I've noticed that a lot of them only do command line. As for feeling l33t, using command line doesn't do that, the ones that do any programming to feel l33t are the idiots that want to be hackers thinking hackers are what you see in the movies. We are already l33t, because out of the few friends I have I'm the only one that can program despite my confidence.

Not all IDEs were made the same though. While most compilers are, as I believe GNU GCC and MinG both are identical in terms of calls to gcc. The reason I think it is better to do command line is because if you get an IDE that you aren't familiar with you can at least open a terminal or command prompt and compile your work while others that have no clue how to compile via gcc will be forced to sit hours reading through documentation just to see what all you have to do. Plus if you don't know about command line compilation, chances are you won't have a clue about the different warning flags that you can pass the compiler.

I've noticed that a lot of programmers don't even bother with the debugger or profiler so I suppose it shouldn't surprise me that so many don't understand using the command line instead of an IDE. Learning the command line for compiler, linker, and learning the debugger and a profiler is important because any good programmer should start as soon as possible to learn to use their tools.
I can't think of a single reason that any beginner would rather use command-line compile over a visual interface, except for the feeling of being l33t. In general, the reason for preferring a command-line compiler in a GUI environment escapes me. This might be a good point for someone to educate me - what is the appeal of a command-line compiler, exactly?

I don't think it's that people prefer command line compilers but that when using a text editor (which is sensible since IDE's usually force you to use crap editors) it's the easiest way to compile.
ascii wrote:
I don't think it's that people prefer command line compilers but that when using a text editor (which is sensible since IDE's usually force you to use crap editors) it's the easiest way to compile.

Well that and if you look at most books they even say use the one you want or just something like Notepad is fine. If you are going to say notepad is fine, then don't you think that they should at least cover simple command line compilation and then link to the GNU G++ man page? (ie g++ -o hello hello.cpp)

My stance is, beginner or not, it is never too early to learn your tools. Learning to invoke the compiler and linker through command line is important too. Same with debugger and profiler. Yet if you look, most books normally only have a short chapter for the debugger and leave it at that. Looking at books, even they make it look like the tools of the trade aren't important. Truly sad IMO.
Last edited on by closed account z6A9GNh0
If you are going to say notepad is fine, then don't you think that they should at least cover simple command line compilation and then link to the GNU G++ man page? (ie g++ -o hello hello.cpp)

Umm... I made several posts arguing this exact point above.
Sorry, the "If you.." was meaning the book/tutorial author and not you as in ascii. I've seen too many books say Notepad is fine and then jump into programming, which to me means the reader is going to have 100+ source code files and no programs to show for it.
Everyone seems to forget that almost all C++ programming books cover what the compiler is, what the linker is, the compilation process is so all they would have to do is cover the first example using gcc just so they can see. In fact Alex Allain's Jumping into C++ ebook does just that also.


I'm going to guess, that just like your appeal to your own authority as far as your claim to definitively knowing the ratio of goobers-to-people-with-common-sense, this is more cockamamie statistical bullshit. I've never read a C++ programming book that had anything in it about how to use a compiler. Ironically, you've also "seen too many books say Notepad is fine and then jump into programming."

Part of installing a compiler is testing the installation. How does one test the installation? Usually by compiling a "hello world" program. Is it safe to assume the reader knows enough to compile a single source file? It is. Should every tutorial and book cover this? Definitely not.
Last edited on
Sorry, the "If you.." was meaning the book/tutorial author and not you as in ascii.

Woops, guess I was just being self-centered :P

I've never read a C++ programming book that had anything in it about how to use a compiler.

I don't own very many C++ books, but all of them do talk for a few pages about the compilation process.
Last edited on
They discuss the compilation process, but in a very abstract way that gives new people little to no help.
closed account (3qX21hU5)
I don't think it's that people prefer command line compilers but that when using a text editor (which is sensible since IDE's usually force you to use crap editors) it's the easiest way to compile.


Now this is just a matter of opinion. You can not say that everyone thinks that IDE's for them to use crap editors. I personally love Visual Studio's Editor (With Visual Assist).

I agree that they should tell a user how to compile with the command line and other things. But they should not have that at the beginning of the book. Like others are saying the main thing for beginners is learning the language and not overloading them with information. There should be a section in the appendix or something about command line compilation and other information, and then there should be a tip in the very beginning telling the user to look in the appendix if they need help with compilation. At least that is what I think
Even this site makes no sense when it comes to helping beginners.

This tutorial is for those people who want to learn programming in C++ and do not necessarily have any previous knowledge of other programming languages. Of course any knowledge of other programming languages or any general computer skill can be useful to better understand this tutorial, although it is not essential.


Then it says this at the bottom of the page:
All C++ compilers support the compilation of console programs. Check the user's manual of your compiler for more info on how to compile them.


Well sure, if no c++ book should cover it as it is out of the scope of the book and it would be overwhelming to the beginner, lets make them read through the compiler documentation because it is worded perfectly for a beginner.

I like Alex Allain's Jumping into C++ as it covers installing Code:Blocks for Windows, Xcode 3 and 4 for Mac, and then for Linux users it covers installing gcc, how to compile in the command line for a simple first program, then teaches how to install nano for editing. He even does the hello world example to teach how to use each one.
Last edited on by closed account z6A9GNh0
Now this is just a matter of opinion. You can not say that everyone thinks that IDE's for them to use crap editors. I personally love Visual Studio's Editor (With Visual Assist).


I'm reading this as "I like the default editor along with a $250 (!!!!!) add-on". And even with Visual Assist you're forced to use an barely customizable environment without any keybindings/commands for efficient editing. Once you use a good text-editor anything less feels like trash.
I'm reading this as "I like the default editor along with a $250 (!!!!!) add-on

Unless you get it through DreamSpark (as I did, and I believe he did as well, professional version) then it's free. I think the VS editor is pretty solid.
closed account (3qX21hU5)
Personally I didn't mind the basic VS editor either, just prefer it more with Visual Assist. Anyways that wasn't the point, the point is that everyone will have a different opinion on if they like a certain editor or not. Some people swear VS is the best and some people love Notepad++.

Once you use a good text-editor anything less feels like trash.

A good text-editor is a matter of opinion.

I believe it is definitely worth the $99 for the individual license, and even the $250 if your working with a team.

@RB Is Visual Assist on DreamSpark? I know they have a student edition you can buy for $50 but not sure if DreamSpark has it. Here is the link if you don't know of it http://www.wholetomato.com/purchase/default.asp If you use VS I would highly recommend trying the 30 day trial, but be warned once you use it it is hard to stop using it.
Last edited on
Topic archived. No new replies allowed.
Pages: 123