Monday, September 22, 2008

Why OS X user shouldn't switch to Linux?

Note: this is in response to Way of the Penguin

You can stop reading now if you're not interested in OS X. Disclaimer: I'm an anti-Windows/IE person (note: no mention of Office, Visual Studio, ASP.NET, etc., just Windows, just IE). I've used Linux for 5 years but found the one in Apple OS X Tiger/(Snow) Leopard.

Answer: Because there is no perfectly good reason to do that! This post will discuss why OS X is a better choice if you already have it (it might be useful for people considering to get one too). The reason why I write this post is because a lot of people have told me that Mac is a waste of money and I should just stick with Linux. There are reasons why OS X costs money. And they are pretty good reasons (unlike that other operating system that costs a lot more and cause much more pain).

If you already have a mac, you can do practically everything a Linux machine can do! Yes, that's right! And more. That's why you pay more for the OS, right? This article aims to bring those reasons out (wow! so high and mightly... what a typical OS X user! eh, what the heck did I just type).

Now the first thing I checked out when I consider buying a computer is, does it have a built-in ssh? (Ruiwen has explained what ssh is awhile ago, so I shall happily skip over it.) Does OS X has it built-in? Well, I ended up with 3 OS X computers now (a Macbook Pro and an iMac, and another Macbook Pro on loan from Google), so yes damnit, of course, it has ssh!

ssh in a mac

ssh in a mac, coupled with gorgeous ever-changing background display d:


Another benefit of having a mac, Adobe design software. Yes, it's a pain doing things with GIMP (mind you, I used Linux for five years now and still using it at work and virtualized in my mac sometime, and until now, GIMP is still a pain). And I do use Adobe software a lot. Photoshop for all my design needs and photo touch-up, Bridge to keep track of all of my photos, InDesign for pretty, pretty docs, and Dreamweaver (well, in the past at least, I no longer use Dreamweaver and prefer coding my HTML by hand, to keep the HTML, CSS file size to the minimum—notice, no mention of Javascript, Javascript deserves it's own post). If you're a graphic designer who have lived your entire life with Adobe Photoshop and Illustrator, you're better of sticking with what you have now; or, if you have a Windows machine, consider switching to a Mac and do away with monitor and colour calibration.

Great UI. Yes, the OS X UI is still unmatched (Vista even blatantly stole ideas from OS X UI and slap their dirty hands on them to form Aero). Not only is it pretty, it's very user-friendly. The amount of user experience research (usually referred to as UX research) that goes to OS X design is tremendous. And being directly involved with UI design several times, it is no easy task to make something that good. The thoughts they put into shortcut keys are amazing as well. I'm used to using keyboards to navigate and do stuffs, so good shortcut keys are a must.

(As a side, while talking about keyboard shortcut, for those emacs user, there is another advantage of using OS X. Now you emacs users would be very used to using C-something and M-something keyboard shortcuts, which are Ctrl- and Alt- button respectively. Now in Windows and Linux Ctrl- are being used for a lot of their shortcuts, making it difficult to utilize both in-application and out-application shortcut at the same time. In OS X, however, the most common shortcuts use Cmd- button, the little Apple button, so Ctrl- and Alt- can be freely used in emacs without causing confusion.)

Now the thing about OS X UI is that it is not limited to the operating system. A lot of third-party software for Mac, free or otherwise, have amazing UI too! OS X attracts many kinds of developers, but out of those, it attracts one kind the most out of any other, programmers with great UI and design taste. Look at Adium X (compare it with Pidgin), look at the powerful TextMate text editor's soft-looking UI (and great choice of fonts btw: Monaco). Or Keynote FTW (strictly speaking, Keynote is not third-party).

By the way, to balance it out, while OS X UI is amazing, I'm not saying that it is perfect. There are stuffs I wish they would have put more thoughts into, such as allowing right-clicking in grid-viewed stack, easy way to modify Dock and Desktop icons, allowing switching of spaces when having 'show desktop' on, or some other minor details that bothers me (those are rare moments, mind you).

Now for me, the deal was sealed when a friend showed my the Terminal (look at the ssh picture above, that black window is the unfathomable, fluffy world of the command line terminal). Yes OS X is BSD-based. It has all of the standard BSD command-line tools (from the tired old cp, mv, rm, ls, to the venerable find, xargs, and sed. Top that with terminal-based emacs text editor (I have never, ever use emacs out of terminal, even in Linux, I'll run (x)emacs with -nw switch, which means, no X GUI). With the terminal, all the reason I have chosen Linux over Windows broke down, and I started saving money like hell to get my first mac. So from an OS X perspective, we have just eliminated one reason to switch to Linux, the ease of the command-line. Now, for those of you still stuck in GUI world, yes, command-line does increase your productivity by a lot, even when you only apply that to doing day to day stuffs. Moving/copying/deleting files from subdirectories several level deep in your home directory can be done easily with tab-autocompletion. The more daunting tasks, such as mass renaming, can be done in command-line much faster than renaming each files one by one (hint: combination of find, xargs, and sed).

What else? Oh yeah, the built-in Apache2, FTP server, and Bonjour. With Apache2 and FTP server built-in, you've almost everything you'd possibly want to serve web pages and files (to yourself or to the world). I've recently set up TWiki on my own computer for my private usage, and the experience was a bliss. Take a look:

TWiki on my http://wiki

This webpage is accessible in my computer by simply typing http://wiki (and don't try to access wiki.chrishenry.com from your own computer, that page doesn't exist outside my computer, in fact, it will bring you to some weird website asking you to register the domain)


All that was done in about half an hour; and that's the first time I was setting up a Perl-based CMS ever (why Perl, you ask? Simply because anything other than PHP-based is fine by me: Perl, Python, C++, Java, ASP.NET). Oh and did I mention that TWiki is awesome? (No, I didn't mention, in case you're wondering, but now I do.)

Now Bonjour is arguably the strongest plug-and-play networking daemon ever written for home network (and office network, when administered properly). Ever wondering how your iTunes can detect other iTunes in the network (yes, even in Windows, Bonjour has been ported for Windows by Apple), or how your computers can easily detect Bonjour-enabled network printer, Time Machine, and other Mac in the vicinity? That's all Bonjour for you. (On the flip side, Bonjour can be a network security nightmare in corporate networks if it is not administered correctly.)

Let's put it in context more familiar to most SoC students, programming. For very basic text editor with syntax highlighting, TextWrangler is a viable free alternative to TextMate. After using different text editors though, I've settled with emacs. It is powerful and fully customizable once you learn the shortcut (oh, and CS1101S students rejoice! You can customize emacs easily using LISP programming language, the more complex alternative to MIT/Scheme). Eclipse is also available for Mac for those Java programmers out there. In addition, there is this one language that you can only code in a Mac, Objective-C. Objective-C is a very pretty object-oriented programming language with dynamic type system. By very pretty, I mean the code looks pretty and highly readable.

id person = [[Person alloc] init];
[person setFirstName:@"Chris" lastName:@"Henry"];


In Java, the equivalent of the above code is:

Person person = new Person();
person.setFirstName("Chris");
person.setLastName("Henry");


Objective-C is used everywhere in OS X. iPhone developers should also be familiar with Objective-C. So Mac opens up one avenue of programming that you can't do in other platforms.

Now, what about C#!? ASP.NET? There's no Visual Studio 2008 for Mac, is there? No. There isn't. Chotto matte kudasai! There is Parallel or Fusion! Both of them are virtualization software that enables you to run other operating system on top of OS X! Recent multi-core CPUs also contain this technology that allows hypervisor to perform much better to run multiple OSes at the same time (Intel's VT or AMD-V technology). You can virtually run Windows XP/Vista or any flavour of Linux on your Mac! They run pretty fast and you can literally sleep the guest operating system and wakes them up in seconds. If you maxed out your Mac's RAM to 4GB, running two guest operating systems is no longer a dream. (Recently, I ran Windows XP quite a bit to try out Chrome and it runs faster than my Firefox 3 running natively in Mac; it's an unfair comparison though, since I usually opened 50-100 tabs in FF3 while I only opened 3-4 Javascript heavy website on Chrome, but still, virtualization is a very real alternatives).

Google Chrome on Fusion

Google Chrome running on Windows XP 64, which in turns ran on VMWare Fusion, on a Mac!


The last thing I want to bring up is darwinports, a package manager for OS X. Quite frankly, the one thing I do miss moving to OS X from Linux is package manager. I came from Debian camp, so I'm used to typing apt-get install firefox3 xemacs21 nmap apache2 to download and install stuffs automatically (Linux software dependencies are a b*tch in itself! A piece of software you want may depend on x number of libraries and other software, each in turn may depend on more; without package manager, they are just too hard to install manually, or . . maybe we are just too pampered with these package manager, I mean, people used to live without them, though then, the world was so much simpler). Luckily in Mac, most software comes with installer. But, if you want to use Linux tools in Mac, that's gonna be a different story. What? Linux tools on a Mac? How? Well, most open source tools available for Linux are made to be portable across operating system. You just need to have the dependency installed, gcc (available in OS X), and the source code. Run configure script, compile, run make install, and bam! It's installed. Sounds easy. But how the heck do I get all the dependencies installed? Manually? Right. That's how DarwinPorts fit in. It is a FreeBSD-like package manager for OS X with quite a huge library of packages (not as huge as Debian repository though, Debian repo easily has 13,000+ packages).

Well, so are there reasons for OS X users to switch to Linux? Almost none. But sure, even for a die-hard OS X user like me, there are perks in using Linux too:

  • Linux has this awesome feature where you can just hover your mouse over to another window for it to gain focus, instead of clicking. This feature is awesome if you can touch type and your screen is small. The benefit is that while the window gains focus, it's not brought up to the top. So I could hover over to a half-visible text editor and type what I saw in my webcast while still having the webcast covering almost the entire screen. Now that's one bad-ass feature.

  • Compiz Fusion is really pretty. Compiz basically uses your usually unused 3D graphic card to do cool stuffs with your Desktop, e.g. wobbly windows when you drag them, accelerated window transparency, and a lot of other effects.

  • Speed: Linux is fast. Period. If it's not fast enough, recompile your kernel and removes all the useless modules (compile as many parts of the kernel as built-in and not as modules). Recompile everything! You can literally recompile everything optimized to your CPU, thus squeezing every ounce of performance you can get from your PC. (Or use Gentoo Linux, whose emerge tool will automatically compile whatever package you're installing; alternatively Debian-based distros can use apt to compile from source, Arch has Arch Build System—pretty similar to FreeBSD ports.)

  • It's free and free. Yeah sure. I know the pain of saving enough money to actually get a Mac. Free is good. (Quiz: why did I say "free and free", isn't it redundant?)

Al'right. Now we have one post for Linux and another for OS X. Now who will be the one coming up with a post for Windows? (smirk d: oops)

Well, all right, I have to work tomorrow, so I shall end here. This post is by no means comprehensive, there is no mention of Spotlight, or Expose, or XCode, or Cover Flow, or . . . (ellipsis indicating I'm running out of idea but refusing to admit)

Btw, in case you are wondering what are those (:, ):, d:, etc, they are reverse emoticons. I don't like MSN and GTalk trying to convert every smileys I type into pictures, so I started reversing them. I'm so used to reversing them that I just use it all the time now.

For reading 'til the end, doomo arigato gozaimasu. Ja mata ne.

- Chris

19 comments:

Jason said...

"Linux has this awesome feature where you can just hover your mouse over to another window for it to gain focus, instead of clicking"

- it DOES? O_O *goes to look for it*

nice read btw

chris said...

Yes it does! (:

In Gnome (I have Gnome running and handy, but you can find the same options in KDE and XFCE), go to Desktop > Preferences > Windows. Tick the first option (Select windows when the mouse moves over them). d: It's my favourite feature.

NG said...

Another good reason for Mac OS, is that all games worth playing, (usually Blizzard games) runs on Mac seamlessly, you dun even have to bother about "D*r*ctX" issues with hardware....

chris said...

Yeah, that's true. (:

It's good that we're probably going to move away from GPU-based rendering back to CPU-based now that CPU is getting too powerful. That will obsolete DirectX and OpenGL. d: Making games more portable. Heh heh.

Edwin said...

There are some apps that are not available on Macports. Recently, I had to use an OCR software called ocropus and it would only compile on Linux. It wouldn't even compile on a BSD machine.

Other applications include "ABLE" which is a Common Lisp editor.

So I have a Linux partition now. I also love Beryl more than the OS X effects because it is customizable.

chris said...

Yeah, sure. Debian repo (as I mentioned earlier) has like 13,000+ packages. Macports only have what, a few hundreds? But the most important tools you'd probably use in Linux are all there in Mac. Plus more.

I'm sure there are other OCR (probably better, though might have to pay) software for OS X. You can code Common LISP pretty well with emacs.

The best part, you can install terminal based Linux on Parallel/Fusion (so that you don't spend much memory to run windows manager) and `ssh -X` to the virtual machine. You can then use OS X built-in X11 to run whatever software you can run in Linux, within OS X itself. (:

Simon said...

Excuse me... is the tag subject even an issue???

MAC OS has always been powered by a POSIX-compliant UNIX OS (early BSD variant), masqueraded with a user-friendly Cocoa-based front-end. Just start X11 from app/utils and you get a perfectly functional UNIX workstation.

On the other hand, Cocoa arguably dumbed things down too much, eg: focus on mouse hover, single window manager, for instance.

Each OS has their niche strengths, exclusive powerhouse apps, and market demographics. Arguing which is better is pointless and passe.

NUS School of Computer Science really ought to do a better job educating your kids with a broader knowledge of mainstream systems -- i.e., knowledge that matters.

Oh, and that CPU versus GPU comment is laughably idiotic...

N'uff said.

chris said...

Yeah sure... But we like to argue. And it's fun for us. You can take it like defending your favourite sports team (though it may suck a lot), or your favourite liquor. They are idiotic for other people, but for the people who love that sports team or that liquor... that's another matter.

Same thing here. I'm replying to Ruiwen's post on Why Linux with another one that supports OS X (we both have the same ends in mind though, getting people away from Windows).

We agree at one thing, NUS SoC should do a better job at educating Singaporeans. Not just technically, but psychologically. The thing that makes schools like MIT far better than SoC is not just the curriculum or the profs, but their students and their mentality.

And there's nothing idiotic about CPU v. GPU, what's your view about it? No view? It's been predicted since a decade ago that sooner or later, GPU will become obsolete. From my point of view, that's good, because you can rely less on proprietary API like DirectX (or the open equivalent OpenGL) and program in more portable manner. In what way is that idiotic?

Well, to each his own. Your pov is pretty nice addition to the other povs here. (:

P.S. Not all UNIX is the same. Not all software can be ported between different *NIXes easily. I know that one of my boss at SoC would argue vehemently that Solaris is better than Linux. Does the fact that Solaris is as POSIX-complient as Linux stops him from arguing that way? It's an open question really, but I doubt so.

chris said...

ahh, i think i understand what you mean by the tag line.

But you should read between the line. No it's not an issue, I think all OS X users know that it's pointless to switch to Linux already. The aim of this post is that 80-90% readers who don't use OS X yet and still stuck with a remnant from the 90s. But I don't want to frame this post as OS X v. Windows, since that would be boring (and hard to write for me, as I haven't been using Windows regularly for several years).

Ruiwen said...

Haha well, between the two (OS X and Linux) I'd actually go Linux.

I'll agree with Edwin above. The Compiz-Fusion effects are way more customisable that anything Leopard has. From window effects to keyboard shortcuts (who's bright idea was it to restrict keyboard shortcuts for a certain action to only certain keys anyway? Spaces, I'm looking at you.) It's not about eye-candy, it's about usability and productivity.

Besides, if I'm running a Linux distro, I get all the apps I need/want right out of the distro's repos. YMMV, of course, but if works fine for me. I don't have to jump through hoops to run software I can get of the box, and so far OS X doesn't appear have anything unique to it that would make me want to stay in that environment =)

Jason said...

Something interesting I found when reading a 2004 paper by someone then in Microsoft Research:

"The performance of these cards is growing at a much faster rate than CPUs, at roughly Moore’s law cubed [4]. Soon the computational power of these graphics processing units (“GPUs”) will surpass that of the system CPU."

Maybe this is what simon's referring to?

Can't say much about OSX until I actually can afford a mac :D But I know I'm very happy with what I'm getting from linux, primarily because of the feeling of freedom and power it gives me over my own computer.

chris said...

ruiwen: umm, you brought one of the most annoying OS X non-feature... can't argue against that, OS X doesn't really allow customizing of shortcuts well. (who the heck think of having Ctrl+Arrow for spaces anyway!? don't they notice that Macbook Pro doesn't have right Ctrl button? that means can't use one hand to use Spaces shortcut, unless you have one gigantic hands.) fortunately though, there's this free OS X apps called Quicksilver. It helped a lot when I was using Tiger (don't use it much now though).

unique to it? friendly UI, great choice of software (albeit most come with installers), excellent third-party software (some are not free, but hey, some of them are really, really nice). plus you can do everything a linux can do! and a windows too.

jason: that can be explained simply.. it's because GPU has not become as fast as CPU yet. the technology to manufacture it already exists (the CPU manufacturing technology). GPU is facing the same problem CPU is facing (heat, limit on how many transistors you can squeeze, etc). another reason is because gamers are more than willing to spend tonnes of money on it.

now that's not gonna last forever. right now games are needing more and more powerful hardware, but that demand is going to slow down (the same with what happens with software as CPU got faster). CPU is still going to go faster and faster (actually more and more cores), up to the point that there will be enough excess capacity for games to utilize processors to do most of the rendering. only the highest end games would need extra hardware, then, GPU might evolved into Physics engine, where computations are much harder than graphics rendering and can be optimized using special low-level ops.

now i might be wrong, of course. looking at the amount of money that gamers spend on highest end graphic cards, nvidia and ati will not let graphic cards die so easily. so only time can tell. i'm leaning towards returning all computation back to CPU though, since it will help with portability of render-based software.

btw, i was happy with linux too, until i got a mac. d: to me, a mac is like an upgrade from linux; i was able to run everything a linux machine can do with more +++.

chris said...

P.S. btw, ATI (i think it's ATI) will soon move to multichips (multicore?) GPUs. there's a hell lot of prediction that GPUs are going to be more general-purpose (like CPU). thus allowing people to bypass DirectX and OpenGL API and write their own rendering software in general-purpose language (or maybe in nvidia's CUDA). i think it's a lovely development that's totally inline with what i thought should happen.

you can argue this does not equal to killing GPU completely, but wouldn't GPU capable of general-purpose programming be very similar to a CPU? (except with extra stuffs like vector calculation.. wait.. hey.. don't Intel SSE has similar ops?)

Ruiwen said...

chris: Heh well actually you could change it to Cmd-Arrows too if you wanted it one-handed. Though, I'd really much rather be able to customise it to use whichever keys I want (I'm partial to Ctrl-Tab/Backtick for going back and forth between desktops.) (Oh, btw, do you know if there's any keyboard shortcut to move windows between spaces? I find using the mouse rather annoying.)

And yup, I can do without the installers (doubleclickdoubleclick-nextnextnext, doubleclickdoubleclick, etc) and for-cost software too. I can't afford to pay too much, and I don't want the guilt of pirating software either.

I guess we're opposites then, Chris =) I was happy with Linux.. then I got a Mac.. and now I'm back in Linux again.

Not that Linux doesn't have its flaws, of course, just that it works better for me =) (Link for some Linux-hating rants =)

chris said...

Haha, I find using Ctrl+1, +2, +3, +4 more convenient now (even with 6 spaces, the max I've ever gone with, Ctrl+6 is much better than Ctrl+Arrow). Unfortunately not, you need to at least click and hold mouse button on title bar. You can use Ctrl+Number to shift those windows though, at least no dragging needed.

My gripe is the difficulty of adding new shortcut, not changing existing shortcuts. e.g. I'm used to Ctrl+Shift+L to start screen saver and lock screen. The best I can do now is a Dock shortcut for screen saver engine. Fortunately, that's a very small price to pay for all the other stuffs I'm getting.

Most great software in Mac is fortunately free. The one super worth it software to buy is Fusion/Parallel, which is not *that* expensive. (Alternatively, Boot Camp, though it's not as effective as VMs.)

Simon said...

Chris, please, you are embarrassing yourself. We're having a ball laughing at it/you/NUS.

If you want to blog, write about stuff you know, opinions, whatever.

Blogging nonsense and evangelizing half-truths on behalf of "NUS School of Computing" is doing you and your school a disfavor.

Ruiwen said...

I see you do write about your opinion too, Simon. But really, this isn't the place for personal attacks like that.

This blog is for the sharing of ideas, so why resort to demeaning others? If you disagree with a point that's been made, feel free to rebut it. I'm sure your opinion will be valued in that case.

chris said...

ruiwen: thanks for the comment. (: this flame war turns out better than i thought.

simon: it's okay to laugh at things i wrote. i'm not concerned about having people laugh at what i thought anyway.

of course i'll be happier if we could have constructive criticisms so that i could learn more. that's how i learned from my mistakes. i've made enough shares of mistakes too, as much as i want to deny them.

btw, i'm actually having a good laugh reading your comments, so we're entertaining each other. (:

JanJon said...

Very nice article... I've never thought of using ctrl-number for spaces, feels so much easier now (though I am one with "gigantic" hands as you say, I can press ctrl-arrow with my left hand alone, though it's not something I'd prefer to do if I have a choice)

I am still stuck to OS X because of photoshop/indesign/office:mac/iWork/iLife. Sadly, linux doesn't have any program that suits me, yet... and unlike in SoC, most lecturers in engineering prefers to create their lecture notes in powerpoint/word using some weird graphics and animation that just doesn't show up right in anything but MS own version of office. And iWork loads faster than office:mac or open office.

I guess linux will never reach that level of user-friendliness, since the whole idea of linux is for people who know how to compile the kernel, etc. Not that I can't, but isn't it a little tedious compared to just inserting the disc and going through the setup? Unless you can remember all the commands without always resorting to the man pages...

Hope one day we can indeed move over to linux. I need at least Adobe to be there...