What makes other languages faster than Java in terms of Rapid Development? [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionMany people say developing in Python, Ruby, PHP ...etc is much faster than Java.
Question is, why? In terms of coding, IDEs, available libraries... etc. Or is the speed in making the first prototype only?
I'm interested in answers from people who worked long time on Java and long time on other languages.
Note: I have developed for .Net before Java and yes it was faster to make some apps, but on the long run (large web projects) it will become like Java.
I think the main advantage of the rapid development languages is dynamic typing, where you do not have to put in any effort for static types, as e.g. in Java's
public List<Tree<N extends Iterator, E super Interface1 & Interface2>>
= new ArrayList<Tree<N extends Iterator, E super Interface1 & Interface2>>();
... and later on think about type erasure.
With dynamically typed languages, you do not have that concern, but can quickly duck-type away. That's faster and often results in more readable code (less type information/noise, see example above). You do need thorough tests, though, but with TDD & documentations via tests, they are nowadays usually written anyways.
And now to some historical examples about statically vs. dynamically typed languages ;)
When the discontent with C++ grew, the dynamically typed language Smalltalk was getting more popular. But then Java came along. Although Smalltalk had good testing techniques already (xUnit was born in the Smalltalk field), thorough testing got popular only later. I think that is the reason for the rise of dynamic languages now. You do need very thorough tests there because e.g. a simple typo in a message call is only detected at runtime.
But maybe now that type inference gets better, we'll have a similar situation again and Scala will thwart the second rise of dynamic languages ;)
Update: I found this thorough programmers.stackexchange post about static vs. dynamic typing. It lists a lot of papers to read, and also considers productivity.
Having moved to using PHP after years spent building java powered webapps, for me this difference comes mostly from having much less stuff to setup, and because languages like PHP are loosely typed, meaning that you don't have to faff around converting stuff to other stuff with lines and lines of code that seems like overkill.
java example:
//omitting the lines and lines of stuff to set up a request and
//the try catch and the exeptions that *might* get thrown
String numberInput = request.getAttribute('numberInput');
int result=0;
if (numberInput!=null && numberInput.length()>0)
{
result=Integer.parseInt(numberInput)+1;
//but now we need to wrap this in a try/catch to catch NFE exeptions
}
//can't just echo it, need to set up an output thingy... ommitting all that too
out.print(result);
out.flush();
out.close();
To acheive the same thing with PHP:
echo $_GET['numberInput']++;
//no setup or tries or catches required, it either works or shows nothing.
This was the biggest plus for me, as I was forever frustrated with java when having to work with validating user input. There was always alot of stuff i had to do every time, for every input, that in PHP is just unneccessary. Validating must still be done of course, it's just alot easier in PHP.
Hope this helps.
For me the main advantage is simple. In Python you can simply read the code nearly like a sentence. Even if someone shows you his code, you are able to figure it out in minutes. For example:
for item in list:
if item in other_list.keys():
new_list.append(item)
I think this seriously shortens the development time.
Oh, and second thing. Well-written documentation. But I'm not sure how does Java documentation looks like.
And I think many useful packages are also a good advantage.
Don't forget about Python IDE or Ruby IRB. Sometimes you can test one thing interactively what takes you much less time.
For rapid prototyping the more dynamic the language the better. Something like excel is a good for rapid prototyping. You can have a formula and a graph with a dozen clicks.
However in the long run you may need to migrate your system to something more enterprise friendly. This doesn't always mean you should start this way.
Even if you start in Java you may find you want to migrate some of your code to C for performance reasons.
精彩评论