Java-based Startups, do they exist?
I get the feeling that most of the hackers here use something like Ruby on Rails or Django, but obviously I have no scientific evidence to prove this, so that is what brings this question to mind. What about Java? Are any of you using Java at your startup to develop your software infrastructure? If you are not, did you consider it in the beginning? what influenced your specific choice.
What about Dynamic languages written for Java such as Groovy or ColdFusion?
38 comments
[ 6.5 ms ] story [ 62.4 ms ] threadAlso, even if you're right, it's not that bad, as it sounds. It's not possible to write something good at a first try. Code, like wine, takes time. A language that fools you to think otherwise makes your work harder.
I think the whole problem with Rails is the premise that you can create whole sites in a minute or two, literally without any significant experience.
My advice: Run far away from ColdFusion. It does suck as much as you've heard, if not more. I don't know why MySpace is using it (if they still are).
I still decided against Java because I feel that meta programming could be that great enabler of the next productivity revolution. A revolution that smarter people than me have experienced ages ago. Having explored Java to some extremes, I know that many of the complexities of something like J2EE are down to the lack of powerful language internal meta programming facilities.
Why not JRuby? Because right now JRuby is even slower than C based Ruby and Ruby 2 will have a virtual machine too, which doesn't have to concern itself with anything other than serving Ruby.
Yes, Java has a lot of libraries. But how many of those am I really using in my startup? Quite a few, and it does take me some time to figure out good alternatives for Ruby. But at the end of the day the library issue doesn't make a big difference in my case.
The only thing that really concerns me about the popular dynamic languages is raw speed for algorithmic stuff. Yes I do need that for what I'm doing. If lisp had any momentum whatsoever I'd gladly jump onto something like sbcl because it has all the metaprogramming facilities and it's as fast as C.
How many lines of Java code would it take you to read a file given on the command line and print out the prefixes of words ending in 'ing'
ARGF.readlines.each do |line| puts m[1] if( m = line.match(/(\w+)(?:ing)$/) ) end
http://journal.dedasys.com/articles/2006/11/23/playing-fetch
In other words, there's so much makework that a small team is at a disadvantage compared to a bigger team, which is not the kind of playing field a startup wants to be on.
Just kidding.
Not really.
The upside is, we are now putting out our I18N'ed version of the product and it was very easy to produce a version of the app in a Unicode-based language, which will probably land us several more clients this year.
In short, Java can be great and there are a lot of things out there to help you build an app, but it only works as long as you keep the code clean and exercise your own discipline to keep from getting too sloppy. Otherwise, you can wind up with code that needs a rewrite from day one.
CF is crap. Groovy is okay, but not -that- great. I'd go with jython or jruby instead if you're thinking of using Groovy.
Scala is absolutely great. It's my favourite language. tipit's server side isn't Scala based only because I wasn't fully aware of Scala when we started out. Scala is functional in theory but even with a very imperative background you can write your code and slowly get used to solving problems 'the functional way', which does come off a bit cleaner (e.g. using case classes).
In my opinion, Java is a clumsy language but the JVM is awesome. Static typing and lack of first-class functions or easy data types make Java programs verbose and annoying to change. The JVM, on the other hand, is fast, portable, well-specified, and there are a ton of libraries that run on it.
To have the best of both worlds, you can use the JVM to run a more dynamic language (not Java)! There are many projects to bring different languages to the JVM, but my favorite is Rhino, which compiles JavaScript to bytecodes. Rhino is also what powers my favorite web framework, Helma.
What is the advantage of using Rhino on JVM against using native Ruby or Python? In Java, at least I know I will be very confortable doing automatic refactorings with Eclipse, which is the biggest advantage of Java against these other languages. Having coded a tool in Ruby with some good testing coverage, I still don't feel as safe to refactor as I was using Java.
Rhino on JVM has the advantages of having access to any java library you want (sun distributes many standard ones, and there are tons of other open-source ones on the internet). Another advantage is that the JVM does hotspot optimization which leads to speed improvements. Most other interpreted languages, such as Ruby or Python, are not as far along with their runtimes.
As for Java vs. scripting languages, that's a matter of taste. In my experience the way to minimize bugs is to write less code, and I explained above why Java programs tend to be verbose, so I believe the benefits of terseness in scripting languages outweigh the benefits of static typing in Java.
I started developing it in '05 before Rails was huge. Using Java has actually been a huge advantage:
There are hundreds of high quality open source libraries. GWT allows me to leverage existing data structures and algorithms on the client-side.
I extended Scheme to make BRL, http://brl.codesimply.net/
I use it in http://ourdoings.com/
We didn't use ruby because it would take us some time to learn it, and I wasn't sure on the maturity. I also prefer strong typing. I have experience with C, Smalltalk, C++, Perl and Java.
Why do you ask at all? If you know java, use it. If you know c (well, not c) - if you know python, use it. If you have to learn something, because you don't know any language, get a job first and think about a startup after you dream in (put here any language).
Any scripting language basing on java will be slower than java. My opinion is: if you can avoid another software layer, avoid it. It makes you depend on more code that you don't control, slows down your apps.
They may be slower than Java nonetheless - because the JVM is designed for running Java.
Someone reported about a factor of 100 for java against Ruby. jython is only 50. But this is still so bad that I would not waste my time.
BRL uses Kawa Scheme, so the code is compiled to JVM bytecodes. The result is slower than C implementations of Scheme, but still faster than PHP.
I think it is desirable to give clients the best possible user experience and execution speed is indeed a valuable point, especially in the web.
A friend of mine still codes assembly if he feels its necessary. I 'am not that fanatic (in facts he is always making fun of java) - but, once you have used his number crunching algos, you'll never go back.