Posting Source Code

Posted: May 12, 2011 in Random Thoughts

I’m playing with various options for blogging about programming, and a big part of that is posting source code easily, in a way that looks good.

Let’s see how WordPress fares:

        private List<string> EmptyListWithSize(int size)
            List<string> list = new List<string>();

            for (int i=0; i < size; i++ )

            return list;

        private List<string> FilledListWithSize(int size, string value)
            List<string> list = new List<string>();

            for (int i=0; i < size; i++ )

            return list;

OK, I’m pretty pleased with that. This uses Alex Gorbatchev’s excellent SyntaxHighlighter. WordPress has build in support for it.

For good measure, here’s some VB.Net code:

Public Class Temperature
    Public Value As Double
    Public Scale As TemperatureScale
    Public Sub New(ByVal newValue As Double, ByVal newScale As TemperatureScale)
        Value = newValue
        Scale = newScale
    End Sub
End Class

Mac vs PC

Posted: March 1, 2011 in Random Thoughts

This is the oldest debate in desktop computing, and trying to figure out the “right” answer is like trying to get an atheist and a priest to agree on whether or not God exists.

Let’s start by saying there is no right answer, only opinion. If you are trying to figure out what kind of computer to buy, then the best you can do is find someone who’s opinion you trust, and listen to them.

I’ll get to my opinion shortly, but first I’ll give you a little background to help you decide whether my opinion is worth a damn.

As I mentioned in my previous Post (MacBook Pro First Impressions) I’m a software developer and a long time Windows User. I am also a long time Mac Skeptic. I am most definitely not a Mac Fanboi (or whatever the term is). I don’t revere the mighty Steve, but as a fan of computers in general I have a huge amount of respect for what he has done both for Apple and for Technology in general.

I am a software developer so regardless of whether I could survive without Windows for day to day computing I absolutely have to be able to run Windows for work.

I run some heavy duty apps by comparison with the average user. Apps like Visual Studio and SQL Server. I also use VM Ware regularly and even on a Windows PC I’m likely to be running further instances of Windows in virtual machines.

I also use my machine for fun stuff. I like Photography to I like to keep photos organized and I like to be able to Edit and Share photos, videos and Audio Files.

I occasionally write Articles, create Presentations, write blog posts, work with spread sheets and do all the other stuff that people do with computers.

I don’t play games as much as I used to. If I do buy a game today it’s more likely to be for the Wii than for my computer.

So, to sum up, I pretty much use my machine for the kinds of things most people use it for, and then a few other things besides.

Now…My Opinion.

My MacBook Pro is the best computer I’ve ever owned.
Over the years I’ve lost count of the number of computers I’ve owned, in recent years I have primarily been using Laptops and I’ve generally gone with a not quite top of the range Compaq or HP.

The MacBook Pro that I bought is roughly equivalent in terms of spec to my last computer, but it is substantially more expensive. The point has been debated many times as to whether Macs are actually more expensive, or whether they are actually cheaper because you get more machine.

I won’t come down one way or the other, what I will say is that whatever the difference is that makes my Mac run faster and longer than my old HP, it’s worth every penny.

In terms of simple build quality and performance the Mac beats anything I’ve seen from other manufacturers. If this changes I’ll let you know, and yes, this is subjective, please no comments saying I’m wrong about this, it’s opinion only.

As an example of why I’m happy, my MBP was sat on and stood on in two separate incidents on the same day (don’t ask). There isn’t a mark on it, it’s no worse for it’s misadventures.

In terms of the OSX vs Win comparison an important thing to remember is that a Mac will easily run both Mac OSX and Windows, but your average windows machine will not easily run Mac OSX (although with the right hardware it can be done).

To my mind OSX is the better OS experience. Windows now feels somewhat clunky and cartoonish with I use it. I won’t talk down Windows, it’s a fine OS and I earn my living with it every day, but I won’t lie to you, I use it less and less in the evenings. Given a choice I would rather live in OSX.

In terms of things that I NEED windows for, it’s all work stuff. Visual Studio, SQL Server and so on. My day to day computing needs transferred seamlessly to OSX and I haven’t really had to look back.

This is my considered opinion, and it broadly confirms the positive things I felt when I wrote the “First Impressions” post.

Mac’s can be expensive, and if you are not going to be putting the power to good use, it may be hard to justify the extra spend. You can get an excellent Windows Laptop for about €600 to €700, Macs will start you off at or above €1000, and the price rises rapidly if you increase the spec.

If you can afford it I would have no hesitation in saying that Macs are not overpriced or bad value for money. You really are buying more than a badge.

MacBook Pro First Impressions

Posted: December 17, 2010 in Random Thoughts

I’ve recently become the owner of my first Mac, a MacBook Pro 15″ with i7 2.66GHz, 4GB of RAM (this took so long to write that my 8GB upgrade has arrived an been installed) and a 500GB 7200RPM Hard Drive.

I’ve been a Windows user since Windows 3.1, prior to that my previous computer was a Sinclair Spectrum, so we’re going back a bit.

Why have I changed? In short, I was seduced. When Mrs Dalton needed a new laptop I half jokingly steered her away from the Toshiba she was looking at to check out the MacBook Pro. At first she resisted the notion with the same logic I’ve always used….”too expensive, you’re buying the badge, I need to be able to run Windows so why bother?”

Over the next few days she looked into it a bit more and finally decided to pull the trigger and go Mac.

When her 13″ MBP arrived I installed Windows under VMWare Fusion and found that it ran it comfortably. I installed Visual Studio 2010 which is a bit of a dog on my own PC and it too ran quite nicely (much, much faster than on my PC). Considering it was running natively on my machine and in a VM on her Mac this was quite a surprise. Maybe you are buying more than just the badge.

So, I bit the bullet. I plonked down almost twice as much cash as she did and sprung for the higher spec machine that I’m using right now to type this.

In keeping with my first impressions review of the HTC Desire a few months back, here are my first impressions of my new Mac.

Out of the Box (10/10)
If you’ve never seen or touched the Unibody MacBook Pro before let me tell you it is a thing of beauty. It simply redefines the concept of a laptop. What in the name of Jimminy have I been doing lugging giant “laptops” around for the last few years. The HP I bought a year ago might as well have been built in 1992 it’s so big, bulky, heavy and relatively under powered.

The MPB is a higher spec but it looks and feels like a completely different product. It’s almost like comparing a Plasma screen with a CRT TV.

Something I noticed immediately is that there are no stickers proclaiming the type of processor, graphics card, etc, etc. Windows Laptops are covered in logos. Perhaps these ‘ads’ help keep the prices down, I don’t know, but out of the box the Mac just looks classy by comparison.

The packaging is simple, even elegant. There are two disks, one for the OS and one for Apps. Providing actual disks seems to be a think of the past in the price conscious world of Windows PCs, so this was a nice discovery.

First Start Up (10/10)
I can’t fault the initial experience of setting up the Mac. Start up time is very quick, configuration is about as simple as it could possibly be. On first glance I like Mac OS.

Getting Online (8/10)
The MacBook Pro found my Wireless connection immediately and I was online without a hitch in a few seconds. Mrs Dalton has complained that her connection drops from time to time. I’m taking away 2 points here even though I’m not 100% sure that it’s the Macs fault. I’ve been watching and sure enough she loses connection while mine keeps going, so the router itself isn’t dropping.

The Keyboard and TouchPad (10/10)
The MBP keyboard is a little different to traditional laptops. The keys are separated from each other. This gives the machine a different look and even feels different when you type. I like it a lot. I also like the backlit keys, why don’t more laptops do this? Again, the answer probably has something to do with keeping costs down.

The TrackPad is huge, it’s also glass as opposed to plastic or metal. I don’t know if that makes a huge difference. What does make a difference is the ability of the Mac to recognize “gestures”. Those familiar with pinching and swiping their way around an iPhone will feel right at home. Gestures go much further than that. Swipe up and down with two fingers to scroll a document. Swipe left and write to turn pages in a document. There are more gestures that I haven’t even gotten around to figuring out yet. In short the Mac unleashes potential in the trackpad that other laptops have ignored.

Applications (8/10)
One of the big reasons why it has taken me this long to go Mac is the fact that I need Windows. I earn my living developing software and both the software that I develop and the tools I use require Windows. That’s just a fact and it ain’t gonna to change any time soon.

I’ve found quite a bit of Useful software since I started playing with the Mac. The fact still remains however that there is a much broader selection of software for Windows.

I am nowhere near the point where I could adopt a Mac and not have Windows installed on it. As long as that’s the case I need to dock a few marks here. I’m not dropping very many however because the Mac really does do Windows rather well when it needs to.

Running Windows (11/10)
My first attempt at running Windows on Mrs Dalton’s Mac is really what convinced me that a Mac could make sense for me. I ran it using VMWare Fusion and it ran beautifully.

When my own mac arrived I tried the alternative approach which is to install Windows to it’s own Partition so that I can boot into it using Bootcamp. This means Mac OS isn’t running in the background and Windows has full use of the hardware.

Then came the surprise. I installed Fusion and discovered that I could start the version of Windows I had already installed as a virtual machine. The best of both worlds. When I need to quickly run Windows I can boot it using Fusion without leaving Mac OS. When I need to do some heavy lifting I can boot into Windows and run it natively.

You have to like that.

Networking (9/10)
It took me a little while to figure out how to connect to my Network Printer but in the end it worked fine. My issues were down to my own inexperience with Mac OS.

In fairness my early opinions of networking with Macs is that it “seems” to be easier and more reliable than Windows. I’ll be honest I’ve been using Windows for long enough now that I should know how to network the hell out of it, but I don’t. I have never grasped Networking in Windows. There are workgroups…shares…Windows 7 adds yet another set of ideas. I’ve given up.

Backups (6/10)
I’m giving Backups it’s own section in this review because Apple TimeMachine is just such a cool piece of software and deserves a bit of attention. But why the low score you ask?

Here’s why. I have an IOMEGA Home Network Media Drive. A 1tb Network Drive. Neither Mac could see it when I tried configuring Time Machine.

I had visions of having to buy one of Apple’s over priced Time Capsules. I could plug an external drive into the Mac and Time Machine would pick it up no problem, but connecting over the air to my NAS was a non starter.

Then I downloaded some software from Iomega. Success, Time Machine could see my disk. Failure…It still couldn’t back up to it.

A bit of messing later I could get the backup to start, but it failed within few minutes. Repeated tries just led to repeated fails.

I finally figured out how to manually create a necessary file, copy it to my NAS and essentially “trick” Time Machine into playing ball.

It seems to have worked, but backup is a pretty serious business and the effort and trickery involved into getting it to work doesn’t fill me with confidence about the day when I need to recover.

The Screen (7/10)
I went for the High Resolution screen. Why oh why doesn’t the resolution go up to 1080p. In this day and age 1080 should be standard shouldn’t it? Or am I crazy?

Sound Quality (7/10)
Sound on the MacBookPro seems ok, nothing special. I suspect that if I was going to use the machine for watching Movies or listening to any serious amount of music I might stump for a set of external speakers.

Battery Life (9/10)
Compared to other laptops that I’ve had the battery life on the MBP is great. I turned it on when I arrived at work recently, and left it on all day. I wasn’t using it full time, just dipping in and out, but by going home time it still had plenty of life in it.

Ports and Connections.(7/10)
Two USB ports seems a tad stingy, but that’s what USB hubs were designed for. No HDMI also seems strange, but there are adaptors that get around that issue.

I would gladly have given up the built in SD card reader in return for a few other more useful ports. Why does everything need an SD card reader these days? I rarely take the cards out of the devices. I use USB cables, bluetooth or Wifi for getting data to where it needs to go.

MAC OS X (6/10)
This is what it’s all about isn’t it? When you get past the beautiful hardware ultimately it’s all about OS X vs Windows.

Early impressions are that I’m happy with OS X. It looks and feels better, more polished than Windows 7. In fact wen I go back to Windows 7 It feels ugly and cartoonish. It never did when I used it exclusively, but I think Windows stands up poorly under comparison.

That said, I had a major Mac Fail moment this evening. I’m not the first to have it and won’t be the last.

In copying some files in a particular directory structure over a similar directory, I expected the two directories and their sub directories to Merge as they would in Windows.

What happened is that the one I copied REPLACED completely the existing directory. In other words I lost all of the data that was in the target directory.

That’s over 600gb of data gone in a puff. Luckily I had backups but I’m now looking at 4-5 hours to recover files that should never have been lost.

It’s bad that OS X defaults to this behaviur, it’s stupid that it doesn’t provide any way of actually doing the merge that you want (you have to poke around at the command line). What’s really screwed up is that the ‘Undo’ command, doesn’t undo. The files are gone, they don’t go to the Trash Can, they can’t be retrieved using ‘Undo’. And this has been like this for Years!

What’s more galling is the Mac cult followers who defend this on forums, as if someone wanting to merge two folders is the one at fault, or heaven forbid one might expect the ‘Undo’ command to know…Undo.

This is a serious fail as far as I’m concerned and now leaves me constantly worried that something I might do could wipe out valuable data that can’t be recovered.

Keep your flashy UI, your first job as an OS is to allow me to manipulate applications and data in a safe and intuitive way. When intuitive behavior leads to the destruction of data, and the Undo command fails in that specific instance, you’ve failed in your job.

Overall (8/10)
I am officially a Mac fan. It boots fast and shuts down like it’s in a rush to be somewhere else.

The old arguments for avoiding Macs have been partially put to rest. It’s still an expensive option, there’s no question about that. The question is whether the extra spend now will be worthwhile in the long run. If I can get 4-5 years use out of it instead of the 2 years on average that I’ve been getting until now then I will have been worth the money.

I do have some reservations about the behavior of the Finder in OS X. To put it bluntly it has broken my trust in it and It could take a long time to get that back.