The difference between MVP and MVC - answered!

June 19th, 2008

One of the questions that was asked in the Q&A session of my Heroes Happen Here talk was about the difference of MVC and MVP.

In all honesty I totally sucked in answering that question. :( I had a rough idea on what the answer is, but a totally honest to goodness answer would take a whole blog post.

Fortunately there are bloggers out there who have clarified on the same matter, and have put up totally beautiful explanations on the differences between the two: Todd Snyder on the Infragistics blog talked about the difference between MVC and MVP last year, and more recently Phil Haack gave his own opinion in light of the ASP.NET MVC framework.

Personally though I liked the summary that Todd Snyder gave:

Here are the key differences between the patterns:

MVP Pattern

  • View is more loosely coupled to the model. The presenter is responsible for binding the model to the view.
  • Easier to unit test because interaction with the view is through an interface
  • Usually view to presenter map one to one. Complex views may have multi presenters.

MVC Pattern

  • Controller are based on behaviors and can be shared across views
  • Can be responsible for determining which view to display

[Todd Snyder on the Infragistics Blog]

I recommend you read through both posts.

Hope this helps! :)

Silverlight Unit Testing slides — but no code :(

June 19th, 2008

On June 7 PHINUG, PHISSUG and PHIWUG conducted the {no frills} - Heroes Community Launch event in the Microsoft Philippines offices. It was a great day of sessions and demos, and I certainly enjoyed delivering my talk on Silverlight Unit Testing.

Unfortunately (and this is my excuse for such a late post) several files of my demo code were corrupted. I dunno how or why it happened, but I’m surmising it’s out of not properly shutting down the laptop after the demo. And then going on a gimmick with the MS Philippines crew. :P No luck in recovering them, sadly.

Anyway, if you want to download the slides of the Silverlight Unit Testing talk, click on this link.

You could also check out the talk I based this one on — cruizer’s Silverlight Unit Testing Talk he presented in Heroes Community Launch - Singapore. He likewise has slides and code there. :)

OSS zealotry and raining on a .NET parade

June 13th, 2008

anti-microsoftA month ago I saw a link on twitter where a startup described how they successfully used Visual Studio and ASP.NET out-of-the-box (e.g., Web Forms) to successfully create a web application that earns money.

Almost immediately, anti-Microsoft tirades show up on the comments:

I think you guys are serious? Microsoft products are a joke. I can tell just from the overall aesthetic and looking at the source of the calendar site that you guys are a joke. I’m surprised Vitamin would allow such a shameless plug for such a crap product.

How much did Microsoft pay you guys for this article? [Comment on Building a Web App The Microsoft way on ThinkVitamin.com]

Of course this isn’t anything new. Any group, whether it’s pro-Apple or pro-Java or pro-open source or whatever, will have members who are, let’s say, overly-passionate about their dedication with their chosen platform. It’s everyday fare for these people to bash Microsoft, change the spelling to Micro$oft or M$, and call it The Borg, alluding to the fact that Microsoft has a history of buying out smaller software companies (which is true, but I digress).

While I find it absurd that software development and technology in general is indeed a religion, it’s a reality that we’re forced to face everyday. That technology peddlers like Microsoft and Sun call their marketers “evangelists” don’t help in mitigating that fact — the consequence being that in any religion there will be fundamentalists.

What I lament is the preceived dominance of these fundamentalists in online forums, wherein their relentless efforts to “rain on Microsoft’s parade” tends to misrepresent their respective groups as a bunch of zealots carrying torches and pitchforks. I don’t know with you but for me, not only does it diminish the image of their respective community, but they also discourage me from joining their community for fear of eliciting their holier-than-thou wrath.

Fortunately, I know enough people from the “other side” for me to know that they’re generally a friendly community. But I’d still opt to be spared from holier-than-thou attitudes as much as I can.

no {frills} - the philippine {heroes} community launch event

May 27th, 2008

no {frills} Heroes Community Launch Philippines

In behalf of the Philippine .NET Users Group, I’d like to invite everyone to attend this event. It will be held on Saturday, June 7, 2008, at the Microsoft Philippines Offices at 6750 Ayala Ave., Makati City.

Sign up now for this event at http://www.clicktoattend.com/?id=128964

I’ll be conducting a talk on Silverlight Unit Testing on that event.

A shoutout and big thanks to cruizer who conducted a similar Silverlight Unit Testing talk over at Singapore’s Heroes Community Launch, and is likewise helping me with my talk, although there would be big differences between his and my presentation.

Abangan. ;)

iPhones and the issue of tactile response

May 14th, 2008

Apple iPhoneThe news was both welcome and surprising: Globe Telecom clinches the official iPhone contract in the Philippines, making the Philippines one of the first few countries in Asia to have legitimate iPhone market presence.

While the iPhone has been present in the local scene since the middle of last year, no official, legal support infrastructure existed for the phone. I know a person who had to ditch his bootleg iPhone because he couldn’t have the touch screen repaired.

That said a lot of Filipinos are thoroughly thrilled with the imminent entry of the iPhone. Some, however, are not enthusiastic about getting the iPhone. Reasons vary, but one former bootleg iPhone owner complains about the whole touchscreen experience vis-a-vis text messaging:

Texting? It’s a nightmare. Multitouch just makes the experience worse. If you have big hands — big fingers good luck. I miss ‘feeling’ the buttons, it allows my fingers to map around the pad by themselves, the iPhone doesn’t let me do this. Oww yes, it also has a very confusing SMS application that works by logging the start of every conversation root, so [sometimes (especially if you're a] newbie [on the] phone) you’re actually rereading your own sent text messages.

Of course, if you’re a geek of the 90s, touchscreen interfaces would not be new to you. It would be just another one of those things that jumped out of Star Trek:

Jean Luc Picard with a plethora of touchscreen books on his desk

On the other hand, I didn’t necessarily like the idea of touch screens.

I learned how to play the piano at the age of 7, and touch-type on an actual typewriter at the age of 10. The idea of tapping into screens that gave no tactile reaction to the act of tapping and touching just felt so, alien to me. The skill also proves valuable every now and then: I write this blog post without lights in the room and with the LCD dimmed all the way down since my wife and daughter are asleep, but it doesn’t matter because I don’t need to look at the keyboard. I know a lot of people who would kill for a backlit keyboard in situations like this.

Thus, when the TED video of Jeff Han demonstrating typing in a displayed keyboard on a multi-touch screen (which is likewise a Star Trek-memory-evoking video), my reaction was warm, but it just did not excite me as much as it did other people. I can’t imagine using an input device that would require me to look at the screen or wait for a sound just to be sure that I pressed the correct button.

As ironic as it gets, there is an episode in Star Trek: Voyager wherein the crew of the starship constructed an advanced shuttlecraft, and Lt. Tom Paris, the craft’s designer, decided to go with tactile controls that he could “feel”:

Levers and switches that control the Delta Flyer can be seen at the left

At Paris’ behest, the pilot’s station features (fully functional) buttons, levers, gauges and other anachronistic elements, instead of the standard Starfleet touch-screen. [Delta Flyer, via Wikipedia]

I first experienced the intuitiveness of tactile response in cellphones as soon as I got my first GSM phone with text messaging capabilities ten years ago. I could key-in text messages into my phone without the need to look at the keys or even the screen (when the situation warrants it) simply because the tactile response of a physical key bouncing back tells me that I pressed something.

A multi-touch screen, cool and suave as it is, will effectively render ineffective the sense of touch as a means to confirm that the action of pressing a key has indeed been performed, and thus, much like Tom Paris, I prefer controls that I could actually feel.

Don’t get me wrong; I am very excited to see the iPhone in the Philippine market, and am likewise excited at the possibility of being able to develop applications for it in the future. Due diligence dictates, however, that I must literally get my hands on a demo or test unit and see if I could live with texting without feeling the cellphone buttons. That will be the crux of the process of deciding on whether to get myself an iPhone, or settle for having a separate media device (an iPod Touch, perhaps?) and a cellphone that will actually let me feel its keys.

Now, if only someone would invent a multi-touch screen that sends electromagnetic pulses when keys are tapped, thereby mimicking the feel of a tactile keyboard button…

UPDATE: In the comments below, Jeff tells me of rumors that Apple licensed “haptic feedback” technology, which is precisely what I described in that last sentence. I’ll be eagerly waiting for that iPhone.

A portrait of a software developer as hero

May 1st, 2008

When Microsoft came up with its Heroes Happen {Here} campaign as part of Launch {2008}, I found the campaign name cheesy. “Hero” is something you reserve for people who do truly great things, and hardly fits into the portrait of a software developer — someone like me. A flawed person who makes mistakes, writes bugs, and tries his best to go home early to the family every night even as QA bug reports come pouring in for immediate repair.

Deep inside of me, however, I knew the kind of power, and consequently, the kind of responsibility, software developers had in our hands.

Four years ago I joined the IT department of Philippine National Bank, and was assigned under the ATM unit — that small team (3 of us actually) who maintains the software for the various ATM models (which span three decades of ATM development!) the bank uses. Many days were boring drudgery, but there were some days wherein we are up on our toes all because of some error on the system, some bug that was found, some COBOL report that crashed, or some cases of fraud that required investigation, or your new software was being QAed not by your usual QA staff but by the meticulous, devil-in-the-details ladies of the Audit Department.

Whenever those days ended I always find myself spewing out a huge sigh of relief.

But beyond relief, the experience whenever I step outside of the PNB offices and use its public ATMs is quite exhilarating. It sounds weird, sure, but it was dogfooding (for the laypeople — dogfooding is when a developer using his own software for real world purposes) at its finest. Whenever I line up for PNB ATMs and everything works as intended for everyone, I’d be happy. Whenever I line up for PNB ATMs and something doesn’t work right — the machine is down, very slow transactions, unresponsive networks, I’d personally pull out my cellphone and call my colleagues over at operations to inform them of the problem. Sometimes, just seeing PNB ATMs in far-off backwater towns with the card receptor light blinking happily green makes me smile.

Sure, it sounds shallow. But there is an immense satisfaction to be gained from the knowledge that you’ve got a software working that genuinely helps people — the power that a public facing software application (which an ATM essentially is, tightly coupled with hardware as it is) holds.

I wasn’t able to internalize it at the time, but it was very clear to me that my very own actions as a software developer directly affected the lives of the people using my products. As both a software developer and consumer, I tried as often as I can to exert the effort to write software that, when ordinary consumers use, will satisfy them — even make them smile, because (borrowing from our Mac loving friends), it just works.

I have long moved on from that bank, but the lessons learned from my stint there remain: your software affects the everyday lives of people, especially if it’s a public facing software. When you make public-facing software you treat it extra carefully because a whole bunch of people — from the youngest to the oldest, the ubergeek and the barely computer literate, from the most patient saint to the loudest whiner — will be using your software.

The challenge will be to please all of them.

They will be using your software in ways that would boggle your mind, especially if they can’t easily find their way around it. They will expect your software to work in ways you would never have imagined. They will do things to it that will make it crumble like cheap cookies even if you thought that your software was bulletproof.

The thing is — when your software craps itself when facing users, it’s usually your fault, not theirs. It’s your fault if your software doesn’t have a nice UI that hardly requires a user manual. It’s your fault when your software allows users to do things that they’re not supposed to do, because you let them. It’s your fault when users refuse to buy your software because it’s too difficult to use.

Software developers have a bad habit of distancing themselves from users, treating such people as computer illiterate idiots simply because users can’t figure their software out, but the bottomline is it’s their fault, as software developers, if a user cannot use their software effectively.

Therein lies the power and responsibility of the software developer. Knowing how to make software is power — knowing how to make software easy-to-use, and highly effective, is a responsibility. By knowing and executing that responsibility, a software developer becomes a true hero. By ignoring it, they become a villain.

I am deeply saddened by what had transpired last week wherein some software developers failed to see the importance of their roles and saw themselves as mere 8-5 workers who try to make a living. If you are a software developer — you are NOT supposed to be “just trying to make a living.” You are supposed to be studying everyday to improve your craft. You should be trying out development tools, concepts and methodologies outside of what you’ve learned in school, or is required at work; outside of your comfort zones. You are supposed to converse with everyday users of your software to find out how they can be made easier to use. You are supposed to converse with other software developers and learn how to make good software. You should be receptive of criticisms and take them as opportunities and lessons learned so that you would learn how to make really really great software that solves everyday, real-world problems.

How do you know you made really great software? When, after your software is used by a person who is barely computer illiterate, they smile to themselves and think “that was easy.”

Then — then you could call yourself a hero.

Unsolicited advice for improving Cebu Pacific’s Sky Sales system

April 29th, 2008

One of the main points of criticism against my rather controversial, death-threat worthy posts regarding Cebu Pacific’s dismal service and the involvement of software development company Navitaire was that they found my posts too negativist and tried to bully me into suggested that I criticize more constructively.

In that case, I do hope Navitaire employees, both former and current, do open their minds and keep themselves from wanting to kill me while I attempt to provide some unsolicited advice, which I hope moves towards a more “positive” and “constructive” analysis of the system at hand.

First I want to acknowledge that some of the errors, particularly, some stray footers, have been fixed and have ceased to be an unsightly annoyance, and let it be known that the fact that errors are being mitigated is something deeply appreciated.

Second, I want to clarify a bit about my background as a software developer. I have been writing software in .NET’s Microsoft technologies in both Windows forms (desktop applications) and ASP.NET (browser-based/web applications) for almost five years now. I have also dabbled in some minor web design, and have been practicing quite a bit of CSS for the past few years. These technologies are (apparently) precisely what Navitaire’s Sky Sales system is made of (as evidenced by the ASP.NET/C# job postings they have in Jobstreet, and the .aspx file extension of the web pages of Sky Sales).

Let it also be clear that I am quite lazy in fixing WordPress templates and do not really care if they are XHTML compliant, as one of the commenters enjoyed the Phyrric victory of pointing out in one of the posts.

Thus I am awfully familiar with the pain of having a consistent look and feel across various browsers, and various versions of those browsers in major platforms. I too dread Internet Explorer 6.0 and its freakishly difficult quirks mode of CSS rendering. I too know that what looks good in Firefox might appear in an entirely different manner when viewed on a Mac’s Safari browser. It’s a gargantuan task and I recognize that.

Unfortunately someone has to do it.

A friend, who works for a major online computer retail store in the US, has seven to nine virtual machines on his workstation, each running a different type of browser, just to be able to check consistency of his work in the sites he works on.

So, while it is immensely difficult to obtain a consistent look and feel and to make sure div tags don’t end up all around the page, neither is it impossible, and is achievable through some considerable effort on the part of the software developer.

However, if you really, really can’t make the site work on all versions of all browsers, at least inform the customers on which browsers the site would work best. JobsDB.com did this by outright locking out people from using any browser other than Internet Explorer for their site. A javascript popup informing the user that they may experience inconsistencies in user experience with the browser they are using and it is best to use this application in Browser X version Y will at least let the customers know to expect problems and ignore them. This is called the Principle of Least Astonishment.

On the other hand, I will stand by my opinion that the disambiguation between the status of payment and reservation is utterly confusing to customers and that Navitaire will be better off simplifying this system. Sure, Navitaire software developers will accuse me of “not having common sense”, but the truth is probably 90% of the users who will use the system also won’t have any common sense just like me. They do not know that processing foreign credit cards, for example, takes time and is one of the reasons payment should have to be confirmed. They will not understand why you can confirm the reservation but not confirm the payment when they’ve already provided all necessary credit card details and requirements.

Likewise, it would totally blow up on their face if their payments are still unconfirmed on the day of their flight, as what several disgruntled passengers attested in the blog comments. If Cebu Pacific and Navitaire do not see this as a catastrophic failure, then I don’t know what would qualify as failure for them.

For the record, based on comments, it is the Treasury Department of Cebu Pacific that is messing up in this part — they are the ones approving payments for all the reservations. Why it appears that the process is manual in a supposedly automated process is beyond me.

Finally, though this should come from Cebu Pacific — it should inform users that they are undergoing system changes at the moment and they are working on it and they are sorry. A simple, sincere apology is deeply appreciated by consumers.

In the end it’s all about genuine concern for customers. My pointing out errors on Navitaire’s system shouldn’t be a big enough deal to merit a death threat because users see those issues every single day anyway. It wasn’t as if I logged in to the system specifically to find those errors. The errors I found are horrible user experiences my non-techie wife took while trying to do her everyday work as a travel agent.

A commenter told us that Cebu Pacific will be able to finish ironing out all the issues by the end of May. I wish they do finish by that time, and maybe things will be better.

Cebu Pacific’s monumental failure: A new online reservation system

April 20th, 2008

Cross posted from Ang Kape ni LaTtEX.

UPDATE: I posted a second installment to this saga, “Cebu Pacific’s failure isn’t in the software, it’s on the phone”.

Melynn, who operates I-NAV Travel & Tours, got pissed yesterday. She arrived at the Cebu Pacific ticketing office at 10 in the morning. By the time she was done, it was already 3 in the afternoon. The office was simply overwhelmingly jampacked.

Nope, there was no Piso Fare promo going on. Everyone was doing their transactions manually because Cebu Pacific just changed their perfectly fine online reservation system with a massively confusing online facility made by Navitaire.

I don’t know precisely why Cebu Pacific replaced their previous online system. It was working fine last time. But a few weeks ago they changed it and it is now what it is.

At first the bugs seem to be really simple, and as a web developer myself I understand how bugs such as this could happen:

Bad rendering of div blocks in Cebu Pacific site via IE7

That’s a screen shot of the online reservation system jumbling its div tags in Internet Explorer 7.0.

Cebu Pacific doesn’t work with Firefox 2.0

And the online reservation system absolutely doesn’t work in Firefox 2.0. Or at least doesn’t go beyond the flight search page. Which renders it useless for FF users. I wonder how it is in Safari.

However, the above are simple bugs really. It’s easy (at least for me) to excuse these kinds of errors.

But along the way they also changed things that shouldn’t be changed. A guy named Phen commented this on a previous thread about Cebu Pacific’s service:

I used to fly Cebu Pacific for my personal trips, the reason being cheap. However with what happened to me last April 4, 2008 for my Davao-Cebu flight, I will never be on this carriage again. I was supposed to fly to Cebu at 6.30 am, I was there at Davao airport 5am. Upon checking in, I was told that I couldn’t take the flight because my ticket wasn’t confirmed! I purchased it online with confirmed status clearly indicated in my print-out. The not-so-customer-oriented staff pointed out that the status for payment was pending, which was written at the bottom part of the ticket. Who on earth would think that you were not able to pay when you got a confirmation?! And worst, nobody from Cebu Pacific thought of calling me to let me know. I was denied right on the spot, and when I asked for their assistance to at least get me in, the lady in the check in counter just instructed me to go to the ticketing office.

Here comes the worst part, no one from the ticketing office had the consideration to prioritize me or give me a confirmed reservation for the next flight at the least. The ticketing staff, Mr. Jonathan Leonor, just told me to wait so that they could check. I was waiting already for an hour, and got the same response when I asked for a reservation. He had even the gut to go out for a cigarette break, what kind of staff are these? [Is Cebu Pacific hoodwinking its passengers into empty flights?]

I verified the above with my wife, and she said it was true. Their e-tickets now have two statuses that you have to check: reserved and paid, and instantly confusion is introduced into the system. Let me illustrate:

  • Reservation is pending and payment is pending. Can you board the plane? No.
  • Reservation is confirmed and payment is pending. Can you board the plane? No.
  • Reservation is pending and payment is confirmed. Can you board the plane? No.
  • Reservation is confirmed and payment is confirmed. Can you board the plane? Yes.

There is exactly one and only one set of conditions where you can board the plane, and that is when both reservation and payment are confirmed. Why did they have to break the two down and confuse the passengers? This disambiguation which instead of making things clear has led to utter confusion is an act of monumental stupidity on the part of both Cebu Pacific and the software developer Navitaire.

Passengers do not care if either their reservation or their payment is confirmed or not. Passengers only care if they can board the plane or not. This is the question that needs to be answered, and clearly Cebu Pacific does not answer this question clearly in their system, and the result is pissed, inconvenienced passengers who have suffer the hassle of being turned back and made to cancel their travel plans because Cebu Pacific did not make things clear to them.

Yes it sounds cliche, but I really have to say it here: if it ain’t broke, don’t fix it. Cebu Pacific should not have changed their previous online system. Or at least Navitaire should’ve entered a more intensive QA phase wherein they hallway-tested the results of their system where it would be revealed that their e-tickets are absolutely confusing.

So for the record: Avoid Cebu Pacific at all costs. At least for the next few months — until they fix their system, or bring the old one back.

Thanks to all who attended the MSDN Session: What’s new in Web Development Visual Studio 2008

April 17th, 2008

Jonjon at the MSDN Session

I’d like to thank everyone who went to the MSDN Session: What’s new in Web Development Visual Studio 2008 last night!

I survived Launch {2008}

April 12th, 2008

I survived Launch {2008}!

Going cross-eyed while presenting

What I mean is, I survived my first time talking to a large crowd in a big event held in a full-sized convention center (actually the country’s biggest yet)!

Can the real developers please stand up?

Pointing out something

I presented on the new language features of C# 3.0 and Visual Basic 9.0.

I’d also like to congratulate Edu Lorenzo who made a presentation on LINQ:

Edu on LInQ

And Patrick Oliveros, who presented on WPF:

Patrick Oliveros on WPF

Congratulations to PHINUG for a job well done on its participation in Launch {2008}!

PHINUG Mashup

More pictures here:
Patrick Oliveros’ Multiply page
Microsoft Community Forums