Guys, who use Java on *NIX, could you
please give me some real killer
examples, when *NIX (any util or
technique) dramatically increases Java
development productivity
There are just so many I don't know where to start, but here are some random thoughts...
On Un*x, it is trivial to install Java (and Tomcat, etc.) without needing to be root (on Windows you must have the admin password to install Java: I don't know why and I'd honestly rather not know, because it will only make me hate Windows more). Really trivial. As a result, on Un*x you can give someone a user account and he can dance on his head, he won't be able to mess up the setup (Java and non-Java) of other user accounts. This is huge.
I'm not saying you can't do it on Windows, what I'm saying is that on Linux (for example, (Open)Solaris would be the same):
- it is trivial
- you don't need the root (ie "admin" in Windows speak) password
Now the goodies... Linux let you have as many user accounts, openend simultaneously (and even displaying simultaneously, say if you want to compare an app side-by-side with several setups) as you want: there's no need to buy "server licence" or whatnots to be able to serve as many "remote desktops" connections as you want (last I checked, I ran into issues with Windows XP because, for testing purpose, I needed several user account on a machine, and Windows "gave me the finger" asking me to buy expensive licenses to be able to open several "remote desktops").
Result? I've got two Tomcat running under two different accounts, two IntelliJ IDEA (because of different setup and because virtual-desktop switching is faster than closing/re-opening another project), about 5 different user accounts always used (and many "discardable" ones) and 20 virtual desktops and maybe, well, 4 different Java versions installed (could install 10 if I wanted, trivially, once again: no need to be root). (btw, I do need all this: it's a MAJOR productivity gain for me, I'm working on commercial Java software and I need to test on a lot of JVMs, etc.).
The non-root Java install cannot be understated: just today I needed to take a snapshot of Tomcat + JVM setup and test on another Linux system. Trivial: "tar -xzcpf /home2/testerA". I scp'ed it to the other system and could test on the other system (both where 64 bits, the only case where this wouldn't work would be 64 bit to 32 bit, there I'd have needed to non-adminly install a 32 bit JVM). 44 MB. 44. The full user dir in 44 MB (including the JRE and our app) and I got my snapshot. No crazy broken HAL issues (Hardware Abstraction Layer), no licencing issues. No 2 GB+ for a full Windows VM snapshot. 44 MB. I did this just today... I don't even want to think about what would have been needed to reproduce the exact user setup on Windows. Sure, it's doable, but here I need five commands (including the remount of /home2/ read-only before tar -xzcpf'ing ).
To me this is dramatic. You simply cannot easily do that on Windows. There are issues: licensing issues, installation issues (it's not as clean nor as easy as tar -czvp/untar), etc. You simply aren't reproducing an entire user setup + JVM + software in 44 MB and sending it over the network and have it running on the other machine in less than one minute. You simply don't. No friggin' way.
If you want to, you can even dupe & swap harddisk in both Linux and OS X and put them in any PC/Mac and the whole friggin' entire system will work on the first boot!. Try that on Windows: hello licensing issue and great phone calls with MS to re-activate your licence (and kiss good bye to your Windows licence on your old hardware the next time it phone MS home).
Also, developers, once in a while, need to buy a new machine. How fun is it going to be to reinstall everything on your newly bought quad-core? How many hours of programs and patches? How productive are you going to be that afternoon? With Linux or OS X: you can dd the hard disk, stuff it in the new system, and that's it. You're good to go.
Free virtualization
Then, today to (once in all while, thankfully not everyday) I needed to try something on IE 6. Here comes KVM (before that I was using Xen). I re-image a stock XP and fire up Windows running under KVM: still with my 4 browsers, two IntelliJ IDEA, 20 virtual desktops, other Java program running, etc. Not a complain. Everything is speedy (old Core 2 Duo here btw, hardly a speed demon, this machine is years old). Sure I could buy VMWare on Windows and get 1/4th of the speed and send the hard disk spinning to death swapping... Not the same experience. Just plain not.
Should something "bad" happen, I can "kill -9" anything. And it guaranteed to release all the resources used by the program. This beats the three-finger-salute like you have no idea. If by the craziest badluck something managed to lock hard my X session (not happened in age but hey...). I can use MagicSysRQ to get my system back.
Honestly, I don't care about these Windows images for KVM: they are throwaway. You can't imagine the sheer pleasure in forcing a poweroff from KVM or just plain simply kill -9'ing KVM.
Excellent firewalling and networking, great for testing
Wanna test how our app responds when there's no network? Simply create a new user account, install a JVM (remember, installing a VM for a new user is as simple as tar/untar or even cp and changing the ownership of the files), launch your .jar and that's it: no network (because everything is disabled by default on machines/network I'm in charge of).
Need to test how our app responds when there's network connectivity?
iptables -I OUTPUT -p tcp --dport 80 -m owner --uid-owner $UID_NETTESTER -j ACCEPT
Need to test how our app responds when there's a very shaky network connection? Simply play with iptables' limit and burst options...
I can do all three simultaneously if I want... No additional licence to pay, no additional software to install.
tcpdump, wireshark, etc.
Network-wise and firewall-wise a "dumb" Linux system is just so powerful: and for certain developers this really counts.
Wanna insert probes and see kernel calls? Here's Solaris' dtrace for you and the juicy Linux clones. Jewels.
Load-testing? Trivial from the command line.
And at any time, for anything, as a developer, you can get down to the source.
To me, the networking advantage are pretty dramatic...
Perfs
It has already been stated that overall the Linux OS (and other Un*x too) is just so much more efficient on equivalent on real hardware. If I had half the programs I'm having here and half the virtual desktop, I'd hear the Windows harddisk shaking like a washing-machine. Here it's mostly silence. There's a reason why the Top500 supercomputers is 95%+ Linux. From the biggest Supercomputers to the smallest smartphones (Android and the iPhone), Un*x OSes simply rock the day. They are that much faster and that much more secure.
To me, the performances advantage are pretty dramatic...
No patch tuesday
Then there's the issue of control: it's not the "patch tuesday" that controls what gets installed on my machine and any suspicious disk activity (my hd is really quiet, I hear it just enough to know if things are alright or not) I can tell what just happened. On Windows there's just so much stuff running, and so much additional bloat coming all the time with critical patches... And zero verification possible. It's closed source. (wanna talk about the nasty nasty Windows phone-home using hardcoded IPs, bypassing the DNS?).
Some developers consider rebooting an unreliable way to execute: I'm in that camp. If my workstation cannot reach months and months of uptime, I don't consider it worthy to waste my time on (and, yup, security patches on an hardened grsec Debian Linux tend to be very rare, making months if not year of uptime totally realistic... For a workstation).
To me, the "less patch, less bloat" advantage is pretty dramatic...
Oh... Forgot to tell, my workstation, because it regularly has months of uptime (I shut it down when I move my desk or move my office ;) happily serves as a statefull firewall and router for: two MacBook Pro, an old Pentium 4, an eeePC, a MacMini.
Damn, nearly forgot too: my workstation has the Squid proxy installed...
Sure, you could open your wallet, deal with all the critical security patches, abysmal perfs issues, mono-user account (unless you open your wallet a bit more), closed system (no look at the source for you Luke), fear of becoming zero-day botted when the latest Adobe PDF exploit allows arbitrary code execution and priviledge escalation, install Cygwin and a lot of small Windows utilities and end up with a desktop that, like SO, will regularly be down for maintenance (how many nines does SO have? 3?) only to try to reproduce 1/4th of what I've given as an example here.
Or you could decide that the learning curve is worth it and start learning Un*x. The command line. The fully networked UI. The philosophy. The sheer power you'll have at your fingertips.
Un*x is another world. It's hard to explain to people who've only ever used Windows but Un*x is, in my opinion, a so much more powerful world.
To me it's simple: if I were forced to work on that unproductive OS that Windows is, I'd quit :)
But companies forcing developers to work on Windows are becoming rare: it's the contrary, now new hires at Google cannot ask for a Windows machine anymore, thanks to security issues :)
(to all silly commenters: before making silly comments, check my first comment)