I'd start with something considerably lighter than that, but I do agree that reading code is a really important part of really learning how to program (well).
As for 'code monkeying' not being programming, I disagree with that, programming is the creation of specific instructions in order for a computer to reach a certain goal and I couldn't care less what the goal was or the way in which you arrived at your program. I'd definitely not go so far as to demean anybody that got in to coding that way, just like not everybody can be Michaelangelo we can't all be Peter Norvig.
From Excel to LISP and everything in between, it's all programming.
I ended up building all of my reports using MVC, before I even knew what a design pattern was.
One of them got so successful with his VB program formerly spreadsheet that he ended up making a very impressive fortune with it.
When I was a kid my 'toy' programs would be a few hundred lines of assembler or basic, rarely beyond that. Then the first time I hit a thousand lines (a score editing program) I realized that my old techniques didn't work any more and I discovered structured programming. This worked well for a while until the limits of organization for a single file were reached and I had to start splitting up the code in to large chunks that 'belonged' together in separate files and so on.
And that's just the organizational stuff, never mind the actual code or data structures.
To throw someone in on the deep end of that and saying 'Swim!' is not going to work except for a very few people that are genius level. The GGP might be one of those but for the rest of so (let's say ordinary mortals) that's not how you learn the fastest.
Of course, once you're ready for a 'big' program (say 50K lines and up) it really will be a great step forward, once you've mastered to read (and work on) a program of that size it will be a huge achievement.
I've never met someone that learned how to code out of the gate by studying emacs though.
And don't underestimate how much you can get done with 'toy' bits of code, libraries are so easy to tap in to that a few hundred lines will go a long way if all you want to do is solve some problem.
Check out some of the more involved 'R' programs that float around here for good examples of that.
You might be adventurous and read the rest of the file. Now you know how a whole major mode works.
Before you know it, you are applying those techniques to your own code without realizing it -- and now your code works like the rest of Emacs.
Show me any Emacs extension on the Internet, and I can tell you exactly how the author learned Emacs Lisp -- that's how different "I learned everything myself" and "I read the Emacs source code" methods of learning are.
> Is Emacs bugging you? Open the source and see how it works. Web server crashed? Read the source and fix the bug.
Both emacs and web servers are major programs, and analyzing them 'from the source' for debugging purposes is a different thing than analyzing how a single minor module works in it's normal environment. Debugging can have you rooting around in the basement fairly quickly, which is more than likely to overwhelm a novice.
Sure, emacs is built that way, but Lisp code isn't quite as easy to understand and debug as you make it out to be (judging by the number of people that hack around in emacs vs those that don't) and you have to keep in mind that you are very good at this, so it may be a bit hard to put yourself in the shoes of someone just starting out and maybe not at your particular level of genius.
What's easy for me may not be easy for you and vice versa, and hacking emacs as a start - at least to me - seems to be a bit much.
Plenty of people have trouble getting slime working, let alone hacking around on the guts of emacs without an experienced hand around to guide you.
If you say, "it's too hard", it will be. (You don't have to be productive on day one. But some day, you should at least take a look.)
Plenty of people have trouble getting slime working, let alone hacking around on the guts of emacs without an experienced hand around to guide you.
If they read the source code, the magic would become understandable. The problem that people have with things like SLIME or monads or pointers or classes is that they build a mental model that's a lot more complex than the real thing. Take a look at the real thing, and your mental model becomes simpler and more in line with reality.
I am interested in well written code that falls into the light to read category. Can you provide examples?
You can memorize every line of the emacs code base, but unless you have a problem with emacs itself that you'd like to solve, it isn't going to get you far.
On the other hand, if you can't find a web-app to manage projects that works for you, and you decide to code one, you will learn much, much more.
For example, I learned C by myself when I was in middle school. The memory management technique I developed independently was "the library allocates, the application frees". No errors in valgrind, and my app works.
Then I started reading other people's C code, and switched my technique to "the application allocates, the application frees". Now C is a lot easier to write!
Assuming that you're the smartest person on Earth only gets you to a local maximum. To get to the global maximum, you have to interact with other people.
The way you interact with programmers is with source code.
I've learned probably 95% of all my programming from doing.
I do take issue though with the idea that the learn by doing crowd is somehow less accomplished. It smacks of baseless elitism.
Seeing other people's code does little for me because I miss all of the reasoning that went into it's creation. However, when I've fought through the same problem myself, I understand very thoroughly the traps, pitfalls, and solutions the task entails. When I reach this level, I can read other people's code and clearly see why they did what they did, and how it's better or worse than my method. I have to take a crack at the problem myself first, though, in order to learn well.
Reading other people's code is, for me, a way to refine and reinforce my techniques, not to learn entirely new things. I learn much less effectively when I try that.
At the end of the day, it takes all types to make software. Those who build the boxes, those who peer into the depths and improve or maintain the boxes, and those who use the boxes all work together to make great software.
To learn how to write real programs, you need to read real programs. Is Emacs bugging you? Open the source and see how it works. Web server crashed? Read the source and fix the bug. Not sure how to configure cron? Take a look at its config parser!
Many "programmers" spend their entire life treating everything as a black box. Take a look inside the box! That's how you really learn to program.