Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: How clean is your startup code?
10 points by d0m on Aug 26, 2010 | hide | past | favorite | 10 comments
So we all know it's important to go public as fast as possible. I was wondering.. how clean is your code?

Do you have 10 php files with 5000 lines each? Or some ruby codes with lots of tests? Do you comments a lot? How is your inter documentation? What if someone joins your startup.. how easy will it be for him/her to catch up and understand the code?



So we all know it's important to go public as fast as possible

That makes it all the more important to write clean, well-documented code. I'm an OO PHP developer, I use an MVC framework I developed myself (similar to Symfony, based on the Doctrine ORM, using Smarty for templates). I tend to write self-documenting code, e.g. Website::listAllByUser($id), but I comment extensively anyway. It would be very easy to get a decent programmer up to speed on any of my projects in under an hour.


It's important to go fast, which is why you need clean code. To be fair, my startup code isn't the best code that I've ever worked in, but it is solid and tested.

By the way, comments are crap in any kind of software. They are out of date and useless like a minute after they are written. 9 times out of 10 when I come across one in other code I delete it.


I like to think that my code is pretty clean, but that might be observer bias... but download the Tarsnap code from https://www.tarsnap.com/ and let me know. :-)


I gave it a look and yeah, it's pretty clean for such low level C.


clean for such low level C

Do you think it would be cleaner if it was in perl?


Just to be sure, I wasn't talking about C being low level but more about the stuff you were doing with C that was low level. I could have said: Clean for such low level Scheme or Clean for such low level Perl.


My code falls into three categories:

Pretty clean: this is stuff that has actual people using it and is critical to the business.

Not so clean: stuff that is new, tangential, or experimental. I don't bother refactoring this type of code for one reason - it may end up in the third category...

Deleted: This is stuff that didn't work and isn't worth keeping or is obsolete for one reason or another.

So in a nutshell: launch before you refactor, refactor before it breaks. Lots of great coders hate this.


My code was not bad, but not superb. There was good architecture behind and a hundred of unit tests, but still time to market was top priority. So it was good enough and I think it is a waste to write perfect code for startup, since future is unknown.

When product proofs itself, it is time to refactor and maintain perfect code base.


My code could be a lot better, but it works for what I needed at the time. I do wish I spent more time making it clean and organized, but the reality is that I am going to do a rewrite anyway. Pumping out the initial version gave us first dibs in the space, so having unclean code really didn't hurt us.


It's pretty clean, I want to move to continuous deployment as soon as possible, right now I have automated deployment, but it's not continuous.

I think a great code base is essential to being able to pivot and iterate. I don't think a startup can afford much technical debt unless you are using the VC rocketship model and taking on tonnes of real debt / loss of equity anyway.




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

Search: