Monday, December 31, 2012

GNU Linux over Microsoft Windows, re: From the perspective of a developer

The following is a copy and paste of a comment made on reddit at this post here.  This comment  was authored by reddit user named, RyanDwyer. I decided to re-post it here on my blog because I wanted to share an advanced Linux developer's assessment of the advantages that GNU Linux has over Microsoft Windows. RyanDwyer writes:

I'm a web developer, not a web designer. I use Ubuntu with Sublime Text 2 at both home and work. I use Linux for heaps of reasons:
  1. Keyboard shortcuts. I have keyboard shortcuts for opening almost any software I use and I've changed the Alt + F4 shortcut to something easier to press. I can manipulate windows (maximise etc) using the keyboard. I can quickly move a window by holding Alt and dragging anywhere on the window. If I'm dragging a window, I can maximise it during the drag by moving it to the top of the screen. I can manage my environment so much faster in Linux than in Windows where I had to reach for the mouse frequently.
  2. Bash scripts. I have a single Bash script that checks out code from our repositories, adds vhost config for it, reloads Apache, creates the Sublime project file and adds it to my Sublime recent history. I have a Bash script that allows me to change my default vhost easily using a symlink. I have a Bash script that can convert a project's database to a dev-ready format, such as replacing other people's email addresses with my own.
  3. Speed of file access/better structured filesystem. If I want to edit my hosts file, I can open a Terminal, typesudo vi /etc/ho and do it entirely using my keyboard in about 3-5 seconds. In Windows it's stored in some bizarre location in the Windows folder (including in a "drivers" directory!) and takes me longer. If I want to view or edit my FileZilla sitemanager.xml file I can do it in Linux by typing less .fisi. On Windows it's in my user folder, under either AppData or Application Data, and then in something like Local or Roaming. I'm confident any log I want to view or config file I want to edit can be done faster in Linux than in Windows. I can open large logs using less with minimal load time, whereas in Windows the IDE will likely become unresponsive.
  4. Compatibility with Linux servers. I can dump a production database and import it into my dev environment in just a few seconds using only my keyboard and a combination of SSH, mysqldump, gzip, SCP, gunzip and mysql. I don't have issues with filename capitalisation being different on local and production. I don't have issues with having functions that only exist on certain OSes - if it works locally, it works in production.
  5. I can list the files in a directory and copy the list into a text editor. I have yet to find a way to do this in Windows without writing a custom script or using third party software.
  6. I can run PHP in interactive mode (php -a). If I want to base64/url encode/decode something I can do it straight from CLI. On Windows I would create a PHP script and put it in a vhost.
  7. Package management. If I want to upgrade or something then I can do it through apt using one command. In Windows I have to mess around with new versions of WAMP. When I used to use Windows I had to install dbase for a client's project. I ended up having to install a second instance of Apache and PHP because WAMP didn't support dbase.
  8. I have powerful tools at my fingertips. If I want to find every .php file that contains a certain phrase and replace it across all files, I can do that in one command. If I want to create a static version of a site I can do so using wget -m .
  9. Process management. If I'm doing an intensive task and it's making my computer run slow, I can pause the process and resume it at a more convenient time such as when I go to lunch.
I guess you need to be familiar with Linux to be able to reap the benefits. For someone who's never used it there's a very steep learning curve. I couldn't imagine going back to Windows.

No comments: