> It would have been much better to utilize environment variables so the only thing that changed between environments was those variables.
I strongly prefer commandline arguments to environment variables: They're more transparent, easier to reason about ("what's running on this server? `ps`... oh, that process there is running in the staging configuration instead of production"), and it saves useless sudos (/proc/<pid>/environ has mod bits 0400, so if the processes you're investigating are running as separate users (and they probably should be), you can't inspect the actual environment that the process has, so you end up sudo'ing to check the environment out when you should have all the information you need in the process list).
If the environment variables are just interpolated into the run script by the deploy and then all passed to the process as arguments, that works too.
Also depending on how those processes are started (as root, from initd, or by hand from shell etc) environment variables might be stripped or incomplete.
Environment variables are kind of like global variables a bit. They are easy to set but feel a little dirty.
And of course if you use libraries or third party package that rely on them, then you don't have a choice.
Often times environmental variables are used inappropriately and make tracking down issues harder due to loss of transparency.
Plus environmental variables are context specific (e.g. user 1 and user 2 might have different ones, or server 1 and server 2 might, or this specific script may have re-defined one(!)).
A good o' fashioned script with the constants defined at the top, commented, and passed into executables on the command line (so tools like ps or taskman can "see" them) is really easy to debug/alter/monitor.
Java and or Oracle's obsession with environmental variables causes more problems than it solves.
I also agree, the only way I would use environment variables is for global configuration like HTTP_PROXY for example, otherwise I still prefer arguments, at least there is no surprises.
I agree but I also use DEBUG in my scripts to allow for on the fly debugging to occur.
I consider it a degenerate case and its only there for my own use and abuse. All it really does is redefines certain functions to be more verbose or print out debug level information.
I had one script that let you do DEBUG=somefunc and it would instrument just that one function. But to be honest it was overkill.
I was sad when I learned about this http_proxy environment variable and that things were actually starting to use it.
An http proxy setting is no more suited for an environment variable than anything else. I think it should just be a string in a file in $XDG_CONFIG_DIR/http_proxy.conf or something like that.
Container runtimes like docker make it much easier to inspect the application environment and arguments. A short `docker inspect <id>` will show you everything that is relevant to the app (environment, arguments, and much more).
One thing not to forget is that env variables are inherited by children, which may be relevant if the app forks.
Environment variables make perfect sense for constants that only, you know, vary with the environment. It's very nice to run the same exact code/artifacts on dev, qa, testing and production.
The way I see it, basically variables that are implicit to the machine/network that everyone should be able to infer. TZ, HOST, that kind of thing. Including, of course, similarly implicit custom variables like bkeroack describes.
On the other hand, environment variables are useful for things you specifically don't want showing up in ps. If you've got to supply credentials (passwords, tokens, certificates, etc) or anything else that requires a modicum of security, it's much better to pass those in as environment variables rather than command line arguments.
> env variables are inherited by children, which may be relevant if the app forks
If your app forks (or any of the multitude of libraries that it may depend on, check and _pin_ your sources (so they don't add un-audited behaviors)), whatever process it execs probably will get a copy of the environment of your process.
Yes, it's possible to clean the environment between the fork and the exec/execve. Do all / most frameworks do so or make it easy to do so? I'm not sure, but would check before making any assumptions about it.
I was about to suggest that sensitive information like credentials would better be kept in files that are referred to by name in command line arguments, but... unprivileged users cannot fork/exec a process as a different user, so children could read all the same files as the parent.
I can hardly believe it, but a plug for my masters work [0] is actually relevant here. I was interested at the time in the intersection of HCI and security, so I made up this thing called sub-identities that let unprivileged unix users create sub-users. It's a really watered-down version of some actual research that's been around for a while, but the point was, it was easy(ish) for the average unix user to use. I don't pretend that it was anything but a toy, though.
All that said, it seems that passing sensitive information in environment variables, squirreling them away in the process space somewhere, then cleaning the environment (all right away, during initialization) would be a smart thing to do.
> "Yes, it's possible to clean the environment between the fork and the exec/execve. Do all / most frameworks do so or make it easy to do so? I'm not sure, but would check before making any assumptions about it."
It might be better to wipe the contents of the environmental variable immediately after reading the value in it (presumably done at startup, or close to it).
Environment variables are useful in their own situations. For instance, OpenShift signals the open IP and Port number as environment variables. Which is useful when you have a program with an unknown set of command-line parameters. Either that or when you only need a subset of the available command-line parameters.
TL;DR: Java as a language is not bad. The problem with Java is its bloatware ecosystem. Endemic to the Java world are uninstallability, Rube Goldberg machine code, and such heights of over-engineering that they're easily parodied:
I think the over-engineering is an unintended side effect of Java's most attractive features: incredibly stable standard ABIs, portable byte code, fantastic tooling, and a language that makes byzantine abstractions relatively easy to implement without the instability you get in C++ or the unmaintainability you get in dynamic languages. Sometimes you actually do need very high level complex abstractions, so this makes Java a fantastic language for those cases. But those cases are rare. Java makes it easy to build towers of babel that stand up, so they happen.
Java can be fine if you exercise discipline around complexity. Java coders need YAGNI and KISS tattooed on their inner eyelids more than coders in other languages.
Anything can be parodied by exaggeration. One could provide a github parodying any language:
C: pointers-to-pointers-to-functions, type puns, and quasi-opaque "types" with really_long_identifiers_t everywhere (among many other possibilities, and bonus points for numerous reimplementations of basic data structures tailored specifically for different types without significant performance gains)
C++: see Java, but in C++ form; or alternatively larded with metatemplate programming
perl: write any valid perl, because it parodies itself
python: mishmash classes, functions-as-stateful-objects, and n-levels of decorators everywhere, and toss in some metaclass programming for giggles
And so on.
(Note: my favorite language to program in is currently C++, and I'm well aware of the less desirable traits of the language and codebases that exist.)
The difference is that with Java, the tools available allow creating immense complexity very easily - and due to how that complexity manifests itself as the complexity of the entire application, each individual piece still looks simple. A parody Java application resembles a real one more than the others you mention, which are more in the "clearly obfuscated" category.
So what you're saying is that the tooling for Java is more advanced than the tooling for other languages. I'm not sure I see this as a negative. I did node dev for a while, it was horrible, no tools that were any good, got a memory leak? Have fun!
Had a memory leak happen in Java once, had the proper tools already, didn't have to interrupt a live server or anything, plus the tools were easy to use and well documented.
Really the problem is that when you program in Java, you need to restrain yourself. You could create another level of abstraction, or you could just solve the problem at hand and abstract it later when you find a concrete case for it. And guess what, when you get there, you've got excellent tools for it.
I love making arguments to POSIX threads. My thread argument in my current project is a pointer to a struct with pointers to functions and arrays of structs which have mutexes and basic types in them. Try saying that fast. Now try changing something in it with the typesafety of C.
> TL;DR: Java as a language is not bad. The problem with Java is its bloatware ecosystem.
That's clearly a DR: one of the major headings is "The Java Language Kinda Sucks".
More accurate summary: Java as a platform is not bad, the problem is that the platform is popular enough that lots of less-than-skilled people are using it, and making lots of less-than-ideal choices about how to use it -- including failing to use the tools available in the ecosystem to streamline the experience (and including, as a subset of that, choosing the wrong one of the languages available on the platform, including choosing the Java language itself when its not the best choice.)
Java as a language not bad, but it's not good either. It's solidly mediocre.
IMO the best thing about Java is the interfaces and libraries. When you want to reuse some else's code, just looking at the public methods and their type signatures makes it basically self-explanatory. This is what I miss most when I'm working with dynamic languages like JS, Ruby and Python.
I think that is both fair and unfair. Fair because what you say is absolutely true. But unfair because if you stick to the non-bloatware libraries, Java is very good, very fast and surprisingly productive. For me, that stack is Guava, Jetty, Jersey, Gson, Guice.
I believe though that you can make poor library choices in any language & framework. With languages that have been around for a while, there are a lot of bad libraries...
The last time I tried using a similar stack, I found out the latest Jersey doesn't play nicely with Guice, since jersey uses its own DI library (HK2). Only one user was actively trying to solve the problem and eventually I gave up and looked at alternatives like Ninja framework (which uses Guice, but not jersey).
Ah, true. I still use Jersey 1. Jersey 2 has gone bloatware, sadly. We need a cleaner implementation of JAX-RS (which is really what we want, not Jersey per-se); I've worked on Apache Wink a little bit, but really Jersey 1 is good enough & good.
I don't know what happened with JAX-RS 2. It feels like the J2EE team got hold of it...
(PS Thanks for the Ninja suggestion; I will check it out)
My company is doing most of these things (except it's more complex because we're polylingual, and don't use Java for web apps), but Java still sucks.
The reason it sucks has more to do with the language and the culture that has grown up around it, than the mechanics of building and deploying that this article talks about. These mechanics have to be solved for most languages. They're table stakes; mostly just a basic level of usability from which you can start to measure against other things.
If I had to name the single worst thing about Java, it would be the tendency for business code to degenerate into a 1:1:1 ratio of interface:class:public-method. For any significant piece of logic, it ends up living in a class on its own, with its dependencies injected either via constructor parameters or method parameters. Whether the constructor or method is used doesn't really matter, unless the method is to be called many times, in which case the constructor acts as a kind of partial application. And of course the class it lives in needs to be the only implementation of a corresponding interface, which only has a single method, the method in question. All other interesting methods this method calls must in turn be called via single-method interfaces, with these interfaces injected via parameters, one way or another.
The cause of this is a religion around a particular style of testing. The development driven by the need to create tests for everything leads to code that has very little cohesion, very little structure, and most closely resembles 80s procedural code, but with vastly more ceremony. Code is hard to browse and read because the link between method call and implementation is hidden in a runtime indirection via an interface reference. This lack of legibility in turn encourages doing more work in these methods (albeit broken out into private methods), and instead of an OO decomposition of the problem, you end up with a poorly factored procedural decomposition.
The biggest symptom is classes with names that are close anagrams of their primary method. For example: StaleJobsCleaner.cleanStaleJobs, StaleJobsFinder.findStaleJobs, JobDeleter.deleteJob, JobDepedencyFinder.findJobDependencies, etc.
The reason it sucks has more to do with the language and the culture that has grown up around it
I think the culture is a far bigger issue than the language. Java is good when used properly, especially with the Java 8 updates. I don't think it's fair to blame Java for the culture issues. During the 90s and early 2000s, an "enterprise" culture formed using Java. However, that culture used Java because it was the new, popular language at the time. If Go or C# or Scala was released back then and had the same position as Java, that culture would've also produced very bad code in those languages.
Fortunately, the Java culture seems to be changing. There is now a more noticeable division between the old style "enterprise" Java code and newer, modern, and simpler ways of using Java.
These days it's important for a developer to know one static language and one dynamic language well. And that doesn't mean just knowing the syntax. It also includes learning the idioms and best practices in those two languages. The actual combination doesn't matter. It can be Java/JavaScript, C#/Ruby, C++/Python, Haskell/Closure, etc. For example, I focus mostly on Java and JavaScript because I use one for server and the other for front end. My JS knowledge made it easy for me to understand the lambda addition in Java 8. My Java knowledge allows me to understand the advantages of optional typing such as Typescript and Flow.
I've seen Java-only developers struggle with lambda in Java 8 because they've never written functional style code. And I've seen JS-only developers fail to understand how optional typing could be helpful because they've never seen the power of static typing in IDEs.
I used to dabble in languages, but I don't have time for that anymore. I've found that focusing and keeping track of changes in Java and JS are enough for me. JS is changing with ECMAScript 6 and includes good ideas from other dynamic languages such as Python. I'm hoping that Java starts to get some of the best ideas from Haskell and Scala.
Java 8 has pluggable type systems, some of them (physical units) are more powerful than what can be achieved in Haskell. There's even pluggable types that enforce immutability; even Scala can't do that.
Yes, Java is a passable language, even if not something I enjoy. However, the programming culture is a big problem, because of the tendency to overengineer in general and overdesign class hierarchies in particular.
The Android project I work on was started by an experienced Java team and has an interface for almost every class, uses injection and had a customized UI framework that was a nightmare of interfaces. Some of that has been cleaned up meanwhile, but those initial decision are hurting maintainabity and performance even now.
"For any significant piece of logic, it ends up living in a class on its own, with its dependencies injected either via constructor parameters or method parameters."
And I was worried I was the only one who thought this was crazy!
In most python frameworks, like django, when you want to call some service, you import some static class or singleton. It is simple and straightforward. If the framework wants to allow you to swap in different implementation classes, then it will define a singleton or static class with a clear API that then dispatches to the specific implementation class based on your global settings. Or, if you want to override the default implementation on the spot, you can just invoke the implementation class you want directly.
So in django, I just do:
from django.core.cache import cache
cache.get('my_key')
Voila! That's all the code I need, and it works great. I can easily swap in memcached or a file cache or a local memory cache or whatever. It is straightforward and easy to debug. If I am wondering why the wrong implementation service is being used, I can usually step through with a debugger right at the point it is being called and figure out what is going on. If you I am writing tests, I either use different settings or monkey patch the static class in my setup and tear down functions.
In most java frameworks, your classes are supposed to either accept the service via a constructor, or have it injected into your class via Guice or Spring. This adds a whole new level of complication and verbosity, and means things break far away from when you are using them. I know people swear by dependency injection, but I really don't get it, I have never found it to be a better pattern than the django pattern.
Python doesn't do anything differently. Your line of code there is accepting the django.core.cache.cache object as the 'cache' parameter to its containing module's global namespace, 'injected' by the module loading system.
Java doesn't have that loading system, so there is a small cottage industry of frameworks that provide its valuable features. None of them can rely on a language-specified import system and global namespace to which things can be added, which is why they get parameterized one way or another.
Breakage from faraway places can happen in either system, as far as I can tell. It's kind of inherent in the abstraction.
That seems excessive to me - at least, I don't see how SOLID principles necessary lead to that outcome even if strictly followed. What is it about those principles that prevent classes/interfaces that have a handful of related methods, like a StaleJobsService or whatever?
For all of the OO patterns, they have a common rule that says to not use them unless they actually solve a problem / code smell.
> The biggest symptom is classes with names that are close anagrams of their primary method. For example: StaleJobsCleaner.cleanStaleJobs, StaleJobsFinder.findStaleJobs, JobDeleter.deleteJob, JobDepedencyFinder.findJobDependencies, etc.
This issue has nothing to do with enterprise style, and everything to do with the fact that that's how "functional" programming is done in Java. What is really wanted is a first-class function `x`, but that doesn't exist. So instead an `Xer` SAM interface is summoned into existence that has that `x`.
Sadly, the unit-test everything mentality leads to a lot of problems in other languages as well. Often times, it provides little to no benefit to anyone while adding complexity to code and changing design for the worse. In a typical application, there are few methods that really benefit from unit tests and even fewer bugs prevented and/or caught by them yet still I see designs being modified to accommodate unit testing while other types of testing that could be useful are generally ignored. Even refactoring, which is the real purpose of unit testing, is generally not much helped by it.
If I had to name the single worst thing about Java, it would be the tendency for business code to degenerate into a 1:1:1 ratio of interface:class:public-method.
I agree. It's ugly and hard to maintain. Most enterprise Java usages of "design patterns" are unnecessary cruft. This is where I step back and say, "what you really want is a function".
The argument I tend to make for functional programming is that it only has two design patterns: noun (immutable data) and verb (referentially transparent function). And even though it's very rare that pure functional programming is used, mutable references (e.g. TVars for STM, reference cells like IORefs) are just "noun-plus" and actions (e.g. m a for some monad m) are just "verb-plus". It's easier (read: possible) to reason about the complex stuff if the simple stuff is done on a sound foundation.
Even object-oriented programming is made better by importing functional concepts. Python's take with "classes are simply functions that return objects" is much cleaner conceptually than the "everything is an object and objects do everything" pattern.
I'm confused about the title of this. I've never heard an argument that went "Java sucks because you are forced to (thing on this list)".
It's always been "Java sucks because it lacks (thing it certainly lacks)" or "Java sucks because it forces you to (thing it certainly forces you to do)", or, closest to this article, "Java sucks because it encourages you to (bad practice, such as those mentioned in this article)". None of these does the article refute.
I've seen places that used Java, and had most of these, and places that used Java and had little of it. I've seen places that used other languages that had all of these, and other places that used those same other languages that had none of it. This seems kind of orthogonal, and as such a bit of a strawman; is it in response to some specific arguments I've just not heard?
Java doesn't suck, not at all. I still find it to be the most productive language for developing systems big and small, mostly because it's well-understood, the pitfalls and traps are well-known, and the community is extensive and supportive, for the most part.
Java got a bad rep because in the late 90's, enterprises hired anyone who had the word "Java" on their resume, with no real assessment of their actual proficiency in the language or programming skills. As a result, there was probably more bad code written in Java than any other language in history (including VB- you just can't write as much bad code in VB as you can in Java if you really (don't) know what you're doing).
Much of this bad code ended up running flaky enterprise systems. So much bad code ended up in closed-source products (like Websphere, and like many JDBC drivers) that were sold to people who didn't really understand technology (but knew Java was sexy!) that Java itself got a bad name.
No, the language isn't perfect. But with all the lessons learned, and with the great developments in Java since Oracle took over (I cannot believe I wrote and believe that now), I contend it's perhaps the single best language for general purpose software in 2014.
The things James talks about in this article are all big problems that have less to do with the language than with the poor development practices that became so endemic to the community as a result of the rush to hire anyone with a pulse to be a Java programmer 15 years ago.
It would be cheap and easy to label this view as almost a perfect example of Stockholm syndrome, but I would suggest you may need to be a little more objective and critical of your tools. The master works with a variety of tools exactly because they have strengths and weaknesses.
Java has some extreme weaknesses in verbosity, almost to the point of programming language diarrhea. It envelopes a development culture that gave us things like: InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState.
It's hard to imagine someone who wouldn't be turned off by the tone of this article. Kicker is the quote at the end: "If you are in a typical enterprise then maybe you are lucky and already doing most of this." I went looking for sarcasm twice and still couldn't find it.
Java enterprise shops are not using git and JRebel and Play Framework and continuous deployments and 2 week sprints and reactive development refactoring boilerplate into lambdas.
Nor are they "mocking" amazon web services for ease of local developer testing. And a request to your boss to write the next services layer in "Kotlin" is likely to be met with the slap it deserves.
I have been an enterprise Java dev. Of the things you mention us not doing, we did about half. We mocked external services for unit tests, used git, and did 2 week sprints. My boss had no say on the programming language we wrote services in, I just would have had to convince the rest of my dev team. I doubt that it looks very different at Google or other suitably modern enterprise Java companies. Enterprise doesn't mean shit, it means big.
I guess define Enterprise. The OS experience doesn't sound like "Enterprise" to me. Just install the JDK? Most enterprises I worked at, it was more like install WebSphere and it's clients.
I did hardly any of these things and I worked at a Fortune-5 company for close to 10 years on a mix of technologies; java being one. Much of the Java there was of the IBM variety. We had WebSphere and their over priced crap. As an insider, many of the DEVs preferred C#. I think much of this had to do with the better development tooling: Visual Studio vs. IBM's version of Eclipse and its infinite list of bolt on and buggy tools. My last 4-5 years there, just about all new apps. were going to C#/.NET platform. I was an insider in an architect role where one of my responsibilities was sitting on a board that oversaw every app. coming into our data center to make sure it followed best practices from language, tools, and general infrastructure stuff like Oracle vs. MS-SQL, SAN or local disk storage.
One of our major areas of problems was JMX Message queues and prioritizing them across load balanced clusters of WebSphere servers. It was extremely clunky where as the .NET had better alternatives.
Since we were an Enterprise (Fortune-5) by a reasonable definition, GIT and open source version control wasn't use. We use IBM Synergy which is another mess. My last year working there we actually did a trial using subversion which gained a lot of traction.
Another problem for Enterprises is single sign on. Especially when you have tons of vendors who want to vet user credentials against our backends. We looked at SAML, WS-Federation, and how much vendor support there was. Like many others at the time, we came up with a kluge based on shared cookies so both our Java apps and .NET apps could work. Largely these standards are too lose to begin with too. Enterprises with deep pockets are hard to work with if your small OEM who can't afford the same financial commitment.
In short, most "Enterprises" have a separate group of people who manage the development environment. You don't typically see DEVs setting these things up. We had standard loads for our developers to install and we had the same for our servers. Yea, there were occasions where we would install more JDKs and JREs to test to see if there was a bug or performance difference in the libraries but for the most part, none of the developers had to really mess with the dev environment or the version control stuff.
The following companies are Java shops (i.e. they use it for all/most/huge or very large part of their coding effort): Google, Amazon, IBM, Oracle, Twitter, Netflix, NASA, LinkedIn, Boeing, Raytheon, Twilio, Box and the list goes on and on and on. In fact, you'll be hard pressed to find companies working on large scale projects that don't use Java in any way (Microsoft, GitHub and Stack Exchange are notable examples -- there aren't too many more). Even Facebook, which isn't a Java shop, uses Java quite a lot for their analytics.
Pretty much all air-traffic control and defense systems in the Western world are written in Java (those of them written in recent years). In fact, every piece of software you really rely on (probably without even knowing it), there's a very good chance it's written in Java. Hell, there's even embedded avionics software written in Java nowadays[1]. So you'll be surprised what many different kinds of tooling -- both modern, super-modern and less so -- is being used in Java shops. Some use hard realtime GCs, some use really advanced model checking (NASA has built an awesome Java model checker), and yeah, many use Git. And even if many of them don't -- the work they do is so important, that I could really care less whether their SCM is hip or not.
In which case find a new job. I don't understand why people stick with these hell holes for engineers when there are many opportunities to be found elsewhere. You can even find remote work so even if you're stuck in a small town with only one Java employer and you have a family and can't move you can still find that dream remote job with modern tooling and practices.
If you apply to these remote jobs but aren't getting hired, that's a solvable problem too. Keep trying to learn more, self-improving and keep applying.
> Keep trying to learn more, self-improving and keep applying.
I think it's worthwhile to add "improve your job application strategy" to that list.
There was just an article on the how bad resumes are at predicting success; the converse is that you can likely improve your resume if you're not getting offers.
And write a cover letter. Probably one in 20 (or maybe one in a hundred) resumes come in with a cover letter. And make it relevant. Talk about what the company does and how you'd be a good fit. Paraphrase their requirements list as a list of your strengths, and explain how things you don't know can be overcome.
When I do this I have almost always gotten an interview. [1] And when I get an interview I almost always get an offer. [2]
The other strategy that works for me is to network. Go to MeetUps relevant to your field and interact with people. I don't care if you're an introvert; I am too. It's hard. But do it. It's worth it.
Right now I have a remote job that pays well where I was recommended by a friend who I met because I was networking.
[1] The only exception for me was the months following 9/11, when no one was hiring because the whole nation was in shock.
[2] I really recommend "Cracking the Coding Interview" by Gayle Laakmann McDowell; if you can answer all of the questions relevant to your field, you should be golden.
Solid advice, but I have a question for you that's always been in my "too embarassed to ask" category: When you say cover letter, do you mean you attach a cover letter to the email as well as the CV, or does the email itself serve as the cover letter?
You can go either way. It's more likely that they'll print a cover letter to go along with the resume if you attach it as a separate PDF, though. They might just ignore the email and print the resume, otherwise.
The point of adding a cover letter is to stand out. If you don't, you're far more likely to end up ignored in the avalanche of resumes, especially considering how poor of a signal most resumes are.
I'd rather have a chance to actually get the job, if it's one I'd find interesting, and writing a cover letter is easy. But you're free to be ignored if it makes you feel better.
We use JRebel on my team, everyone has a license. We do continuous depolyments and are coming to the end of our current two week sprint. We use Java 8 and are actively leveraging lambdas for code that is more readable.
For sure, we are not doing everything mentioned but I think we're pretty progressive and, on the whole, have a healthy attitude towards learning new things. Not every job has to be as suffocating as your example.
"Java enterprise shops are not using git and JRebel and Play Framework and continuous deployments and 2 week sprints and reactive development refactoring boilerplate into lambdas.
Nor are they "mocking" amazon web services for ease of local developer testing."
We do all of these things (minus play framework and i don't know what reactive development is) where I work and we're in the fortune 500.
I work in a Enterprise Java shop in the midwest that employs 35k+, of which 5k+ are software engineers. We have 2 weeks sprints, daily scrums, retro and IPMs. We maintain legacy code that has been in production for more than 8 years and write new fully unit and integration-tested code in Groovy/Grails, Ruby/Rails, Java, and Angular. We use the latest tools and machines (both Win and Mac, paired with Intelli J). And our servers are all virutalized. No physical servers under our desk.
I'm in a 70,000+ person company ("enterprise") and we use most of the things in your list. My direct experience does not match your assumptions. And this is a company that is not considered leading-edge in softwawre development, believe me.
The problem is not necessarily with Java or the JVM as a technology, but rather the "Java shop culture"[1] that often goes along with it. Although I would call it "Enterprise shop culture" instead, since it seems to stem from people who (sometimes unknowingly) perpetuate big company politics and a consultant attitude, even in startups.
I've found "Java shop culture" in non-Java places as well--C#/.NET for example.
Java as a runtime is a really nice piece of technology, Java as a language is pretty good, if a bit dry.
It is the heavy-weight anti-YAGNI ecosystems that grow around it (the AbstractFactoryFactoryManager APIs that these Java shop cultures tend to produce) that makes working with Java suck, in my experience.
And yes, that stuff can be avoided if you aren't stuck working on a maintenance project and you are really careful to smash down any signs of that sort of culture growing when you see it.
I've coded with Java for... well, since it came out (C, C++, Lisp before that) and I have never worked at any place with a culture like that. In fact, in my experience, it's the Microsoft shops that have been all (wannabe) Enterprisey (yes - that is a word)
> The blocking model limits parallelism, horizontal scalability, and the number of concurrent push connections.
[citation needed]
Seriously, where are the benchmarks? I see lots of claims of threads being slow and heavy (see also every time green threads comes up), yet... they are not. And every benchmark I've seen shows that, gasp, kernals are really fucking good. And library-of-the-week's greenthread kernel is not.
So if you're using NIO instead of blocking IO threads, well, say goodbye to 25-30% of your throughput. But at least you got to feel all clever using unnecessarily complex async programming, so that's worth it, right?
Each thread has a minimum stack size which can grow memory quickly if you're using 10k's of threads. Using an async framework like Netty gets you into 100k connections and beyond. (Not that it's always the right thing to do unless you have lots of long-lived requests)
Like all virtual memory the stack isn't actually allocated until it's used.
So, no, that doesn't grow memory quickly. And while it's great Netty will get you to 100k connections, you can totally have 100k real threads on Linux. In fact, as far back as 2.5 in 2003 starting & stopping 100,000 concurrent threads took just 2 seconds with the introduction of NPTL. CPUs & memory have gotten a smidge faster since the Pentium 4 days so that time has almost certainly dropped significantly.
But the stack will be used for each request, especially in Java app servers where stacks are often dozens of frames deep. The lowest stack size I could get away with for Tomcat 6/JDK 1.6 was 128 KB.
Sure, you could do better with a lightweight C/C++ solution.
Before down-voting and replying, please, copy and paste examples from the Rosetta Code website, which would prove my statements to be incorrect.
1. Syntactic noise.
2. Verbosity.
These gives us lots of cryptic lines of code, full of design patterns and other kluges. This is also related to the two below:
3. Over-abstraction.
4. Everything must be a member of a class.
These two are simple and straightforward. These few pages long stack traces is a result of these unnecessary method calls.
5. Static typing makes our code safe.
This nonsense results in even more lines of cryptic code ("generics") and even longer stack traces.
I am not talking about XML configs, over-"engineered" components (beans, servlets, etc.)
Here is a lemma: Any algorithm (at least those represented on the Rosetta Code website) could be coded with less lines of code, less words per line, less "special symbols" (with much better readability) and executed with less memory waste (this one excluding scripting languages for obvious reasons) in any other mainstream language. Period.
Sure, Java does not suck. It is stupid us, who are unable to "get it".
Not that I typically defend Java, but I think that (going by your Rosetta Code algorithm comparison test) Java fairs well against a few mainstream languages:
Now, this isn't entirely fair; one of C++'s faults/benefits is that depending on your shop and/or framework/libraries, "idiomatic" C++ can vary greatly. Template heavy C++ tends to look like vomit. C++ that uses Boost will typically be more unpleasant to look at than C++ that uses Qt (imho anyway).
Java really comes into it's own horrible self when you get beyond mere algorithm implementation. A quicksort method in Java will tend to be relatively fine, but for projects larger than that it becomes idiomatic to make your java code a real mess.
Definitely. Pointing to C++ as a mainstream language that is uglier than Java seems a bit like missing the point since it is basically the exception that proves the rule, but he did say "in any other mainstream language. Period." ;)
I maintain 2 semi-big Play 2 web services (written in Java, not Scala) at work, and I just hate it.
- SBT is super slow compared to maven
- Compiling a play 2 app is slow
- IDE integration is quite bad
After a year, I would definitely not recommend Play 2, or SBT on a Java project.
My choice when using Java today would be Dropwizard, although I haven't deployed anything in production using it, I tested it for a couple hours, and I think it's the best combination of libraries.
One thing I definitely agree on, is to use Docker if possible. We use it for almost everything at work, and it improves our deployment speed, it gives us more flexibility and local/CI testing is now super easy. In case you deploy with Docker, using only environment variables for configuration is great, that way you can control the configuration directly via the docker command line. With Java a good library for this use case is Typesafe's config, which can automatically use environment variables.
SBT is probably the best example of the total immaturity of the Scala community in terms of real-world engineering. Hey, we're building for the JVM, we've got Maven, it's arguably the best solution in any language for a very difficult problem that has stopped entire language ecosystems in their tracks. Let's rewrite it, from scratch, using unproven concepts! And put 'simple' in the title!
Afterwards, we'll call XML ugly and claim to be more 'functional', without even noticing that Maven's pom format is actually a nested s-expression structure that happens to use angle brackets.
> we've got Maven, it's arguably the best solution in any language for a very difficult problem that has stopped entire language ecosystems in their tracks
Wait wut? Are you drunk? :-)
My experience is that SBT works great, while Maven tries to fight you at every step. SBT developers try to help you get you work done, while questions in the Maven community are usually answered with bullshit responses.
Maven (like Eclipse) are a great example of what's wrong in the Java community.
Not yet. You wanna show me the better solution than Maven? Something that manages multi-module projects, with various versions of dependencies, and packaging as war/jar/tgz/whatever?
I've probably spent way more time cursing Maven than praising it, but that's the nature of a build/packaging/dependency tool, it's like a sysadmin, you're either not noticing it's there or cursing its parental lineage.
What's SBT offer over maven? Lack of XML, with more trendy markup and new bugs? Like I said, immature.
If you're motivated to wade this far down the thread, but can't be bothered to explain one concrete benefit in one sentence, I've gotta assume it's pretty difficult to come up with one.
Just one, to not prevent you from doing your own research:
Type-checked build definitions.
I lost days to debugging broken Maven setups were some tags were misspelled or placed at the wrong position, and Maven just gave a shit about it.
SBT immediately tells you what's the issue.
Another one: It's completely painless to introduce new settings/keys/commands/tasks. Want to have a deployment step which moves some files to the right place after compilation?
3 lines of code. 3 lines, not a god damn Maven plugin.
Well, we seem to disagree on the usefulness of those items and the quality of SBT's solutions vs the pain of rebuilding an entire new build/deployment stack and fighting through all the bugs you've created.
We'll just have to see how history unfolds. IMO sbt already hit the high-water mark and is receding, lots of shops using scala today advocate using mvn.
EDIT: You inspired me to do some research. Apparently, senior engineers from typesafe do hour-long presentations named "Effective SBT" at Scala Dayz conferences. Truly the simplest of build tools.
> IMO sbt already hit the high-water mark and is receding, lots of shops using scala today advocate using mvn.
I haven't seen that at all in practice. I think that's just a bit of noise on the internet.
SBT keeps getting better, and many shops which originally opted to stay with Maven are now moving to SBT, because it's just so much better than Maven.
Not sure what your problem is. Even back in the 0.7 days, SBT was better than Maven. I'll change profession before I ever move back to Maven.
Oh, let's have a look what that "senior Typesafe" guy has to say about SBT vs. Maven:
Well, coming from first contributing to the maven-scala-
plugin, then eclipse, then sbt itself, I can tell you that
some of the things we do in sbt just fundamentally won't
work in Maven, otherwise I'd have tried them.
If you'd like my branch list of broken experiments, I can
share them, but be assured that I personally was an sbt
hater before learning the tool.
All of the complaints of syntax and documentation DO
represent a younger project vs. a more mature one.
However, architecturally, I'm placing my money on sbt over
maven. THat's not to say sbt is perfect, but I think most
of these complaints are adressible.
In the previous project I worked in, we switched to Dropwizard for a lot of services that now run in production. We were already using Jersey, Guava, etc., but Dropwizard gives some nice extra glue and standardized our configuration and gave us a standardized way to instrument services (via metrics). It can really recommend it for RESTful services.
Also, there is a nice Maven plugin that creates Ubuntu packages from Dropwizard projects:
Your experience around the performance of SBT (and possibly, by extension, Play compilation) runs very much counter to my experience. I have found SBT to be much faster than Maven (thanks largely to the console). There may be something wrong with your project that is causing it to build so slowly. Are you seeing the compilation go very slowly or is it more issues with artifact resolution?
I've used SBT with and without Play 2, and it was a pain every time. On a standalone app, resolving dependencies was the big time consuming part, but compilation was slow too. I'm not talking like 3x slower than Maven, but it feels slower.
We've had around 7 different projects using SBT at one point (most are now using Maven), and it was always that painful for us. We've mitigated the issue with resolution by using our Nexus server as a proxy, it helped a bit.
But other than performance, over the year we've had a lot of random issues with caching. Things like a dependency not found in the ivy cache which required us to completely remove the cache for that artifact. A "test" run which found no tests to run, which required us to remove the target directory for some reason.
Play 2 was just the icing on the cake: it has a lot of dependencies, and the routes in Scala takes what feels like forever to compile, not joking it feels like that single route file takes as much time to compile as 30 java files.
I'm sure it's not the experience of everyone, seeing how many people enjoy using Play 2/SBT but for our organization it wasn't a good choice.
Yeah, historically the artifact resolution has been kind of slow if you have several sub projects. However, there was just a new release of SBT that added a bunch of improvements for this[1].
Play 2 really is a different framework than Play 1, which was what brought Play its fame. If you like Play 1, try the Ninja Framework. It has a cheesy name but it has the super fast development cycle that Play 1 used to have.
I would agree with that, though perhaps more about PHP than Java. We like to say "use the right tool for the job" and "you can write bad code in any language", but that's just a way of seeming egalitarian and not really dealing with the issue. It feels bad to talk about shitty programmers but they're kind of a problem.
It is only tangentially related, but I recommend this video from Brian Geotz, a Java language architect. He breaks down the challenges of adding features to the language, in a room full of Clojure devs no less. Worth a watch: https://www.youtube.com/watch?v=2y5Pv4yN0b0
Agreed about the verbosity and Java 8 is only making the situation worse. I've been a Clojure enthusiast for a number of years now, but I was hoping there would be less of a need to use other JVM languages with Java 8 and Streams. I find working with Streams to be 3 steps forward and 2 back. The syntax (as usual) is cumbersome, and add a layer of generics on top of that and you have somewhat of a mess. I also find interop with traditional Java Collections to be annoying though maybe I am not following (yet to be discovered) best practices for dealing with Streams.
Edit: Ohh and BTW, if you ever have the opportunity to see James Ward speak in person, do so. He is a great presenter, and a regular cast member at the Boulder Java User Group.
> If your app needs a relational database then use an in-memory db like hsql or cloud services like Heroku Postgres, RDS, Redis Labs, etc. However one risk with most in-memory databases is that they differ from what is used in production. JPA / Hibernate try to hide this but sometimes bugs crop up due to subtle differences. So it is best to mimic the production services for developers even down to the version of the database.
The idea that you can develop locally or test against a different type of database then what you are (or will be) using in production is silly. I don't just think it "sometimes" is a bad idea, I reject it outright. You should always be using the exact same database (type and version).
For cloud deployments most XaaS providers have cheap or free dev tiers. For local development it's easy to use VMs. For any project that requires external resources (Postgres, Redis, RabbitMQ, etc) I have a VM that gets spun up via Vagrant[1]. Just "vagrant up" and all external resources required by the app should be available.
> So first… Use a build tool. It doesn’t matter if you choose Ant + Ivy, Maven, Gradle, or sbt. Just pick one and use it to automatically pull your dependencies from Maven Central or your own Artifactory / Nexus server. With WebJars you can even manage your JavaScript and CSS library dependencies. Then get fancy by automatically denying SCM check-ins that include Jar files.
Though I agree that it's a good idea to have dependencies externalized, it's not always possible. Some libraries (ex: third party JARs) are not available in public Maven repos and not everyone has a private one setup. In those situations it's fine to check in the JAR into the project itself.
I like the approach outlined by Heroku for dealing with unmanaged dependencies[2]. You declare them normally in your pom.xml but also include the path to a local directory (checked into SCM) with the JAR files. Anybody that clones your repo should be able to build the project with no manual steps. Works great!
I think an important lesson for web application development—mentioned in the article—is keeping the server stateless, moving state into the client, and using a real middleware like Redis for the session cache.
I'm a .NET developer and I love C# & Visual Studio but have worked some with Java. Most of his arguments sounded to me like- "Just do complex-sounding long list of steps, it's easy!" Java development seems like a massive pain, and too much time not actually spent on development.
>Clojure: The lack of some OO constructs makes managing a large code base challenging
I would be intrested in what his problem is. The only thing that I can think of is subtyping and Im not sure how subtyping helps managing organisation.
Clojures namespacing is pretty nice, it might be a bit to complicated but it does everything you need.
all of his points except for one are related to the jvm in general, which most people agree doesn't suck, and then when it is time to address java he just says "scala, clojure.. are great" Yes, thats the point. The JVM is well liked, but Java as a language is not, and I don't think he did much to change anyones opinion.
C compilers were between K&R C and ANSI C, writing portable code was #ifdef mess.
C++ compilers were even worse than C ones. Each between their own interpretations of CFront, C++ ARM and ongoing work at ANSI.
Outside UNIX world, no one cared about POSIX, which was in adoption phase anyway. So even across UNIX systems, #ifdef spaghetti code it was.
Safe system programming languages like Ada, Modula-2, Modula-3, Oberon were failing to pick up steam with the enterprise adopting UNIX variants and its two main languages C and C++.
Java brought sanity into writing portable code and better type safety.
The initial versions were surely slow, but the adoption of JIT and AOT compilation across commercial JVMs helped to adopt it.
As for the ivory towers that get written with Java, they were being written in code generators based in UML/OMT/Booch..., C, C++, Clipper and lots of 4GLs when it appeared.
It is just an enterprise sin to write such type of software.
Right now Java is slowly moving to the Third System (see the evolution from J2EE => JEE 5 => JEE 6 => JEE 7). Ditto with the mindset of Java developers of today.
I do not agree that JVM does not suck. It sucks badly. No tail calls support, no (optional and confined) unsafe pointer arithmetics, no value types and a pathetic limit on a method size makes it an extremely shitty target for any language other than Java. All the existing languages running on top of JVM are very, very inefficient, or have to pay a horrible price for being able to run reasonably fast (crap like `recur` in Clojure, for example).
edit: I suspect that none of the downvoters ever implemented a single compiler targeting JVM.
The JVM is just another example of worse-is-better. If you were to actually write a high performance JIT-able cross-platform VM that supports multiple languages, it wouldn't look anything like the JVM.
The JVM worked well enough and a lot of companies put a lot of effort into it. But fundamentally, the design is "meh". It just gets the job done.
Is there a good reason for VMs to support TCO rather than having compilers perform it?
> no (optional and confined) unsafe pointer arithmetics
When do you want this? There's sun.misc.Unsafe#setMemory if you really need it.
> no value types
Might be added in JVMS 10 or some version thereafter.
> a pathetic limit on a method size makes it an extremely shitty target for any language other than Java.
True.
> All the existing languages running on top of JVM are very, very inefficient, or have to pay a horrible price for being able to run reasonably fast (crap like `recur` in Clojure, for example).
Fair enough, but it wasn't designed as a general purpose compilation target like llvm.
> Is there a good reason for VMs to support TCO rather than having compilers perform it?
Again this word! Proper tail calls handling is not an "optimisation". Optimisations are supposed to be optional, while tail calls handling makes a semantic difference.
And, no, compilers cannot do it statically. You cannot statically resolve virtual calls, for example. Consider the following trivial case:
`(define (f g x) (g x))`
> When do you want this? There's sun.misc.Unsafe#setMemory if you really need it.
Try implementing, say, an STG efficiently. Or even a WAM.
> Might be added in JVMS 10 or some version thereafter.
JVM may start to suck less at some point. But now it sucks.
> but it wasn't designed as a general purpose compilation target like llvm.
Exactly. And that's why it's inferior to the other VMs, which were designed with multiple source language semantics in mind. Including even CLR.
Why limit your VM expressive power? Restrict only untrusted loadable modules, do whatever you want in the trusted realm.
> C derived languages are already enough.
Not nearly. You won't have a managed VM with fast run-time code generation with C.
> Just because it looks like a method call, doesn't mean it is one.
Problem with intrinsics is that the majority of your optimisation passed do not know anything about them. See LLVM as an unfortunate example. Most of the SIMD intrinsics are not even used in a simplest constant folding there.
> Not nearly. You won't have a managed VM with fast run-time code generation with C.
I was speaking about security exploits. C should never have happened.
> Bingo! CLR is better. Scrap JVM.
Yes the CLR does quite a few things better than the JVM compatible VMs do currently.
However, the JVM being a specification means I can find a JVM for anything has that a CPU, from smart cards up, servers, mainframes, cars, weapon guiding systems, factory robots, anything.
So while technically better than the reference implementation, it doesn't cover the application spectrum JVM compatible VMs do.
People tend to forget that Sun (now Oracle) JDK is just the reference implementation.
> I was speaking about security exploits. C should never have happened.
I see. I sort of agree - C should never have been exposed to the programmers. But a C-level VM is an extremely useful thing for implementing high level languages. I'd rather move safety checks a number of levels up, and leave VM level to performance-related stuff.
VMs should be available in runtime (no matter if an AOT is present or not) in order to allow an efficient run-time code generation. And VMs should also be available during compilation to make it possible to efficiently implement reflective compile-time meta-languages (e.g., like Common Lisp).
And the difference between abstract machines, intermediate representations and virtual machines is very elusive (see all the confusion around LLVM for example).
Java itself was once so popular that a completely unrelated programming language, javascript, had java in its name to ride the coat-tails of its popularity.
The culture and behaviors that have grown up around it though make it easy for people to fall into holes. (Both technical and non-technical, e.g. hiring culture)
It's like if a minefield existed via the path of Java and people said "There's no way through this minefield." And another retorts "Of course there is a path! Just go through it carefully, learn the topology, and it's just as fast as sprinting across an open meadow."
One of the few big problems I have with Java is that you can't use anonymous classes as real closures like it intuitively looks like you should be able to.
I haven't used Java for a long time myself - and am not up to date with it's current featureset. I know I used to like coding in Java back in 2000/2001, but my professional career demanded switching to C/C++ - which I did and also said goodbye to a few years ago.
Anyway - something I posted yesterday in the "Java for everything" thread here:
> My view of Java may be a bit biased, since I also tend to look at things from the sysadmin pov nowadays. I can only tell that I never disliked Java until I had to take care of the monstrosities the Java developers bring to life, and mind you - I started out as a Java dev back in 2000.
>
> The main issue I have with Java is the JVM and memory usage and leaks. No matter what people claim - no memory leaks in Java is a fairy-tale. We run both custom C++ and Java services (about 50/50) on a few hundred servers - and I cannot find a single issue in our ticketing system related to memory problems with any of our C++ services. Java services? Every. Single. Week. When I get an alert some JBoss unexpectedly died or became unresponsive - "java.lang.OutOfMemoryError" is most likely going to be the problem. A lot of those are permgen space errors, and yes you can try all the "fixes" like increasing the permgenspace, permgensweeping, enabling class unloading, ... but these don't always fix the problem and slow down your services. Every time this happened in our own services, this had to be fixed by our developers. It takes weeks to locate the problem, and you end up deploying new versions, upgrading JBoss, JSF, Bouncycastle, ... whatever.
After a while dealing with crap like this - you start avoiding projects using the JVM (although elasticsearch is pretty nice)
If I'm reading this correctly, it just boils down to "use the right tools and Java won't suck" which is something that can be argued for most programming languages. This is fine and all, but one of the problems for new programmers (the majority of languages comparers) is that learning what Java toolset to use is a huge hurdle. Java's diverse ecosystem and long history hurt its image by making it seem like a hulking monstrosity that is reserved for enterprises. Combine this with the verbose syntax and any cursory glance at Java will drive most new programmers away. Compare this with other languages that do not suffer from such a poor image and it becomes easy to see why people often say, "Java sucks."
What I wonder is if the following exists:
* A simple/clean tutorial that introduces a developer to the most common tool chain (perhaps various tutorials for different use cases - web, desktop apps, gamedev, etc.).
* Instructions that don't just name drop, as this article does, but instead gives concrete examples that lead to a fully functional work environment. Perhaps one that works as this author describes - scripts to setup dev environments, deployment, CI, etc.
* Advanced instructions that point you to documentation in the case that you need to go beyond a simple work environment.
* A comparison of various tools in the Java ecosystem that compares the use cases and, more importantly, gives examples of how various tools would be effectively used together.
One of the reasons why I personally find Java to "suck" is because the friction involved in getting up and running in an efficient manner is far greater than that of other programming languages. I think that rather than write such an article defending Java, it would be much better to create a beginner resource that can onboard developers easily.
Right, but the traditional core ecosystem tools have pretty poor performance (long deploys, etc). Point is there is something there that "needs to be fixed". There are tools that do that, but those are hard sells in an enterprise environment for a lot of reasons.
Businesses tend to be wary of building long-term solutions in flavor-of-the-week frameworks/environments/etc. Even when it's just a dev tool, even assuming that the tool behaves exactly like a real production environment, there's overhead to throwing away your workflow that Just Works and getting everyone used to something new. And developer culture right now is that there's a new must-have "Hottest Tool/Framework/Library That Will PUMP UP YOUR PRODUCTIVITY!" every couple months.
And rightly or wrongly those tools are often a hard sell to management when there's ongoing costs - we can't get funding for a JIRA server let alone JRebel. Yes, the time it saves me would be worth more than $1.50 per work-day, but that's often not how managers look at it.
JRebel IDE plugins integrate with your IDE debugger to hide the indirection from you. Works for me. If it does not work for you (or the performance hit is non-negligible) then I suggest you contact their support, they usually fix stuff in couple of days (from my personal experience).
And, AFAIK, Play! is also fully debuggable. What's bothering you?
Yes, the IDE hides the indirections, but not in the bytecode. I mean when I need to profile or debug the binary and optimise e.g. the GC or the heap usage, I am stucked, right?
It gives you extra costs and complexity on scalability and availability. Also makes continuous integration and frequent releases more tough than it should.
"Decoupled Schema & Code Changes: When schema changes and code changes depend on each other rollbacks are really hard. Decoupling the two isolates risk and makes it possible to go back to a previous version of an app without having to also figure out what schema changes need to be made at the same time."
Generally you would use an expand/contract migration pattern.
You deploy a schema expansion so that both the new and old code will run, deploy the new code, and once the new code has been validated you deploy a schema contraction.
That's what I came up with, too. But it's still coupled: you can't "go back to a previous version of an app without having to also figure out what schema changes need to be made", post-validation, anyway.
I love Java. When used correctly it's a very powerful language that is easy to run in many environments. I choose it for any personal project that I can see growing beyond a few small scripts.
I hate Java culture. Too much Enterprise Java is filled with SomeThingImpl, MyModelDAO, SomeShittyBean, and magical XML configurations. I don't know how things got this way (I haven't been around long enough) but there is no reason Java the language has to be attached to this nonsense. I totally understand why people take one look at a modern Java codebase and swear off the language forever.
For me though, Java is the mainstream language that I find makes me most likely to be correct the first time I write a program. Yes that comes with verbosity. Yes that means I have to use a RAM-hungry IDE. But I write code that runs fast and correctly the first time. I love that.
Exactly. Java is fine if you just write plain-old classes. It's when you overuse patterns and try to make everything hyper pluggable/configurable with XML-based dependency injection that it becomes a disgusting slog.
I write Java that is 100% "Plain Old Java Objects" and it is just fine. Keep it simple.
No developer should install JDK, it's a mess, madness and risk for crapware. Just use the JDK zip/tar.gz for that one specific project.
Even for distributing java apps I find it much easier to bundle JRE with the app and never ask for the devop or end user install it separately. The license for bundling is quite permissive [1] and bundling can be also used for os x apps [2].
That's from 2007 and more's been added since. What hasn't changed is it's still in Antlr 2 whereas the latest version of Antlr is version 4. Groovy's not simple, it's an obsolete dinosaur.
Suddenly I'm reading Java-come-back articles, which is nice. That convinced me to some extent I should learn Java more for serious coding, instead of spending the same time on php/python/javascript. Not saying the rest languages are bad, but life is too short to get good on all of them.
I'm not sure about the "Useless Blocking Sucks" paragraph, it's very opinionated and using the play framework in production is nothing I would recommend for enterprise deployments. The technology is still very immature and I do not see that the overhead of an extra thread per request would matter.
His last note should have been his first; it's the Java environment that doesn't suck in any magnitude more than other environments, and has oodles of benefits for getting Serious Business done. You now have your choice of language with which you can enjoy the rock-steady JVM/JDK-library environment.
>>Spend a couple evenings or weekends working on implementing one of these items. Then show your manager what you did in your own time (that will convey how much you care) and then let them take the credit for the amazing new thing they thought of.
Why would someone want to do that , unless its someone's personal project?
If the expected cost of interviewing for and finding a new job where these things are already in place is greater than the cost of a couple evenings or weekends to add those features to the current work environment.
Java has some problems. I would contend that using the wrong tool for the job == using the tool wrong. Java has its place, but overall there is a better, more specialized solution in most instances that doesn't have some of Java's (pretty hideous) warts.
This article reads like an advertisement for play2. I created apps with play 1 and when play 2 was released I was quite excited hoping for things to get even better. Unfortunately the authors like Guillaume Bort and some others found love for Scala. Now the core framework is written in scala and play feels like a scala framework even though they added some Java Apis. The last time I checked play2 out there were conceptual inconsistencies between scala and java flavors of play2. For example Java comes with a hipster ORM (ebean) and Scala has a completely different almost non ORM flavor called anorm. Also IDE Support for play2 java flavor sucks. The biggest advantage of playframework was to have an agile framework like rails in the java world. This advantage has gone.
I guess I just felt bad to see all those great bulleted itens with some nice phrasing around and then to see my dear Dynamic Typing there, alone, without any adjective. No love, no hate, simply emotionless "Bad" :(
Good point. I should have put more details in there. I prefer static typing with good type inference because it allows me to have a compiler validate a lot of my code pre-runtime. Otherwise I'm left with tests and actually running all of the code to do that validation. The value of this for large code bases has been worth the tradeoffs in my experience. But since this is one of the most debated things in programming I don't expect to sway anyone. I'm happy to leave this as an item of "it depends" / personal preference.
Clojure does have optional static typing via core.typed. It's still in active development, and the tooling around it is still rough around the edges, but it's a more sophisticated type system than Java's.
No really, Java the language is bad. Terrible in fact.
The fact I need an IDE to make it workable (just) highlights this point. J2EE was terrible too, because it showed where things can go, if you let the Java astronaut architects lead.
Some of my most profitable projects were helping to rescue systems by migrating to to an alternative language on the JVM, or off it completely.
The worst part is the damage Java inflicted upon a generation of developers.
I have a problem, I think I will use Java, and Eclipse, and Maven, and all the rest. Now I have twenty thousand problems!
Edit - if you disagree, then say so. Bit spineless to downvote without a valid point to back it up!
As HN has grown it has attracted a more vocal contingent of Java developers. It's getting progressively harder to criticize the language without somebody shouting you down.
Are you insecure about your new found favorite language that you have to bash the old one that you didn't have much success with to justify your new choice? If you are really happy with your new favorite language, great. Do good work with it and move on. No need to keep smearing the old one.
Heh, no. Your comment didn't seem rhetorical so I was just providing an explanation for the phenomenon you've observed. However, we do engage in much spirited discussion throughout the software world about the relative merits of various languages and their features. There's no getting away from it, and Java's gonna get beat on until the end of time. Hope you don't take it personally.
None taken. If those frequent "spirited discussion" soothed your ego, by all means increase the weekly Java bashing. Meanwhile we just keep making software with it.
It's not about ego, it's about taste. Specifically the tastes of the majority of HN.
Sure, lots of software gets written in Java. And (less so) Cobol and Fortran. Every sensitive Java (and PHP, etc) user who is on HN and feels compelled to respond to every slight has to understand, though:
HN was founded by the guy who wrote Beating the Averages[0].
We're in PG's house. And he never liked Java.
So if Java fans come here with a chip on their shoulder about it and constantly take the bait and get into flamewars about how solid and adequate their language is, they should remember what forum they're in. Not that opinions in the forum can't be changed, but why bother when there's plenty of Java love out there elsewhere?
And all throughout the land, the name "Viaweb" is on everyone's lips, synonymous with e-commerce, rather than the Blub technology also-rans at Amazon and eBay.
So it's basically herd mentality with reinforced in-group cliche. Just because PG started HN, we all have to toe the party line to bash Java? If you think PG cared about everyone here has to agree and follow his opinion, you paint him a very shallow man.
And I think he's naive in that blog in using single language as a criteria to evaluate developers, but there's another story.
No, I'm just saying that like attracts like. If PG starts anything involving programmers, a lot of them are going to share a number of his opinions on the topic, because they self-select that way. So HN is naturally going to be dominated by those who dislike Java.
You can keep responding to that dislike, but on HN, given its natural audience, staking out much of a pro-Java position is doomed to futility.
I don't need an IDE to write Scala (or Java I'm sure), but I certainly feel more productive not having to bother with memorizing package structures.
Working outside of Rails, I've found there's actually a fair amount of that in Ruby. And auto-require like functionality it helpful, with little to no downsides.
The same is true of IntelliJ IMO. Some developers prefer Sublime. I find code written in Sublime to be consistently messier, with more of a "this person just kept writing code until they got something that compiled" feel. Instead of having the ability to explore methods at your fingertips just an "arrow down" or ALT+SPACE or CTRL+J or CMD+B away, they use a map and filter where they probably wanted a collect.
>The fact I need an IDE to make it workable (just) highlights this point. J2EE was terrible too, because it showed where things can go, if you let the Java astronaut architects lead.
IMO you could say the same thing about C# and VS as well. Using tools that require as much work from the developer as the developer requires from the tools has gotten way out of hand. Delphi turned this sorry state of affairs into an art form.
I'm well aware. The folks who write Xcode have spent a significantly greater amount of time making their code completion put exactly what I want at my fingertips at exactly the right time.
I don't necessarily disagree, but that's likely not the reason your being downvoted. Your tone is incendiary and the comment is devoid of content. Claiming different parts of Java are bad without reason doesn't have any more substance than simply saying Java is bad.
Did you need to rescue the systems because Java couldn't do the job? Or because it had 500 different(many poor) developers in the code? My guess is the latter...but I don't know your projects.
> If you need some ammunition to prove to your management that your startup times are killing your team’s productivity then use the stopwatch on your phone to count the total minutes per day wasted by waiting for the app to start.
I strongly prefer commandline arguments to environment variables: They're more transparent, easier to reason about ("what's running on this server? `ps`... oh, that process there is running in the staging configuration instead of production"), and it saves useless sudos (/proc/<pid>/environ has mod bits 0400, so if the processes you're investigating are running as separate users (and they probably should be), you can't inspect the actual environment that the process has, so you end up sudo'ing to check the environment out when you should have all the information you need in the process list).
If the environment variables are just interpolated into the run script by the deploy and then all passed to the process as arguments, that works too.