r/programming • • Mar 13 '17

Teach Yourself Computer Science

https://teachyourselfcs.com
56 Upvotes

22 comments sorted by

14

u/kamatsu Mar 14 '17

The Dragon Book is frankly not good. Stop recommending it. There's also a lot more to PL than just compiler implementation (although that is a very important area!).

There is little actual theoretical computer science here: no automata theory, complexity theory, computability theory, theory of model checking or programming languages, type theory, verification, concurrency theory, process calculi etc. etc.

I think these things are far more fundamental to computer science than various applied technology topics which feel more fundamental to software engineering.

2

u/mrkite77 Mar 14 '17

There is little actual theoretical computer science here: no automata theory,

Maybe it was dropped in the newer versions but I own the first edition of the dragon book and there is definitely automata in it.

The dragon book also has the best explanation of dfas and nfas that I've ever seen.

3

u/sylian Mar 14 '17

Hmm I'm self studying CS as well and I was about to move into Dragon book, so which book is better than it?

It is still the recommended textbook for Stanford and MIT.

Also I need a real good book on Concurrency and multithreaded programming, I really need to ace it for my personal project, any recommendations?

3

u/kamatsu Mar 14 '17

I second Andrew Appel's book.

For the Concurrency aspect, I would recommend a few books, but one book that I think is quite nice introduction to lower-level aspects of it is Ben-Ari's Principles of Concurrent and Distributed Programming.

0

u/[deleted] Mar 14 '17

[deleted]

3

u/pdp10 Mar 14 '17

Modern Compiler Implementation in Java (or C, or ML)

I guess this is the kind of title you need today to ensure a broad audience from among boring Java schools, traditionalists, and type theory hipsters. :)

3

u/oxalorg Mar 14 '17

Or perhaps a book written with students of 201X in mind, instead of 199X?

1

u/pdp10 Mar 14 '17

Other than the popularity of teaching Java (arguably a derivative of C++) since the late 1990s, how would you judge the students are different?

6

u/ronniethelizard Mar 14 '17

How hard is recursion to understand? I had no problem with it, but see lots of comments about how it tripped people up.

Is it because a big deal is made of it and so people think it is difficult?

I could see it being an issue if the compiler tries to allocate space statically for a function rather than on the stack, but that would also cause problems in multithreaded code (unless you could absolutely guarantee that no 2 threads will be in the same function at the same time).

Edit to clarify, one of the things in the linked article talks about recursion.

18

u/danogburn Mar 14 '17

I had no problem with it

Well aren't you special

6

u/Lanza21 Mar 14 '17

Meh, it's a fair question. For some reason there are a LOT of terrible explanations out there.

7

u/[deleted] Mar 14 '17

I found the mathematical explanation far easier to understand. Is it just me, or is compSci, unnecessarily complicated? It looks like we value jargon and fancy words over clarity.

3

u/MiserableFungi Mar 14 '17

Maybe you lack perspective. Have a go at letting a lawyer communicate the same thing.

1

u/pdp10 Mar 14 '17

I can see why some think so, especially if they're more comfortable with equations than natural languages, but it's the semantics that let us communicate regardless of whether the subject is lambda calculus or "xorq $63, %rax".

Remember, the two hardest things in computer science are naming things, cache invalidation, and off by one errors.

3

u/IsADragon Mar 14 '17

When I was taught recursion I did not have a clear understanding of the stack and that recursion was being put on a stack. So it felt unintuative to me that I could just keep calling into the function when up to that point my concept of a programming was that programs were quite linear, since up to that point everything we had done in labs was pretty linear. So I had to get over that misinterpretation of what was happening at run time first.

2

u/[deleted] Mar 14 '17

There is a number of platforms where recursion is absulutely impossible (read - everything is inlined). E.g., all the modern GPUs.

2

u/joequery0 Mar 14 '17

I had to read an entire book focused on recursion before I really understood it. Its called Thinking Recursively. It just didn't click with me like it does for people like yourself. Sorta how like it doesn't click with you how people might struggle with it.

1

u/DonnyTheWalrus Mar 14 '17

I'm self taught, and my first intro to comp sci concepts came from MIT'S 6.00.1x on edX. Note that I like math and did very well in it through single var calc but did not study any higher math in uni.

My first time through, I bailed out at recursion. The concepts up until that point had been fairly straightforward, but I had zero grounding in real programming principles. Up to this point my view of programming was of a "flat" nature and everything about how code was executed seemed like magic.

The explanations at first (fib, factorial, etc) were simple and easy to understand. It seemed to just be a weird way to emulate a loop. Then we tried the towers of Hanoi problem, and that's where I got lost. I kept hearing "base case, and the general case" but how those things were supposed to fit into the practical world of entering code into a source file just didn't make sense.

I took a break, studied some inductive reasoning and logic, worked on my general coding abilities -- then retook the course. This time a light bulb went off, and almost immediately it just made sense.

I think it just takes time to learn to engage in a recursive thought-framework. It's not something that most people utilize at all in their daily lives. It's probably also different depending on your perspective when you learn it -- are you a newbie learning in Python where the idea of a call stack often isn't ever mentioned, and the whole way programs actually work is left as dark magic? Or do you start at a lower level with an understanding of what the stack is and what actually happens during a function call?

2

u/3brithil Mar 14 '17

I just started learning CS last semester, can I get some more opinions on the books and courses mentioned in the video?

I've heard of some of them before and it seems well thought out, but I'd love to get a second opinion.