Yep.The Rials looks like a magic in productivity:)But an interesting news: Have you ever tried “web2py” ? In my opinion it’s the best pythonic Rials! It’s productivity… unimaginable
Ruby on Rails uses a lot of code generation. Comparing it with other programs written in other languages brings up a lot of questions. Both the verbosity of the language has to be taken into consideration as well as the underlying libraries.
Take for example Java. It’s got a lot of libraries that one can use. Making a desktop application would just mean that one has to use the SWING library.
Compare that to Common Lisp. Common Lisp can do the same thing that Java does, and probably even more, but are the libraries that one can use, or does one have to write everything?
One can even write a desktop application Brainf*ck, but the understanding the source code would probably require omniscience.
I assume we’re not talking about ‘tricks’ where you’re just running external code, plugging together existing components, or having 8000 char+ lines.
So, given that:
Full applications? No.
Incredibly useful utilities? Absolutely.
Gadgets / Widgets / Plugins? Sure
Depends on what your definition of an application is I suppose.
Total lines of code is, and has always been, a poor measure of effort required. Sure, they might have legitimately only needed to bang out 579 lines - but if it took them longer to get to that point, it all becomes redundant.
That said, I’m all for expending less effort for more productivity, and if they’re getting great results through rails - good on 'em!
You can do some really cool user interface stuff in C#.NET with WPF and Expression Blend (XAML user interface descriptions). Do all the data binding of .NET objects to XAML elements. Using other .NET 3.5 frameworks like WCF, you could probably create a networked photo sharing application in less than 100 lines of C# code.
There’s a lot to be said for well-designed, productive frameworks and environments that don’t make you reinvent the wheel every time you need a GUI app or a web app or a data structure or whatever.
This is not a programming language issue, but its about the available libraries that support it.
It is obvious, you know it, but you do not mention it. Why?
You could do single, double and circular single and circular double linked list implementations in under 100 lines of standard c99 so you’d have at least 500 lines of space left to use them. That’s a whole lot of possibilities, I bet it includes tetris! and many more puzzle games.
Now imagine what you could do with 600 lines of c# or objective-c, the sky is the limit!
The little detail that it’s a web app makes it sound a bit more impressive, but then, that’s exactly what Ruby was designed for.
XForms is quite good for writing short web applications. If I remove the empty lines, inline instances, comments and some static XHTML, I’m down to 487 lines for a data entry system currently in production. This features adding, editing, and removing data in three forms separated into tabs, validation against other XML files (with helps, hints, and alerts), file upload / deletion, navigation between data items and a collapsible log displaying all the entered items with the current one highlighted.
The more lines of code your software has, the greater the number of bugs.
The more lines of code your software has, the longer it takes to solve one bug.
So writing less code helps you write good software.
Who said this code wasn’t complex though? It could be 579 lines of code that are all 1000 characters long!
Honestly… who cares how many lines of code an application is? As long as it fufills it’s requirements and it’s easy to maintain, that’s all that matters. Not some c0ck-measuring contest to see how small you can get the source files!
Well, not sure if it counts, but if I’d persevered it COULD have become a commercial application:
I wrote my own (VERY clunky!) word processor in Z80 assembly language for the TRS-80 in about 1980, I guess. It must have been in less than 16K bytes, probably quite a bit less, because that’s all the memory my computer had. But it worked pretty well - I wrote most of a novel on it.
I remember the TRS-80 had a chess program that fitted into less than 4K of memory. Played pretty bad chess, but it did work.
The creators of the darkbasic language (thegamecreators.com) regularly hold a competition where the entries have to form a working 3d computer game within 20 lines of code. Due to the level of functionality you can achieve with such a high level command set, this is not only feasable, but results in some great games.
However, due to each command being of such a high level of functionality, each takes a long time to execute. I think many programmers don’t think about the execution complexity due to being so focused on the uncompiled code and how that looks.
It is a great practice to avoid using 20 lines instead of the 5 you actually need. I recently rewrote a class method at work and removed 50% of its code. This lobotomised code not only fixed the problem, but ran faster (no surprise there). That said, if the system had been properly designed at the beginning, that class would never have been needed.
Measure twice, cut once.
“Honestly… who cares how many lines of code an application is? As long as it fufills it’s requirements and it’s easy to maintain, that’s all that matters. Not some c0ck-measuring contest to see how small you can get the source files!”
Exactly!
All the “Oh boy, someone wrote a 600 liner which represents does cool. I should drop what I’m doing and do what that guy’s using!” moaning… some people should simply take a step back and think about what they’re doing. Hint: programming isn’t about typing text in an editor.
People are too focussed on operating tools (e.g. a language, editor, ide). The tool isn’t important, it’s what you do with them and more importantly WHY you’re using these tools.
The more of these same-themed blogposts are posted on this blog, the less motivated I am to read them.