As a learner should I use an IDE?

Pages: 1234
closed account (3CXz8vqX)
"For any problem that is even moderately complex... a debugger will literally save you hours of time and frustration (this is not an exaggeration)."

This is really my point. As a beginner.... you don't get this complexity.

A debugger might be a great tool...but can it deal with Seg Faults with anything more than "Segmentation Fault" as a clue >.> Though then again, you don't come across Seg faults until pointers and stuff so...
Last edited on
Ravenshade wrote:
TheIdeasMan... using Code::Blocks performs debugging in the exact same manner. Build...see errors in terminal output...solve errors...rebuild...solve more errors. Cycle repeats until the damn thing builds.


I thought so, but credit to Disch for wisely mentioning it in the first place.

Building is not debugging. Building is compiling & linking.

Debugging is fixing runtime errors, of which there are different sorts. The most common one for newbies is a segfault, which means the bad access of memory - like going past the end of an array.

The more tricky sort, are logical errors, which is where the program compiles, but produces the wrong answer because the logic is wrong. For example you want your program to multiply numbers by 10, and wonder why it doesn't. The answer is you had * 1.0 and not * 10.0 .

One can use a debugging program to keep an eye on the value of variables and see where they go wrong & deduce why. This is much easier than outputting values with code - that is what I used to do in 1987 & is definitely the hard way of doing things. A dubugger can have breakpoints & allows results of expression to be done on the fly. You can step over or into functions & loops.

What is happening here, highlights the problems of learning the way you are. There are concepts that you are not even aware of, or at least have misguided idea of what the concept is. The same thing (user not aware of concepts) can happen with someone using an IDE, but difference is that the IDE will do a lot of stuff automatically or implicitly. For example, an IDE probably has a Debug menu, which you would notice & might have a go with, just to see what it does - now you have discovered debugging. In the shell, you have no idea a debugging program even exists, and probably won't do until someone tells you about it, or you read about it somewhere.

Last edited on
This is really my point. As a beginner.... you don't get this complexity.


That doesn't mean the tool is less valuable to a beginner.

The value of a debugger may grow exponentially with the complexity of the problem, but that doesn't mean a debugger isn't useful for simpler problems as well.

I routinely answer questions on this forum that the person could have solved in like 15 mins of effort if they knew how to use a debugger. It probably took them longer to post their problem to the boards than it would have to fix it themselves.

I'm not blaming them or anything ... I'm just trying to emphasize how important of a skill it is, and how every programmer needs to learn it. The sooner they learn it, the better.

A debugger might be a great tool...but can it deal with Seg Faults with anything more than "Segmentation Fault" as a clue >.>


Yes.

When you get a segfault in a debugger, the debugger snaps as if you hit a breakpoint, taking you to the exact line of code the program segfaulted. Where you can examine your variables and see exactly why it crashed (often a bad pointer or out of bounds array index -- both of which are instantly identifiable).
Last edited on
A debugger might be a great tool...but can it deal with Seg Faults with anything more than "Segmentation Fault" as a clue

It can identify the exact statement where the problem occurs. Sometimes fixing the problem may take some additional effort in understanding what it actually means, and thereby deciding what action to take. But its a good starting point.
Last edited on
Apart from me learning to type faster - I would mention this also:

In industry one cannot:

- spend hours debugging with output statements;
- ask on a forum how to fix something;

Ravenshade - could you consider taking on board what industry experienced people like Disch are saying to you?
closed account (3CXz8vqX)
TheIdeasMan if you're programming for a living you're not a beginner are you.

I've already said that you 'should' switch later on as the advantages outweigh the negatives by a factor of 3:1. On the otherhand with beginners I believe a fundamental understanding of everything needs to be learned before graduating to the IDE. Finding bugs yourself, whether they be compiler errors, or because you typed y= 3 instead of y == 3 somewhere is I believe a key skill in learning about why good clean code is needed. Why people need to comment their code and many other very basic concepts that many professionals take for granted.

It's like a taxi driver saying that driving is easy, yet not understanding that a beginner doesn't know how to use clutch control. Conversely, the Taxi driver has just said: Use an automatic! =D See my point? It isn't teaching the necessary skills, sure they can be done without when push comes to shove but certain things should be learned in order to better control your code and program effectively.

That said...this thread has convinced me to at least try out Code::Blocks again... attempt 7892 at trying to learn pointers.
On the otherhand with beginners I believe a fundamental understanding of everything needs to be learned before graduating to the IDE.


The point is using an IDE makes it easier to gain the fundamental understanding of everything.

What you're saying might make sense if using an IDE was more difficult than coding in a plain text editor and launching the compiler via commandline.... but it isn't. It's actually easier for most people.

What's the point of starting with something more difficult, only to graduate to something easier later on? Especially if that easier approach offers way more functionality?

EDIT:

attempt 7892 at trying to learn pointers.


Pointers are not very difficult once they "click". The concept is very simple, just for some reason newbs have a hard time wrapping their head around it.

If you have specific questions or what something clarified, I'd be happy to help.

Last edited on
Why don't you install QtCreator on your Linux? I haven't used Code Blocks, but Qt is really good - it can use all kinds of technologies, comes with 1000's of example code, & has heaps of documentation. You can still cross compile to Windows & other OS's.

For pointers, read chapter 5 of this K&R if you don't already have it:

http://zanasi.chem.unisa.it/download/C.pdf


In C++ you should also prefer to use references rather than pointers (they are kind of similar). In C++11, you should learn smart pointers like std::shared_ptr .
What part of pointers specifically confuses you? I assumed you knew very much about C/C++ from your posts and the fact that you use Linus' OS.
closed account (3CXz8vqX)
~Disch ... I get the concept. I just don't get the point... ....I'll just use a global instead >=D /shot

~TheIdeasMan
The only reason I chose not to install QtCreator is due to cross compatibility, the belief that the windows version is exactly the same. Personally I prefer to hard code, the only reason I'm using Code::Blocks is so that I can support others through my tutorials. So far Code::Blocks isn't throwing up the errors and problems it used to, in fact it seems pretty fluid and intuitive at the moment.

....but whaaaaaaa. Okay, why? I always thought I was supposed to be using pointers. Lets not confuse me with 'smart pointers' when I don't understand normal pointers.

Edit. Wait...aren't C pointers different to C++?
Last edited on
Ravenshade,

What you are saying is OK, but we are trying to point out that it is much harder that way. We have shown to you why that is so with the debugging concept.

Here's another question: What compiler options do you normally use with the g++ compiler?
@RavenInTheShade: Pointers are identical in C and C++, even the quirks and undesirable parts that come along with const-correctness.
...but whaaaaaaa. Okay, why? I always thought I was supposed to be using pointers. Lets not confuse me with 'smart pointers' when I don't understand normal pointers.


Learn them in this order:

- Ordinary pointers - the same for C & C++
- References in C++ (not hard)
- C++11 smart pointers

The only reason I chose not to install QtCreator is due to cross compatibility, the belief that the windows version is exactly the same.


Choosing a different IDE, because Qt is the same across different OS's doesn't make sense. I proposed Qt because of it's rich set of features & wide acceptance & ease of use.

Personally I prefer to hard code, the only reason I'm using Code::Blocks is so that I can support others through my tutorials.


You are writing tutorials? You learnt today what a debugger is, have yet to learn pointers - and you are writing tutorials?

And by hard coding, you mean that instead of visually drawing a Dialog Box with controls in it, you write code to do the same thing? Although that is very commendable, again your approach is much harder, much less productive.
closed account (3CXz8vqX)
Apparently I'm not the only one who things beginners should use text editor and g++ ! http://www.cplusplus.com/forum/beginner/41446/

Anyway, normally I use -o though I don't have to, depends on whether I actually want to name the file. Are there any debuggers out there that don't come with an IDE?

~L B Interesting.... I've been renamed =D. Thanks for that ^_^
That thread is from a few months after Moschops first registered. I am sure he had a slight change of brain since then.

And the name was just to bring things back down to casual, no longer serious arguing.
Last edited on
closed account (3CXz8vqX)
~TheIdeasMan

If it's the same, it's probably my mistake then. I just glanced at the IDE Comparison on Wiki and chose what appeared to be the most functional yet worked on different systems. Qt, last I checked is a GUI maker (wxWidget, Qt so on), which is a tad higher level (that's just my assumption). It seems like there's competition between Code::Blocks and QtCreator.

Yes, yes I am writing tutorials *evil grin*, it's mostly for myself, I don't expect people to pay any attention. I've used this technique for a variety of things, including learning how to play the flute, learning a language or even demonstrating how to solve a problem. I can get the concept all day but if I don't use or demonstrate it, it doesn't become concrete. That's generally the problem I have with pointers.

Hah, last time I created an app it was with Python and before that Visual Basic. I've also played around with SDL (still playing around). As it is, being 'productive' isn't on my 'priorities' list. I'm not learning this at Uni, nor do I do it for an occupation. Just for the sheer joy of C++ ^-^; .

Also, I didn't just learn today what a debugger is, it's just your definitions and my definitions of what a bug is, differ. Anything that prevents the program from compiling correctly is a bug as far as I'm concerned and anything that helps get rid of these is a debugger. Coincidentally compiler errors are in effect a debugger tool. I find it therapeutic to solve the problem most of the time.

edit. What serious arguing? *rage*
Last edited on
Anyway, normally I use -o though I don't have to, depends on whether I actually want to name the file.


Have you heard of these ones?

-std=c++11 -Wall -Wextra -pedantic

The last 3 produce warnings , which are very important. It is a good idea to compile code so there are no warnings at all. You could get particularly pedantic and use -Werror which promotes warnings to errors.

This is another example that demonstrates you lack of basic knowledge.

Are there any debuggers out there that don't come with an IDE?


gdb - read the man page for it & the article in the documentation section top left of this page.
closed account (3CXz8vqX)
I have actually, I used to use -ANSI and various others as well. The reason I don't use them at the moment is because I have very little need for them most of the programs I write are mostly for learning about concepts not necessarily for getting everything spot on correct.

Thanks for that!

Edit. Actually not C++11 but that's because it wasn't even a standard back then when I was using these flags. (Yeah, it's been a while).
Last edited on
Oh wow kempofighter showed up :O I've read some of your old articles and some archived posts from you before. Never actually seen you post though, figured you had left.

As for the topic, there's nothing wrong with using an IDE as a beginner. I do recommend learning how to invoke your compiler and debugger and perform linking from a command line at some point though. It's a good skill, and sometimes you won't have any other option. But as Disch has stated, none of those really have to do with the language itself. That's more of a systems topic.
closed account (3CXz8vqX)
*cough* didn't see Kempofighter's post.

I do like the hard way ^_^.

True enough ResidentBiscuit.
Pages: 1234