Tuesday, February 7, 2012

Planning vs doing

My dad possesses a great amount of patience, he reads books cover to cover, he would start to learn the electric guitar by studying musical theory, he learned DOS before BASIC and then MS Access. It took me many years to begin to understand that patience is not the only way. I have been long tormented by the battle between my dad's inherited logic of doing things with patience versus my natural tendency to jump from page to page, learn differential equations without previously memorizing the multiplication tables and writing a program without knowing where each bit of data is stored. I still carry this "first things first" philosophy with me, I will not skip boring episodes of my favorite shows, will not do something I have not planned first and I feel bad for not knowing my multiplication tables or my alphabet (sorry dad).

These are the thoughts racing in my head this morning because recently I have started skipping math intensive chapters in the GEB in order to actually read the rest. In light of this epiphany about myself I have been looking at the way I work and I identified both areas where my dad's first things first philosophy still rules my thought processes but also finding where my ADHD philosophy takes over. An example would be that thanks to code completion I have been programming in Java for two years without knowing much about the standard Java libraries, but on the other hand I am reluctant to pick up Scala because I haven't read the book yet. The battle between the planner and doer in me is raging wildly and it is damaging me at least as much as it is helping me.

In software I see these two battling philosophies at play each day. It's the good old fashioned hacker vs architect battle. The architect collects all the requirements, writes hundreds of documents, gets everyone on board, designs, meets, designs, makes some drawings, meets, meets, meets and then starts developing. The hacker spins up the IDE, jumps in, writes some code, goes snowboarding, gets yelled at by the boss Monday morning, mainlines caffeine, writes more code and repeats until the most godawful piece of spaghetti code is produced, it then gets fired, attaches ninja/hacker/guru before their title in their resume finds a partner and founds a start-up.

It is funny because both types of programmers know how to do things right. The planner does realize that spending 50% of the time on documentation is insane and the doer always has this grand plan to take the crappy system and transform it into the unified theory of everything. Yet our minds are too ill equipped for feats of such awesomesauce we simply cannot do it alone. So we are tied up into teams where the planners take all the managerial positions (the alternative would lead to anarchy, rebellion and feces on the walls) the hackers are minced through a well designed machine of bureaucracy where they secretly rebel going off at their own time to work in their own project getting ready for that start-up.

Then there is agile, and then there was laughter. Let me explain, if you put a dictator (no offense) a tripped out hippie (yes offense) and a couple of mediocre guys who don't care much (maybe offense) in a room and ask them to make a space rocket the methodology will NOT affect the outcome. If we are what we eat, then we are also what we produce (this is a disgusting statement) or closer to the truth we produce things according to our image. So it is all up to the developers and the team they compose, the right rookie in the right team can become a solid developer whereas the "graduated from MIT at 16" can also be ground to a mindless pulp by the time he/she reaches 20.

I have seen great code, I know it exists and I no doubt believe there exists the perfect team. But finding such a team, studying how it works and then trying to implement the idea to other teams is in itself a bureaucratic meat grinder at the organizational level. People, like atoms, like butterflies are who they are, we need to love ourselves and those around us, we need to accept our weaknesses and enjoy our strengths. The same bureaucratic operation that oppresses my mind into guilt and agony when I skip a page of a book is the same one that tries to sell you "advice" on being agile, productive, sustainable, insert buzzword here.

Teams are like clouds. All you can do is set the conditions and hope for the best. You can't program people to act like robots, no matter how hard you may want to (and I do!)

Till next time,
Stratos out.

Thursday, December 1, 2011

Quick and dirty test data generation


I am a noob with postgres and linux, if you are an expert why are you reading this? So I just had to generate a large ammount (>1) of rows to test against. This is a step by step dirty way to get from SELECT to INSERT (I know you can do it with sql smart ass but can you do it in under 2 minutes?)

1) Get the table with some random row of data
psql -d <my-db> -c "SELECT * FROM <table> where id = <id>" > raw_sql
gedit raw_sql&
(GEDIT? I hear you scream. NOOB! I scream back.)

2) Format the raw_sql. Depends on the data your millage will vary.
Find and replace whitespace with nothing.
Find and replace || with | null |
Find and replace || with |
Find and replace | with ,
Save as <file>.csv

3) Delete the null stuff.
Open a spreadsheet and import the csv.
Select all columns with null and delete them.
(Basically the spreadsheet allows values and attribute names to be aligned and easily deleted.)
Export to csv.

4) Create the Insert
Open the new csv file (using gedit)
Add at the top psql -d <my-db> -c "INSERT INTO <table>
Then surround the attribute list with parens
Then add below that VALUES.
Then surround the values with parens and add a final " at the end.

5) Multiply
Copy and paste as many times as necessary and change the values that you want to differ manually.
Save as <something>.sh

And run ./<something>.sh

Till next time,
Stratos out.

Friday, October 7, 2011

Good bye Steve








So many have spoken about Jobs. It doesn't matter what I say, but I have to say it.

Steve was a usability wizard and every computer person should be striving to achieve what he did.
Steve made PCs usable by everybody.
Steve helped save the music industry.
Steve brought the smartphone to the non-geek, non-business world

Steve created the mobile computing market.
In one broad stroke Steve innovated preexisting industries and became the standard overnight.


Thank you Steve. You will be missed.

Monday, September 5, 2011

Long time no C

And then it was vacation time and then vacation time was over...

Teachers and students are in back to school mode and so am I, so this is a post about going back to school work.

Updates:

My app is coming along nicely, didn't get a lot of play time with the Xperia mini from the Sony-Ericsson loaner program but found two bugs that need fixing. Still loads of bugs remain, a help function doesn't exist yet and a couple of cosmetic updates for the app to be "ready-ready," then another month for "ready-ready-ready" you see where that one is heading, right? Last week I did a soft come back which was cut short cause I had to go to a job interview on Friday.

Job hunt is now on, I still haven't heard back from two folks that said they would meet with me over coffee to talk employment. I guess people are busy/away for labor day or they give the cold shoulder here by putting your address in their spam filter.

In an effort to become a better programmer I am reading Effective Java, solving Project Euler problems in Python and listening to the Java Posse during my walks. I am also planning to attend a web developer seminar and the largest AI class ever made.

It feels like the years I spent checking registers should have been spent sending JSON objects, doing CSS transforms and designing thread safe hash maps. It's never too late though loads of programmers are productive in their 30s... they take us out back and shoot us after 45 right?


Till next time,
Stratos out.

Saturday, July 30, 2011

We are anonymous! Or not?

Following Google's decision to use real names for g+ I saw the real name and anonymity debate spark up. Real name people argued that you are a coward for not using your own name while anonymity folks gently ignored them and created Biggus Dickus the third on g+.

To me the anti-anonymity crowd are either naive or evil. Evil because ultimately they want us using our own names so that the secret police and telemarketers can get to us faster. Naive because they do not realize that we all live in a totalitarian regime. Sure the secret Mountie police wont knock on my door for posting "Cartman like" jokes on my facebook to my army buddies but the Nazi judgmental recruiter who looks at my web presence evaluating me for a job might not appreciate the humor of Biggus Dickus the third. (Not only that, now I called her a Nazi. This will be an interesting interview.)

You see it is not that we are paranoid it is that we cannot be sure that every potential client, employer, CIA agent out there can appreciate irony. But this is not about dick jokes, rest assured. It is also that my loud Pastafarianism may really agitate my ultra-religious relatives, my call to arms to protest the G8 doesn't go well with my firm's CEO, my militant Islamism may land me in some cell somewhere away from toilet paper and lawyers. Anonymity protects forum trolls and flamers as much as it protects unpopular ideas and fosters revolutions.

Instead of fighting privacy I expect Google to understand the need for my SpiderMan33 persona and my Stratouklos nickname and Stratos and Mr Xakoustos they are all me, in different contexts. SpiderMan33 may admit that he spent half the day reading comics, Stratouklos shares dick jokes, Stratos posted some nice photos and Mr Xakoustos was working on a project. They all happen, they are all different and I do not need my comic buddies/mates/strangers/boss to know of each other's existence. Oh and while you are at it, Google please make my avatar change depending on who I post to so I don't have to juggle four Google accounts. Thanks!

Sincerely,

DickMan41 aka Helen from accounting.

Till next time,
Stratos out.

Monday, July 18, 2011

Fractals and design

So my first releasable app is already a month over my initial estimation. The Android learning curve is taking twists and turns, I am graphically challenged so it takes me longer to design a good icon, blah, blah, blah. Everything mentioned is true but what is interesting is that when it comes to design the challenges that need to be solved behave like fractals.


Or in other words in software design and in lesser extent electronics most problem domains are fractals. Design generally deals with fractals, for instance, to build a single engine one must build hundreds of components, that are built off hundreds of cogs and pieces, that have to have dozens of unique features. And once the engine is built it needs to go into a car/boat/plane composed of thousands of parts that they themselves represent millions of smaller problems each visible only once a designer focuses into the problem area.

Because of the fractal nature of the problem domains and the lack of serious standardization in design principles. software design is notorious for it's cost overruns, widening scope and date slips. In software a huge ten day design effort problem can be hiding behind every aspect of the project. A feature might be impossible to test without setting a ridiculous number of data by hand, a function takes too long to complete and concurrency at that stage requires redesign and so many more that volumes of books are not enough to list them all. Due to the number of unknown factors involved one could say that the model of solving a software engineering problem is chaotic and as such very difficult to correctly predict and estimate.

As software engineers we try to use our tools to accurately model and predict our future but when we actually look at our methods we generally look at the sky, lick our fingers and say hmm... it'll be OK. Only to find ourselves in a thunderstorm of epic proportions a week later. Unfortunately because business and money are also involved very often someone warns us of the coming storm but in an effort to keep our bosses, clients and investors happy we tape his/her mouth SHUT and throw them in the basement. Cause if you hope it will work out, it works out right? Ask any of sailors down at the bottom of the sea.

New methods are being developed all the time but rest assured that every tool in the world can be manipulated to predict good times when contracts full of money are at stake. I mean ask any construction company, they'll tell you: "Don't look at the sandy land we are developing on, look at the nice drawings instead and please give us money." Trust us, we won't go over budget before you are way too committed to pull out. And the world keeps on turning.

Till next time,
Stratos out.

Friday, July 15, 2011

Vertically integrated design in a 2.0 world

This is mostly inspired by the troubles faced by RIM and other companies.

Vertical integration in design used to be a good idea. The same company is in control of the architecture, the hardware, the software, the brand, the marketing, everything. Electronics produced this way rely on standardized interfaces to communicate with the outside world, everything is well contained and you as a company you control your products and subsequently your brand tightly.

It was such a good idea in the 70s and 80s but from the 90s onward the world started to accelerate. Design by comity and over-protectiveness slowed down innovation and created bottlenecks. To fight these, companies discovered outsourcing to speed up the mundane parts of design which at least allowed for features to have a quicker time to market. But the outsourcing solution is not enough in the 21st century world, time to market of 1-2 years is unacceptable in most industries if not all of them.

Mega projects are feeling the strain of trying to catch up with newer, leaner, more distributed designs and these growing pains seem to me to be the driving force behind agile methodology adoption by large corporations. If you have read some of the agile books out there the introductions sound like pitches aimed at alleviating the major problems faced by industrial mega projects. Elimination of bottlenecks via feature teams, knowledge transfer via team interactions, better control via transparency, etc, etc.

But agile has had mixed results. Change itself causes some initial slowdown in production or the fear of a slowdown. Management and employees don't easily embrace changes that undermine their job security which is a natural byproduct of some agile methods. Not to mention that often the wrong methodology is applied to the wrong project due to a silver bullet mentality.

And then came crowd-sourcing and the shit really hit the fan! The most affected industry of all is the mobile phone industry. The smartphone wars that have ensued are a testament of the changes going on in the world of electronics and software. Six companies are in the ring, one so far behind it is irrelevant, yes that's you HP, sorry. One already accepted defeat and hopes to band with competitors to survive, nice call Nokia. Microsoft, after having their crappy windows used to wipe the floor with, comes back with WP7 but is it too late? RIM is faced with mounting pressure to do something, market Blackberries to toddlers maybe? And the two kings of the ring right now, Apple and Google. Well Apple was the king to be precise before Google and their Android army started kicking their butt. But Apple, RIM, M$ and co have banded together in a last ditch effort to stop the green menace.

In the battle of Android vs everybody else it seems that Android cannot survive the constant barrage of patent trolling, leveraging the existing power in markets outside the mobile arena (WP7 and Xbox, iOS and AirPlay, MacBooks, iPad, iLife) and challenges posed by a newer and not as mature platform. In all this mess my money are still with Android. Why is that? It is not my natural tendency to side with David against Goliath, I mean Google is close to taking over the whole universe it isn't a David. It isn't even their motto "Don't be evil" that makes me like them so much.

Google will win because vertically integrated design in the 2.0 world is doomed to sink like a monolith. iPhone5s best features are already integrated into Android (smells like counter lawsuits by Google?) or are about to be topped by C2DM functionality. Simply put the practices of industrial secrecy, design by comity, content approval processes are no longer relevant in today's fast moving world. Time to market of over a month is too much at this age. Your only hope is to make your source open, attract as many individual designers as possible, give your platform to anyone who asks for it and let them change it as they please, in one word: Android.

Till next time,
Stratos out.