views:

418

answers:

14

Hi everyone,

A friend of mine is a Java developer, who's using *NIX for ages. He claims that *NIX is for real Java geeks, whereas WIN is for dummies (and I'm one of them, according to him) and girls. When I ask him to argue his position, and explain, what's so good for Java developer on *NIX, he starts talking about console, wget, curl and grep. But sorry, wget and curl analogues exist for the WIN platform as well. As for the console - I'm using FAR Commander, and have access to the command line when I need. Moreover, even if I decide moving to *NIX, I will certainly use Netbeans or Eclipse on it, so there will be no big difference.

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 (in the way the hints are given in "The Pragmatic Programmer"), or, which is also important, gives more fun from the process.

Thanks in advance!

+1  A: 

You can claim to be a "real java geek" because you are not using WIN like all the dummies and girls.

There is no general reason why you should write your java apps on UNIX based systems. Personally I think that working on a UNIX based systems forces you (sometimes) to have a deeper look into the system. The knowledge that returns from doing this is a detail most java developers miss, because they don't have to. But that is one of the concepts of java - getting rid of system-dependent issues.

But let me say that to you : there is no need to work on unix BECAUSE you wan't to develop java applications

ins0m
+1  A: 

it is false, real geeks don't code in java.

Aif
what do they code in? python? :)
Dave
Machine code obviously. ;)
Jonathan M Davis
perl of course! (yeah machine code is a good answer too)
Aif
Machine code by hand. It's the fastest!
Steven Schlansker
LOL. No Java is not my preferred language, but it most definitely has its place. So, as a tongue and cheek answer, this is quite funny, but as a serious one, however, it's quite poor.
Jonathan M Davis
Excuse me, but REAL programmers use butterflies. Citation - http://xkcd.com/378/
kylex
real geeks code in klingon
ckarras
+10  A: 

Mac is another great *NIX-like platform to develop Java, having all those curls and greps, plus an user experience that does not suck.

Java is fairly platform-agnostic, and it also applies to development platforms. If you are comfortable with your Windows setup, there is no real productivity gain you will get from switching a platform.

Having said that, I myself switched from Windows to Mac four years ago for development work in the web stack, including a tiny bit of Java. I have never looked back, Mac just feels better subjectively for development. But this is highly personal and subjective.

If you want to see for yourself, your best bet would be to borrow a machine running any other platform and try to set up a new environment there and work with it for at least two weeks. Anything less than that, and you won't know the system well enough, but two weeks should be sufficient to get a feel for the new system. Then, even if you end up liking your old environment better, you at least have first-hand comparison, which is much better than just other people's rants.

Jaanus
Macs are great too. I divide my time between Mac and Linux. With the Macports project a large selection of software is also just a port away. Additional bonuses are Omnigraffle and MindManager for which I do not find a good alternative on the other paltforms (although MM is nice on Windows too).
Peter Tillemans
+9  A: 

The money you save on the Windows license can be used to buy an IntelliJ IDEA license and a nice dinner with your girl ;-)

Seriously, the linux desktop environment is getting really slick.

I find memory management saner as the swap tends to stay empty where Windows start copying things from disk into memory and back to disk.

SOmething that really bothered me on eclipse on windows was that sometimes running the clean target would fail because a file was locked which was probably being indexed or something. I never encountered that on Linux.

Git (and other SCM systems) work better on UNIX clones like Linux and Mac OSX due to the CR/LF issues. This is not insurmountable, but it has bitten me a lot in the past.

On debian derived linux especially the sheer amount of programs which are just available when you need/want to try them is an enormous liberation. I mean it is alike the iphone appstore for geeks and everything is the same price.

Peter Tillemans
+1 for the IntelliJ recommendation. Spot on. And dinner with the woman in your life? Priceless.
duffymo
+1  A: 

Personally, I think that *nix platforms have a lot to offer developers since a lot of what they provide are programs and utilities written by programmers for programmers. But you only really get that benefit if you're familiar with the programs and tools available in *nix, so switching is bound to result in a productivity loss (albeit temporary). But as you point out, quite a few of the powerful command-line utilities in *nix are available for windows. I'd say that what productivity gains you'd get would depend a lot on you and what you do with the tools available. You can be quite productive with both *nix and Windows.

As for Java, it's platform agnostic. Most of the major tools for it (and obviously the libraries) are cross-platform. It's designed so that your OS doesn't matter. I seriously doubt that you'd gain much productivity related to Java if you switched platforms.

As much as I prefer to work in Linux, I think that it's really a matter of preference unless the tools that you need are on a particular platform and not another - and which platform would be better at that point would depend entirely on which platform had the tools.

Yes, I'd argue that *nix is geekier, but that's not necessarily a good reason to switch. Use whatever OS works best for you. And for Java development, you can pretty much take your pick.

Jonathan M Davis
+2  A: 

False. Use the tools you know for the problem that you need to solve.

If you want you can learn *NIX to yourself, and many applications are deployed in *NIX. But that's only a preference.

I've developed in Linux and Windows, and in Linux java is VERY fast, but I prefer windows since I like the operating system. The applications are deployed on linux servers.

Javier
+1  A: 

Depends on what you're doing. If you're doing a lot of command-line work, then I would prefer a *nix shell over the Windows shell or Cygwin. tail, grep, Ctrl-p, Ctrl-n, kill...all of those commands are easier for me in *nix then their equivalents in the Windows world. Starting and stopping Tomcat, SCP'ing WAR files around, etc.

Mike Sickler
All of this you can do from your IDE though.
CurtainDog
You can SCP from your IDE?
Mike Sickler
+3  A: 

Honestly, your friend gives what I find a typical, lazy, bigoted, and antiquated argument to using a Unix-like platform do your (java) development on. For that he probably needs to be flogged :D

But, I don't disagree with him at all - I just disagree with the argument. To be honest, you can use Windows as your (java) development OS just fine - but you are missing out on a ton by doing so. Let me give you some highlights based on my experiences both when wearing my developer hat and when wearing my build engineer hat:

The number and quality of basic command line tools that you have available on a Unix-like machine whip the living the daylights out of anything you are going to find in Windows land - if you just take the time to learn them. Let's say you are developing an application and are looking at its logging output. Your only option on Windows really is to open the log file in some text editor and ctrl+f your way around it like a neanderthal - let's hope the log file doesn't rotate on you either. Whereas if you are on unix-like machine, chances are you can tail -F your.log and pipe it to other tools of your choice (grep, awk, cut, etc.) to get at the exact output you want.

Speaking of consoles, you'll have to drop to one whether you want to or not - IDEs are always leaky abstractions over tools that you really ought to learn how to use manually. And the console experience on Windows is awful. Sure you can trade in cmd.exe or powershell for cygwin and use a halfway decent console app like Console2 or ssh to yourself with putty. But using cygwin on Windows compared to an actual shell on a unix machine with a good terminal application is kind of like comparing masturbation with coitus involving the girl of your dreams. Both will result in the same outcome, but one of them doesn't feel quite right and leaves you with dirtier hands.

Also, effective development depends on getting in to very concentrated flows. It's kind of hard to establish a flow on an operating system that's known for being visually noisy, obtrusive (UAC, for instance), unstable, and just a pain in general to get things done quickly in.

Also, there are nuanced things with Windows that poke their head out. Tools like maven (a popular java build system) never seemed to work quite right on Windows XP (yes, that OS is still very prominent) due to the spaces in your home path at C:\Documents and Settings\. Git is only just recently usable on Windows without having to jump through 200 hoops to get it installed. Plus, you are forced to use a case insensitive file system with Windows, which causes all sorts of fun when your path to some file in your code is "foo/bar" and you check in that actual file to source control as "foo/Bar" because foo/Bar and foo/bar are the same right? Yeah...

So, as I and others have said, you can still develop (java) in windows just fine, but you are missing out on some finer things if you don't at least give unix a shot for at least a month. If you are aren't convinced after that, go back to Windows. Don't take your friends word for it or mine. I just wanted to (hopefully) give you a compelling argument that was better than your friends to actually try.

Disclaimer: I use OSX as my development environment, and only work on Linux servers when I have the choice. I encourage everyone, unless they are paid to write apps that get installed on Windows apps or ASP.NET webapps to never use windows if they can help. With that said, take my arguments with however much salt you see fit.

whaley
+2  A: 

My two cents, I'll keep it short.

1) I don't see any significant java-specific advantages of using linux or mac over windows.

2) It does affect productivity. Even though, like you, I use IDE, the more I get familiar with bash, the more I love it. Once you're used to its simple and concise commands, you can never return to windows. It's amazing, how much time I've been losing on simple tasks before switching OS!

3) We're not talking about general OS usability differences, right?

Nikita Rybak
+11  A: 

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)

Webinator
to all commenters: before writing straw man fallacies, please stick to the fact. The OP asked for **dramatic** time savings and I gave a few that happened to bring me dramatic gains lately. Please show me how to do that stuff, for free and fastly, on Windows or refrain from MS astroturfing ;)
Webinator
A good point here: no matter which platform you use, these days you will probably need to virtualize. http://www.virtualbox.org/ is a good virtualizer.
Jaanus
A: 

Hehe... It's like talking about religion or politics...

Where I work (developing a Java-based ERP), a year ago we've migrated all desktop computers from Windows to Linux, basically for legal/license reasons (besides, the ERP is open source).

I actually enjoy the Linux Experience. Things I've noticed between both OS when we migrated:

  • Installing applications / configuring applications: Linux not so simple as Windows (like installing PL/Java ... $#%&!!)
  • Learning curve: A little steep on Linux (or maybe because I was used to Windows)
  • Developing with Eclipse: no changes at all (obviusly)
  • File System: BIG difference. Linux has a noticeable better performance than Windows.
  • Configuring environment, tools, shell scripts, tunneling, ssh, etc.: I've found Linux more versatile (once you get used to).
  • OS/Window Manager/GUI General stability: Ubuntu+Compiz+Java STILL has issues (but it's getting better after each release).

Specifically for Java development, I think that the OS is not a very important matter. However, a Job generally requires some other related activities which can help choosing the right environment.

Federico Cristina
*a Job generally requires some other related activities which can help choosing the right environment* : like security of your confidential data? which is why Google now refuse new employees the right to use Windows? ;)
NoozNooz42
A: 

Using java on Linux or on Windows just an experience. A developer who tends to work both on Windows and Linux tend to choose Linux because they feel that linux is a great platform.

Productivity cannot be considered, it all depends on the person who produce. It is not solely based on tools.

I use Windows for my day job to develop VC++ and C# application. As soon as I head back to home, I use Ubuntu and hack python, I FEEL that Ubuntu and emacs is great environment (emotions? may be).

Honestly I don't know what else we will be using on Windows other than

  1. Windows Explorer to access C: D: E:
  2. Cut/Copy/Paste

With linux you will be doing above 2 also and much more i.e. learning. I feel, Linux has steep learning curve. Learning is exciting for many.

Gopalakrishnan Subramani
+1  A: 

As stated in a couple of previous posts, the shell is the ultimate time saver. Need to look through your source for a string then analyze the results filtering on location in a source tree.

Pipelining input/output streams is one of the most important and powerful ways to interrogate your source/logs/configuration/etc.

Also with minor limitations you can control everything from a login shell meaning that when you want to automate any task you can and through this automation can save time.

ie you plug in a usb disk, a backup of your source tree happens automagically, you login in the morning your source syncs with scm, etc.

Raymond
+1  A: 

I develop java mainly in Ubuntu and can say that disk performance between all the developers using Linux is far superior to those using Windows (on the same project). Compile and regression test times are in the magnitude of 5 times faster.

I personally prefer OSX though, which I use at home, the interface is much cleaner and less buggy than Ubuntu (although it is getting better every day), and with OSX you get the powerful terminal you get with Linux.

So to make a list in no particular order...

  • *NIX Stability vs. Windows in my experience is higher
  • Terminal in *NIX is better than anything I've seen on windows
  • Disk performance (in my case) is faster in *NIX
Flash84x