Wednesday, August 14, 2013

The Great Postal Vote Scam And How To Do Something About It



I've mentioned before that the major political parties have exempted themselves from the Privacy Act. I think it’s section 7c. In 2006 Natasha Spot Destroyer (remember her) introduced a private members bill to remove this exemption but of course it’s failed to gain any serious support and last I heard it was dropped, reintroduced, and then put on indefinite hold.

Why don’t they want to drop the exemption? 

Because I suspect it favours the major parties. The ones who can spend the big $$$ building up huge databases on anything they can find out about us.

And of course it allows them to get away with this latest travesty I’m calling the “Great Postal Vote” scam.

Maybe you’ve received an envelope recently addressed to you that had something written on the outside like “IMPORTANT Postal vote information for the 2013 Federal Election.”

If you opened it up you will find an application form for a postal vote, a reply paid envelope, and you may also be surprised to find a letter from your local member of either of the major parties. I’ve only got the Liberal one but I understand that Labour are up to the same trick, albeit slightly more transparently.

This letter of course has nothing to do with the Australian Electoral Commission and has in fact been completely prepared by the political party in question and mailed out en masse.

The trick is, the address on the reply paid envelope is not the Australian Electoral Commission but is instead controlled by the political party in question, albeit disguising itself, in my case, as the “Postal Vote Centre”.

This allows them to copy down your full contact details, the date by which you need to vote by, your security question the AEC uses to confirm who you are, and your signature, before of course forwarding on the form to the correct AEC address. If you weren’t looking carefully, you might have been none the wiser that the political party was even involved. They certainly do their best to hide the fact.

To rub it in the application form includes an AEC privacy statement assuring you everything is above board. In fact candidates (not the party) are entitled to your name, date of birth and residential address. However they are not entitled to your phone numbers, your email, and especially not your secret security question and answer.

No doubt if pressed the parties will say “No… this is not deceit… this is providing an essential service to remind people who will need to postal vote…”.

Seriously politicians, you don’t believe this rubbish, why on earth do you expect us to believe it.

It’s obvious by the deceit they have used to gather this information that they cannot be trusted with it.

If ever an argument was needed political parties should not be exempt from the privacy act, this is it.

However, here’s a good payback. Grab the application form and instead of filling it out, write in big red letters, “I WOULD NEVER VOTE FOR A PARTY AS DECEITFUL AS THIS!”. Don’t give them any details. Put the form in the envelope and mail it back to them. The good news is, they have to pay for the postage, and you get to tell them first hand you’re not happy with them for pulling this stunt.

If enough people do this it will hurt them on the $$$ and they might just reconsider. The really cool thing is that they can’t just ignore them because there just might be someone’s genuine application form in there that they are now responsible for forwarding on.

Wednesday, May 29, 2013

The Real Pete Kistler Story

I spent about six months in the USA some time ago and in most respects really enjoyed myself. One of my favourite discoveries was a program on NPR called All Things Considered. This program as well as meeting some Americans for real did a lot to break down the perception that most Americans are thick-witted red necks.

For me, its things like NPR in America, ABC here in Australia and of course the BBC, that are symptons of a healthy democracy. If rights and freedoms are to be eroded, it's independant channels like these that will be the first against the firing squads.

ABC radio occasionally repeats All Things Considered, but it's scheduling has to fight with the sitting of parliment. I know which I'd rather listen too.

But the good news is it's online. And one of the stories today (which is yesterday for the USA) was about a guy called Pete Kistler and the company he has set up.

So the story goes, Pete Kistler went for a job he was suprised not to get, and later found out from a friend that the interviewers had googled him up and found a drug dealer by the same name, and got confused. (Doesn't that sound just a little incredible to you? It did to me.)

This story has been repeated to infinitum on the web by a bunch of parrots. But the NPR guy is not a parrot, he is a journalist, a real journalist, and he checked the facts.

And guess what, the whole story is a fake. No such Pete Kistler has been recorded in any jurisdiction. The stuff on the web was faked for any one who bothered to check the story online, which is as far as any parrots got if at all.

The story was created just to promote the company this bloke set up that offers a service that is supposed to do something about similar problems, starting at $1000 (USA) a year. It's the sort of story that ensured they got free advertising and promotion by all those parrots who loved a good story but didn't check their facts.

(And by the way in case your wondering I classify myself as a parrot too, I'm not a journalist).

The question left is would you trust your reputation protection to someone who resorts to fraud to promote himself and his business.

The Buck For A Vote Scam

Just ask people who know me and they will tell you I complain about the government almost as much as I complain about SharePoint. But it's obviously not that bad because I've never actually done anything about it.

Well that stops today (well tonight anyway).

I've just read up on the new legislation that is about to be intrdoduced into the Australian Federal Parliment that will effectively give each member of parliment 33 cents per year for each vote they get in an election. That works out to be around $1 an election cycle.

For independant MPs, at least those who were independant at the time of the election, it goes straight to them. But for party MPs, it goes to the party, not the MP.

Normally corrupt governments are supposed to hand out dollars for votes. It takes an really corrupt government to think up an idea where it takes your vote, and your dollar too.

Just like in the USA which is dominated by the Republican vs. Democrat parties, or England's Labour vs. Conservative (and friends), Australian politics is dominated by the Labour vs. Liberal party. Well I should say Labour vs. Coalition because there are a handful of Nationals (read Country party) which doesn't mean much unless your from Queensland.

In the mix there are a handful of independants, I think 6 now, though 2 of those were not by choice being found out to be so crooked that each party has had to disown 1 member each. I want to stress the "found out" bit there. It's alright to be a crooked MP as long as your not found out, otherwise there would be a hell of a lot more independants.

And only a bunch of crooks could come up with this scheme and try and sell it as a good thing to the Australian public. And of course it's being endorsed by both parties. You don't get that sort of cooperation between the otherwise opposing political parties unless your talking about politician pay rises or political party exemption from things like the Privacy ACT or the Do Not Call Register.

And what's worse they are going to back date this thing 2 years, so the two main parties each earn themselves a $2 million windfall, just under 4 months out from the next federal election. Actually, since I think we have about 14 million registered voters, and voting is compulsary in Australia, I would have thought this should be a bit more.

Where was your mandate to do this? Mandate is a word politicians love to use when they are introducing unpopular or controversial polcies in their first years of office. I certainly never voted for this.

This has got me so frakking angry. If you don't watch Battlestar, then frakking is a rude thing that coal seam miners do to holes in the ground.

And with the current government party effectively in walking dead status, this is a perfect time for them to slip this sort of snouts in the trough legislation through. Keep your eye out for some more like this in the coming weeks.
A few, I dare say, marginal seat politicians have objected to this legislation, or voiced deep concerns. And sure they might try and claim the higher moral ground for a few news bites, but they are still going to take the money when it goes through.

And the worst thing about this one party is as bad as the other. Instead of Liberal and Labour you might as well call them butter and margarine. I can't taste the difference.

Take the issue which is commonly called "boat people" in this country. When in opposition Labour attacked the Liberal Government for lacking compasion, but when in power, took an exterme right position on the issue, more right than the previous government's position.

But don't get me wrong here, for every complaint I have of one party, I can identify an equal complaint with the other party. They both talk about how they serve the economy and forget the people who vote them in. Neither side has any real answers for the big issues.

And so all this is going to do is allow the party machine to drown out any idependant and original message with the continual party diatribe, even more than ever before.

Well I've never written to my local MP before, but now I will. If you support this policy then the other guy is going to get my vote. I'll write the same thing to whoever the other guy is and let them work out the conundrum between themselves.

Now the government is telling us, this is a good thing, It means that parties won't be influenced by big money, like in the USA, which is funny because most of the time they seem to be doing exactly what the USA is doing, like going to wars, locking people up in some bay, etc.

I think it's a little too late to be worried about big money. I mean, what do all you politicians do when your finished being politicians, you go and work for all those big money interests that you represented when you were in government.

And I include you in that list Mr Carr, touting yourself up as the next leader of federal Labour. What did you do when you stopped being Premiere of NSW (that's like a state governor for anyone in USA). You went and worked for the same financier that made a mint out of public works tollways you helped roll out while in government. I would expect this from the Liberals, because they are meant to represent business and facists, but people from Labour go and do exactly the same thing.

No one is fooled for a second that big money interests aren't already represented and well entrenched in our government. Just look at the ICAC investigation into Obeid, which gives us an idea of what is going on regularly. They don't need to worry about some $5,000 limit on donations, they just go around it.

Actually come to think of it, this absurd spin of how this is such a good thing, which they can barely deliver with a straight face, has made me change my mind.

The worst thing about this is that all that money is not going to be spent on getting the message out, it's just going to be spent on useless spin and attack ads. And for propping up the son's printing business or the wife's PR company.

So heres an idea. I'm guessing that an informal vote doesn't count towards this revenue. Since voting for one party is as bad as voting for the other, how about, just vote informally. Don't put numbers on the ballot sheet,  just write in really big letters: "NOT GETTING MY DOLLAR".

I can't think of a better way to protest than to hit their wallet nerve. And it's not like my vote is doing any other good.

Well it's a thought.










Monday, May 27, 2013

Defending The Battleship

Do you remember when Windows Presentation Foundation first came out and suddenly all the Microsoft WPF avangelists were saying, "Battleship Grey... Yuck!" to put down traditional Windows forms to make WPF sound better.

Well you know what. They missed a very important point. It was never just battleship grey.

Back in '93, I worked for a place that hired a consultant who, for as much as I could see, spent 30 mins every morning changing the colour scheme of his Windows... uhm was it 3.1. First he started off through all the team colours for Rugby League and then after exhausting that sport, moved onto AFL. (These are two types of football games for any international reader out there).

And about the same time, Visual Basic was getting popular and we started to get lots of crazy coloured contexts. You know, the sort of app where all the windows to deal with accounts receivable are in green, while all the accounts payable are in pink and so on.

And this used to ifuriate me so much because the Win API had some clearly defined custom colours that were just being ignored. If you choose your own colour scheme then everyone used the colours the developer liked. But if you used the system colour schemes then the user could use the system configuration tool to choose their own colour scheme.

Why is this a good thing?

Well not so my colleague could keep himself entertained for half an hour every morning.

But rather, because the eye and all the wiring and process to support it is possibly the most complex organ ever developed in evolution. And Most people are not average but sit somewhere on a bell curve. Half the people have better than average sight and half the people have below average sight.

Some have colour blindness, some are dislexic, some work in light too bright, some work in dark rooms. And the ability to change the colour scheme of you whole system and all supporting applications in a single go is absolutely essential.

For example, I am dislexic, and I've found that if I tone the white background of text fields to a slight blue/grey then I can actually avoid headaches that I otherwise get after a while reading black text on a white background.

These days I wear tinted glasses that do much the same thing, but being able to adjust the colour of the background still helps.

It was one of the things I was looking forward to Windows Phone 7 because I had heard they had tight control on colours. But Windows Phone 7 was a little too locked down and the colour schemes that the user's had to choose from had some serious flaws.

It's something I miss with Web Development, where "graphic treatments" are order of the day and no one seems to care about us poor dislexics. There is probably more effort put into helping blind people read web pages through trying for WC3 Accessability conformance.

But at the same time, if you've done enough browsing, you will almost certainly come across a web page where you find the colour scheme so bizarre that you can barely make out the text, and usually have to select the text with the mouse just so you can read using the inverted colours.

Wouldn't you like to be able to control colours on certain web sites? Without resorting to hacing the CSS that is.

PHP Strings Are Fast

I've recently been playing with PHP again. Last time I touched it was 2001 or there abouts.
And I found I needed a HTML-Builder (well needed to port my C# one). Being a little rusty I looked around for something like a StringBuilder and found none. Because, as most of the posts put it, PHP strings are fast enough.

Well I wasn't completely convinced, so I wrote a quick test that through a number of iterations built up 3 really big strings at the same time, and the response just came back straight away. Not to be put off I kept upping the iterations till it was getting to something absurd, when finally, I got an out of memory error. But the key point is, up till that moment, the responses were always coming back almost instantly.

So well done PHP. I find some of the language a little old fashion, but those PHP strings are lightning fast.

Wednesday, February 13, 2013

Office 2013 First Impression: OUCH! MY EYES...

I have been using Word since it ran on DOS. It was my favourite wordprocessor (and I used a few back then) for a very long time. And I've only ever had one small issue with the upgrades, that was, until Office 2007. I just hated it. And the most common shout out the office had was "Where is the option that used to do...".

Now there are people out there who love the ribbon. Fair enough. I'm not saying it was a bad idea. What I'm saying was the fact that it was forced on us and that we couldn't choose not to use it, or even customise it back the way it was without resorting to pretty drastic effort.

Office 2010 was a little better thankfully but not as much as I would have liked.

And now we get Office 2013 and your litterally blinded by the glare when it opens.

All the information and details on the page are lost to the noise being produced by the nothingness.

Apparently this was the most common complaint with the preview, so they decided to add a light grey and dark grey option as alternatives to the white, but the result is inconsitent. Word for example is almost OK with dark grey but Access seems to get worse because while the rest of the page is still glaring white, you get this dark sidebar that just emphasies the issue.

And this was "by design"?

I think the problem is that the current design team want to write for Apple and Android users, and are quite willing to do so at the damnation of their existing user base, or at least their experiences and expectations.

If this has been the same design team for the last 3 versions then Microsoft, please fire your design team. If this has been different design teams each time then please fire the person hiring the design teams.

Here is my big question for the design team responsible. "Under Windows 7, why didn't you use the system colours?" Why then are all the arguments Microsoft had in the past invalid because you think you know better? If you had used system colours and somone wanted a glaring white theme they could have done this by changing their system colours and have all my applications look that way.
Alternatively, if I have a visual impairment such that certain background colours or combinations are easier for me to see by, I can again change system colours and thus improve all my programs, except apparently Office 2013.

And for the everyone who was whining about how battleship grey is so boring (mostly this seems to be Mircosoft people who want something differnt) just change your system colours to something you feel is more exciting and stop complaining.

I guess I'm going to have to add Office 2013 to that list of things not to do or I'll go blind, and maybe give this Open Office thing a go.

Wednesday, January 30, 2013

HTML: Can't handle the confusion? Shouldn't have become a web developer.

Looking back at the history of HTML and its emerging trends can get quite messy.

I love the idea of HTML 5 and developing some really cool web apps but all those new elements and the varying support have lead me to do a sanity check on all the HTML tags I have at my disposal. And I doubt it's going to settle down any time soon. But I guess that's same story as usual.

In HTML, there is the standard, there are the recommendations, and then there is reality. And at the end of the day, its what works that counts, regardless of whether it is offically approved or not.

Besides adding many new elements, HTML 5 has dropped a few older tags traditionally used for styling. This is a good thing but not nearly enough of the old tags have been dropped for my liking.

For example, why is <big> dropped but not <small>?

Remeber when <tt> was recommended over <code> and <samp> for mono-spaced font? Well <tt> has been dropped but <code> and <samp> are still there? I agree, the only time we see a teletype machine these days is on old movies, but I still fail to see why a browser, regardless of device type or screen resolution is going to show source code in different way to any other browser.

Remember in HTML 3.2 where <strike> was recommended over <s>, the later having been pretty well dropped. Well now <strike> is out and <s>, which came back in with HTML 4 is the winner. <s> probably achieved this by developing an alternate semantic purpose. Rather than meaning strikethrough, <s> is now supposed to mean "Somethings not right with this text". It's still strikethrough at the end of the day though.

And if <s> can change to mean "incorrect" why can't <b> take on the meaning of <strong> and <i> the meaning of <em>?
<b> and <i> are still there but are still strongly discouraged. The argument for this goes like this:

<b> as bold, is a direction of style, not meaning. <strong> on the other hand means to stand out. Some browsers may choose to make the text stand out in way different to bold. In cases where you really want bold, you should use CSS.

But in reality, every browser just bolds the content of <strong> and <strong> has taken on the meaning of bold. Just look at any HTML editor and press the [Bold] button. You will note that they almost always achieve the bold by using the <strong> tag, and not by CSS or <b>, even though in this case, the latter is more correct as per the user's intention.

Same thing for <em> and italic too.

And now of course we have <mark> as in marked with a yellow high-lighter.

My problem is that <strong>, <em> and <mark> all have the same meaning, to make the text stand out. In reality, when your deciding which to use, you end up asking yourself do I want the text bolded, italic or marked in yellow, which is a styling intent, so should be done with CSS anyway.

Any why was <acronym> dropped in favour of <abbr>? A coin flip? Less characters to type? I can't think of any other reason to favour one over the other. Do screen readers spell abbreviations out loud but attempt to read acronyms as words?

(Wow, I'm starting a lot of sentences with And here. My english teacher would turn in her grave.)

There are also a few new tags which I'm not sure I value much. <output> and <time> for example, that as far as I can tell just render as normal output. There is an expectation that they might be rendered a different way in the future. Well I have an expectation that once people get used to them rendering as normal, changing that later is probably not going to happen.

And finally, why can't we come up with one universal format for audio and video. There are three formats for each and not one of the six is supported by all the major browsers. It is a classic case where commercial interest and pride win over common sense. And because we lost this battle now, it's going to be a long time before we ever get to fight it again.

Tuesday, January 29, 2013

<textarea> and Turning Wrap Off

A <textarea> control includes a "wrap" attribute, the official values of which are:

  • "soft" which is the default behaviour
  • "hard" which inserts a line break into the actual content
 I've found a number of sources that recommend using the CSS "white-space" property instead of the wrap attribute which has a number of values that include hard and soft as well as some options to supress wrapping.

The problem for me is that none of these "official" methods actually do the following:

- turn the auto-wrapping feature off so each "paragraph" appears on one line AND
- allow the user to enter a new line by pressing return

In my case I just wanted the user to enter a list of short items, one item per line, but allow for the chance that one of the items might be longer than the width of the control.

IE9 recognises the "white-space" and you can use this to stop wrapping but none of the values allow the user to also hit enter.

FireFox 18 simply ignores the white-space property with respect to user input in a text area.

Actually, I think the white-space property was meant for the actual content that appears in the HTML source, not for user input.

Thankfully, all the major browsers support the "unofficial" HTML "wrap" attribute value of "off". This does exactly what I want except for some reason IE renders in both the scroll bars disabled until overflow occurs in which case it enables the relevant scroll bar. This is both distracting and eats up real estate in smaller text areas. You can solve this with the CSS "overflow:auto". So:

  <textarea cols="20" rows="10" wrap="off" style="overflow:auto"></textarea>

FireFox prefill and autocomplete="off"

FireFox has the ability to record every value you enter into fields on web pages, and if you visit that page again, it will prefill those fields with the last known value when you refresh a page, go back or revisit that page.

I suppose this is useful for the everyday user but this behaviour is on by default and it overrides when a web developer explicitly states what they want the initial state of the fields to be. This includes things like the "value" attribute of a text field, the "checked" attribute of a checkbox or radio button, the "selected" attribute of an option, and specific content in a text area. Thankfully they seem to draw the line a prefilling a password field.

The behaviour may also if client script events don't take this behaviour into account.

So if you want to to be able to set the initial state of your controls, or you want to ensure that your fields start in their default state such as an empty text field, then you will need to add autocomplete="off" to your controls to tell FireFox to leave them alone.

This works even though "autocomplete" to me means something completely different, but I guess W3 though that adding another attribute prefill="off" or firefoxleavethisdammfieldalone="true" would be overkill.

Another option is to have a little bit of client script that presets the fields and then enable client side events after that. This option might be more useful in an ajax driven page.

display:none and jQuery.hide() not working for <option> in IE

For some reason IE (at least IE9) will not allow you to hide an <option> tag. I initially discovered this when when a jQuery.hide() failed in IE but worked in another browser. I created a quick test that included an <option> with a style set to display:none (the equivalent of a jQuery.hide() ) and got the same issue.

I recalled IE had added a whole bunch of HTML attributes in the past and tried a few desperate alternatives like visible="false" or hidden="true" but nothing works at an <option> specific level.

A quick search on the net confirmed this was a known issue. The general recommendation is to remove and re-add the <option> as required.

Another option is to add the HTML attribute disabled to the <option> using jQuery.prop( "disabled", true). This greys out the option and makes it unselectable. This doesn't have the same visual affect but serves a similar purpose.

Never the less it would be nice if IE could add this to their fix list.

IE's <select> has also been a bit of a pain in the past, always rendering on top of content regardless of its position in the HTML or the z-index values.

Wednesday, January 16, 2013

The Curly Question of Braces

Sometimes arguments come down to what I call the "Chocolate vs. Caramel" factor.

If I was to ask which of these flavours you preferred most people I'm hoping would not be expecting everyone to answer the same. Nor would I expect them to accuse anyone who answers this question differently as being wrong.

Strangely enough, if I was to replace these flavours with the question of whether the opening curly brace should appear on the same line or the next line, then a lot of people seem to loose this concept of "personal preference" and break out into jihad or something.

The use of braces, curly braces or curly brackets if you prefer (I call them squigglies) actually dates back to before c. The language BCPL (1966) used  $( and )$ to delimit a statement block to distinguish them from ( ) used in an expression. This influenced Ken Thomposon when he developed his language B (1969) that actually used { } and was the predecessor to C (1973).

C of course is the language we remember and is still widely in use today. So languages that use squiggly brackets are often described as C-style languages and include C++, Java, C#, Objective-C, JavaScript, PHP and Perl. That's a big chunk of the most commonly used languages in use today.

The issue boils down to whether you should write code like this (same-line):

  if ( expr) {
    ... statements ...
  }

 
or this (next-line):

    if ( expr)
    {
      ... statements ...
    }

or more importantly, does it even matter?

There are a number of variants on top of this, one that I've encountered in a C++ codebase I had to work on that followed this 'philosophy':

If a single statement:

    statement;
   
can be interchanged with a block of statements:

    {
        statement1;
        statement2;
    }

   
then surely the logical block idention for:

    if ( expr)
        statement;


should be:

    if ( expr)
        {
            statement1;
            statement2;
        }

This particular indention isn't widely used and I've only encountered it in the one software house, but as an argument goes it's as valid as most others I've heard.

There are a few cases where there might clearly be a right or wrong answer and they mainly falls into 2 categories, conformance and language peculiarities.

For conformance, the most likely reason is the old "All our code is this way so this is the way we want you to do it". And this is a pretty valid reason. There is lot to be gained from uniformity in large code bases and most developers can make this sort of shift if they need to.

These days IDEs usually offer a configuration option to automate one way or the other, and some (I'm thinking of Visual Studio specifically) allow you to cut and repaste the code so that it will automatically be reformatted as per this choice, which is great, as long as the reformatting doesn't bugger up something else.

The other thankfully less common conformance reason is that you have one particular loud mouth Nazi that wants it their way, and in the interest of peace, the rest of the team conform, where as they really should just punch them on the nose.

Most languages handle either convention without any issues, but there are a few languages where parsing of the code actually leads to different results.

In PowerShell the "foreach" looping statement supports either but in a piped expression where "foreach" is an alias to the ForEach-Object cmdlet, the opening squiggly has to be on the same line or something completely different happens, that usually leads to a syntax error.

So given:

 $list = @( 1, 2, 3);

Either of the following works fine:

    foreach ( $item in $list)
    {
      $item + 1;
    }

but in a piped expression

    $list | foreach
    {
      $_ + 1
    }

will error with:

ForEach-Object : Cannot bind parameter 'Process'. Cannot convert the "$_ + 1" value of type "System.String" to type "System.Management.Automation.ScriptBlock".

where as the following works:

    $list | foreach {
      $_ + 1
    }


However I'm not sure this justifies having to write all your PowerShell this way, specifically because I wouldn't have written this code either way, but rather:

    $list | foreach { $_ + 1 }

At the same time, because you get a error when you try to run the faulty code, testing will quickly identify where such an issue occurs. For PowerShell to misinterpret rather than report an error you would have to create a ScriptBlock object that I'm pretty sure you can't do in out-of-the-box PowerShell.

JavaScript is often used as another example because of how it supports optional semi-colons. If there is no semi-colon on certain lines the interpreter first add a semi-colon before compiling. Yes, this is a simplification but it will serve for the purpose of this discussion.

Issues occur when after adding the semi-colon, the line of code compiles and results in behaviour that was not expected. The problem is that the examples I have seen are obscure. For example, if you are returning an object from a function:

  function createApple()
  {
      return
          {
              name   : "Apple",
              colour : "Red"
          };
  }


The "return" line is actually interpreted as "return;", the function then returns "undefined" and the next line of the function is never called.

The problem is this issue has nothing really to do with squiggly brackets, because the following is equally flawed for the same reason.
   
  function createApple()
  {
      var apple = { name : "Apple", colour : "Red" };
      return
          apple;
  }


The other problem with the first createApple() example is that the squiggly brackets here are not being used for statement block but rather an object expression.

The real issue here is that this sort of problem is best dealt with by testing, specifically unit testing and not coding conventions.

The strangest thing is that I've heard a number of claims used by both camps, some being really rediculous.

For example the claim of readability surely has to be a matter of personal preference, and I suspect in a lot of cases, depends on which method the programmer was first introduced to.

The claim by each camp that the other method makes the code read more like BASIC though has got to be the wierdest. There have been times when I've confused my C with C++, with Java, C# and JavaScript. But I can safely say I have never confused my code with BASIC.

I assuming of course that they mean a BASIC without line numbers like Vax Extended Basic or Visual Basic. But I can't believe in any universe that C will ever look like BASIC unless of course you wrote your C like this:

  #define IF if (
  #define THEN ) {
  #define ELSE } else {
  #define ENDIF }

  ...
 
    IF result THEN
        printf( "The result is true\r\n");
    ELSE
        printf( "The result is false\r\n");
    ENDIF

 
Yep, that compiles and works in Visual C++ 2010 but even I would think it was BASIC at first glance if I didn't know what I was looking at.

And you know what? Now that I look at it, the readability is no worse than:

    if ( result ) {
        printf( "The result is true\r\n");
    } else {
        printf( "The result is false\r\n");
    }

       
Hmm. Why is "reads more like BASIC" being considered an insult anyway?

My personal preference is for next-line but I equally accept someone's personal preference being same-line.

For me next-line works really well with one exception, the do-while construct. For example:

    do
    {
        statement;
    } while ( expr);

   
doesn't work for me but then neither does:

    do {
        statement;
    } while ( expr);


Fortunately I don't use do/while very often.

Because of my preference for next-line I often here arguments specifically in favour of same-line, a couple of which are worth mentioning.

The first is that same-line saves paper when printing and screen space.

This is a pretty dated argument. I can't think of the last time I printed a piece of code, and the days of 80 x 25 screens are wll behind us. And back then we used to ship boxes of computer printouts every month by the truck load. I'm not sure saving the odd row here and there ever really provided any value.

The other argument is that same-line is the way it's done in "The C Programming Language" by K&R, considered the authoritive book on C.

With respect to this claim though I will quote the actual book states at the end of a short discussion on indention:

  "The position of braces is less important, although people hold passionate beliefs. We have chosen one of several popular styles. Pick a style that suits you, then use it consistently."
 
I don't think I could have said it better myself.

Tuesday, January 1, 2013

Why I Will Never Buy Another Windows Phone

Two years ago I purchased a Windows Phone 7 mobile.

I was all excited because the main development language was C#, currently my favourite development language, and Charles Petzold was writing a book on how to program it, the same author that I learnt most of my early Windows programming from.

And then I learnt that if I wanted to write a program to run on my one phone, I had to pay Microsoft an anual fee for the privelege. Now I can write Android programs for free. If I was going to have to pay to have my phone unlocked, I might as well write for Apple and dust off that Objective C book.

Windows Phone 7 sales apparently were less than expected. I think they were after a 5% market share and I think they might have scaped in 3.5% but where I am, having a Windows phone is even rarer than that. Of course only Microsoft have the real figures but they only publicly talk about their over exagerated "License Sales" quantities.

Well Microsoft, here is the "secret" on how to sell a whole lot more real units. You have to be the earliest, the cheapest or the best. If you can do at least one of those your in with a chance. Windows Phone 7 did none of those.

Apple had already got there with the earliest. I really like the apple hardware and interface but I despise their locked down nature.

It just so happened that my wife purchased an Android phone at the same time which had a significantly cheaper price tag. During the last two years I've been able to compare many of the features:

File Connectability: My wife plugs her Android phone onto the computer and she can copy files directly to it. Alternatively she could copy files over our wifi. My Windows Phone 7 can only copy files via Zune (I hate iTunes but Zune is even worse than that) and then only that narrow set of files that Zune permits me (pretty well just Audio, Video and Photos). In fact if you want to copy a podcast or audiobook and have the phone remember where you are up to, you need to copy the file to the Zune podcast directory, and then change the genre to podcast. Also it lists and plays podcasts from newest to oldest but that order is problematic for audio books.

Extra Storage: My wife just plugs a micro SD into her Android phone as needed. Microsoft for some reason decided this was not allowed for Phone 7.

Email Connectivity: Windows Mobile 6.5 would work directly with the email client. This feature is not available in Windows Phone 7. Getting rid of features is not a way to keep existing clients.

Internet Sharing: My wife can use her phone to connect a laptop to the internet. My phone 7 couldn't for about a year until the 7.5 update from both Microsoft and then my hardware provider.

Cut and Paste: My wife's Android phone had this from the start. I had to wait till Microsoft decided that I was deserving enough for an update, and even then it doesn't work properly.

Custom Ring Tones: My wife can assign any MP3 file to play for each specific number in her address book. Again this feature had to wait till the Windows Phone 7 update, and then the file could not be more than 40 seconds long, had to be copied to a specific Zune directory and again had to have the genere changed to something rediculous.

Desktop and Theme: My wife can organise her desktop pretty well any way she wants, and has a variety of themes available. My Windows Phone 7 has these rediculously larged fixed sized icons, some of which animate for no apparent reason offering other than to distract you with noise (I'm talking about you "People" icon) and have this rediculous colour scheme. You can choose one colour from a very limited list. On the main screen you get white text on top of this colour, but in lower screens (specific individual address, you get really small text in this colour on top of a black background. So you have to choose a colour that contrasts with both white and black.

Application Availability:And here is the crux. For a phone to compete with Apple and Android it really needs to have as good a range of applications as they already have. But application developers will target those platforms with the market share first, and then only start to think about the other platforms. With the poor market share and end of life looming you might understand why your still waiting for Bad Piggies on Windows Phone 7.

SharePoint Integration: My Windows Phone 7 has a significant amount of SharePoint integration built in to it from the start but I've never used it and never wanted it. This sort of functionality should have been stuck in a free app that could be downloaded if needed and not taken up space, screen and time.

Music Player: My wife has and Android music player that allows her to create and organise playlists, sort her music in any order she wants and search by name. It is very easy to use and navigate. On Windows Phone 7 I have "Zune!" which just seems to fail on every one of these features.

Bluetooth Keyboard: My wife can use a bluetooth keyboard with her Android phone. While my Windows Phone 7 has bluetooth, they decided for some reason that an extenral keyboard was an uncessary feature and doesn't support it, which is why my wife has my bluetooth keyboard.

I could go on my point here should be clear. Windows Phone 7 was too little too late and too expensive.

Now with Windows Phone 8 and Windows 8 tablets starting to enter a very similar competitive market space, I see nothing to suggest Microsoft has learnt from it's mistakes.


SharePoint Directions

I wanted to comment on what I see has been the general direction of SharePoint over the last couple of versions and the issues that arise from that.

Have you ever wondered why you can only change the master page in SharePoint once publishing has been turned on? I can see no technical reason. It seems simply that the UI component to do so was packaged with publishing because it wasn't there from the start and had to be packaged somewhere, even though it has nothing to do with publishing at all.

Of course this wouldn't be a problem except that once you turn on publishing you can't generate a site template, or if you do with any of the various workarounds, it is officially unsupported by Microsoft.

You can however change the master page in SP Designer regardless of publishing. In fact there are a whole bunch of features that should be in SharePoint that can only be done in designer. For exmaple if you want to include the standard left menu in a new page, you have to edit the page in SP Designer.

If you wanted SP Designer then you used to have to pay extra money. But many of these features should arguably have been in SharePoint itself. I think that's why Microsoft relented and decided to make SP Designer free, because that would be cheaper than to have to add all this functionality back into SharePoint directly.

The problem is that SP Designer includes a whole lot of functionality that would prevent it from being deployed to secured production environments. The last two large clients I worked for will not allow it to be deployed to anything higher than the developer environment.

And now it seems that Visual Studio is becoming the preferred tool for dealing with many of the things that SP Designer might have done, but there is no way I'm going to get VS deployed in an environment that already rejects SP Designer.

These tools are fine for more complicated and genuine development tasks but they are simply over-kill and over-complex for things like changing a master page or choosing a page layout that includes the left menu.