Showing posts with label Effort. Show all posts
Showing posts with label Effort. Show all posts

Saturday, 16 October 2010

When do you not generalise your code?


At the moment, I'm working on a Silverlight project. The best way to learn a technology is to build something in it. Reading books and blogs and the rest will give you a vibe for what the technology is but only getting your hands dirty will make it real. Real is when you understand the beast and all its tides and moods. You also get to know the elegance of it and where the shine in its soul radiates from. Yes, I'm still talking about Silverlight.

One of the simple tasks in this current project requires me to parse a CSV file. That's easy enough to write on your own but anyone who has written a parser knows that if someone else has built one that does what you want then you should consume theirs. They would have handled all the exceptions and possible gotch-yas. This means I don't have to worry about that and I can get the task done quickly.

In this case, Fast CSV is a common choice in the .NET world. I've used it in the past on and it does what it promises. With the MIT license, the price is right too.

Sounds easy right? Well not totally. For my Silverlight application to consume this library, it must be a compiled as a SIlverlight library. Easy enough - I'll port it. Thing is, this code extensively uses the System.Data namespace and as I found out quickyly, there will be no talking directly to a database from a Silverlight application. That makes complete sense.

After looking in to it, the main use of System.Data is in the use of the IDataReader to stream the CSV file. There is also some DataTable usage. Nothing that couldn't be wrangled to use another stream reader and a generalised Linq table, in it's place.

But then I stopped...

When is porting the library more trouble than it is worth? My task is such a small simple one that I might as well write a custom parser that takes each line of the CSV file that I'm reading via normal file IO and push it straight to my view models for display.

Robustness of the code is an issue but I'll test drive it and keep it simple and neat. It doesn't have to be so general that it caters for every possible situation. It is just for my situation.

In this case, I have decided that a quick CSV parser that exists as a helper class in my project is good enough for this task. It is not just good enough but it's the right choice. Get the job done in a thorough way but don't over engineer the solution because it is the funnest way.

This has been a good learning experience and has solidified my resolve that sometimes you can write code that isn't so gold-plated and generalised and that's ok.

Monday, 21 June 2010

How Software Loses My Trust


I have one word for you that is the most important concept in Information Technology: Trust

If users don't trust your product then they won't use it. It doesn't matter how many features you have or how many fancy schmancy algorithms are written in the latest whiz bang technology if a person uses your site and it behaves badly.

When you walk in to a financial institution, they will make it clear that the power of their brand and the price of their stock lies in the confidence their customers have in them. Especially important is the outward facing applications that they have on the Internet. Banks and Insurers are well aware of the importance of this. Even though they are huge mammoth organisations that do not always deal well with the tides of change, they will let that one guiding principal of being reliable and trustworthy guide their software development. This said, I mean mostly the facade of it in the very least. Then be careful what you pretend to be because you might just become that and finance computing is not that bad these days compared to other domains.

Why am I currently going on about trust in online software? Well, it all comes back to my old and true nemesis: Optus. For those of you who don't know the joke of a telecommunications market that we have in Australia, Optus is the second biggest telco in the game. Telstra is the biggest and still dominates since it had all it's infrastructure paid for when it was fully owned by the Federal Government and then privatised to make a quick $buck$. There are global players here like Vodaphone, Virgin Mobile and 3. No matter how innovative the imports try to be, the ruling duopoly holds them back with their market controlling behaviour and terrible customer service.

Recently, I've been led to believe Telstra service has improved but I'll have to wait to experience it again before calling it. As a mobile phone user with Optus, I have the right to throw as much mud as is acceptable, especially after the experience I had today.

This afternoon after 5pm, I received an automated call from Optus informing me that I had failed to pay my last two mobile phone bills for May and June. I was surprised at first and then remembered that I paid them on their website. You create an account on their website when you sign up for your phone account so that you can easily make payments online using your credit card. Over the almost 2 years of my phone contract, I have always paid using their website. It usually takes between 2-3 attempts to get the payment to go through and no matter how many times I ask them to save my credit card details for later use, they never manage to.

Each time I go to pay my bill, I login and go searching for the relevant bill paying screen. Of course one of the main headings is Bills in the left hand menu. Under that is a list of features and not one of them is for paying your bill. You instead have to click on the Bills heading to go to pay your bill. Tricky but I learned that after about 6 months of wanting to commit homicide on any random member of their usability team. Ahh, the delusional assumption that they even have one is still strong in me.

Once the page required to pay my bill is found in the rat's nest that is their website, I re-enter all my card details and choose to pay. You can't choose how much you want to pay. They give you that number and you just pay it. The invoice amount is updated once a month and if you have already paid but it didn't register then they just add it to the next total. I learned to ignore that too. Once I paid twice the amount and they wouldn't even reimburse but instead held it over for my next invoice. Yes, their refused to pay back money that they should never even have taken.

Then I pay until they accept the payment. Like I said, after about 3 tries. They give me a receipt number and my final assumption is that the bill is successfully paid. Actually, that assumption is based on the text on the screen that says something about your bill being successfully paid.

Several months later, an automated dialing machine with a rude message accusing me of being a bad customer who never pays is placed to my mobile phone after working hours.

At least they are consistent but the one thing that Optus does not have is my trust. I lack trust in their billing system, their payment gateway, their phone service and even snigger at their advertising. They DON'T care what I think. I'm stuck in a two year contract with them that promises I'll pay my $83.50 per month for my phone service. Obviously none of that money goes to their IT department. We instead pay for that with blood.

When the time comes to find a new provider for my mobile phone, I'm considering dropping back to tin cans and string. It certainly won't be with Optus because I can't trust them and I don't want a relationship with someone I can't trust.

Monday, 11 January 2010

No go areas can be gone around


Working in locked-down IT work environments can be frustrating, especially as a developer. We usually find a way around or are able to provide valid productivity or basic functionality reasons to have the rules relaxed for us. As long as I can write and run code, administer most tools required for development and google when I'm stuck then I'm a happy coder.

It is the latter that is most likely to be restricted to the point of insanity. This is the case in my current workplace and in pretty much every bank, insurance company and Government department that I have ever frequented for remuneration.

Why can't I use the Internet at work?

Let me talk to you here about how I work and how I like to work. These are two different things but certainly impact the other. How I work is what makes a Damana tick. How I like to work is what makes a Damana productive in the workplace.

As software engineers, ours is a thinking game. The actual doing does not take much time. If you see your job involving a lot of typing then you are most probably doing it wrong. The majority of my time is taken up with deciding what to do and then implementing it follows as a distant second.

When I say thinking, that doesn't mean reclining with feet on the desk and smoking a cigar, while wearing a dressing gown. No, it simply means that my progress can be broken down as follows...

How I like to Work
  1. Decide which task to work on next [thinking] - Where does the task fit in to the work I'm currently doing or just finished? What is the highest priority at the moment and which task satisfies that? What task will score me the most points with the business? What are the business benefits of this? So on and so on;
  2. Pick up the task [doing] - claim the task in whatever tracking system is used. Read any specs, details or notes associated with the task. Talk to the analyst or business to gain a common understanding of what needs to be achieved;
  3. Look at the code and running application so far to find out where this task fits in to the scheme of things or work out where it will if nothing yet exists. [thinking] - Understanding the context and the requirements is a thinking processing. Scrolling through the code or clicking a few buttons in the front-end doesn't constitute "doing" to me;
  4. Come up with a solution and an approach [thinking] - most problems are solved or have patterns that are used to best solve them. Experience will let you identify them quickly and googling can help you otherwise. This is the point where you can jump to the quickest solution or procrastinate and find the perfect one. My way is to think of a few ways and implement the one that seems the nicest technically and is within the timeframe. Of course, this is all decided knowing that refactoring is available to me in the future;
  5. Deciding how to test what I'm about to build [thinking] - working out how to test something lets you explore your understanding of the problem domain and create an interface to what you are about to build. It helps inner design and in determining how to build only what is needed;
  6. Write tests and code [doing] - this is the typing part;
  7. Show the user/business representative/analyst what you are building as you build it [thinking] - this is thinking as a group (not to be confused with group think);
  8. Merge and deploy [doing] - this can be automated. With a lot of developers on the same project, this can be a problem solving exercise and also involve thinking if bugs or clashes emerge during integration.
This is of course a skeleton view of the process and does change depending on what the task is. The thing is that what I refer to as "thinking" takes up the majority of time. If I was to add percentages to the different steps, I'd allocate 15-20% of that time to "doing" parts.


Why does this have anything to do with my me accessing the Internet?

How I Work

To be clear, I am not a Buddhist monk and really don't understand how I work in all aspects of my life. I'm nowhere near Nirvana but I do have a bloody good idea about what makes me productive at work.

Thinking is a mentally intensive process. It's not even correct to call it a process as that seems to imply some kind of contiguous set of steps. That's not what it is to me. Solving problems and implementing solutions needs to happen in small bursts. Of course, these bursts can follow each other closely or be broken up over different periods of minutes, hours or days. Days are less likely since I work in smaller tasks than would require days. Either way, I have to break that process up so that I don't become mentally exhausted. Breaks are important.

Call it slack. Call it a brain-break. Call it what you will.

Nothing is going to let me work 10 hours in a row doing nothing but thinking. Instead, I need to work in the bursts I talk about. Think-Do-Stop; rinse and repeat. What this means in a work day is that if you _made_me_ put all the thinking and doing together then you'd see me working a 6 hour day and then collapse in a heap. Instead, if I take micro-breaks between the bursts, I can easily produce valuable output in a combined 8-9 hour day, all the time working at a sustainable pace.

Does that mean spending time sitting at my desk with my brain turned off? Not really. Usually my brain-breaks still involve thinking but in a different way to the way I think at work. For me, reading my RSS feeds; sharing knowledge, events and fluff in real-time with friends online ; and turning around and talking about the front of the newspaper with my office mate let's me recharge. How much of the time I spend doing this depends on the how challenged I feel that day due to difficulty of and interest in the task and how tired/alert I'm feeling.

The format of working I have developed over the years has resulted in my being able to easily punch out 9 hour solid productive days, without burning out. In the process of learning this, I have burnt out. Damn, I'm the Phoenix of software development.

That's why I need access to the Internet at work. I want to read what I want. I want to talk to whoever I want. I want to be slack whenever and however I want. At least assume I mean well and want to do the best work I can. Not all of us want to abuse resources or our employers. In fact, most people are good people. Why treat us as if we are like the few who rort the system? It's the same as blaming all religious people for the acts of extremists. That's not representative.

It doesn't matter how much you lock-down your environment, I'll have my slack time. Thanks to smart phones, you have no way to bore me to death or burn me out anymore. So, what's the point of doing it now?

Monday, 21 December 2009

Optimism is Power


I've been working in Darwin in the north of Australia for three weeks now. It's where I grew up but that only means that I knew it as a kid. Who I am as an adult formed by living in Canberra and Sydney and travelling the world.

Yes, I'm an eternal optimist. It annoys the hell out of cynics, pessimists and misanthropes but I'm OK with that. Me being OK with that also annoys them but luckily for me, I am too positive to be swayed by their black-hatting.

Why do you care about my glass-half-full view of the world? I'll tell you why...

Positivity is Power.

I don't want to sound like Tony Robbins because he is a bit of a knob actually but I do want to get through to negative thinkers. In Darwin, I seem to meet one positive person each week out of the 20+ new people I meet. That's 5% and based purely on my small sample size and sloppy counting methods.

Sydney wasn't like this, was it? I ran in to a lot more positive can-do people. After voicing this observation to a Sydney friend, he suggested that this could be because of the kind of people I was meeting in Sydney anyway. People in the circles I ran in were making the most out of life. They changed their lives if they needed changing and looked for opportunities constantly. It was and still is an energetic crowd with drive. Everyone wanted to change the world. We often joked that we would stop getting out of bed if we no longer believed that. These thoughts push you to progress and succeed. These people push you to progress and succeed.

It has been tweeted a lot lately that you become what the people closest to you believe that you are. You are made in to what they expect from you. That is so true that it terrifies me. What if I don't find that crowd of over-achievers here in Darwin? Will I ever do anything more with my life?

Then I break in to hysterical laughter and realise where I really got my can-do attitude and ability to see the silver lining on every cloud. It was through trying, failing, trying again and doing brilliantly. It was from what I was taught from a young age by my parents who said "you can do anything you set your mind to".

How does this apply to work? Good question and I'm glad you asked. It applies like this...

Belief

Belief releases you from the negative thoughts that say you shouldn't bother because it's not achieveable anyway. It gives you options. The option to do anything you choose to achieve.

Purpose

Purpose is making a choice from the options and deciding that's what you will aim for. Often people have dozens of great ideas but they do nothing with them. One average idea achieved, is better than 10 brilliant ideas that are filed in the might-have-been pile.

Drive

Once you have a purpose, you can realise it. In my career at this time in my life, it means working in Darwin and improving the software development environments I participate in. That will be onsite with my clients; in the user groups I start and join; and in my own personal projects. The fact that I have done it before in the other cities I've lived in, means that I can do it here. It's not about who rocks up to join in. It's about what I want to build and if I build it, they will come.


So, my point? Get out there and do something. Anything. You really can do anything. Build better software. Make sure the work you do is something you are proud of. Share your knowledge online and in the workplace. Talk to people about what excites you about this industry.

Change the world or don't even bother getting out of bed in the morning.

Wednesday, 1 April 2009

The Whole Nine Yards


A common question I get from people new (and not so new) to our industry is "do I have to do all that extra stuff after work?"

In the past, I have said that it's ok to learn on the job only, if that is what you prefer. I've only now realised that I have been lying to them. I was telling them what they wanted to hear and then went and did the opposite.

The real answer to that question should be a big resounding YES!

Science and technology are areas that are constantly changing. To work anywhere near the middle to the top of the game then you have to be writing code at home; reading books and blogs; and contributing to the community. Yes, not just one of those but all three. If you can do more than that then you should.

What do these three major areas involve and why should you do it?

Writing code at home

Every programmer/software engineer/developer or whatever you call yourself, should be taking time outside of working hours to write some code. Start your own project and build something from beginning to end. Get a new idea or rebuild something you'd like to understand. It does not have to be a huge web application sitting on a complex stack and hosted in a cloud. It can be a script, a tool to help you improve something in your job or life or just an algorithm. It is easier to find an idea and build something rather than just start writing code. Like work, you need a purpose.

Learn a different language. Learn a different technology. Learn more about what you already know. Become a better coder by spending more time doing it. It's like painting and public speaking and lifting weights, the more time to spend doing it the better you will get at it. Especially if you already have the base.


Reading books and blogs

The best people I've ever worked with constantly read everything they can about what they work in and what they want to work in. This goes from technical books and blogs to books about learning and working with people. We all have dozens of feed subscriptions in our readers and are constantly trying to keep the number of unread articles down to a manageable level.

If you aren't sure where to start then ask what your friends read. Follow people on twitter who work in an area you are interested in and who share links. Find an author you like and read everything they write. Find a publisher of books and read stuff they publish.

Start reading now. You are already falling behind.


Contributing to the community

This is a controversial one and something I regularly fought with my recent room mate about. I feel it is your responsibility to learn and share and share and learn.

Contributing to the community can happen by going to a user group that shares your interests where you can speak and listen to your peers. Blogging what you have worked out during the day or something you couldn't find on your last google but solved yourself is another way. Setting up a site where you can share what you have written and show how it is used is also a very good idea although that is a bigger commitment that can be avoided for now with a simlple blog.

Tweeting is also important as a way to propogate information about what you or others have written. Share what you read through Twitter, your reader, your blog or other social networking sites.

Once you start it will become a habit.


No matter what people tell you, get out there and do more. Learning only at work is not good enough. It is not about running to keep up. It's about learning for life and keeping your skills fresh and valuable.

Acknowledge Me

Apple started a user experience trend many iOSes ago when it accepted Settings changes and did not ask for confirmation. Once the chang...