1. Post #1

    May 2012
    12 Posts
    Decided I want to learn C++. Started about three days ago a few hours a day reading the tutorials on www.cplusplus.com and I have a few questions. First of all will I be able to learn it all online or should I buy a book? Is C++ even the best first language to learn? If you know C++ how did you learn?

    Here is something I have made from what I have learned so far.

    Code:
    #include<iostream>
    #include<string>
    #include<sstream>
    
    using namespace std;
    
    int addition(int a, int b)
    {
    	int A;
    	A = a + b;
    	return (A);
    }
    
    int subtraction(int B, int C)
    { 
    	int S;
    	S = B - C;
    	return (S);
    }
    
    int multiplication(int d, int e)
    {
    	int M;
    	M = d * e;
    	return (M);
    }
    
    int division(int f, int g)
    {
    	int D;
    	D = f / g;
    	return (D);
    }
    
    
    int main()
    {
    	string choice ("0");
    	int choiceb, x, y, z;
    	
    	cout << "1: Addition\n2: Subtraction\n3: Multiplication\n4: Division\n\nSelect one of the above: #";
    	getline (cin, choice);
    	stringstream(choice) >> choiceb;
    	
    	if (choiceb == 1)
    	{
    		cout << "\nYou selected Addition\n#";
    		cin >> x;
    		cout << "Plus#";
    		cin >> y;
    		z = addition (x,y);
    		cout << "Equals: " << z;
    	}
    	else if (choiceb == 2)
    	{
    		cout << "\nYou selected Subtraction\n#";
    		cin >> x;
    		cout << "Minus#";
    		cin >> y;
    		z = subtraction (x,y);
    		cout << "Equals: " << z;
    	}
    	else if (choiceb == 3)
    	{
    		cout << "\nYou selected Multiplication\n#";
    		cin >> x;
    		cout << "Times#";
    		cin >> y;
    		z = multiplication (x,y);
    		cout << "Equals: " << z;
    	}
    	else if (choiceb == 4)
    	{
    		cout << "\nYou selected Division\n#";
    		cin >> x;
    		cout << "Divided By#";
    		cin >> y;
    		z = division (x,y);
    		cout << "Equals: " << z;
    	}
    	else
    		cout << "The number " << choiceb << " is not a working number. Please select 1-4";
    }
    I know a lot of things in it are pointless but it was just for the learning experience. But please tell if you have any suggestions to make it better/smaller or anything i'm doing wrong. Last thing is what would be a good project for a beginner like myself? I know I have tons more to read and learn but I feel I learn best by actually making simple programs like these.


    P.S. This is my first post. Apologies if I'm posting this in the wrong section or something.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Programming King Programming King x 2Artistic Artistic x 1 (list)

  2. Post #2
    Gold Member
    Jookia's Avatar
    July 2007
    6,768 Posts
    To make it smaller or better? Use operators instead of functions.
    Reply With Quote Edit / Delete Reply Linux Australia Show Events Dumb Dumb x 3Agree Agree x 2Zing Zing x 1 (list)

  3. Post #3

    May 2012
    12 Posts
    To make it smaller or better? Use operators instead of functions.
    The functions were just for testing It would be better to just use operators.

  4. Post #4
    Gold Member
    darkrei9n's Avatar
    November 2007
    5,137 Posts
    Rather than fifty million else ifs you can use a switch in this case. It would look like this.

    Code:
    switch(choiceb)
    {
         case 1:
              (code here)
              break;
         case 2:
              (code here)
              break;
         case 3:
              (code here)
              break;
         case 4:
              (code here)
              break;
    }
    And as Jookia said, use operators rather than functions.
    Reply With Quote Edit / Delete Reply Windows 8 United States Show Events Agree Agree x 5 (list)

  5. Post #5

    April 2010
    2,404 Posts
    Watching the entire 60+ videos of "C++ spoon feed" helped me a lot, especially when learning about pointers.

    http://www.youtube.com/watch?v=tyVhn0FWWB4

    I recommend it to all first time programmers who want to start with C++.

    To answer your question about either learning from books or online: It is all a matter of personal preference.
    I've never bought a book and instead used online resources to help myself learn but what I did, most importantly, was practised. Always practise whenever you can until you fully understand something because solving problems on your own helps hard-wire these solutions into your brain.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 2Useful Useful x 1 (list)

  6. Post #6

    May 2012
    12 Posts
    Watching the entire 60+ videos of "C++ spoon feed" helped me a lot, especially when learning about pointers.

    http://www.youtube.com/watch?v=tyVhn0FWWB4

    I recommend it to all first time programmers who want to start with C++.

    To answer your question about either learning from books or online: It is all a matter of personal preference.
    I've never bought a book and instead used online resources to help myself learn but what I did, most importantly, was practised. Always practise whenever you can until you fully understand something because solving problems on your own helps hard-wire these solutions into your brain.
    Awesome! Those videos look like there going to help a bunch. Will definitely start watching them tomorrow.

  7. Post #7
    Gold Member
    W00tbeer1's Avatar
    July 2008
    3,129 Posts
    One thing I would personally do is change the temporary method variables all to be the same three names, such as A, a, and b. Since they are only used for each call and not globally, you can make it easier on yourself rather than making some named 'e' or 'g'. Not really a big deal, just something I would do.

  8. Post #8
    Gold Member
    Mr_Razzums's Avatar
    December 2005
    4,517 Posts
    Rather than fifty million else ifs you can use a switch in this case. It would look like this.

    Code:
    switch(choiceb)
    {
         case 1:
              (code here)
              break;
         case 2:
              (code here)
              break;
         case 3:
              (code here)
              break;
         case 4:
              (code here)
              break;
    }
    And as Jookia said, use operators rather than functions.
    Doing functions in this case is perfectly fine. The more you learn to use break things down into functions the easier OOP will be. Its good practice anyway.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 3 (list)

  9. Post #9
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    The more you learn to use break things down into functions the easier OOP will be.
    The more you learn about the difference between OOP and procedural programming, the easier both will be.. It is not good practice to have useless functions. In this case it almost makes sense because the OP is doing it on purpose, but in a real program you would eliminate the function since it is useless.
    Reply With Quote Edit / Delete Reply Windows XP Show Events Agree Agree x 2 (list)

  10. Post #10
    kill yourself
    Protocol7's Avatar
    June 2006
    25,716 Posts
    The more you learn about the difference between OOP and procedural programming, the easier both will be.. It is not good practice to have useless functions. In this case it almost makes sense because the OP is doing it on purpose, but in a real program you would eliminate the function since it is useless.
    C++ gets really cool once you implement custom classes. And that's obviously where OOP comes from.

    Even just little things, like in my most recent homework I had a data wrapper class and put it in a single vector instead of three vectors of standard datatypes. It's a minute difference but once I changed it, the difference was immediately clear and made the rest of the assignment easier than shit.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  11. Post #11
    HQRSE FUCKER
    ief014's Avatar
    September 2009
    3,045 Posts
    So far from my experience, books have helped me much more than tutorials.

    This is what I used. Helped me a lot with pointers and references in C++ when I was starting out.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Agree Agree x 1 (list)

  12. Post #12
    kill yourself
    Protocol7's Avatar
    June 2006
    25,716 Posts
    Ah, fucking pointers.

    Nuff said. When I was dumb in C++ they annoyed the hell out if me, I just put in ampersands and stars until things worked
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 9Agree Agree x 9Programming King Programming King x 4Winner Winner x 1 (list)

  13. Post #13
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    C++ gets really cool once you implement custom classes.
    Separating your code into functions has very little to do with OOP. That was my point. I never said writing functions was bad or that OOP didn't make things more obvious. Just that they both have little to do with each other.

  14. Post #14
    kill yourself
    Protocol7's Avatar
    June 2006
    25,716 Posts
    Separating your code into functions has very little to do with OOP. That was my point. I never said writing functions was bad or that OOP didn't make things more obvious. Just that they both have little to do with each other.
    I... was agreeing with you...?
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 1 (list)

  15. Post #15
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    I... was agreeing with you...?
    Great I suppose, just wasn't obvious from the way you basically kept preaching about OOP when I was making the point that it was irrelevant to the discussion...
    Reply With Quote Edit / Delete Reply Windows XP Show Events Dumb Dumb x 2 (list)

  16. Post #16
    Gold Member
    camacazie638's Avatar
    November 2005
    476 Posts
    I currently have limited internet access and am searching for any possible .zips or .rars of sample code, training videos or tutorials.
    Also, besides starting to learn C++, are there any other languages that one could benefit more from in the coming years?
    Mobile apps seem to be in demand, but thatís just my opinion.

  17. Post #17
    Gold Member
    deathshead's Avatar
    June 2005
    25 Posts
    dfsf
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 5Funny Funny x 1Programming King Programming King x 1 (list)

  18. Post #18
    Gold Member
    WTF Nuke's Avatar
    March 2009
    4,417 Posts
    Looks ok.. I suggest never using a computer again to ensure it doesn't suck more than it already does.
    Well that's rude.
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Agree Agree x 1 (list)

  19. Post #19
    Gold Member
    deathshead's Avatar
    June 2005
    25 Posts
    sdf
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Informative Informative x 2 (list)

  20. Post #20
    Gold Member
    Soulmemories's Avatar
    December 2005
    247 Posts
    Personally? A college class that forces you to do work and having a teacher or TA that will work with you helps loads.

    Also with the switch statement, you need to be careful if you make a bunch of those, they'll end up jumping between different case statements, and you'll wonder why you program is glitching up the whole time.

  21. Post #21

    June 2011
    11 Posts
    cplusplus.com was the best tutorial I know of; it's the first and only tutorial I used if you don't count me looking up syntax for certain functions and tutorials on GUI libraries as C++ tutorials. Only other thing you should need is google.

    And don't bother with books, they are always outdated to some point and contain a limited amount of knowledge, whereas with the internet, if you don't understand something, you just look it up. As long as internet is available, books will always be useless in my opinion. The internet is all of the world's knowledge a few keystrokes away; a book is just a few pages with a few webpages' worth of information which costs money. (unless you just download a .pdf of the book)
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Disagree Disagree x 1 (list)

  22. Post #22
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    And don't bother with books, they are always outdated to some point and contain a limited amount of knowledge, whereas with the internet, if you don't understand something, you just look it up. As long as internet is available, books will always be useless in my opinion. The internet is all of the world's knowledge a few keystrokes away; a book is just a few pages with a few webpages' worth of information which costs money. (unless you just download a .pdf of the book)
    The thing about books is that the technical content is often of a much more consistent quality and they go very in depth in the subjects they touch. Whereas cplusplus.com for example is merely a beginner's introduction to C++ and doesn't really teach you a lot of important stuff.
    Reply With Quote Edit / Delete Reply Windows 7 Show Events Agree Agree x 2 (list)

  23. Post #23
    T3hGamerDK's Avatar
    January 2011
    2,551 Posts
    Though it's not as good as reading a book, or some of the more complete documentations on the web, there's a wiki that contains 'books' for programming, learning latin or spanish, how algorithms work and how you improve on them, and how computers work, and a lot more.
    I use it everyday, and improving works the same as wikipedia (it's wikimedia software)
    http://en.wikibooks.org/wiki/Subject:Computing

    I thought you guys might find it VERY useful :)

  24. Post #24

    April 2012
    30 Posts
    I learned C++ from books, but the internet wasn't what it is today.

    And don't bother with books, they are always outdated to some point and contain a limited amount of knowledge...
    This is often true, but not with C++. The language isn't changing. However...

    ...whereas with the internet, if you don't understand something, you just look it up. As long as internet is available, books will always be useless in my opinion. The internet is all of the world's knowledge a few keystrokes away; a book is just a few pages with a few webpages' worth of information which costs money. (unless you just download a .pdf of the book)
    I pretty much agree with this. There's nothing so amazing about any of my books that would motivate me to recommend them, but I won't throw them out.

    Edited:

    Rather than fifty million else ifs you can use a switch in this case. It would look like this.
    There is nothing wrong with using a stack of else-ifs, but changing to the code to use a switch is a good noob exercise. Knowing how to use both is good.

  25. Post #25
    Behemoth_PT's Avatar
    March 2007
    1,920 Posts
    I think before you go to C++ or C# you should start with just C.

    I think before you go to C++ or C# you should get some experience in C too. I don't know any C++, never learned and don't know the differences but I can figure out what you're trying to do just by looking at the code.

    But that's just from my experience.

    EDIT:

    I think for simple functions like multiplications, divisions, sums and subtractions you could make macros instead of functions.

    Macros aren't C/C++ but they define values or simple operations to a macro you want to make.

    for example: if you have, lets say a variable called a that repeats itself throughout the code and, let's say it's value is 50, you can define 50 as a macro for something like VALUE

    like this:

    instead of this:
    Code:
    int addition(int a, int b) { int A;   A = a + b;     return (A);}
      int subtraction(int B, int C) {      int S;     S = B - C;     return (S); }  
    int multiplication(int d, int e) {     int M;     M = d * e;     return (M); }
      int division(int f, int g) {     int D;     D = f / g;     return (D); }
    You can do this:
    Code:
    # define addition(a,b) ((a)+(b))
    # define subtraction(a,b) ((a)-(b))
    # define mult(a,b) ((a)*(b))
    # define div(a,b) ((a)/(b))
    Careful with this because it's not C and it's a bit advanced to you.
    #define is a pre-processing directive. And in some cases it will cause some algebric errors that your compiler will not warn you about.

    For example: see why I put ((a)*(b)) in the mult(a,b) function instead of just a*b?

    let's say I write this code with just a*b:
    Code:
    # include <stdio.h>
    # define mult(a,b) a*b
    main()
    {
      printf("%d*%d=%d\n", 3+1, 2+3, mult(3+1,2+3));
    The output will be 4x5=8 witch is wrong!
    Why did the compiler do this? Because he assumed you were making the following operation (3+1*2+3)=8.

    Now Let's say we want to make a more complex operation like 1000/mult(2+3,7+3)
    So now that we no longer have problems with the sums inside our macro, the result of mult(2+3,7+3)=5*10=50, right?
    Being the final result 1000/50=20

    Is it?
    Code:
    #include <stdio.h>
    
    #define mult(a,b) (a)*(b)
    
    main()
    {
      printf("%d\n", 1000/mult(2+3,7+3));
    }
    $ prog
    2000
    $

    Weird, eh? The result of the division is bigger than 1000.

    Let's see if you can figure this one out by looking at the expansion made by the pre-processor:
    Code:
    printf("%d\n", 1000\(2+3)*(7+3));
    So basicaly multiplication and division have the same order of precedence, so the following will happen:
    1000/5 = 200
    200*10 = 2000

    That's why you use:
    Code:
    #define mult(a,b) ((a)*(b))
    That's it!

    This is the same as making "#define NUM 100" except this time you're using #define to define instructions instead of values.
    However if you want to define a value using C you use constants:

    C
    Code:
    const int num = 10
    not C, yet usable:
    Code:
    #define NUM 10
    Note that macros are a useful and quick alternative to some functions in C.
    Since you're a beginner I recomend you train functions first before jumping to the use of macros. And if you do use macros use them as a substitute for the most simple and generic functions like sums, multiplications... etc etc...

    Macros are more complex than what I just taught you. You can make lots of functions with them and other cool stuff that you'll surely learn by yourself in the future.
    However, don't use them now. Use them when you've mastered cycles, functions, files, pointers or vectors first.
    Reply With Quote Edit / Delete Reply Linux Portugal Show Events Disagree Disagree x 11Funny Funny x 1Dumb Dumb x 1 (list)

  26. Post #26
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    Or you can just use functions and rely on the compiler to optimize this for you. And make your code debuggable at the same time.
    Reply With Quote Edit / Delete Reply Windows 7 Show Events Agree Agree x 1 (list)

  27. Post #27
    blankthemuffin's Avatar
    July 2009
    1,265 Posts
    Note that macros are a useful and quick alternative to some functions in C.
    Since you're a beginner I recomend you train functions first before jumping to the use of macros. And if you do use macros use them as a substitute for the most simple and generic functions like sums, multiplications... etc etc...
    There is absolutely no reason to use the preprocessor here, or even bring it up really.

    Not sure what the fuck you're talking about when you say the preprocessor is not C.
    Reply With Quote Edit / Delete Reply Linux Australia Show Events Agree Agree x 2 (list)

  28. Post #28
    Behemoth_PT's Avatar
    March 2007
    1,920 Posts
    I was just giving a tip in macros to avoid writing big functions that do so little. Nothing important, really, just informational. It's not the pre-processor that isn't C, its the usage of #define. That isn't C. Go check.

    Edited:

    Or you can just use functions and rely on the compiler to optimize this for you. And make your code debuggable at the same time.
    That's why I recomended the usage of macros in small functions instead of big ones. Because with macros, if you have an error or mistake it will be a pain in the ass to try to figure it out.

    Also I don't use any debugger. Where I study they just want us to use the fedora text editor and the console, and that's it. So basically when we get a segmentation fault, it's chaos.

    But, yes, as I said before, I was just giving a useful tip because there is no harm in using macros as substitutes for such small functions. As for bigger and more complex functions, absolutely, use functions!
    Reply With Quote Edit / Delete Reply Linux Portugal Show Events Dumb Dumb x 4 (list)

  29. Post #29
    Gold Member
    Jookia's Avatar
    July 2007
    6,768 Posts
    there is no harm in using macros as substitutes for such small functions.
    Yes, there is. You lose type safety, the compiler doesn't get to optimize it, you can cause unintended side effects.
    Reply With Quote Edit / Delete Reply Linux Australia Show Events Agree Agree x 4 (list)

  30. Post #30
    blankthemuffin's Avatar
    July 2009
    1,265 Posts
    I was just giving a tip in macros to avoid writing big functions that do so little. Nothing important, really, just informational. It's not the pre-processor that isn't C, its the usage of #define. That isn't C. Go check.
    Yes it is, define is most definitely a part of ISO C99, I just checked. Section 6.10 might be worth a read.

    That's why I recomended the usage of macros in small functions instead of big ones. Because with macros, if you have an error or mistake it will be a pain in the ass to try to figure it out.

    Also I don't use any debugger. Where I study they just want us to use the fedora text editor and the console, and that's it. So basically when we get a segmentation fault, it's chaos.

    But, yes, as I said before, I was just giving a useful tip because there is no harm in using macros as substitutes for such small functions. As for bigger and more complex functions, absolutely, use functions!
    There's a reason to use macros in this example, the fact that they're dumb text replacements that don't worry about type. This means the function will behave like the standard operators because that's really all they expand to.

    Please don't take that as you being right though, since for the most part there's no reason to replace a function, small or large with a macro unless you actually know what you're doing. The lack of type safety and the code bloat they generate is completely counter productive for the general case. Not to mention without a froody compiler like clang they can be a pain in the ass to debug.
    Reply With Quote Edit / Delete Reply Linux Australia Show Events Funny Funny x 1Zing Zing x 1 (list)

  31. Post #31
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    That's why I recomended the usage of macros in small functions instead of big ones. Because with macros, if you have an error or mistake it will be a pain in the ass to try to figure it out.
    A small pain in the ass is still a pain in the ass. I gotta lube up and everything. It stinks.
    Also I don't use any debugger. Where I study they just want us to use the fedora text editor and the console, and that's it. So basically when we get a segmentation fault, it's chaos.
    I hate to go ad hominem on you, but this is simply ridiculous. Either the place teaching you this has absolutely no competency at all, or you're grossly misunderstanding their teachings.
    I was just giving a useful tip because there is no harm in using macros as substitutes for such small functions. As for bigger and more complex functions, absolutely, use functions!
    No, it's just bad advice. Use macros only when absolutely necessary. If you can replace a macro by another construct while still meeting performance and readability requirements, do it.

  32. Post #32
    Why even trying C++ when you can do what you can do in C++ in C?
    Why not write Entity_SetHealth(Entity *this, int health) instead of Entity->SetHealth(int health)?
    Reply With Quote Edit / Delete Reply Windows 8 Russian Federation Show Events Dumb Dumb x 10 (list)

  33. Post #33
    Icedshot's Avatar
    April 2010
    2,312 Posts
    Why even trying C++ when you can do what you can do in C++ in C?
    Why not write Entity_SetHealth(Entity *this, int health) instead of Entity->SetHealth(int health)?
    yes, and why use template <class T> T function(T something); when you can write out every single case manually?
    Reply With Quote Edit / Delete Reply Windows Vista United Kingdom Show Events Zing Zing x 5 (list)

  34. Post #34
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    yes, and why use template <class T> T function(T something); when you can write out every single case manually?
    I thought a long time about how to answer his post. Let's just say you wrote it more succinctly and with more wit than I could've mustered in one great sentence. Bravo.
    Reply With Quote Edit / Delete Reply Windows 7 Show Events Friendly Friendly x 2Agree Agree x 1 (list)

  35. Post #35
    Behemoth_PT's Avatar
    March 2007
    1,920 Posts
    Yes it is, define is most definitely a part of ISO C99, I just checked. Section 6.10 might be worth a read.
    That's weird. The book I use mentions #define as a non C command, just an order for the pre-processor to expand an instruction that you want to repeat throughout the code.

    It's not a very good book but it was where I learned C from. I then advanced to other books.

    Since every instruction in C ends with ; and #define doesn't, that's proof enough. Also when you're typing #, you're calling the pre-processor, not doing any instruction in C.

    Edited:

    I hate to go ad hominem on you, but this is simply ridiculous. Either the place teaching you this has absolutely no competency at all, or you're grossly misunderstanding their teachings.
    I understand, and I'm no C pro exactly.
    If I'm wrong then I'm wrong, I don't use much macros myself, because they suck when debugging. I just use them for small mundane operations such as simple sums and such things. And I just started using and comprehending macros a while ago so there you go, I'm no pro myself.

    The place I'm learning from (my uni) has a policy for helper/debugger programs for beginners. We have 2 programming subjects in the first year, Micro-Processor Programming and Algorithms and Data Structures.

    In Micro-Processor programming our regent strictly forbids the usage of debuggers and helpers for our learning. For the final assignment what we use it's up to us.
    In classes, It's just an open fedora console and the text editor because he wants us to learn from our mistakes. Also the type of exercises he gives us in that subject to do in classes are nothing of a coding nightmare so there's no issue in using our limited ressources.
    They're just for us to understand how things work at first hand and think of how to resolve the problems he puts in our way.
    Normally the programs that are given to us in that subject are strictly mathematical, like making sequences, mathematical algorithms and such. We do that until cycles. Then from vectors up we program things like tic-tac-toe lottery, saving files in data-structures. You know the 101.

    In the next C subject things get a little more dificult. We can use debuggers and helpers and we're basically on our own. We create our own libraries and such. I don't know exactly since I'm not making that subject this semester.

    But this is how things work. I myself don't agree much about how they teach us the programming 101 in our uni, I think it's a huge impact and the regent is a jackass if you ask me.
    Reply With Quote Edit / Delete Reply Windows 7 Portugal Show Events Dumb Dumb x 3 (list)

  36. Post #36
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    That's weird. The book I use mentions #define as a non C command, just an order for the pre-processor to expand an instruction that you want to repeat throughout the code.
    The preprocessor is part of what makes up the C language. There's not much more to it than that. You don't end comments by ';' either, they're still defined in the C programming language.
    But this is how things work. I myself don't agree much about how they teach us the programming 101 in our uni, I think it's a huge impact and the regent is a jackass if you ask me.
    Yeah, no offense but teaching people how to code without debuggers is insane. It's not representative of real programming and only teachers you how to guess what happens in your code rather than see what really happens (Guessing won't detect memory corruption, a debugger will). Seems like they want to teach you how to do more with less but they end up doing the complete opposite in the process.

  37. Post #37
    kill yourself
    Protocol7's Avatar
    June 2006
    25,716 Posts
    Debugging for me is an integral tool for problem solving. It's much better than going "WELL WHAT'S WRONG WITH MY CODE SOMEONE LOOK AT IT"

    I can just set a breakpoint, find the offending line and make an educated guess why it's blown up.

    Edited:

    I can't count the amount of times I've been in the "What do you need help with" thread and seen a problem that was just like "use a freaking debugger, that's what they're there for"
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  38. Post #38
    Gold Member
    Catdaemon's Avatar
    February 2005
    2,821 Posts
    I can't count the amount of times I've been in the "What do you need help with" thread and seen a problem that was just like "use a freaking debugger, that's what they're there for"
    Using a debugger and understanding what it tells you is a skill in itself. I wouldn't expect beginners to be proficient with it, especially not with C/C++.
    Reply With Quote Edit / Delete Reply Windows 7 Show Events Agree Agree x 2 (list)

  39. Post #39
    kill yourself
    Protocol7's Avatar
    June 2006
    25,716 Posts
    Using a debugger and understanding what it tells you is a skill in itself. I wouldn't expect beginners to be proficient with it, especially not with C/C++.
    I know, that's why I try to get people to use em.

    Teach a man to fish and all that
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1Friendly Friendly x 1Winner Winner x 1 (list)

  40. Post #40
    T3hGamerDK's Avatar
    January 2011
    2,551 Posts
    Using a debugger and understanding what it tells you is a skill in itself. I wouldn't expect beginners to be proficient with it, especially not with C/C++.
    A skill that saves more manhours than I can even count.
    Reply With Quote Edit / Delete Reply Mac Denmark Show Events Agree Agree x 2 (list)