Archive for the ‘Uncategorized’ Category

A Tale of Two Phones

For the last few months I’ve been using a HTC Windows Phone 8X. It’s an incredible phone. Yesterday I got a Nokia Lumia 920. I haven’t had a long time to play with it, but I feel I’ve used the phone enough to make an accurate comparison.

There has been some debate over which phone is better. The Lumia 920 was a long awaited phone, and the 8X was a surprise entry which has been known as the "signature" windows phone. Both of these phones are amazing, and both in my view, are the best phones available.

Hardware Design

Both of these phones are beautiful. Before I got the 920 I expected the 8X to win this category. I liked the addition of having the grill match the phone colour, it’s lighter, thinner, and a touch smaller (though if you want a small phone you really should be looking at the HTC 8S or Lumia 820).

Two small problems with the 8X is I found the windows button touch area was too small. When I first got it I was constant hitting it and nothing happened. But you do get use to it and it might just be a small defect with my phone, so I think of it as a small problem. The other is the USB port is the wrong way. I found this with the trophy too. Companies seem to have all standardised with The USB logo faces up. Except for HTC which face it down.

These small problems don’t exist with the Lumia 920. But it also has some big advantages. First the screen. I thought the 8X screen was beautiful. But then I did a direct comparison to the Lumia 920. There was no comparison, the Lumia screen was significantly better.

The biggest design problem with the 8X is the buttons. The are barely there. It’s meant to make it all look much more consistent, but the result is the buttons feel cheap and tacky. They can be hard to press. While the Lumia uses Beautiful metal buttons, it looks great & gives it extra quality.

A big difference with Lumia phones is the power button is on the right side with the volume and camera button. At first this is weird, it goes against all other phone design that keeps it at the top. And worse, there’s nothing to indicate that it’s the power button. BUT – it works. Especially for large phones where it can be hard to press the top button with one hand.

While on the topic of the power button another annoyance about the 8X is when you turn the phone off, a simple press of the power button turns it back on. This means that you could  accidently turn it back on, and if it’s off, how do you know it’s off and not just on standby? You have to hold the camera button down and if that turns the screen on then it was on standby – not exactly intuitive. Compare that to the 920. To turn it back on you must hold the power button for a few seconds – so it’s harder to accidently turn it back on, and by pressing the power button  you can tell if it’s off or on standby – much more intuitive.

So to my surprise I give the best design to the Lumia 920 for its screen and buttons.

Software

Both phones run Windows Phone 8. It’s beautiful, smooth and fast on both. Manufacturers have to add value to the OS with apps. Of the HTC apps, there’s only one worth mentioning – the flashlight. It’s simple wouldn’t have taken them long to write – but it’s useful. There is a similar app available for all phones in the marketplace, but my understanding is it’s a bit of a hack, so it may not be as efficient.

On the other hand Nokia phones come with a heap of amazing apps. Maps, navigation, music. They’re great. Also there’s some apps you normally have to pay for which you can download for free with a Lumia.

There’s no contest here – The Lumia 920 wins hands down.

Camera

I quite liked the 8X’s camera. I’ve barely used the Lumia 920 camera so I’m not going to declare a winner. But online sources seem to confirm the 920 has the best camera in a smartphone.

Conclusion

Both these phones are incredible. But if given the choice take the 920.

Average user does not mean complete idiot

There’s been this common misconception with user experience design for years now. Good design is a design where a complete idiot understands how to use every feature immediately.

This is completely wrong and leads to useful features getting cut because, “It’s too complex”

There is an elitism in IT where people assume they are special because they know more than the basics about computers and that those, “Average users” are complete idiots and should be treated as such.

Nowhere is this more clear than with Windows 8. Many reviews have said how complex and how it will confuse the end user. But they never say that it confused them. Here’s the problem, they were able to get the hang of it pretty quickly, but they see themselves as “elite” as they not only use computers everyday, they write about computers. But then they make comments about how this theoretical “Average User” will struggle.

A good user experience does not mean something so simple you can’t do anything meaningful. A good UX is one that can be explored – it pulls you in to touch it, experiment with it, play with it. A good UX is consistent, so that once a user has learnt how to do something can guess how to do similar things.

The modern UI in Windows 8 achieves this surprisingly well.

R.I.P. Neil Armstrong

“Do you know how many people are watching this live on the telly? Half a billion. And that’s nothing, because the human race will spread out among the stars-you just watch them fly. Billions and billions of them, for billions and billions of years. And every single one of them at some point in their lives will look back at this man taking that very first step and they will never ever forget it.”

Entitlement and Responsibility

If there’s one problem the internet and access to so much free information and tools has created is a sense of entitlement. Too many people believe they have a right to get everything the way they want it with out doing anything themselves. They don’t have to be grateful that they get to use it, the creators should be grateful that their content is being used that is the only reward they should seek.

And of course it’s a load of crap. The following message got posted about “Code alignment for Notepad++” on the Notepad++ forum

Code alignment v3.0 on Linux Mint 10, based on Ubuntu Maverick, under Wine 1.4.0 causes unknown exception when starting N++. N++ will start but crashes soon after opening Plugin Manager, most likely due to missing .NET 3.5.

[Mad] By what fucking excuse you think .NET is worth anything ? All it does it corrupt and prevent cross-platform support. Either quit or switch language, or help making .NET compatible !! Oh, I forgot ! Micro$oft dicks can’t help !! FUCK YOU.

So I release for free an extension. He decides to run the program in an environment that’s not supported by Notepad++. And when it doesn’t completely work he decides to insult me and question my skill as a professional developer. I took the bait…

I bet if somebody gives you a free chocolate ice cream you tell them to fuck off because it wasn’t strawberry.

Let’s get this clear, code alignment is a free extension. I’ve released it purely out of the good of my heart. I have no responsibility to make you happy and I owe you nothing. Yet you come on here and act like you’re entitled to use it. That I have somehow wronged you.

I wrote this extension to help myself, since then I have added requests for others which have no value to me. But if you think I’m going to waste my time to satisfy a low life who can’t even be bothered to treat me with respect, you’re delusional. Write it yourself.

If i did make it wine compatible i bet you would tell me to fuck off as i hadn’t written a port for eclipse yet.

The main reason I wrote it in .net is because it’s a port of my extension for visual studio. Keeping it in .net let me share the code, develop it faster and not have to maintain duplicate code. Giving me more time to add new features and spend doing other things.

Grow up.

As far as I’m concerned anyone who acts like that is entitled to nothing.

But what responsibilities do people who make free software have to their users? I’ve given polite feedback and suggestions to open source projects projects and have sometimes (luckily few and far between) been granted with a sharp

If you want it write it yourself. That’s why it’s open source.

Code alignment has greatly benefited from community. People have left respectful comments, suggestions and questions and they’ve started some great conversations. And this is where the responsibility comes from – respecting the people who have taken their time to discuss with you how to make the product better.

I believe we have a responsibility to do two things…

  1. To be honest. If you can’t provide an update for a while as you’ve got other stuff on, tell people that. They’ll understand. Don’t just say ‘soon’.
  2. Be respectful, unless they’ve insulted you, respect that they are trying to help.

Doing anything else is great and end users should respect that you are going beyond the call of duty.

Code alignment website

Lots of changes have been happening in code alignment recently. I’ve mentioned some of them in random places, but haven’t given a lot of details. But today I want to focus on the brand new code alignment website.

http://www.codealignment.com

I’m really happy with the website, it’s nothing fancy, but looks very pleasing. From now on this will be the central point for code alignment news. It also features an issue tracker, feel free to use it to suggest any improvements.

You’ll also notice that code alignment has a fancy logo and a branding style. The main logo is designed my friend Michael Csikos who shares a lot of my ideas about formatting code. After he had made the logo we were talking more about how to brand the individual programs. I suggested replacing the = with a symbol to represent the different IDEs and the end result looks great (The Visual Studio sign was created by another friend of mine – Martin Krestan)

 

Donations & Advertisements

Before I continue I want to make it clear, Code alignment is, and will always be a completely free tool.

I’ve donated a lot of free time to develop code alignment during the last 2 years now. During this period I’ve never thought about trying to make any money off it. But when making the website I decided to add a ‘donate’ button and put an unobtrusive advertisement  down the bottom, completely separate from the content.

Future versions of code alignment will have an about box with a donate button on it. That’s as far as it will go. Don’t fear me getting greedy and creating popup ads or constantly bugging you to donate.

Personally, I find code alignment an essential tool for software development. The amount of time it has saved me would easily be measured in days by now. I know many others feel the same. If you enjoy code alignment, then please donate.

Code alignment 3

It’s been a while since I’ve released an update to Code alignment. But I’ve been working on it on and off since that release and I’m ready to release a significant update – Big enough to warrant being version 3.

When Version 2 was released it had some important changes

  • It became its own toolbar instead of just adding them to the edit one. This was useful for people like me who knew the shortcuts and wanted an easy way of hiding them from the toolbar.
  • It separated the align by string and align by position into different functions. This was great as the old way you had to default the position to zero,  but when you actually wanted to align by position you wanted it to be at the caret location.
  • A lot of streamlining – The big one was align by space not asking for position, just using your caret location.

Looking at the changes from Version 2 to Version 2.9 it’s amazing how much it has improved. My favourite additions are

  1. Align by space aligning the last space in the first space block – With this align by space became the most awesome feature of the extension.
  2. Changed the selection logic for XML style documents
  3. Releasing a Notepad++ version

So now we come to the list of what’s new in version 3…

Lots of backend changes.

Shortlist

    1. There is now a common assembly which is shared between the Notepad++. Before the code was common but as shared files. This was to overcome some problems in Notepad++.
    2. More decoupling -  allows for various behaviours to be changed.

Regex support

You can now specify regular expressions to look for. Even better you can (optionally) add a named group ‘x’ to specify where to perform the alignment. For instance, the regex

;(?<x>)

will align by the first character after a semicolon. This has allowed a lots of simplifications in the backend. Don’t expect this to work with tabs though – I’ll explain that in a future blog.

New ‘Align by string’ screen

Unknown to most people, Code alignment started off as a macro. A macro I didn’t write myself, but had constantly improved over the years. When Visual Studio 2010 came out with its improved extension model I took the plunge and completely rewrote it from scratch. The entire approach was different (and much better).

The only remnant of the old macro was the ‘Align by string’ screen. Pretty much it was a basic VB dialog. I can’t remember if this was in the original macro or something I added to it. But when I rewrote it, I just add a reference to the VB dll (in my c# project) and used the same code. Why? It was simple, fast and did what I needed.

But that last remnant is gone. The new screen not only allows you to use regular expressions but also keeps a history of the strings you’ve chosen to align by – not just the last one. There’s also a check box to align from caret position.

Align by position is gone replaced by align from caret position

Let’s face it, the only position ever used was the current caret position. Entering the column number was just too annoying. Sure, there could be other ways of choosing the location, but the caret location works so damn well.

Slight change to Align by space

Now that code alignment allows regexes I could simplify the code for a few things. One was the align by space. Before it could be defined as “align the last space in the first space block” this has ever so slightly changed to “Align the first character after the first space block”.

What does this mean? Most of the time nothing. The only difference is it will ignore whitespace at the end of lines (as there is no character after the first space block).

Behaviour in Align by string for align by space or equals has changed

Before if you were in the Align by string dialog and you entered a space or a equals, it would perform the same as if you had done an “Align by space” or “Align by equals”. It no longer does this. You now have full control over the box and what you enter is what you will search for.

Why my style for AND and ORs is clearly superior

When it comes to the style of code a lot of it is personal preference, and unfortunately we too often focus on these preferences as opposed to the parts that can be clearly reasoned as a better style. The obvious example is curly braces…

public void MyMethod()
{
}
public void MyMethod() {
}

In terms of readability one isn’t really any better than the other. You can reason why one is better, but it really is just a personal preference. Personally I prefer it on a new line. Why? Well, the biggest benefit to me is it works better with my code alignment extension.

But there are ways of formatting our code which is clearly superior. As I’ve been saying for years, the most important one is code alignment – lining up your code makes it so much more readable.

But I wanted to focus on one case today and that’s ANDs and  ORs. It’s something that a lot of people aren’t too disciplined with. When it’s simple and on a single line it’s fine but as soon as it needs to be split, people don’t know where to put the && and ||. The first way is

if (myObject != null &&
    myObject.Kind == Kind.MyKind &&
    myObject.HasValue &&
    myObject.Value >= myObject.MinValue)

this is what I think most developers do. But it sucks. The Ands are hidden if one was an OR it could be easily missed. So the first thing we can do is align the Ands.

if (myObject != null             &&
    myObject.Kind == Kind.MyKind &&
    myObject.HasValue            &&
    myObject.Value >= myObject.MinValue)

It reads nicer but it still has problems. First if it add a new value the ands need to be moved, our eyes are attracted to the left first, not the right. And when we talk, we say X… AND Y. The AND is more of a prefix than a suffix. This leads to…

if (myObject != null
&&  myObject.Kind == Kind.MyKind
&&  myObject.HasValue
&&  myObject.Value >= myObject.MinValue)

Here the AND is clearly shown as a continuation of the if. Our eyes quickly jump to the symbol.

And in case you’re wondering it works with anything not just an if

bool value = condition1
          || condition2;

return value1
    || value2
    || value3;

 

The problem with MSDN gallery Q and A

As many of you know I have written a few extensions for Visual Studio. The most popular by far are “Solution Explorer Tools” and “Code alignment”. Each only a few downloads short of reaching 6500 downloads.

I get a few queries and comments about these extensions, but the MSDN’s Q and A section has a major problem in it.

For some reason it has decided that you don’t need new lines. and just replaces them with a single space. Now on some forums, this might be understandable. You want comments kept short, and you don’t want them to take up screens so why not? But this is a Q and A for developers. Developers asking and answering questions about an extension to visual studio. It’s quite often they want to enter code.

So what does that mean? Well let’s say in my comment I wrote…

var foo = "Hello World";
for (int i = 0; i < 10; i++)
    Console.WriteLine(foo + i);

when I submit it, it would become

var foo = "Hello World"; for (int i = 0; i < 10; i++) Console.WriteLine(foo + i);

And that’s just for a simple case, many of the times I’ve seen this happen the result itself wraps over 10 lines. It’s ugly and unreadable.

MSDN didn’t use to act this way, it respected new lines but then they changed it for some unknown reason. On a side note it has also never respected multiple spaces and I’ve had to replace spaces with ` to make the formatting appear correct – pretty crummy for a developer Q and A.

It’s especially annoying for my code alignment extension. The extension aligns characters across lines, so when people post suggestions they post multiple lines – which gets swallowed up by this bug.

It’s ironic that for my extension that encourages good formatting of code, it has a the Q and A section which doesn’t allow any formatting.

I hope Microsoft fixes this problem soon. I can’t be the only person who is annoyed by this.

The ribbon

This is a bit of a follow up to my last post on windows 8. If there’s one thing Microsoft has been criticised more than anything else in Windows 8 it’s the decision to include the ribbon in explorer.

“Look how big and ugly it is!”

“Clean design means providing us only the functionality we want, not shoving every command in sight”

The think there is a fundamental misunderstanding in what the ribbon is. People see it as a toolbar replacement. This is incorrect.

The ribbon is a menu replacement that might render toolbars redundant.

So when comparing UIs, you shouldn’t compare a ribbon to a toolbar, but to a menu. Compare Windows 8’s ribbon to OSX’s menu and you’ll come to the conclusion OSX’s menu is far more complex.

“But OSX’s menu is hidden; it’s out of the way, the ribbon is in your face”, you say? Well again, I think you’re missing an important thing the ribbon can be minimised so it looks just like a menu. I will admit I hope in the final release Windows 8 has the menu minimise by default.

This behaviour of being able to minimise or stay open is very powerful, what if you wanted to do multiple things in your menu? As soon as you select one the menu disappears and you have to start again to select the next. On the other hand with a ribbon if it is minimised you can double click it to keep it open select all the options you want – selecting one doesn’t hide the ribbon, the double click the ribbon again to minimise it – That’s much nicer.

One more note about Windows 8. They really need to work on the icons. There is no consistency between them. “Hue variance should justify itself”

Visual Studio

I’m actually going to go to the territory that no developer has gone to – I want the ribbon inside Visual Studio. I may have just lost you but listen to my reasons.

  • In all the hundreds of menu items, I go into the menu to use a grand total of 3 of them.
  • The ribbon is a menu replacement, not a toolbar replacement. Toolbars can stay how they are (or preferably back to what they were in VS2008, there’s so many problems with them in VS2010)
  • The most important way select commands in Visual Studio is shortcuts. The ribbon does an excellent job at exposing shortcuts.
  • The menus are cluttered from years of addition of commands and never removing commands. The ribbon forces the organisation to be rethought.

I think these are quite compelling reasons. At the moment, I have kept my toolbars to an absolute minimum (10 commands). Some of these I wouldn’t mind to be more hidden inside the ribbon – Target Deployment Device, Solution Configurations & Solution Platforms.

Windows 8 Impressions

Before I start, I am still to use Windows 8 myself. All I know is from videos and posts about it. The purpose of this is mainly to give my views on what other people have said, and point out their flaws.

First techcrunch’s

Microsoft’s Bold Move: If They Can’t Win The Tablet Race, They Won’t Acknowledge It Exists

First this title is obviously hyperbole in order to try and get clicks. Really low techcrunch.

Now the basic premise of the article is about how by using the same operating system as they use for a desktop, it’s not really a tablet. The problem with this, no reason is given why and doesn’t address the fact that Apple (and google) are using their mobile phone platform for tablets.

Why is a PC operating system on a tablet not really a tablet but a mobile phone operating system on a tablet is a real tablet?

Sure you can point out how a phone is more like a tablet than a PC is

  • Mobility
  • Battery life
  • No keyboard

But you can do the same for why a PC is more like a tablet too

  • The form factor is more similar – Apps that work on a decent sized screen should be designed differently for one on a tiny mobile screen
  • Multitasking – because of the phone’s limited screen real estate you’re less likely to want to view more than one app at a time, if you were given that extra space, then you want to see multiple things at the same time.

Microsoft are not ignoring the tablet market, they are simply taking a different approach to apple.

 

Next a techcrunch video

Fly Or Die: Premature Opinions On Windows 8? We Got ‘Em Here!

Wow! They didn’t even try to be fair. John Biggs although making some inaccurate statements looked reasonable next to the other guy…

First his “the ipad is a lot lighter” comments.

That’s because ipad was running on an ARM processor while the other wasn’t. Now that would be a fair comment to make – IF THEY POINTED OUT WINDOWS 8 WILL BE AVALIABLE ON ARM TOO! But they didn’t. The impression they gave was ALL Windows 8 tablets will be heavy, have a fan and won’t be able to compete with the iPad on battery life. All of that is wrong.

On comments about the network…

You’re going to blame windows 8 because you didn’t bother to setup the network on it? His comment that it MIGHT be their fault sums it up – figure out what the problem is before you start going on about it.

“Can I get this without the Windows?”

Although it’s true that you can’t get it without the classic windows, if you don’t want to use classic windows – you don’t have to! You can stay in the metro UI.

He then instantly fails it because of this. But as I said, you can use the metro UI for everything and only go into the classic mode for stuff that’s not in Metro.

So let’s compare Apple’s and Microsoft’s solution to needing to do something the tablet interface can’t do.

Apple’s solution – You can’t do it.
Microsoft’s solution – Switch to classic view and do it.

And they’re saying apple’s solution is better?

Next – From Daring Fireball

Now the thing I found funny about this post is a big part of what he’s saying is

“I’d be appalled if Apple were to unveil something in the half- (if that) finished state of Windows 8 for tablets. I enjoy writing about what’s real.”

Now I don’t know enough about the author of this article to make a statement against him. But, one thing Apple fans and Apple journalists love to do is speculate about apple products.

FRONT PAGE NEWS – iPhone 5 MIGHT HAVE A SLIGHTLY BETTER CAMERA!

The amount of garbage like this that gets released on an almost daily basis is incredible. So I find it amazing that an Apple fan would say that writing about a beta people have in their hands is not “writing about what’s real” when the tiniest of news from some unnamed and unconfirmed source about apple is treated like gospel.

Return top

INFORMATION

The occasionally interesting thoughts & insights of a software developer