Good quality learning resources for programming and algorithms?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Good quality learning resources for programming and algorithms?

harmonics
I would like to work through The Elements of Computing, but I will likely need to do some other work first.  My current knowledge and skill in programming is very basic and spotty, and so I am relearning C at the moment (more completely).  Is C a suitable language for working through the book?  It seems like I ran across something mentioning that a requirement for working through the book is prior experience with an object-oriented language.  Is that correct?  If so, then I would need to first learn an object-oriented programming language and the relative programming principles involved.

And I noticed that it is stated in the FAQ:

Is the course suitable for non-CS majors? Yes, as long as the students can program in some modern programming language. In fact, if you wish to learn or teach a mini CS program, we propose the following three-course sequence: Intro to CS (in either Java or Python), Algorithms, and Nand to Tetris. This sequence gives a hands-on overview of most of the important ideas and techniques in applied computer science.

I am very interested in doing the sequence mentioned above.

I have previously looked at many Python books and partially worked through some of the highest rated ones, and I felt that the educational content of those books was fairly poor in teaching programming principles.  Is there a well written book for learning programming using Python out there that the authors of The Elements of Computing  have read and can recommend?  Is there also a recommended book for learning Algorithms?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Good quality learning resources for programming and algorithms?

harmonics
I ran across an ebook on object-oriented programming using C.  Maybe working through it after finishing my current books on C would be sufficient.  The book is here:  https://www.cs.rit.edu/~ats/books/ooc.pdf
Reply | Threaded
Open this post in threaded view
|

Re: Good quality learning resources for programming and algorithms?

WBahn
Administrator
In reply to this post by harmonics
Any programming language can use and many people have done it in C.

The APIs that are given by the authors are written from an object-oriented perspective and are a much more natural match to languages such as Python or Java.

One way you might approach it is to first learn C and how to develop and implement algorithms in it and then use the N2T projects as a means to learn Python or Java. The algorithms needed for the first couple of projects are sufficiently tame that you can focus on learning the new language fundamentals while you do them.

Reply | Threaded
Open this post in threaded view
|

Re: Good quality learning resources for programming and algorithms?

ivant
In reply to this post by harmonics
The first part of the book (hardware) doesn't require any programming experience.

For the software part you can use a language of your choice. If you don't already know some language, then I suggest starting with Python and using it for this project. IMO C isn't that good of a choice in this case. It requires manual memory management, its string utils are lower level and harder to use, and you'll have to find (or write) a hash table implementation when you need one.

Incidentally, I think you'll be able to learn C much easier after your work through the course. Jack, the high level language developed in the course, is quite similar to C, even though it's meant to look more like Java. And having some assembly language experience will definitely help as well.

Also, learning different types of languages will make you understand what is fundamental part of programming and what is just the language's idiosyncrasy.
Reply | Threaded
Open this post in threaded view
|

Re: Good quality learning resources for programming and algorithms?

harmonics
This post was updated on .
Wbahn, that sounds to me like a good way to approach it.

ivant, my issue with starting with Python is nothing to do with the language but rather, the lack of a solid beginner programming book.  I have tinkered with C and C++ over the years, and there are some very good beginner programming books for those languages.  And I am just now comitting the time to properly learning C, filling in holes and moving beyond basics.  Last year a young family member became interested in programming and was looking for a good beginner programming book using Python.  I thought that was great, and so I began looking at the popular beginner Python books, skim reading them, and working through parts of the more promising ones to get a better idea of the educational quality so that I could recommend a book to start with.  Surprisingly, all of those books (around 10 of them) fell very short of teaching good beginner programming principles, most often jumping way too early into object-oriented programming and using third party libraries after only having barely touched on some fundamental programming principles.  That seems backward to me for teaching programming.  Those  books seem to be much more about how to perform tasks with scripting rather than teaching fundamental programming principles.  And so it seems to me that while C is tougher to deal with than Python as a beginner, the educational quality of the better beginner programming books for C is far higher than the same for Python.  And working with C as a beginner isn't that much more difficult.  It just requires significantly more patience in the beginning before getting down to doing useful things than is the case for Python.  But of course, if someone knows of a solid beginner programming book using Python (that you have read through and can vouch for the educational quality) I am would like to know about it.

I did recently run across a beginner Python book titled, 'Python Programming: An Introduction to Computer Science, 3rd Ed.', that on the surface looks like a better beginner book than the others I have looked over.  But I haven't had time to give it a good  check over yet.  But just quickly looking at reviews, it seems that it will be much the same as the other beginner Python books I have looked over.  Here is what one reviewer had to say about it:

I am sorry, I just do not think this is great as a CS book. While the first few chapters give you a good start, it gets pretty bad towards the end. In spite of its claim (or at least one reviewer's claim) that this is a Computer Science text book disguised as a Python book, it really is more of a Python book. It introduces string processing and even the Python graphical toolkit before introducing "if". While there are some who suggest the book can be read out of order (I disagree on that though), I still think this is a very poor choice of arranging the book. While nicely-formatted text output and pretty graphical things may be rewarding for some people, a real CS book should focus on things like "if", "switch", "for", "while" and similar before introducing "pretty" things, regardless of how the book can be read.

Half of the exercise programs in the book are like "Go back to the program you did in Chapter X and redo it using the Y statement". It would be much better to learn both computing and Python if one were given many different situations to use it in, instead of just adding another feature to the same few programs every chapter.

While Zelle has an excellent idea (Python as a first language, and language for teaching CS), this book was poorly executed. If Zelle would rearrange the book so that graphics and strings would be last or even not included and start only with the basics (operators, decision structures, functions, loops) and give better exercises, this book would get 5 stars. He does a good job of communicating the subject matter, but needs to think a little more about when and where to communicate it.
While it does seem to me that Python could be a great beginner programming language, it's hard to imagine it being so without good educational materials for learning programming with it.

What I think I may end up doing (for lack of a quality beginner Python book) is following Wbahn's recommended order of C, implementing algorithms in C, and then moving onto an object-oriented language.  But ironically, the object-oriented language will likely be C++, simply because I have an excellent beginner programming book using C++ (Stroustrup's Programming Principles and Practice using C++).  I have already worked through nearly half of that book in the past (short of the chapters of working with a graphics library), and it was an excellent learning experience.  But I also felt that I should head back and get a good command over C first before going further into the object-oriented stuff and come back to that book later, which is where I am at now.
Reply | Threaded
Open this post in threaded view
|

Re: Good quality learning resources for programming and algorithms?

WBahn
Administrator
While I tend to be of your general mindset, harmonics, I'm aware that it is primarily because it is the way that I learned things and, more to the point, how I learned to learn things. Learn the fundamentals and build from there. But it's not the only way and, especially for many of the folks in today's generations, is often NOT compatible with how THEY have learned to learn things. For many of them it's all about being able to do something "real" as fast as possible and then building upon that, all within the context of being able to do more sophisticated "real" things. The fundamentals are learned as a consequence of being needed to do those things, instead of the foundation upon which doing those things are based. Seems backwards to me, but it is a viable approach and is better matched to today's learning styles which tend to be pretty impatient.

Python tends to take this to extremes because it has become a scripting language used by people who are not interested in knowing anything about computer science or those fundamentals -- they are only using it because they have some "real" thing that they want or need to accomplish and they want the shortest path to accomplishing that goal.

I personally found this very frustrating when I learned Python (or even C++, to the limited degree that I have learned it) because there was way too much magic involved. I could visualize exactly what was going on (at the level I needed to, anyway) with my C code, but couldn't with Python or C++ because I insisted on trying to understand it by understanding what was going on under the hood.

I think learning either language and then doing N2T will greatly aid learning the other, as well as gaining a better understanding of the language you learned originally. Even though I still tend to be a fundamentals-first kind of person, I think the applications-first approach is probably actually the better match. Learn Python from that perspective, using N2T as the "real" thing you are trying to accomplish. Along the way you will learn not only the fundamentals out of necessity, but how the fundamentals work at all levels right down to the hardware. You'll also learn how objects really work which should peel back some of the magic in Python and yield some "Ah ha!" moments. Finally, when you are done, you will have a very solid foundational framework upon which to base learning a language like C, which should then go much more smoothly.
Reply | Threaded
Open this post in threaded view
|

Re: Good quality learning resources for programming and algorithms?

harmonics
Wbahn, learning C in a systematic and patient way is actually going pretty smooth.  Learning it in an impatient sort of way to do something interesting (how I did it before) was what ended me up with a spotty understanding, and it ended up sending me backward for gaining a better understanding.  And I'm not complaining about that.  It is what I want.

If I were to use Python for working through The Elements of Computing Systems, there is still the issue of finding a good book.  I simply haven't found one.  I think I will stay on my path for now.  Reason being, I would much rather learn programming using any language via good teaching than a preferred language via bad teaching.  And I'm just not finding any good teaching for Python.

I appreciate the discussion.  Back to work...
Reply | Threaded
Open this post in threaded view
|

Re: Good quality learning resources for programming and algorithms?

WBahn
Administrator
harmonics wrote
Wbahn, learning C in a systematic and patient way is actually going pretty smooth.  Learning it in an impatient sort of way to do something interesting (how I did it before) was what ended me up with a spotty understanding, and it ended up sending me backward for gaining a better understanding.  And I'm not complaining about that.  It is what I want.

If I were to use Python for working through The Elements of Computing Systems, there is still the issue of finding a good book.  I simply haven't found one.  I think I will stay on my path for now.  Reason being, I would much rather learn programming using any language via good teaching than a preferred language via bad teaching.  And I'm just not finding any good teaching for Python.

I appreciate the discussion.  Back to work...
I've got no qualms at all with your approach. C isn't a language that lends itself to "just learn enough to get my application done."

Another problem I have (had) with Python is the dynamic typing. But I realized finally that it is just a different approach and that my coding style was based on exploiting the strengths and mitigating the downsides of static typing. Dynamic typing is largely incompatible with that, but if you program to exploit it's strengths and mitigate its weaknesses, you are fine.

An alternative to Python is Java -- it's also an intrinsically object-oriented language that fits well with the N2T API descriptions and there are LOTS of good books out there for learning Java that focus on the fundamental programming.