Programming FAQ
paulgraham.com
paulgraham.com
The thing about logo is that it was specifically designed as an educational language. It teaches the basics of syntax, commands, variables, and functions, and it offers instant gratification. It is very easy to see how a computer can follow very simple programs, and if you do something wrong you see it immediately. Once they've mastered the fundamentals of logo (which should only take a couple hours) then I would have them move on to a full blown language.
Someone, somewhere has to have done this already. I should look it up!!
I don't know if pg has exhibited, it would be interesting to know. Even more interesting would be to know if he still paints.
http://1.bp.blogspot.com/_KKByGBh0xRM/S0FD11qiIXI/AAAAAAAAA1...
Can anyone enlighten me about this? My first thought is that n+k units of code is less than n*k, but I expect it's more subtle than that :-)
What about code reuse? In OO land, it's fairly obvious to me that I could take any number of my protocols and use them across a TCP/IP connection, or carrier pigeon, or a file, but I can't see how the closure example would allow this sort of sharing. Is that the point? Only code what's necessary?
The thing is, a lot of the time you need sideband data. A simple closure isn't always enough. Perhaps you need configuration options, or you need names for diagnostics, or you need to monitor throughput statistics, etc. A closure is a clumsy interface when it's overloaded to do multiple things. You end up with some kind of variadic argument list and having to switch on the first or more arguments - you basically end up writing a method dispatch routine.
So in this specific example, I would suggest that using a closure may turn out to be the wrong choice longer-term. I'd probably prefer a base class with a virtual method, and a concrete descendant which delegated the action to a closure. That way you get the succinctness of a closure when that's sufficient, but you also get the future proofness that a base class provides - you can add more functionality in the future, but without breaking previously defined implementations.
Our ultimate solution was to create a global table about if the relevant bit of state applies to the function (based on __name__). Also an ugly hack, but keeps the api clean. :(
Of course I didn't do things like emacs-slime, so, I always have a repl open in a separate window. ':set lisp' along with 'set lispwords=...' worked fine.
Vim users are yet to have a full Slime replacement, but Nekthuth is quite nice.
Then in your spare time learn lisp.
The formers will give you money; the latter, enlightenment.
...if you were interested in programming embedded microcontrollers for robots, html and css isn't going to get you too far and I think learning Javascript as your first "programming" language would do more harm than good...
For 20 years I've been coding for mainframes, minis and desktops. No more, for the last ten years it all has been the web and solely the web. And I hope it stays like that.
Regarding embedded programming, yeah you're right, but that's a totally different ballgame and I know most of the readers are interested in web stuff.
About old-fart c++ desktop programmers, poor guys, whether they adapt or join the cobol programmers of last century.
Or at least try Go, the language, to keep the fun alive.
In the last year I've been asked about iPhone programming more than web, seriously.
This is what I never managed. I picked up programming very fast at school, but could never come up with anything I'd want to use it for. Now that I finally have a few concepts I want to see done (good UIs to promising algorithms), I no longer have the time to pursue them.
That's part of why I believe kids now should start with html+js+css and be introduced to greasemonkey, stylish, and browser extensions. Maybe Node.js, too. Everyone uses some site a lot, and they will find problems in those sites to attack with their new knowledge.
How can you get to a good design without some plan? Could someone shed some light?
If you are disciplined enough (and you should be), design can effectively happen as you go.
If PG means graphical design, I don't think this is true. Looking at the list of hackers in Coders At Work (as a random sample of respected programmers), it is not clear if any of them understands graphical design and they typically have ugly homepages.
(Jamie Zawinski, Brad Fitzpatrick, Douglas Crockford, Brendan Eich, Joshua Bloch, Joe Armstrong, Simon Peyton Jones, Peter Norvig, Guy Steele, Dan Ingalls, L Peter Deutsch, Ken Thompson, Fran Allen, Bernie Cosell, Donald Knuth)
I think Graham answer what he consider as good design in the link below, you should check it out: http://paulgraham.com/taste.html
Programming FAQ by edw519
What editor do you use?
Textpad.
How can I learn to program?
Find a customer with unreasonable deadlines. Hit them. Repeat. It won't be pretty, but you'll be the kind of programmer I'd go into battle with: great at the things that really matter and mediocre at the things that don't.
Why do you advise plunging right into a programming project instead of carefully planning it first?
It's incredibly difficult for anyone to define what they want when they start with nothing. It's human nature (incredibly easy) to criticize what you have and how to make it better. Plunging right in and producing anything raises you from LevelIncrediblyDifficlut to LevelHumanNature.
Why do you keep going on about PICK?
I have a very small back pocket that holds everything you need to program in PICK. Whatever you can do in technology <x>, I can probably do in PICK, often quicker and easier.
Isn't object-oriented programming naturally suited to some problems?
Sure, but that doesn't necessarily mean you have to use formal object-oriented technology. You can mimic the concepts with almost any technology.
I'd be interested in people's experiences with it, though.
Or if you want to suggest Lisp, try "insert-your-own-language-here".
Amen. We should hang out.
http://lambda-the-ultimate.org/node/186#comment-1351
Borges was a literary critic. He didn't do novels, but his short works are mind-stretching.
The intended meaning is of course "a novel written by a literary critic that is not primarily a writer" but that's a mouthful, isn't it?