
What I hate about “beginner” programming books   - jsnk
http://allfuzzy.tumblr.com/post/19464639511/3-things-i-hate-about-beginner-programming-books
======
pook
Point #2 is the Little Coder's problem _Why spoke of: a beginning programmer
is likely to be discouraged by the vast difference between the toy programs
displayed in introductory books, and the real code that inspired them.

I think any purported attempt to teach programming which does not end with the
student creating a non-trivial, cool app, is a shame. What went wrong between
SICP and current (non-Hartl/Shaw) beginning texts?

------
zdw
The "worthless example to explain features" in my pet peeve...

This is something like "we're going to have a class named Vehicle" and "class
Car inherits Vehicle" in an OO language.

You would almost never use something like this in a real program, and it takes
what's a minor and problem fraught feature (inheritance) and quickly has new
programmers creating bizzaro hierarchies that never should be.

~~~
turkeygizzard
Forgive me, but I'm really new to programming, and I don't really understand
why your example is something that shouldn't be used in real programming.
Should a Car be a Vehicle object instead of a sub-class?

~~~
driax
The problem lies in that you never have a "Car" which should inherit
"Vehicle". It's a question that never comes up in programming. The bad part of
it, is that it sometimes makes new programmers look for these kind of concepts
in their code, and write class-based code around them. Exactly the problem
<http://pyvideo.org/video/880/stop-writing-classes> discusses.

Basicly it teaches people to think in taxonomies, which is not good for
object-oriented programming since it usually results in highly complicated
code, with way to many classes and inheritance.

Inheritance is mostly good for factoring out common code between different
sub-classes. Or extending library classes in a way that wasn't thought of when
they were written.

~~~
nikcub
I don't think I have ever read a programming book that teaches OO in the same
way that most developers use it - that is implement top level first and then
when you have commonalities between objects abstract them out into parent
objects.

Thinking about and mapping out class hierarchies is something that Java
enterprise analysts do.

A good example to teach OO would be a config parser. Write a config parsing
object, then sub-class for parsing Yaml, INI, XML, etc.

------
iamdave
I'd like to add a 4th one:

Those arbitrary and excessively long introductory chapters that teach you the
history of the language. Granted, that might have some merit in a classroom
setting where an instructor is going to ask you a pointless question about who
designed the first interpreter, but this is the sort of thing that should be
kept to a minimum, or kept out.

Zed Shaw's "Learn to code the hard way" are brilliant for this. They get
_right_ to it, nothing you don't need to learn and get your hands dirty.

------
graeme
I started learning programming in January using K & R. It is a wonderful book
which avoids all of these problems.

It's short. You write challenging programs in the tutorial introduction. And
the accompanying "C answer book" has good solutions for all the exercises.

I also like the fact that each example is a working program. You learn the
concepts by applying them. And the exercises really make you think.

People say its "not for beginners". I actually think it's an ideal way to
start. The "beginner" books are just confusing.

------
nhebb
My pet peeve is books that show the wrong way to do something followed by the
right way. If I'm new to a language, I haven't committed these sins yet, so
please just skip to the preferred method. All this does is add mental
overhead.

~~~
deniska
It seems to be not only programming language books' fault. And not only books'
fault. Even teachers at schools and universities sometimes show wrong way of
doing something.

------
slimdizzy
3: If there are multiple valid solutions to an exercise, list them. If some
solutions are better than others, explain why. If there are solutions which
are technically invalid but commonly thought up by new programmers, explain
what they did wrong.

I would also add a forth point: "Overdoing the 'lol im not like those nerdy
others programmers, im a regular normal person like you' rhetoric. Instead of
mentioning an old cliche (and then trying to distance themselves from it), why
not just not mention it at all?

------
Apocryphon
#1 is a great point and a great recommend. There is certainly a place for
long, ponderous reference book-like tomes, but they are a poor substitute for
concise beginner books. Eloquent JavaScript is amazing in that respect.

~~~
GlennS
I think the right approach would be to print the concise beginner book and
bind it with 1000 blank pages. That way it won't be too daunting for the
learner, but can still perform well in a secondary role as a monitor stand
once they're done with it.

More seriously, I think that the discipline of making a shorter book usually
produces better writing. If you're going to write something longer than say
300 pages (about 1 K&R-length) you'd better have a lot of interesting things
to say.

~~~
Someone
I agree ('the internet' thinks this idea is from Pascal: "Je n'ai fait celle-
ci plus longue que parce que je n'ai pas eu le loisir de la faire plus
courte.")

Problem is that that short book, having taken more effort to write, would have
to be more expensive (paper, printing, distribution, etc. cost 'nothing' for
any book worth anything at all). Selling a shorter book for more money is
possible, but customers typically prefer the longer book ("more is better, and
even if it is not, I just don't read the extra stuff")

~~~
aridiculous
Which is why you have to find the cracks in the inefficient market. Thank god
for passionate individuals not driven primarily by money.

------
ValG
I believe there is a start-up that is gaining traction that is looking to
remedy all of those issues. I can't remember what it's called right now, but
the concept is you learn to program online in an environment that shows you
where the mistakes are and also what the outcomes are to keep you motivated.
Seems like an ideal situation; and frankly it's a little surprising something
like this hasn't come out sooner considering most programmers go through this
sort of pain... Maybe it's seen as a right of passage, if you can put up with
the BS, you deserve to be a programmer?

~~~
ValG
Found it; Codeacademy, <http://www.codecademy.com/#!/exercises/0>

------
tolmasky
I'm no expert, but I think it's possible that the fact that's a book at all
may be a failing. The goal is to get them writing code and seeing results, as
well as mimicking their later real world experience of experimenting to find
the right answer. That's why I think things like code academy better reflect
the way we'll be teaching this in the future.

~~~
evincarofautumn
I’m not sure I agree. Sure, programming is a craft, and the only way to learn
it is to _do_ it. But I see no reason why a book can’t serve as an
introduction, giving the reader projects to complete and guidance toward
completing them. Being that they lack interactivity and mentorship, sure,
books are difficult to make into what beginners need. But just because they’re
not the _best_ medium doesn’t mean they should be completely discounted.

~~~
tolmasky
Let me begin by saying that I don't think books aren't the right approach for
every programmer - simply true beginners.

In my experience beginner programmers get stuck very quickly on very small and
frustrating bugs, such as not understanding how to put together the syntax. If
they can't overcome this quickly, you may completely lose them. This is where
the book completely fails as it can provide no further assistance. Even if the
answer is provided in the printed text, the individual may not "see" the
difference between what they've typed and what the book has printed (it may
take a while to get used to the computer-level of exactness you need when
comparing code, and to overcome some punctuation blindness they may have
developed from normal reading, etc.).

Similarly, I believe it is bad to read too much before doing anything, because
as you read you believe you are following along: "uh huh, that makes sense,
sure, got it...", then a whole chapter in you may actually start coding and
notice you don't really know what's going on (or again, simply think you don't
due to some simple syntax mistake). Now the individual will feel overwhelmed
as they have an entire chapter's worth of material that they may or may not
understand. Even if there are exercises in the middle, people often say "oh
thats easy and makes sense" and skip it since its a "waste of time" (which is
bad, because its very easy to think you understand something when they don't).

Having seen a few people use codeacademy, I now believe that it may need to be
taken a step further: I think for the first few exercises the code should
actually be ghosted so that the user is literally "tracing" over it (as
opposed to the current technique of saying "now type this in the console").
For example, as I described in a previous comment, one person got completely
stuck because it said "Now type variable.length.". The user didn't notice that
the last period wasn't part of the code and unfortunately the error isn't very
beginner-friendly: "Expected an identifier but found '}' instead" -- "what, I
didn't type a }? And what's an identifier?". I believe ghosting the text and
beeping when you type a character that doesn't match can give you a feel for
the code -- its kind of how rewriting notes really helps it sink in vs. just
reading them. Then, slowly take the training wheels off.

~~~
Hyena
You are basically describing the LXTHW model.

------
jvanderwal
How about another one.. "Takes too long to get to the interesting parts."

i.e. learning Obj-C and taking until the very last chapter to give even a
cursory intro to apps. By the time they get there a ton of people will be
burnt out / disinterested.

------
erez
My pet peeve are books/tutorials that spend most of their time in the
interpreter. I appreciate interpreters for what they are, but I don't thing
the ability to type 2+3 and get 5 is relevant to any programming language
skills.

------
phatbyte
Also:

\- Please stop including math in every example. I just can't stand see another
fibonacci example. Ok we get it, it's awesome for showing recursion, but use
other things. Also, don't put math problem on exercises. I'm learning a
language, I don't want to recap all my scholl math at the same time. I'll die
if I see another "get all the prime numbers from 1 to 100" yada yada yada...

\- Don't use the concept of "throughout the chapters we will be building an
app...", most of the times these apps suck and are plain boring, and it's
demotivating for the beginner. Instead create different small apps in every
chapter.

\- Bonus: It would be awesome if books started including a cheat sheet.

~~~
sun123
OMG !are you working as a programer ?

~~~
phatbyte
OMG yes !!! And do you know how to interpret what you read ? I never said this
was for experienced programmers, only to newbies !

------
aridiculous
I was thinking about how I never "look at the language's documentation" when a
book or tutorial tells me to.

As a beginner/intermediate coder myself, I can't just "look at online
documentation" because I don't truly understand how to use it and understand
properly. Does anyone have a good resource for learning how to use
documentation?

I know that may sound trivial to experienced hackers, and possibly
paradoxical, but I'm actually quite sincere about this request.

------
itmag
Random idea: tailor programming books somewhat to personality types? Eg an
ENTP and ISTJ are not going to enjoy creating the same kinds of programs.

------
robomartin
I'm also pretty tired of "foo" and "bar". At the very least they teach nothing
about the thought process that should go into naming things.

~~~
FuzzyDunlop
This is a huge annoyance for me, as is providing an example in the terms of
'A', 'B', 'C', and 'D'.

PHP's manual is terrible for this. It's not just a naming problem, but a total
failure to explain the purpose of that concept or function with a proper use-
case.

    
    
        class A {
            public function a($a) {
                $this->a = $a;
            }
        }
        
        class _A extends A {
        }
    
        class B {
            public function b($b) {
                $this->b = $b;
            }
        }
    
        $foo = new A;
        $bar = new _A;
        $baz = new B;
        
        ....
    

Another thing is stuff like this:

    
    
        Array.sort(function(a, b) {
            return a - b;
        });
    

Firstly, if you're a beginner, that means absolutely nothing other than an
array is being sorted. Secondly, if you do know what it is, it fails to
explain what else you might be able to do other than sorting from lowest to
highest.

------
Confusion
Although point #3 has also annoyed me no end, I believe I learned a lot from
being forced to solve problems myself. Peeking at the solution is just too
easy and severely diminishes what you can learn by being forced to think more
about the problem. I believe Introduction to the Theory of Computation by
Sipser gets it right: answers to about half the exercises.

------
anthonyb
Totally agree, except for his point three - beginners typically don't care
about exercises, they want to get something working. As long as it works and
does what they want, they're happy.

------
lysium
...not to mention 'From Beginner to Professional in 28 days!'

------
hackermom
"Teach yourself blah in _21 days_ ", anyone?

