|
Jim Langston wrote:
To be fair, Hans, lines of code shouldn't be a fair assessment, if it was we would all be using APL. In APL we can write an entire program in one line. Regards, Jim Langston -----Original Message----- From: Hans Boldt [mailto:boldt=G1DYhSM1WHTQT0dZR+AlfA@public.gmane.org] <SNIP> No, there are indeed quantitative means to compare the suitability of particular programming languages to particular tasks. To illustrate, I can send you my 200 line Python program that does the same job as a published 400 line RPG CGI program. (To keep the comparison fair, I kept the program structure the same and included the same comments.) _______________________________________________
Jim: As I said, I tried hard to keep the comparison fair, and so I kept the structure the same and kept the same comments. I also avoided other techniques to compress the size of the program, like coding multiple statements on one line. I agree lines of code is not always a fair assessment, especially if you're playing "Perl Golf"! (http://www.sysarch.com/perl/golf/) In this comparison, though, the RPG program could have been a bit shorter had the programmer used /FREE calcs. Also, one reason the Python program was shorter was because Python has no "end" statement. But in general, the Python program was shorter largely because of the conciseness of the language and the power of the class libraries provided. The point of my note to Brad was that you can't assume that one tool is just as good as another just because you can complete the same task in both. Lines of code is just one example of a quantitative metric you can use to compare two tools. Other metrics you can use are program run-time performance (compiled languages are usually better), programmer productivity (interpreted languages are usually better), portability to other platforms, and time to learn the language. There are also more subjective accounts, such as Bruce Eckels opinion that he is 5 to 10 times as productive using Python. (See http://www.oreillynet.com/pub/a/network/2000/03/30/softwaredev.html) (Bruce has written books on C++ and Java.) Open source guru Eric Raymond also has some interesting things to say about Python. (Read http://www.linuxjournal.com/article.php?sid=3882) Cheers! Hans
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.