6 ms·
I've worked with PHP for 16 years, and with Grails for almost 5. There are some aspects of Grails and Groovy that make me more productive than developing in PH
by mgkimsal 14y ago
I've worked with PHP for 16 years, and with Grails for almost 5. There are some aspects of Grails and Groovy that make me more productive than developing in PHP. GORM simplicity and expressiveness, and CriteriaBuilder stuff, combined make using direct SQL very rare (required in a few cases, but rare).
However, there are aspects of PHP that make things more simple, and this gets down to somewhat of a cultural thing. Of the PHP people I know, many (most?) of them have done some server setup and understand the entire request stack. I know a lot of PHP people don't grok all that as well, but of the people I know personally, many do. That number is far higher than the number of Java folks I know who really grok the full web stack. I'm not saying none do, but... many don't have to as much as PHP folks.
A friend of mine who's done Java for a decade (and Groovy some too) was confused by a complaint I was having about Java web stuff. Specifically, I was (am?) having some trouble getting session replication stuff working. We need to load balance web servers, and I really want to avoid server affinity on a load balancer. In PHP, sessions are serialized to disk, but serializing to memcache or some other database is pretty simple. Java... not so much.
My friend's confusion was "why are you doing that? just tell the ops guys to set it up". Well... I am the ops guy. Which gets to the culture of dev stacks. Historically, the Java shops I've seen inside are larger, and there's a bigger separation of concerns - the server/ops person often isn't even much of a developer, they just drop in a war file and keep websphere running, etc. Again - YMMV, but that's been mostly what I've seen.
The 'separation of concerns' here is the heart of the issue. In PHP, all session stuff is handled in code. In Java... well, your app server takes care of that for you - 'out of the box' you don't have any real direct control over how they're handled, and configuration of such is never done in code, but at the server level.
I'm reminded of PHP in 96/97. If you were doing PHP back then, it's because you really loved it, not because it was your job, and you really needed to grok everything about everything to get it set up and working (locally, anyway). If you're really set on using alt.java tech, you likely have a greater commitment to getting your hands dirty in multiple levels.
disclosure - i run groovymag.com and have a bias towards all things grails and groovy :)
- rabbitfang 14y agoGroovy, Scala + Clojure = next generation of languages being adopted by Java devs. All the things we love about Java combined with a more modern syntax.
- democracy 14y agoI can't see why you can't serialize session to database or memcache or anything else if you want. The amount of code involved is almost zero... Also I don't see a reason to have a shared storage for session objects in a scalable distributed application you are trying to build. In Java you could, for example, use ehcache with out-of-box replication - simpler than using external C-based application like memcache. And in Java world you have to deal with different applications servers (Weblogic/WebSphere/JBoss etc.) where apache http and nginx installation and configuration is very primitive in comparison. Yes, it involves sharp skills when it comes to huge loads and replication, but that's another story. Your friend is probably a young junior developer, you can't be a serious java developer without a decent server skills - there is no ops team at home to do it for you and you can't really gain a lot of knowledge only doing stuff at work.
- mgkimsal 14y agoFriend in question is certainly not a young junior dev - >10 years of dev experience, 8 in java, and does java training. Trainers may be more focused on language stuff vs admin stuff, so I cut some slack there. But.. the majority of java people I've known have been developers only, who don't do any server admin. Again, not saying java devs who know sys/server admin don't exist, but, the ones I know who do that aren't 'java devs' in the sense of only doing java, but tend to be polyglots with experience from multiple backgrounds. I'm not sure why you'd not have a shared storage for session data in a multi-server system. What else do you suggest? http://ehcache.org/documentation/configuration/configuration http://ehcache.org/documentation/configuration/configuration - that's an insane amount of configuration it looks like compared to something like PHP. It also looks like you're tying yourself to a specific caching solution vs having generalized session data.