7 ms·
The confusing series of shell scripts most Java services (Cassandra, Kafka, Elasticearch) come wrapped in are a constant annoyance. Not only do they rarely if e
by schmichael 12y ago
The confusing series of shell scripts most Java services (Cassandra, Kafka, Elasticearch) come wrapped in are a constant annoyance. Not only do they rarely if ever follow common shell command idioms, but trying to configure production services turns into tracing environment variables through a series of shell scripts sprinkled across my system.
It's nothing wrong with Java the language, but the platform just seems to make common UNIX best practices hard.
Edit: Just remembered Kafka is Scala, not Java, but I think it just supports my asssertion that the Java/JVM ecosystem just makes common best practices hard.
- jaxytee 12y agoJava just has a slow to adapt ecosystem, and that slowness seeps into everything Java touches. The fact that it's 2014 and there is no Java Repl highlights this. Java is FINALLY adding Lambda functions (a lackluster implementation at that), but guess what? There already exist billions of lines of code written in "noun based" Java. Our shop has a client that refuses to upgrade from Java 5. There's no chance in hell this project sees a Lambda.
- kyllo 12y agoNot just lambda functions, but functions period. Java through 1.7 does not even have functions, the closest thing you can get is to write a class and give it a static method (which of course is not a closure). AFAIK in Java 1.8 you still cannot define or call functions outside of a class. So it's still "noun based."
- peterashford 12y agoI find that as incredible as a FPL not containing an implementation of OOP
- x0x0 12y agoI was about to say "omg yes" -- as someone who writes piles of java code, this is a constant pain. However, look at the other tools: I run python out of a virtualenv. I use rvm to run multiple rubys, and that shit breaks all the time for me. (Or rather, I use it infrequently enough that I never learn it well enough; I use it for the first time again every 2-3 months). That said, java is a special bit of shit. Those shell scripts are really complex. Most java shops have had problems with classpaths exceeding the 32k limit in shells! And java is yet another language where the morons who run it refuse to sand off some of the really sharp edges most likely because their heads are in their asses. To give two really simple examples: 1 - why the fuck can't I import a directory full of jars? eg --classpath ./lib/jars/* or better yet, recursively descend --classpath ./lib/jars/** For personal projects I often use ant just to manage the classpath. 2 - a nullsafe repeated dereference operator, like groovy. If I'm pulling out a.b.c.d out of a nested object, in real code, I have to say if String address = null; if (a != null) if (a.b != null) if(a.b.c != null) if(a.b.c.d != null) address = a.b.c.d.address; return address; // vs groovy String address = a?.b?.c?.d?.address; this is the sort of minor irritant that you have to deal with all day long with deep class hierarchies, and there's some really low hanging fruit to instantly make my life better. sigh. And for java, the combination of ant, maven, ivy, etc, are a special set of hell.
- agibsonccc 12y agoRe: classpath. You mean like this[1]? [1] http://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html http://docs.oracle.com/javase/6/docs/technotes/tools/windows...
- x0x0 12y agoeh, you're quite right; it's the recursive I really need. oops. fta: Subdirectories are not searched recursively. our solution has typically been to unjar all the libs and turn everything into a single giant jar, though this often leads to 100+M jars.
- agibsonccc 12y agoYeah I use uberjars sometimes too. Java deployment in general is awkward/subpar. Some of the newer tech like dropwizard has helped with this, but it's still far from ideal.
- pron 12y agoTake a look at capsule[1] (I'm the author). [1]: https://github.com/puniverse/capsule https://github.com/puniverse/capsule
- agibsonccc 12y agoThis is what I was going to bring up. Also: hello again ;).
- justbaker 12y ago"I use rvm to run multiple rubys, and that shit breaks all the time for me." You are doing it wrong then.
- coldtea 12y agoThere are several problems with RVM (and a lot of extra "magic" it does compared to say rbenv). Those have been discussed in the community for years. So, besides the use of a BS idiom "you're doing it wrong", the parent comment doesn't add much value to the discussion.
- aaronblohowiak 12y ago> trying to configure production services turns into tracing environment variables through a series of shell scripts sprinkled across my system Yes, exactly. cat /proc/28014/environ | tr \\000 \\n Is a way to show what you end up with, but I have yet to discover a good way to figure out how the environ was set there in the first place, having to fall back to strace'ing the full process tree from the startup script to figure out everything being launched and reading its source :(