What Can You Build in 600 Lines of Code?

I wrote a solunar tables calculator that performs astronomical calculations to return sun rise/set/transit, moon rise/set/transit/underfoot times, moon phase, major and minor solunar periods and some other cool stuff. The php version fits in about 700 lines including commments. The c version fits in about 800 including comments.

Making it a goal to limit an application to a specific number of lines of code is, by definition, a coding horror!

Please consider pointing to software that can count “lines of code” for different languages esp. PHP

I remember when they used to have 1K programming contests. Your source code had to be 1K or less. Some people did some pretty creative things.

guess it sorta depends on what language your talking. 600 lines of assembly barely buys you anything. someday we’re all gonna be out of a job because any monkey can build software by snapping legos together :frowning:

Im pretty sure that with 600 lines of code I can do some Hello World.

Almost sure!

Pah, using frameworks and libraries is cheating.

Heck, I made a fullscreen Polish flag in DEBUG.COM in 19 bytes. Beat that, 37signals!

to be fair ive written quite a lot of lil apps here and there that do very useful things in under 600 lines of code - to be honest though, 600 is quite a lot and is a dependant and language and style

Pfffstsss… I can write an full featured webshop with ERP system integration in 2 lines:

system = FullFeaturedWebShopWithERPIntegration(:webenabled = true)
system.processRequest(CGIRequest::instance)

yeah - its THAT simple and ONLY 2 farging lines people… :wink:

Why not 666 lines of code ? /sarcasm :slight_smile:

TrXtR, yeah farbrausch(www.farbrausch.de) are cool, check out the debris demo from 2007: http://pouet.net/prod.php?which=30244.

Anyway, what 37signals has done is smart and elegant, but not very impressive. But the goal was ofcause to show how elegant the rails framework is. As always use(+create) the right tool for the job.

As a programmer you should be more impressed with the algorithms and impress the boss, costumer, etc. with the programming statements.

/P

"Pfffstsss… I can write an full featured webshop with ERP system integration in 2 lines:

system = FullFeaturedWebShopWithERPIntegration(:webenabled = true)
system.processRequest(CGIRequest::instance)"

And what else can you do with that? Nothing. People have done a wide range of things with RoR, one of these being a Todo list in 600 lines. It’s a demonstration of the completeness and flexibility of RoR.

That said, it might only be 600 lines but it misses out a lot:
http://rifers.org/blogs/gbevin/2005/3/18/blabla_tada_in_java

Back in the 90s there was a competition to write the nibbles (snake) game in a minimalistic way. I was somewhere 48 bytes as I remember, the winner was somewhere 37 bytes. that was a pure assembly fun.

I remember the days when part of the programmer’s job was to write code that was as efficient as possible simply due to memory restrictions. The days leading to 2G memory and TByte harddrives have nurtured a generation of lazy and inefficient programmers.

Hey Now Jeff,
Make everyone think 600 line what could we do. I like the screen shot too, I never knew I could read Japanese until today.
Coding Horror Fan,
Catto

#include “masterlib.h”

int main(void)
{
/* some functions defined in “masterlib.h”, dont forget to link it /
stop_the_wars_in_the_world();
find_cure_for_cancer();
end_poverty();
make_justice();
/
TODO: maybe call adjust_my_bank_account(); after these… */

return EXIT_SUCCESS;

}

I can build Hello World in under 600 lines of code

Yeah, but…it’s just Ta-Da List.

Not to crack on Ta-Da List; it’s cool, but it’s basically just a little thing that manipulates checkboxes, isn’t it?

hmm, how would you make a solid computer game in that much code? it seems to me that without a lot of pre-existing code (frameworks, libraries, etc.), that’s going to take much more effort.

"600 Lines"
If it’s only lines of code that were typed by a developer not including the framework, configuration and generated code then 600 seems a lot, there are ways of producing functioning code without little if any “lines of code”.

I’ve been hearing a lot about Ruby On Rails lately, mostly FUD. I also read an amusing article about Rails developers calling themselves “rock star coders” and creating that online persona. I’m tempted to learn Ruby On Rails but I’ve heard that it is “the rails way or the highway” and it forces you to design the database to meet its requirements and does not allow any SQL hacks to solve problems. It sounds like one of those frameworks that promises to save you time until you need to do something slightly unconventional and then you need elaborate hacks. Even ASP.NET is guilty of that but it is flexible enough to meet most needs.