Monday, March 31, 2014

On Linux

Linux- The choice OS for Real Programmers(tm) everywhere. I've seen many people comment on how Linux is a much better choice for developers than Windows, and in a few cases- even the suggestion that you aren't a real programmer if you don't know Linux. Why is this? I've seen a few different reasons why, ranging from it simply being easier, to Microsoft being a horrible evil corporation.  I decided to take on a project and give Linux a try for a week to see if I couldn't make the decision myself and find out why Linux seems to be the choice OS for developers everywhere.

In looking up Linux flavors, I found a few that looked interesting or I had previously used for a short amount of time before. Centos, Ubuntu, and Mint were the top three choices I came to, and ultimately decided on Mint after remembering an interview with a Linux admin where someone asked them about mint and their reply was something about "Oh, You mean Linux for people who don't know Linux".  It seems like as good of a starting place as any. It has a clean UI which doesn’t leave me feeling stuck in 1995, is surprisingly light weight in terms of CPU and Ram use, and has a lot of support. Mint it is!

Experiences with Mint 16


I am going to break this up into sections to try to prevent incoherent rambling. I am working with Mint 16 cinnamon.

Install:

This was really easy. I used a Live DVD to install, but you can also use a thumb drive. The only thing I would suggest is to pay attention to when it asks you how you want to partition your drive. I accepted the default partition on my 60 gig SSD, and it split it into 2 30 gig partitions. I shouldn’t have done that, and as of writing this, am trying to figure out if I need to reinstall Mint and partition it correctly, or if I should try finding a utility to merge the two partitions. This would actually be an easier mistake to correct in windows, but it isn’t like I have all my settings “just so” and couldn’t make everything work again. So, don’t be a lazy person like me and maybe pay attention a bit to the install.

UI:

UI for Mint 16 is really clean. It feels like what Windows 8 should have gone for. Easy to understand, and it uses icons that really help direct the user to know what the heck it is they are doing. It has a built in “run” bar like what windows 7 did, and overall really doesn’t feel foreign at all. This doesn’t really effect much in the way of development, but it is nice when the UI looks clean.

Media:

This is where I had issues, and I think Linux, or at least Mint, as a whole will have issues. It seems that Linux assumes nothing. I am running NVidia GTX 570 as a video card, and have a monitor with speakers connected via HDMI. I also have headphones so I don’t disturb my girlfriend when watching shows, or listening to music.  Both of which I find to be fairly important when I am developing because I need a slight distraction to either reset, block out background noise, or get me in the right frame of mind. If you have Headphones and a standard audio jack, the audio might just work right out of the box, but for me and my HDMI connection with the video card- it did not. It took a bit of googling and searching to find out which version of the driver to use. Searching on the package manager got me many different options to choose from, that may have been correct or not. It was not nearly as easy as windows to find out what I was supposed to do to make my graphics card work. I also had issues with making my monitor be the default sound output. In windows, it has some set of defaults that usually output directly to the speakers you want it to with not as much fuss. Neither of these were particularly difficult, but they were time consuming.

Linux itself really isn't the issue here. It's mostly NVidia, as they have apparently been not so great at the linux support. Linus Torvalds sums up his experience and love for NVidia here.

Development:

This. This is where Mint really went from “eh” to “Wow.” I love developing on Mint so far. I am currently working on making my own blog website (Feel free to visit the prototype here – but it still coming together and will not really have any functionality for a while yet.) and felt like this would be the perfect way to test out Mint and see what developing in a Linux environment really was like. It has been surprisingly easy. Currently, I am developing a Node.JS/Mongo/Angular.js SPA page to display my blog. For an IDE, I am using Web Storm, but I also had to pull in apache to run through some Angular.js tutorials. On Windows- this would have actually been a pain in the ass. I’ve messed around a bit with apache, installing node, grabbing random libraries. All of them can be overwhelming if you are trying to start out, and frustrating even if you know what you are doing. On Mint- it was as simple as “sudo apt-get install XXXX”. It’s like NPM, or NuGet- but for your OS. Apache, Mongo, and Node all installed very easily. I didn’t have to track down which version to use, or do something special that was hard to look up to start a service. This is where Mint really Just works. I believe most versions of linux have some form of Package Manager. Ubuntu, which Mint is based off of, uses the same “Apt-get” command to install packages, while Centos and Rehat both use YUM package manager. The only thing I had to do differently was I had to go out to download Web Storm and install by calling a shell script that IntelliJ provided with the download. In some cases, you may need to run a command to include some other libraries repository as well- but usually they will give you the command that you need to run to add that packages repo to your existing repositories so that “apt-get install” will work for them as well.

Performance:

I would not have ever thought to list “Performance” as something to talk about with an OS. I always thought of it as a cost, and either the OS works and was responsive, or didn’t work and really wasn’t worth the time. Well- here I am, commenting on Mint’s performance. It is very solid- very responsive, and most of all- Mint takes very little in the way of resources. I’m used to the OS requiring 4 gigs of ram to operate, and needing at least 16 gigs to do any decent development. Mint actually doesn’t use near as much! My home machine has 16 gigs of ram. I ran 64 bit Mint 16 and have not yet made it use more than 4 gigs of ram total. At one point in time, I counted 3 different Web Storm IDE’s open, 22 different Chromium Tabs (Some of which included flash video for Crunchy Roll or You Tube), MongoDB, Apache, a Java MongoDb UI, and Spotify. If ram is an issue, or you intend to run multiple VMs- Use mint, or even Mint XFCE.

Summary:

Over all- I highly recommend Linux, and particularly Mint. I love how easy it is to get dependencies, how clean the UI is, and how much support is out there. For all of the issues I have run into so far- the solution was a google or two away. I will be running Mint on my home machine, and will eventually convert my work machine to use it as well. The only hang up I have right now is the fact that I have a windows phone, and want to do windows phone development.  The reason that this is a hang up is because the windows phone emulator requires Hyper V. Unfortunately; this gets used from running the windows VM. To my knowledge, this pretty much requires that windows be run directly on the hardware instead of a VM. Once I get an android phone, I will almost certainly dump windows as my primary work OS and make the jump to Mint. Give Linux a try- boot up a live disk, or install it on a spare hard drive! I think it would be well worth while to learn about, and should even be fairly enjoyable for trying new languages and libraries.

I would like to thank Mathew Conley for reviewing this and making sure I didn't make a complete ass out of myself in my attempt to work with and test out Linux for development. If you haven't had a chance, check out his blog at SimonTek

11 comments:

  1. Consider Vagrant :) All the advantages of Linux from any OS you want!

    ReplyDelete
    Replies
    1. *All* the advantages? Definitely not. Performance nope. Gnome3 (which I love) nope. Vagrant serves it's purpose but this is about what OS to spend your entire day in, not which OS to deploy to.

      Delete
    2. In addition to what Todd said, I'd say go for Docker instead if Linux is your host. Much faster, resets your machine to a common base point every time.

      Delete
  2. Happy you like Linux, been using it for a few years now and I love it too. :)
    Also, Linus Tovalds*

    ReplyDelete
    Replies
    1. I have horrible speeling. Thank you, will work on trying to at least get names right in the future

      Delete
  3. Hi,
    it is indeed possible to do Windows Phone development from a VM, you just need a processor that supports Hyper-V and a hypervisor that allows for VT-x (i.e. VMWare)

    ReplyDelete
    Replies
    1. I did not know about that. I'll be checking that out (I'm guessing this is the paid version- VMWare as compared to VMWare player.)

      Thanks!

      Delete
  4. Next step - tiling window managers. Xmonad as example.

    ReplyDelete
  5. Mint is a very good Linux distribution for someone who's never used Linux before. Once you feel a bit more comfortable, a distribution like Arch Linux is perfect. The main selling point is the documentation and the Wiki it comes with: it has pretty much every corner covered when it comes to making Linux do something for you, and this includes getting your sound and video working properly.

    ReplyDelete
  6. I would say that most Linux distributions will provide similar feedback--Mint is not overly special although I will agree that its interface is very well-designed.

    ReplyDelete
    Replies
    1. At the risk of sounding dumb- I do like shiney. I do really like Mints UI, it comes off as really clean to me.

      Delete