Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"Don't write code until you know what you're doing. Now, you may not be able to "know what you are doing" just from thinking, in which case you should start a TEST project and write a bunch of ugly code to make sure your ideas are correct.

Then, start again, in a new directory. We had seven or so different test project directories during the making of Delicious Library"

Wow! Must some inflexible language. In Python, Lisp and Javascript, (those are the ones I am 'happy' with) you can coax "test project" code into real and beautiful code. You can explore as you code.

Many other issues he mentions can be transcended simply by using a better programming language and a good helping of bottom-up programming.



Maybe for a small bit of code: a method or a simple class.

But once you are talking about a serious system? Your prototype code is guaranteed to be of prototype quality. Starting over from scratch is a strong way to mitigate the risk of it infecting your production code.


In the languages that I mentioned (js,lisp,py), you will write a small function in the interactive shell (repl) and play with it and tinker it until it works perfectly. Then you'll write another function that uses this and other such functions etc. You'll build functions on top of functions until you have a fully usable system. As you know, this is bottom-up programming. While you can continue to improve things and refactor code as much as you want, at no point do you have to throw everything out and start clean. You don't lose any work.

I don't know much Objective C. I've just written some tiny iPhone apps in it. But my feeling is that it strongly encourages top-down programming, which results in the programmer having to do the things mentioned in the article (plan ahead, rewrite from scratch etc).


In the author's case, its Objective-C.

May not have the elegance of a dynamic language but it won't have the sluggishness either.


Your username clearly indicates where you stand :-)


Heh, actually, I'm partial to Python and Javascript, myself.

My id is a bit misleading in that sense.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: