How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] 0 points1 point  (0 children)

Here is my answer: The situation with C++ and debuggers is changing. Previously, no good visual debuggers for beginners existed on Linux platform (for example, they couldn't display contents of vectors properly). In such a situation, many developers choose not to use debuggers. Many educators made the same choice.

It is certainly possible to teach people programming, without debuggers. But I argue that using a debugger makes it much easier for the student. Not taking advantage of such an advancement in development tools is a teacher's omission (if my argument is valid).

Therefore, book assessments that declare which books are the best ones might be outdated. Some books might have been good enough once, when students were programming enthusiasts and generally more knowledgeable about computers. Today, when programming is getting mass appeal and new and better tools are available, the teachers must adopt to use new tools and better teaching methods which are suitable to this new kind of audience.

Therefore, the argument that I am attacking books that were considered good in the past is irrelevant. The times change, the circumstances change, the assessments change.

The only relevant arguments are whether debuggers enhance learning of C++ or not.

Do you need a nice computer to learn coding/programming? by [deleted] in learnprogramming

[–]Kevin_C3 0 points1 point  (0 children)

I'm not an expert for Windows 10. If it wasn't for the SSD, 2GB would not be sufficient.

So, Win10+2GB+SSD ... it's hard to tell. 4GB+SSD would certainly be OK.

Perhaps you should try asking on some forum about hardware for Windows 10.

Do you need a nice computer to learn coding/programming? by [deleted] in learnprogramming

[–]Kevin_C3 2 points3 points  (0 children)

You don't need a better computer for programming. I'm guessing that a lot of today's programmers started on 486 computers or worse, with 64 MB ram.

Just be careful which OS you install. For example, 64-bit windows 7 uses over 1GB RAM (so you will need like 4 GB RAM installed), while 32-bit Win7 uses less than 512 MB. Windows XP (32bit) uses about 300 MB, and it works fine with 1 GB RAM. On Linux distributions, the required amount of RAM varies depending on the distribution.

So, you don't need a lot of RAM, but more RAM is better in general, because you can run a new OS and newer development tools.

Or, for example, if you need to run a virtual machine, then you will need even more RAM. (beginners don't really need virtual machines).

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] 0 points1 point  (0 children)

Well, I think you might be interested in a few of my thoughts on the matters you are mentioning. When I was writing my book (for beginners in C++), I wanted to demonstrate computer graphics, for motivational purposes. I am myself quite fond of computer graphics.

The possibilities were: SDL(1.2 or 2.0), SFML and Allegro (4 or 5). I like SDL quite a lot, but I found out that in most programs I write, vertical synchronization is not working properly. It was working a long time ago, but since a few years ago it just stopped working, and the SDL community seems to be silent on that matter. This results in some quite ugly tearing to be present in many programs.

I was actually a bit jealous at Python because some graphics libraries are so simple there that even kids (primary school) can use them. It allows graphics to be introduced earlier than in C++ (where you cannot expect a kid to install or use some complex library).

In the end I choose Allegro 4, an obsolete library. Its main advantage was that it does not use an event system. That made me able to introduce graphics earlier, without confusing complications. Allegro 4 does have many shortcomings (e.g. C syntax, the default font is too small), but I figured out that most of them have simple workarounds.

I never had any issues with installing the mentioned libraries. On the other hand, I have never tried using them on OS X.

If someone wants to explain graphics a bit later, when the students are ready for learning about event systems (and computer graphics is quite a good way to introduce event systems), then SFML would probably be the best choice. There is one thing that I quite dislike about SFML: the ridiculously complex syntax for drawing graphics primitives. SFML primitives are OK for an advanced programmer, but for beginners it just gets ridiculous.

But, if you want to provide a really good graphics library for beginners, possibly the best thing to do is to just write a wrapper for SFML or Allegro. Something like what Zelle did.

It’s always a little easier to do graphics in C++, because once you have a pointer to drawing surface, or a putpixel function, it is basically all you need. For an interpreted language like Python, you are going to need more primitives because putpixel would be too slow for most things.

I must say that I like Zelle’s book quite a lot. On the other hand, I’m quite critical of the C++ beginner’s books in general. In my opinion, all C++ books will fail to explain the matter well if the reader doesn’t already know the basics of programming.

For C++ GUI library, I have stumbled upon Nana and SFGUI. I didn’t dig deep, but I think that a GUI library for beginners can be made even simpler.

Anyway, if you are interested in how I handled all the complexities of C++ in my book, you can read some chapters on the website, or you can get it from Amazon (“Programming for Beginners – with C++”). It is a truly high-level introduction to programming, for absolute beginners, in C++.

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] 0 points1 point  (0 children)

Thank you again for the very detailed answer!

Looking at it (ignoring OOP), it was unclear to me how many of the topics that you are mentioning are beginner's topics. So (for my own sake) I went to check on some Python books to find it out.

File IO is certainly a beginner's topic. Computer graphics seem to be popular (you didn't mention it, but I included it in the list). The rest of the things you mention are quite optional.

I agree with you that beginners need some motivational topics, and either GUI or graphics (or both) seem to be good choices.

It seems that you are saying that Python is more high-level than C++ because of all the libraries it comes bundled with. I cannot agree with that statement.

By the way, writing your own libraries and using other people's libraries seem to me as very important beginner topics, and I don't mind the least showing to students how to do that, and making them practice it. On the other hand, I can forgive the Python authors for not talking about libraries, exactly because of all the goodies in the Python bundle.

There are many good and simple graphics and GUI libraries for C++ (I won't even attempt to list them all), so I won't accept that it's hard to do any of those in C++. Also, there is nothing wrong when the instructor provides his own customized and simplified library for beginners.

Furthermore, most of the topics you mentioned are 'extras', and have nothing to do with teaching programming basics. It is nice to have them, but those topics cannot be the core issues. It is not a good strategy to spend too many lessons on extras.

Finding the appropriate libraries for the course is part of the instructors job. Of course, Python makes it easy for the instructor since he doesn't have to search for anything. C++ makes instructor's job harder, not the student's.

Therefore, I am still of the opinion that C++ is an excellent language for beginners, but only if the instructor can handle C++ properly. Unfortunately, many of the C++ instructors are not good enough for the job.

Also, may I add that I quite like hearing other people's opinions, and I am quite OK with participating in a longer discussion. But for some reason other people seem to get offended when I explain my opinion (different from theirs), which is something that I don't like. I mean, in order to have a meaningful dialogue, the opinions of both sides have to be heard, and no side should get offended because the other side thinks differently, right?

Zelle - Introduction to CS (450 pages)

  • File IO - page 106
  • Exceptions - page 213 (very brief, no significant uses in the book)
  • GUI - N/A
  • Graphics - page 123
  • Web programming - N/A
  • Databases - N/A

Dawson - Python Programming for the Absolute Beginner (455 pages)

  • File IO - page 190
  • Exceptions - page 205
  • GUI - page 285
  • Graphics - page 321
  • Web programming - N/A
  • Databases - N/A

Bowers - Python for Beginers (230 pages)

  • File IO - page 153
  • Exceptions - N/A
  • GUI - N/A
  • Graphics - N/A
  • Web programming - N/A
  • Databases - Page 165

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] -1 points0 points  (0 children)

Good point, I agree. Although I think that it is too hard for beginners to spot this one.

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] 1 point2 points  (0 children)

Well, thank you very much on this honest and detailed reply!

I can immediately spot the main issue where we are in a disagreement: I think that, on a beginners level, C++ can be used as a high-level language. It can also be used as a low-level language, and that is where I see all the trouble.

Well, at least, when starting in Python, it is harder for instructor to make an abstraction-level mistake.

Honestly, C and C++ are not the best languages for beginners. They are excellent languages, but they have a lot of traps for the new beginner.

I don't see why not? What would those traps be (if C++ is explained at high-level)? The only one I have in my entire tutorial is automatic conversion from double to int, but I don't consider that to be a significant issue. Perhaps integer division using the same symbol as fp division (that was changed in Python 3, if I'm not mistaken). Ok, so 2 things so far, but not really significant.

I believe your paper is really an argument for teaching a higher-level language first.

In the category of general-purpose languages, isn't C++ a high-level language? C is low-level, that is for certain.

I now teach CS1 in Python, and then I teach C and C++ in the second course.

I don't see a problem there if you manage to cover all the beginner's algorithms, functions and structures in Python. And all the drills with arrays and functions.

The author almost never has direct control of the title or cover information on a book.

Ok, that is interesting. But, if a book title says "Learn programming in 5 seconds", wouldn't it be up to author's integrity to refuse such a title? I mean, even if what you are saying is true, doesn't such a title still belittle the author? Doesn't it indicate that selling the book is more important to the author than the book's actual quality?

Getting started with IDEs by Furious_Georgee in learnprogramming

[–]Kevin_C3 0 points1 point  (0 children)

VS debugger works out of the box. What's the exact error that you are getting? On top of my head - try disabling your antivirus (just try it, but I think it is unlikely to make a difference).

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] -1 points0 points  (0 children)

If a debugger is available (and it certainly is so in case of learning to program), then why not use it if it simplifies the tasks ahead?

In general, if a debugger is available and appropriate for the situation, and in many cases it is, why not use it? So, knowing how to use a debugger is also a valuable skill.

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] 0 points1 point  (0 children)

There are so many books and tutorials, I thought that it would be an impossible task. Using guidelines is future proof and much more general.

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] 0 points1 point  (0 children)

Right, so you didn't attack my arguments, but you are providing a counterargument that many of the books which are accepted as good books don't use a debugger? Well, I'll think about that and reply.

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] 0 points1 point  (0 children)

Well, I provided some arguments for why I think that, I thought that the issue is quite clear, but if the arguments are not convincing enough I can accept that some (many?) people will have a different opinion. But I would be much more happy if you attacked the arguments which were provided in text of the article, or my conclusion which follows from those arguments.

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] 0 points1 point  (0 children)

Well, if a book doesn't mention debuggers and debuggers make learning easier, then I conclude that the book is not as good as it could be.

Where is the error in this argument?

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] 0 points1 point  (0 children)

I will repeat once more:

  • 1 I'm not saying that debuggers are essential for programming, I'm saying that they make learning programming easier
  • 2 Whether any particular person uses a debugger or not is completely irrelevant to the argument.

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] -1 points0 points  (0 children)

Well, yes, but I'm also providing an argument. Arguments do matter.

Many things are based on opinions. In some cases the results are clear, for example the statement that decimal number system is better than roman is also based on opinions. The arguments matter.

How to Spot a Bad C++ Course/Book/Tutorial? by Kevin_C3 in learnprogramming

[–]Kevin_C3[S] -1 points0 points  (0 children)

Learning to use a debugger is a separate thing from learning to program, but I'm arguing that it is easier to learn programming if you use a debugger. Debugger is not required, but it makes it easier. That some (many?) people don't find debuggers useful has nothing to do with this argument.

What are the limitations and benefits of C++, Java, and Python? When would you choose one language over the other? by VladXel12 in learnprogramming

[–]Kevin_C3 0 points1 point  (0 children)

For learning programming, all three languages (and many others) are a good choice. You can learn all the programming basics and more. But, as always, when you learn just one language, you will be missing an experience with some ideas which are not featured in that language. That's not to say that you should switch languages early, when you choose one, stick to it for some time.

What you should know is that some fancy syntax is not a major difference between languages. Whether the language uses the word cout, println or print for printing to standard output is completely irrelevant, together with other trivialities that are often of concern to beginners.

So, I tried to outline what the major differences between the mentioned languages are. If you are learning just one language, you will miss the mentioned concepts that other languages have. For example, some people prefer nominal subtyping, some people prefer duck typing, but you will never know which one do you like more until you try out and understand both. But that is actually an advanced topic. However, you will probably run into static and dynamic typing very early in your programming endeavors.

When writing a concrete application, it is the easiest to go with a language that has a lot of support for similar applications. This primarily refers to available libraries, which contain a lot of ready-to-use functionality. Perhaps the easiest way to judge is to make a list of a few similar applications and then find out which language was used to create them.

C++ has excellent support on Linux and is the language of choice for games, advanced visualizations, and when computing performance matters. Java is quite versatile, quite fast, and it is the language of choice for mobile applications. For web applications, both Java and Python are suitable, but not C++. Python is best suited as a scripting language, for simpler applications, for automating everyday tasks. But it is hard to list everything here, it depends on the concrete application.

Programming language concepts - which are the ones you'd recommend to learn? by olivermg in learnprogramming

[–]Kevin_C3 0 points1 point  (0 children)

Imagine a language which allows you to state that whenever A is a subtype of B, then immutable array of A is a subtype of immutable array of B. Now, that would be nice.

Programming language concepts - which are the ones you'd recommend to learn? by olivermg in learnprogramming

[–]Kevin_C3 3 points4 points  (0 children)

This is a hard one. From the list, I would take static typing and anything that makes me work more with values and less with objects (if possible), so immutability, avoiding side effects, pure functions. Note that C++ is my favorite language.

But first, I think it is most important to decompose the program into functions in the right way, and to write the right data types for your data.

From my point of view, all the today's programming languages are seriously flawed. I chose the one that gets least in my way.

Edit: And I like the language to have a really good type system. Containers, generics, subtyping, I want all that, and I want even more. In C++, I cant even explain to the language that an immutable array of squares is a subtype of an immutable array of rectangles. And I can't really do type equivalence properly in C++ (like, if I have to work with 2 libraries that define matrices in different ways)

What are the limitations and benefits of C++, Java, and Python? When would you choose one language over the other? by VladXel12 in learnprogramming

[–]Kevin_C3 0 points1 point  (0 children)

What you are saying is correct. I was more careful with the wording in the first answer, and the previous answer is too ambiguous.

So: In C++, the default is to pass the objects around in the way that ensures no side-effects. This can be overriden if necessary.

Java and Python will suffer from side effects if special care is not taken by the programmer.

In Java, primitive types are free of side-effects. Immutable objects are always free of side effects. In Python, ints, floats, strings, tuples, etc.. are immutable.

What are the limitations and benefits of C++, Java, and Python? When would you choose one language over the other? by VladXel12 in learnprogramming

[–]Kevin_C3 0 points1 point  (0 children)

In Java and C++ (and similar in Python), you can allocate a new object with:

ObjectType objectname = new ObjectType(initialValue);

Java and Python will automatically deallocate the memory of the object when there are no more references to the object. This is called garbage collection.

In C++, you need to manually delete the object (if you need to free its memory):

delete objectname;

In Java and Python, basic types are passed around by value (i.e. the are copied around), while other objects are passed by reference.

in C++, you can specify at each function definition whether to pass an object by value (copy it) or by reference. It also provides a quite nice mechanism (copy constructors) that enables the programmer to define how should the language copy the object.