3.1 -> 4.0 Sample Case -- lines.ex

new topic     » topic index » view thread      » older message » newer message

Today I was cleaning up some demos and decided to take the lines.ex program and just see how much we would save by converting it to use new language constructs and the new standard library. I knew we would save a good deal, but what we did save blew me away. During the process I actually fixed a few bugs, gave better help output and added a new feature (now displays % of code commented). In the end?

Old: 591 Lines
New: 195 Lines

That is 33% of the size, i.e. 66% of the old program is gone! This is stripping no features, only adding features and fixing bugs.

The old program can be seen at: hg:euphoria/file/1eb5b6dfb62a/bin/lines.ex and the new lines program can be seen at: hg:euphoria/file/a80bc56102c7/bin/lines.ex.

Now, not to over sell 4.0, this was a utility program of minimal size. As the program size goes up, boiler plate code % and utility code % goes down, thus typically the larger the program the less over all you will cut. But, none the less, going from 591 LOC to 195 LOC is pretty impressive.

Have fun with 4.0!

Jeremy

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu