If you could choose a server side language, what would it be?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Red Squirrel

No Lifer
May 24, 2003
68,332
12,559
126
www.anyf.ca
I would not use mono unless I absolutely have to (to run an existing app). If you use Linux then may as well use something that works natively imo. You don't want to add an emulation step if you don't have to. Yeah some people say it's not emulation, but it's a similar idea. It's like Wine, not really a fan of using it for something other than a temporary workaround.
 

slugg

Diamond Member
Feb 17, 2002
4,723
78
91
I can't comment on the stability of Mono. I literally have no idea. But my first choice would be exactly that: C# on top of Mono. They say it supports everything in .NET 4.5 except for Workflow Foundation. So as far as your data layer, you could do it in Entity Framework, which is unmatched by any other ORM framework, in my opinion. Then you can throw together a WCF service in a few minutes, where Visual Studio will pretty much guide you through the whole thing. It doesn't get much easier for faster, really.

I see you've already stuck with Java 8, which is pretty safe, but let's just keep this going for kicks and grins.

If you want something fun and cool, ignoring C#/.NET, I would go with Grails, which is basically a full stack based on Groovy. This is about the fastest time-to-market stack on the JVM platform, in my opinion. You can write your basic RESTful services in just a few minutes, assuming you already had basic knowledge of Grails. Besides, lets say you hit a snag - it's still completely compatible with any other JVM language, including plain old Java, even within the same assembly/project/jar/war. Combine this with either Maven or Gradle and you're golden. You could even keep all the code you've already written in your project, then just add Groovy/Grails to your project and mix the two. Some IDEs are even smart enough to convert your existing Java code to Groovy, so there's that option, too.

I like to think of Groovy as a kind of non-verbose Java, sprinkled with a bit of "just-works" magic. Granted, it's definitely something that can be abused, but if you're a seasoned programmer, it just means you have more conveniences.

I completely agree with your choice on PostgeSQL. I wish more people would embrace it. :)
 
Last edited:

smackababy

Lifer
Oct 30, 2008
27,024
79
86
So right now, I'm going with plain old Java 8 to try and get something done quick. I figured I'm already doing something new with dart + angular dart on the front end.

Once I get something done right I'll probably branch out. I'm thinking of either giving scala or go a shot.

I'd go with Java close to 100% of the time, unless I found there was a requirement I couldn't fulfill with it, and even then, I'd attempt to do with with Java before giving up. =)

Java, IMO, is fast enough, has tons of documentation, and has a lot of additional tools and technologies to solve most problems. It helps that I have a ton of experience in Java, though.
 

slugg

Diamond Member
Feb 17, 2002
4,723
78
91
I'd go with Java close to 100% of the time, unless I found there was a requirement I couldn't fulfill with it, and even then, I'd attempt to do with with Java before giving up. =)

Java, IMO, is fast enough, has tons of documentation, and has a lot of additional tools and technologies to solve most problems. It helps that I have a ton of experience in Java, though.

Agreed with everything you said as being factual, but I'd argue that it's a bit misleading.

"Fast enough" could be interpreted a couple ways: its execution speed and time-to-market. I would say that with respect the latter, Java falls miserably behind Grails/Groovy, C#/.NET, Python, Node.JS, Rails/Ruby, and many others. As for the former, they're all close enough that it's a wash.

I agree that Java has tons of documentation. That's because there are many vendors that offer their own flavor of documentation for their own flavor of development stacks for their own flavor of the JVM for each version. D: What a nightmare! And a lot of the open source projects have craptacular documentation that takes hours to decipher (*cough* Hibernate *cough*).

As far as additional tools and technologies, again, I agree with this. Off the top of my head, you have three major IDEs for Java: Eclipse, IntelliJ, and Netbeans. All of them suck, and all of them are missing features that the others have. For C#, you only have one major option: Visual Studio. It does not suck. As far as frameworks and other technology, Java has more options than I care to count, which means you have to sift through hours of BS opinions, such as this thread, to find a solution that actually works. With Groovy, you have one major option which covers 90% of your use cases: Grails. With C#, you've got .NET. Ruby has Rails. And don't you dare say that Java has Spring, for that's one of the most fragmented "frameworks" I've ever seen. It's a glorified dependency injection container - that's it!

Java is also unnecessarily verbose; for every 3-4 lines of Java, you may have 1-2 lines of Groovy, and in some cases, even in C# (especially with POJOs versus POCOs). This isn't a big deal as far as functionality, but it gets annoying when you see pretty much every other language keeping up with the times, except for Java. I'm happy that Java 8 can now handle lambda calculus, which is a feature we got in C# back in 2006. The only thing Oracle wins in is marketing.

So, back on topic... if you want something fun and exciting, Java is not the answer.
 

Cogman

Lifer
Sep 19, 2000
10,280
131
106
Right now, Java has been good enough. I've been spending enough time fighting the frontend stack that I'm glad I chose something I'm familiar with for the backend (And for the most part, the backend has been really simple. Like take request, feed it to dao, say something, I've spent almost zero time one it). AngularDart is currently at 0.14 and it has enough fun to keep me happy :).

Because the backend is so simple. I don't think it will be too hard to swap it out for something else (or several something elses) in the future.

I agree with slugg. Java is pretty boring. I just have a good amount of experience there to make me pretty productive in it.
 

beginner99

Diamond Member
Jun 2, 2009
5,228
1,603
136
As far as additional tools and technologies, again, I agree with this. Off the top of my head, you have three major IDEs for Java: Eclipse, IntelliJ, and Netbeans. All of them suck, and all of them are missing features that the others have. For C#, you only have one major option: Visual Studio. It does not suck. As far as frameworks and other technology, Java has more options than I care to count, which means you have to sift through hours of BS opinions, such as this thread, to find a solution that actually works. With Groovy, you have one major option which covers 90% of your use cases: Grails. With C#, you've got .NET. Ruby has Rails. And don't you dare say that Java has Spring, for that's one of the most fragmented "frameworks" I've ever seen. It's a glorified dependency injection container - that's it!

Java is also unnecessarily verbose; for every 3-4 lines of Java, you may have 1-2 lines of Groovy, and in some cases, even in C# (especially with POJOs versus POCOs). This isn't a big deal as far as functionality, but it gets annoying when you see pretty much every other language keeping up with the times, except for Java. I'm happy that Java 8 can now handle lambda calculus, which is a feature we got in C# back in 2006. The only thing Oracle wins in is marketing.

So, back on topic... if you want something fun and exciting, Java is not the answer.

I disagree. Netbeans is pretty good and also free compared to Visual Studio ignoring the gimped express versions. When have you last tried it? What exactly sucks about it according to you?

Next is Spring which personally I find pretty good because it is fragmented or the actual word is modular. I especially like spring-data. See accessing data with rest/.

Example for the "DAO":

Code:
import java.util.List;

import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

@RepositoryRestResource(collectionResourceRel = "people", path = "people")
public interface PersonRepository extends PagingAndSortingRepository<Person, Long> {

	List<Person> findByLastName(@Param("name") String name);

}

That's all you need. You don't need to implement the method or write the query. It's done auto-magically for you. These repsitories also already contain default search methods for searching by ID and returning the results in a paged fashion.

Also the "findBy"-methods can be be far more complex like:

  • findByLastnameOrderByFirstnameAsc
  • findByLastnameAndFirstnameAllIgnoreCase
  • findByFirstnameNotLike
  • findByStartDateBetween
  • findByAgeGreaterThan
  • findByAddressZipCode
  • ...

In the latest Address is another class and zipCode a property of it.

Also Grails is based on hibernate and spring behind the covers.