Thread: New C++ tutorial for beginners - opinions wanted!

  1. #61
    Registered User
    Join Date
    Jul 2015
    Posts
    37
    Quote Originally Posted by Elysia View Post
    There's no point talking to a wall, obviously.
    And you cant find even one, even one book or tutorial that goes according to your suggestion. But you want me to follow your advice.

  2. #62
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    I just checked out a page at random.

    Quote Originally Posted by From-Your-Link
    By doing this, the statement '5 + 3.14;' has been made a part of a so-called function 'main'. This so-called function makes up the main (and in this case, the only) part of our program. But what does all of this mean? Or, to be more precise, what is the meaning of the program that we have just written?
    Why are you referring to main as a "so-called" function? While not necessarily the wrong usage of that phrase, it tends to convey an ambiguous negative impression that might be confusing to some readers.

    Quote Originally Posted by From-Your-Link
    However, what is the meaning of a semicolon symbol? In addition to being a way to terminate expressions and mark the end of a statement, it instructs the reader or the executor of the program to discard the value of the expression preceding it.
    This paragraph sounds wrong. Someone new to programming might take that to mean: "When you see a semi-colon, that means the value of the expression before it is discarded".

    You should be more clear about the fact that the value of the expression is discarded in that example because it is not being stored anywhere (which you get into a bit later), not because of the semi-colon.

  3. #63
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Kevin C View Post
    And you cant find even one, even one book or tutorial that goes according to your suggestion. But you want me to follow your advice.
    It's not even worth talking to you. Goodbye and welcome to the ignore list.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #64
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by Kevin C View Post
    And you cant find even one, even one book or tutorial that goes according to your suggestion. But you want me to follow your advice.
    Fair enough. Most tutorials and books exclusively teach the use of the [] operator, but why, when offered an option that guarantees safety, would you ignore it, and refuse to teach it? Refusing to acknowledge something that is objectively and demonstrably better, for an overwhelming majority of cases shows nothing but a stubborn nature on your part.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  5. #65
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    Quote Originally Posted by Kevin C View Post
    The C++ language has native arrays, and they are terrible, at least for beginners. "std::vector is an array" - is close enough.
    erm..., i disagree with that one... saying they are both ways of containing data is close enough i'll grant that. And as for being terrible for beginners, I think they are a fundamental concept that aids understanding of the higher level types. Using them dynamically is harder sure, but the static allocation and access is so graspable before feature-rich containers come into a beginners picture.
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  6. #66
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by rogster001 View Post
    ...I think they are a fundamental concept that aids understanding of the higher level types. Using them dynamically is harder sure, but the static allocation and access is so graspable before feature-rich containers come into a beginners picture.
    That depends on the individual. Some don't care or grasp basic underlying concepts that are close to the hardware. Nor should they have to. An array should fulfill its function while exposing a rich, useful interface. That's std::vector and std::array in a nutshell. C arrays are dangerous and inherently low level.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #67
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    in the chapter on for loops, you used a double for the loop index.
    massive no. not good idea
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  8. #68
    Registered User
    Join Date
    May 2010
    Posts
    4,633
    I'm open for suggestion. Suggest me a better way for beginners to avoid silently introducing an error into their program without using at(). I'm listening.
    Perhaps "extending" the vector and string classes to provide rudimentary bounds checking as done by Stroustrup in Programming Principles and practices using C++?



    Jim

  9. #69
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    No one is ever going to do that. If everyone tried to provide helper functions for functions such as strcpy, et all, then much of the evil in the world wouldn't be here. Programmers are just too lazy to do that.
    Besides, how is this different from using at(), which does exactly this anyway?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #70
    Registered User
    Join Date
    May 2010
    Posts
    4,633
    Besides, how is this different from using at(),
    Because you wouldn't need use at() to have an exception thrown when using the array notation.

    And I'm not talking about programmers, I'm talking about our Tutorial Writer supplying a header file to be used with his tutorial.


    Jim

  11. #71
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    I really dislike the tutorial. For someone who wants to explain things so much better and change the way things are taught, you sure are going down the well-trodden path. I'm not really sure what is so different; you are just taking a lot, lot longer to explain things.

    Why aren't we programming anything cool? You have all these beautiful pictures of fractals and stuff. Teach around a nifty project like drawing a fractal - just as a suggestion - because one of the things that make programming worth it is doing something gratifying.

    I hate to be so down on it but do you really want people to learn something useful or not? I doubt we'll get people who can do better than this at the current rate you're going:

    10 PRINT "THIS IS MY COMPUTER, HEAR ME ROAR"
    20 GOTO 10

    There are plenty of places doing EXACTLY this in simpler languages than C++, and people are against that, too. Why are you different?

  12. #72
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    Its cool that you took this task on, to create the tutorial, and you hold your corner well, must have took a lot of dedication. but I feel it may have been done without any peer review as you wrote? And now a lot of holes appear when presented completely.
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  13. #73
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    "Ugly syntax" is subjective, but the number of characters isn't. Two characters for [], 5 characters for .at().
    Wait, using at() is an ugly syntax? Seriously? I think it's very intuitive.

    Trying to write code using as few characters as possible is a bad way of coding. Use as many characters as is required to make code readable by another human being. The word "at" is very intuitive for humans (or at least for me). It makes sense that I'd try to find the value of a vector at position 5 or 10 or whatever I choose to type in.

    The fact that it throws an exception is even better.

  14. #74
    Registered User
    Join Date
    Jul 2015
    Posts
    37
    It appears that there are some very rude and stubborn people on this forum, so I have decided to have a conversation only with people who are polite. Also, I will be responding only to well-meaning comments and questions, and I also do not want to be dragged into a discussion with close-minded people.

    Matticus: If you rise above the C++ perspective and think about programming languages in general, then ‘main’ is, generally speaking, not really a function, because it is not pure. It can be called a procedure or subroutine. This is mentioned in the tutorial only to instill some interest into the reader. The procedures will not be mentioned until the tutorial talks about graphics, in a much later chapter.

    About discarding the value of the expression, I think that if you continue reading the tutorial there can be no such doubt as you are suggesting.

    Elkvis: .at() is slightly better than operator [] with debugging checks, but the price to pay is huge. Consider:


    • it’s three more characters, which does make a difference to a beginner
    • It is different from the way other common programming languages do it
    • It is different from the way that C++ programs and other tutorials usually do it. The beginner who was instructed to use .at() will not know about the operator[]. Then, in fact, you have to teach both ways and explain the difference. And then, in order not to confuse the beginner, you will have to choose again to use mostly one or the other. And then you went nowhere.

    It is out of the question.

    rogster001: Native arrays? This is a high-level tutorial. Low level stuff should not be in a tutorial for beginners. There was already a discussion before about using the word ‘array’ for vectors, and the conclusion was that vectors satisfy the requirements of array abstract data type.

    whiteflags: I compared the pace of progression of my tutorial to other books and tutorials. Word-for-word, I am about 20% faster to arrays, functions, sorting. In general this tutorial is faster. This is at the expense of removing all the unnecessary details that burden other tutorials and books.

    We are not programming anything cool because so far the tutorial has progressed only to arrays, which would approximately be at the page 80.

  15. #75
    Registered User
    Join Date
    Jul 2015
    Posts
    37
    Elkvis: about .at() again, it does make sense to use it in a tutorial for people who already had some exposure to programming. Since at least 50% of the other C++ tutorials actually go too fast, and they are appropriate for such an audience, it would be ok for them to use .at(). But those tutorials are not for total beginners, in spite of what they claim.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Researching C++ - Your Opinions Wanted Here!
    By McCrockett in forum C++ Programming
    Replies: 2
    Last Post: 11-08-2012, 09:38 AM
  2. Storing position/velocity of agents -- opinions wanted
    By Ocifer in forum C++ Programming
    Replies: 11
    Last Post: 02-03-2012, 04:06 PM
  3. Expert opinions wanted!
    By MK27 in forum Linux Programming
    Replies: 8
    Last Post: 11-01-2011, 10:14 AM
  4. Beginners Contest #2 For those who wanted more!!
    By ILoveVectors in forum Contests Board
    Replies: 16
    Last Post: 08-12-2005, 12:03 AM
  5. Opinions Wanted
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 03-04-2002, 09:56 AM

Tags for this Thread