10 ms·
This is definitely an improvement for Java, but it leaves me with a few thoughts as someone who has done Java professionally at times, but also professionally l
by freedomben 9y ago
This is definitely an improvement for Java, but it leaves me with a few thoughts as someone who has done Java professionally at times, but also professionally lived in other ecosystems including C++/Qt, Python, Ruby, Golang, and of course node/JS.
1. Setting up a project is still a pain in the butt. Tools like Gradle are a nice improvement over Ant (and some would say maven), but still most people don't even understand them. You have some serious reading ahead of you if you want to set something up that isn't already templated somewhere for you. You can lean on an IDE for sure, and for most Java devs this is probably a no-brainer. I'm weird in that I don't like magic. I prefer to know what the tool is doing on my behalf, and the Java IDE world is so complex that it isn't practical to learn that unless you're in the ecosystem for years. Then dealing with weird exceptions from the JVM can be maddening.
2. The Java world moves slowly. It could reasonably be years before many shops transition to Java 9, when you would actually realize the benefits of this in your work life.
3. So much Java runs on the server side anyway, where executable size and entrypoint doesn't really matter that much. Because of this, it may only be a small subset of Java shops that really get into Java 9/Jigsaw and iron out the bugs, and create tools/tutorials for others.
- malkia 9y agoCurrently I'm doing C++ with Qt, sometimes C# (game dev under Windows), but was at Google just few months ago doing Java. While Qt is great, we've been running into logistic problems - like we have plenty of tools that use it, and we are forced to place all the binaries into one folder ("bin"), and the Qt dlls there for legal reasons, license, but buying the license for static linking won't be a problem for us reallly. The real problem is that once we link our binaries statically, then our plugins that also use Qt won't work with them, unless we do some magic, and forward all QtXxx.dll end points to be from the main executable, or use more abstract interfaces - e.g. our plugins should not use Qt directly.
- kodablah 9y agoI likewise have used these. Qt (really C++) development in general suffers from annoyingly slow compile times in my experience. Also, once you go beyond anything trivial, .pro files become complicated as do build systems around them.
- malkia 9y agoWe don't use .pro files or QtCreator - it's Visual Studio + custom build rules. Still slow, and nasty with generation. As build system, we used to have IncrediBuild, but since we are PS4 developers we get SN-DBS for free - http://www.snsys.com/products/SN-DBS.asp http://www.snsys.com/products/SN-DBS.asp - it speeds up the build, but once the Qt moc/etc rules come in, the build needs to wait for these to be generated, and then proceeds. There are ways to overcome this, and we are looking into improving this. I've tried using .pro files, but first, I can't sell them to the rest of the engineers, as pretty much almost everyone knows Visual Studio, .sln/.vcxproj files. There are some ideas about alternative build systems, but not there yet. (at the end most of these just generate .sln/.vcxproj, like CMake, or premake, etc.).
- kodablah 9y agoMy application is cross platform. So I use .pro files + qmake, then make/nmake. As I started needing to move files around in cross platform ways, I just maintain a Go script now that does the build. Tired of custom DSLs and having to dig deep into build-system-specific things (e.g. Groovy w/ Gradle and the confusion around what code runs when like defs vs tasks, doFirst, etc).
- malkia 9y agoTry using "jom" as replacement for nmake - it's done by Qt themselves, and it's much better! - https://wiki.qt.io/Jom https://wiki.qt.io/Jom
- ateesdalejr 9y agoI agree on the using some other language to do builds instead of using a complicated build process. Python is sufficient enough for me.
- zura 9y agoWhy do you need to link statically?
- jcelerier 9y ago> but buying the license for static linking won't be a problem for us reallly. You can statically link with LGPL code, as long as you provide a means to relink (typically, shipping .o files if requested). https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynami...
- oblio 9y agoIs there any kind of cross platform development kit where for project set up it's not either magic or pain or both?
- malkia 9y agoMy only experience with Java was through BAZEL, outside of it I'm mostly Visual Studio guy with some Makefile knowledge. With BAZEL things were working pretty smoothly, but I've never used maven, gradle, ant, etc. Really weird, because If I post that I have 3 years experience with Java and not knowing any of these tools... What I'm trying to say is that with BAZEL this might be easier for cross platform development (not sure though)...
- karussell 9y agoDo you mean some IDEs like IntelliJ or NetBeans?
- Turing_Machine 9y agoThe Red Language (which I just learned about yesterday) looks pretty good in that respect. One binary, no dependencies. http://www.red-lang.org/p/about.html http://www.red-lang.org/p/about.html I gather the GUI story on Linux isn't great at present, and there's no iOS support, but all of the other important bases seem to be covered. I've tinkered with it a bit today, and so far it's as advertised.
- mwcampbell 9y ago> other important bases seem to be covered Except accessibility for blind people (through screen readers), and probably people with other disabilities as well. I just tried the Red GUI with the NVDA screen reader on Windows, and it's mostly inaccessible. BTW, this is a problem with nearly every GUI toolkit developed from the ground up (that is, from the host OS's low-level graphics primitives). The exceptions are mostly the big, "bloated" GUI toolkits, like those provided by the major operating systems, the major browser engines (and by extension Electron), Qt, JavaFX (though only on Windows and Mac), and maybe a few others. Edit: SWT is one of the most accessible options for cross-platform desktop applications. That's mostly because SWT primarily uses the host platforms' native widgets. But it does have some custom controls, and for those, it implements the platform-specific accessibility APIs. I understand that a lot of people don't like the conventional desktop look and feel though.
- kodablah 9y ago> other ecosystems including C++/Qt, Python, Ruby, Golang, and of course node/JS [...] Setting up a project is still a pain in the butt I find this is not Java specific and many of those other technologies have similarly painful project config, especially as soon as you do something non-trivial. > The Java world moves slowly. "Vendoring" the stdlib, which essentially is what is happening here, alleviates that (at the cost of not sharing source, which is usually OK for the JVM in non-security contexts). As for work life vs home life, that is not very Java specific. Many companies hang back on old standards by choice.
- saulrh 9y agoI find this is not Java specific and many of those other technologies have similarly painful project config, especially as soon as you do something non-trivial. My experience with Java has indicated that the problem is actually in the opposite direction. I agree that all packaging systems suck for larger or unusual projects, but for small stuff there's a clear distinction - there is nothing in Java packaging that's trivial. Or you could see it as "nontrivial" being very different for different toolchains. If I'm doing something that'll never exceed 1KLOC and doesn't depend on any exotic libraries, I can throw together a crate, module, bundle, package, etc in a matter of minutes and then forget about project configuration. Java... anything other than "local-machine CLI project with no dependencies and an IDE" will have you spending more time on config than code.
- bennofs 9y agoI find it's pretty straightforward using gradle (except that it doesn't build fat jars out of the box). Can you elaborate on what you're having trouble with?
- saulrh 9y agoI didn't try gradle and my experiences weren't incredibly recent (three-five years in most cases), so maybe that's what I was missing. Dependencies and portability were by far the biggest issues. eclipse, netbeans, idea, et al didn't seem to do dependencies at all; even if you had a library jar actually on your filesystem it was a huge PITA to point at it, and getting a project that'd also compile on someone else's machine was horrible. leiningen didn't have a single tutorial that I could find and I voodoo'd my way through a clojure tutorial before giving up. maven broke in strange ways when I tried pulling in deps and figuring out the correct incantations in the pom files was a pain. More recently, I could probably have gotten along with sbt if I'd had a week to play with it, but it also has the "no useful tutorials" problem and I was on a time limit. Some of this is certainly lack of experience, or even simple Doin It Rong. I could see maven being much easier with a directory full of examples to look at, for example, and sbt I'm sure is great once you wrap your head around it. I just feel like, even if I was limited by typing bandwidth instead of figuring-things-out bandwidth, those tools wouldn't hold a candle to python's or rust's tooling. Even makefiles and cmake seem to have better happy paths. I'll look at gradle next time. There are situation where I could use a jar.
- karavelov 9y ago> It could reasonably be years before many shops transition to Java 9 Java 9 is short term support release, ending support with the release of Java 10 / Java 18.3 (March 2018). Next LTS JVM release is supposed to be 11 in 1.5 - 2 down the road. A lof to large organizations will be holding back for the next LTS release before considering migration.
- djhworld 9y ago> 3. So much Java runs on the server side anyway, where executable size and entrypoint doesn't really matter that much. I guess you could argue this might allow Java on the Desktop to be feasible again, but it might be too late.
- deleted 9y ago[deleted]
- pjmlp 9y agoWhen did it stop being feasible? I surely get to use it more than Electron apps, thankfully.
- tootie 9y agoMaven is complicated but also very stable and powerful. It's no less arcane than webpack and if you're using any decent IDE all the available options will autocomplete. Fat jar deploys were always super simple and having a self-contained executable is even better.
- wellpast 9y agoMaven at its core is very simple. The lifecycle is well-documented and so is the dependency resolution. Many coworkers I've worked with have called it complicated and then I find out they really haven't learned the (very simple) lifecycle and how build behavior gets attached, etc. This is all very simple but it is something to learn. I don't know why this happens. I think programmers are so used to imperative (ant/Grunt/etc/etc) programming/building that it becomes confusing for them when they encounter a declarative system. And their brain revolts. Because they are like how do I just do a thing (i.e., copy some file somewhere, call a "build" method, etc, etc.)!? Instead of realizing the value of the declarative + idiomatic Tao and learning it...they say no, no gimme gimme let meee do it. Much like my two year old. And then I'm left fighting non-reproducible builds and getting their projects going in my IDE like it's somehow 2005 again. But Maven is great, declarative systems -- especially declarative build systems are the optimal way to do builds (in most cases).
- greenhouse_gas 9y ago>I don't know why this happens. I think programmers are so used to imperative (ant/Grunt/etc/etc) programming/building that it becomes confusing for them when they encounter a declarative system. Because, after all is said and done, programming is about having your computer "do" something - whether it be to write some bytes to the disk or to send some bytes to the network. It's just that sometimes there's an advantage to use an abstraction - such as say "SELECT * FROM TABLE WHERE ROW_ID =14" is an abstraction over something like "for (int i =0;i<table.size();i++) if(table.row[i].elem[1] == 14) ... ", but often you don't need such a complicated abstraction, you just "need something done" before (or after) building. Whether it be that you want to download an HTML file to package, or to move the resulting file to a certain directory, or to clean a certain directory, your build language shouldn't be that arcane that you have to create a "build.sh" to get things done.
- cle 9y ago> So much Java runs on the server side anyway, where executable size and entrypoint doesn't really matter that much. This assumption is why developers are abandoning Java in troves with the serverless trend, where exe size and init time matter immensely. And good riddance!
- sixo 9y agoThis feels like a weird time to say good riddance. Is this an anti-serverless post, or...?
- danjoc 9y agoSo much misinfo/FUD in this post. I'll just respond to this one teachable point, >You have some serious reading ahead of you if you want to set something up that isn't already templated somewhere for you. Start with a maven project, $cd /path/to/maven/project/ Create your archetype, $mvn archetype:create-from-project Install it in your local repo, $cd target/generated-sources/archetype $mvn install $mvn archetype:crawl Generate a new project from your new template, mvn archetype:generate -DarchetypeCatalog=local
- kstenerud 9y agoOh wow! A complete maven project after only a few cryptic commands in weird generated subdirs and a -D switch! It's so simple and obvious it's almost criminal! I bet the OP is eating humble pie now!
- danjoc 9y agoI'm not feeding OP humble pie. I'm sharing information with people who are unfamiliar with Java, so they don't believe what professional Java developers can clearly see is obvious bait. I'm glad freedomben likes nodejs, but he shouldn't talk dirty about Java while pretending to know something about Java. His one comment to this story dominated what could have been an otherwise interesting discussion about a new feature of Java 9. Sad.
- hinkley 9y ago> 3. So much Java runs on the server side anyway, where executable size and entrypoint doesn't really matter that much. My read is that Java is doing this now because they ignored microservices and containerization at their own peril. 8 and 9 between them include a bunch of things to squeeze runtime and disk size to be comparable to other systems.
- zbentley 9y ago> ...squeeze runtime and disk size to be comparable to other systems. Really? Most of the "microservice era" or "cloud native" or $timely_buzzword platforms are really big. Golang binaries for large services are bloody huge. TL;dr don't assume other systems have small footprints until you deploy a Node.JS app and do "du -h node_modules/"
- pjmlp 9y agoMicroservices and containerization are the next cloud fad. I am yet to do any enterprise Web project that isn't a classic application server. Not everyone and his dog are jumping into it.
- hinkley 9y agoWhen I was coming up, I overheard a conversation amongst a bunch of greybeards about how these big computing organizational changes are not a fad, they're a cycle. Like the tides. Since I started working right at the cusp of a switchover I had one more opportunity to observe this behavior and test this theory than most people do, and it does appear to match reality. People make monoliths for performance reasons and then can't maintain the monolith, so they go back to forced independence. Every company does this on a different cycle but the epicycles are the 'fads' you see, and it's been going on since at least the 70's. Similarly and perhaps more forgivably, people organize a system (think, client-server, peer to peer) for reasons of the current laws of physics as they apply to clocks per second, storage space, and latency. Those inequalities shift with each new generation of hardware. So what was the right thing to do 15 years ago might be the right thing to do again next year. It's not that we've been wrong for 15 years, it's that we are wrong now. And will be wrong again in another half a dozen years. But we have to use the tools available to accomplish the goal now, and that means we have to adapt, repeatedly.
- pabl0rg 9y agoGood points. If you go back to java development and want to try a fringe build system, Kobalt is nice and straight-forward compared to maven/gradle. You configure the project in a kotlin file using a DSL. You may never need a plugin and the DSL + Kotlin give you a hybrid of Maven and Gradle. http://beust.com/kobalt/home/index.html http://beust.com/kobalt/home/index.html
- parasubvert 9y agoSetting up a Java/Kotlin/Groovy project takes two clicks these days: http://start.spring.io http://start.spring.io And that is a simple template that just takes advantage of curated OSS ecosystem dependencies by the Spring team. There’s really no magic, I find Maven or Gradle to be as opaque as say Gem bundles, Bower, or NPM and Grunt (Or whatever the new flavour du jour in Node land is). That is to say, the core concepts are all mostly similar but just slightly different enough to cause hair loss. And let’s not talk about Golang dependency managers...
- mohi13 9y agoI vividly remember starting my first java project a few years back and starting my first node project a year back, personally getting started with node was easily 5x more complicated with so many weird tooling before a first line of code is written.
- ricardobeat 9y agoAre you thinking of node or a web project? Node requires zero tooling and is distributed as a single executable ~10-20MB on all platforms + already comes with npm.
- mohi13 9y agoMaking a web service via nodejs vs a web service using say dropwizad, all these web pack business is pretty complicated.
- ricardobeat 9y agoI’m still confused. Webpack is a frontend build tool and completely unnecessary for writing a web service. Also, from the Dropwizard tutorial: 1) configure Maven 2) create a config class 3) write a mapping.yaml for “Jackson” 4) create an application class 5) create a representation class 6) create a resource class 7) register the resource 8) configure maven again (!) for building a .jar 9) finally run it. With node you literally write 5 lines of code importing the http module and run `node server.js`. I can’t possibly imagine what steps could be more complicated than Dropwizard. I consider webpack overly complex myself, but it’s a completely self-inflicted option and not a standard for nodejs development at all. I’d be curious to know what docs you were trying to follow if you can recall.
- iovrthoughtthis 9y agoReally? 1) Install node. 2) Write script. e.g. console.log('hello'); 3) Run script: > node script.js hello Java 1-10) Download Java * 11) Ensure JAVA_HOME is set right 12) Write java public class Hello { public static int main(String[] args) { System.out.println("hello"); } } 13) Compile java > javac Hello.java 14) Run java > java Hello hello * Yes, this is obviously facetious. EDIT: Code formatting thanks to https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc
- fnl 9y agoNone of these points are valid: 1. Dependency management is probably a lot easier with Maven than with C++ or Python. Hope that needs no reference... 2. No idea why, but Java is backwards compatible. So not updating to the latest version is only laziness. 3. Having much smaller containers or virtual machine disk sizes should lower your AWS/Google/Cloud... bill a (little, but whatever) bit and therefore make your CFO happy...
- misja111 9y agoYou're wrong about point 2. Java has backward compatibility but there are a few exceptions. On top of that, the library's that come bundled with the jdk have a few backward incompatibilities of their own. These might be small things to fix when your codebase is small, but for enterprises with codebases of millions of lines, these issues turn an upgrade in a major challenge. Apart from that, there is another reason why companies don't upgrade and that's because they are locked to a certain java version by their application server. Upgrading to a new java version would require upgrading the application server as well, which would cost a lot in terms of licensing and which would introduce some risks and overhead of its own.
- raducu 9y agoI can confirm all of what you said. That's the reason application servers AND big monolithic applications NEED to die and they need to die right now. Just have clear defined boundaries for services, deploy them inside a docker/rkt whatever container; just let whatever legacy application run with java 1.4 until you replace it completely.
- fnl 9y agoWell, that is a good thing: You still can buy regular support for Java 6, which was released more than 10 years ago. So if you really think updating your monolith to Java 9 is worth less than paying for that support, you can do so. Not all software generates such a huge margin that updating it would be a viable option for your business. How many other languages provide such long-term support for releases that are a decade old, even if you were willing to pay for it?
- z3t4 9y ago+1 for wanting to know what actually happens. I do not like the direction web dev is heading, with prepossessing, and transpiling a language that is already an embedded scripting language.
- FractalNerve 9y agoI didn't understand the article, can someone explain what it means for java development, please?? Will we be able to create runtime-less executables that are fully dependency free? That would be awesome to write a bootloader in Kotlin or any other Java Synthax Substitute.
- aweiland 9y agoWhenever I start a new project I use http://start.spring.io/ http://start.spring.io/ Obviously it's Spring centric.