News for hackers. Stuff that matters.
Re:DHH: How do I learn to program? by jacquesm on Wednesday September 22, 2010 @02:21PM (#1717044)
You can't begin to understand something the size of emacs before you've taken a bunch of steps in between, and looking at 'toys' makes you understand how toys are put together as well as gives you the skills you need in order to appreciate what makes stuff tick one 'level' up from there.

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.

Re:DHH: How do I learn to program? by jrockway on Wednesday September 22, 2010 @02:24PM (#1717054)
I disagree; you don't need to understand all of Emacs to read the source code. You type "C-h k", press a key, and then the source code for the key you just pressed is displayed. It's written in a simple procedural style. Now instead of guessing how that works, you know.

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.

Re:DHH: How do I learn to program? by jacquesm on Wednesday September 22, 2010 @02:35PM (#1717087)
You can change this now to be about a single small module in emacs, but originally you wrote:

> 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.

Re:DHH: How do I learn to program? by jrockway on Wednesday September 22, 2010 @05:06PM (#1717532)
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.

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.