Skip to content

Busy with work.

27-Jul-07

It’s been a bit since I blogged. I’ve been busy with work. I’m working on a non-deterministic algorithm, that will be used for random data generation that serve as seeds for a more complex algorithm that generates serial keys.* I know the above is very ambiguous but that’s all I’m allowed to say. It’s not an easy task, and I’m quite sure it is a futile task, but it meets the company needs, and it’s just one step of validation, and besides it keeps me happy busy.

In the process, I have been trying out several distributed revision control systems. So far I have tried:

  • Bazaar
  • Mercurial
  • Darcs
  • Arch
  • monotone
  • svk

I think they are all good at what they do, and picking one above the others, is really a matter of personal preference.

I liked bazaar, git, and mercurial the most. I decided on Git, because of the ability to interact with svn out of the box, it’s svn integration is really good. I actually liked bazaar the most, but it’s svn support is not as robust as git’s. Now let me be clear I hate git’s command interface, but it’s growing on me. The fact that there is a emacs vcs mode makes it a lot simpler for me.

With this I’m not suggesting ditching svn for a distributed system. At work we use svn and it’s not going to change any time soon. If it were not for the fact that I have the bad habit of using svn branches for development, I wouldn’t care about merging all that much, while merging in svn it’s not really as bad, as some people make it sound, you do have to be careful, and svn it’s not very helpful with conflict resolutions, besides that, the fact that I don’t have to run a server for my local repository is a wonderful thing. I also like the simplicity and multiple methods for publishing my Git branch.

If you haven’t tried a distributed revision control system, and you are a svn user, I suggest you start with bazaar, as it’s user interface is very much like svn so the learning curve is really small, Mercurial is also a nice system to start with, though a bit different than svn.

If you do try them out, I would love to hear about your experience.

* This has nothing to do with warez keygens, it’s part of the validation process of our software.

good programmer, bad programmer.

06-Jul-07

A friend of my wife came up to me yesterday, he’s studying to become a Systems Engineer, and he wanted to know: What did I do to become a good programmer?

My answer: Who said I was a good programmer?

To be honest, I’m not sure if I am a good or bad programmer, and I never thought about it until he asked.

Coincidentally I found a few blogs talking about this very subject. They go to explain how, good programmers are more efficient and productive than bad programmers, and how good programmers take ownership of their projects, and don’t need to be micro-managed etcetera.

In my opinion it is true that good programmers tend to be more efficient, productive, and effective. I also agree that most good programmers are capable of taking ownership of a project and running with it.

But, I think in the real world things are not black and white, as the above statements seem to imply.

There are circumstances that can make a good programmer, behave like a bad programmer, the implications that good programmers are more disciplined, is also not necessarily true.

Humor me a bit more, and let me outline the variables, that I think are important, and may break the above perceptions:

Work Environment: The work environment is a very important variable. Productivity, efficiency and reliability depends highly of your work environment, and what you as a programmer need.

Some programmers need peace and quiet, others need to be surrounded by people, others need open spaces, other needs music, or a combination of some or all of the above, we are complex beings.

If you put someone that needs to work in a open space, in an office, he’s productivity will go down, we humans can get used to almost any environment, but there is always a trade off, and it is the programmer that has the short end of the deal. I believe this is why Google works the way it does, there are offices, cubes, open spaces, recreation rooms, conference rooms, and much more. They don’t care where you do your work (at least that is what googlites tells us). That right there is a productivity booster.

Projects: The type of projects you work on, can motivate you and inspire you to be better, and study more, or they can stifle you and bore you. This is a big problem, in several fronts, the truth is that no matter what the company needs the work has to be done, boring or not, and usually they need it by yesterday.

The problem for the programmer, is how does he motivates himself to do the work, and do it well?

I know this seems like a childish or amateurish proposition, and most professionals will roll their eyes at it. Don’t get me wrong it has to be done, it is your job, whether you like it or not, but it depends on the character of the programmer, and his own self pride, whether the level of the result is to par, with the results, of work he finds interesting and challenging.

Most managers overlook this issue, and in the end, either the programmer leaves the company or department, or he stops caring.

It is not an easy problem to solve, some companies have worked out this issue by given programmers, time slots to work on whatever they want, others will sit all the programmers down, explain the projects at hand, and let them volunteer for the different projects (this has a lot of potential problems).

But the truth is that most companies can’t afford to that, and they have to resort to other types of incentives, sometimes they work sometimes they don’t.

In this life, people have to do a lot things they don’t like, and they have to do it well, I’m not making excuses here, I do believe you need to be realistic, and know, that no matter what you do, or where you work, you will have to do things you do not like, and when that time comes, you have to make tough decisions, you can do it or leave.

But my personal opinion is that life is to short, to waste your time on things you don’t care about, or don’t want to do, sometimes we don’t have a choice, we have families to provide for, but if you do have a choice, use it wisely.

Management: A good manager, is a blessing. He is the first and in some cases the last line of defense or defiance.

A good manager, knows his team, and knows what they are capable of doing, he knows how to push them to be better, faster, and efficient. In short he knows: the good, the bad and the ugly, of his team, and is aware of the role that each member currently plays, and what they could play, he fights and stand up for his team

When upper-management puts out a ridiculous deadline to a highly critical project, it is usually the manager, and the Senior staff, that comes with a plan of action to deliver in time.

Sadly, this is hardly ever the case.

Most managers are ill prepare to handle the different personalities, and work ethics of his employees, most managers don’t understand, and don’t even try to understand the realities of each team member, sometimes there isn’t time for him to do that, after all he/she does have a life.

A lot of people think they can be a manager, and that being a manager is easy, well, being a bad manager is a piece of cake, all you need is to be good at watching your own back, and obvious denial ability, because nobody likes excuses.

But being a good manager, is a very tough job, you are dealing with people, different cultures, and personalities, your boss has certain expectations, usually this expectations are unrealistic, and brought by lack of knowledge or by politics.

Managers, –good one at least, have the task of bringing clueless upper-management requests, to reality. It’s difficult to explain; that the project they want deployed in three months, actually needs a year. More so when s/he has to wrestle with the managers and directors of the other departments, who say that’s the design is ready, corrected, and certified, that he’s just giving excuses, because his team, are a bunch of whining hacks!

Of course, when the problems start flying, you would hear the requirement people, shouting that, that feature is not correct, or a feature was overlooked, a procedure is not following all the steps outlined in the documents, designer will then come out, defend themselves in which ever way possible and point the finger else where.

And so the cycle continues.

This is the reality that some, most programmers live, and deal with.

In an ideal environment, the:

Good Programmer = Productivity + Efficiency + Self dependence.

Is true, and even in not such and ideal environment, it can hold, but then there is the human aspect, that’s never taken into account.

Now, if a bad programmer is one that is:

  • Unproductive.
  • Inefficient.
  • Slow, or dependent on others

Then there is no problem, because, if they want, they can learn to be the opposite of that. You the good programmer can teach them.

The truth is that, if you think about it, you can’t rely on the above conditions to differentiate the good from the bad.

I read a blogger, who said that:

You can know a good programmer from a bad or not so good programmer, because when the project is assigned a bad programmer, will start looking for sample code, and waste time looking for how others have tackled the problem, while the good programmer just starts working on it.

I think, that is not a fair or realistic statement. If I’m given a problem, that I know it was solved, efficiently and intelligently by someone else, I would go and look and talk to the person, who did it and if I can use the code unchanged, I would use it, and give due credit.

I don’t know if all this makes sense, I’m sure it doesn’t.

I have to say that all this has to be taken with a grain of salt. I have had been told, by some that I’m a good programmer, and by others that I suck. Truth be told, neither of the opinions affect me in any way, I love what I do, and will keep on doing it, with or without pay. I think that alone makes me a decent programmer.

I’m very interested on your thoughts in the matter, it does not matter if you are not a programmer, I think this extends to other careers.

Variations of Murphy’s Law

05-Jul-07

I had a very unpleasant variation of Murphy law.

It all started as a normal Tuesday morning, it was actually a beautiful morning. Things were looking good, I had finally come up with a sane design, and a proof of concept for some cryptographic work I’m doing. I was ready to start implementing the libraries; I was happy, no I was actually ecstatic. Woke up my laptop, the screen stays blank, no sweat, will do a cold reboot, so I do that.

The laptop starts booting, all is good, I log in, start working and notice my screen is flickering! WTF? suddenly it goes black! I start trying to revive it, and to make a long painful story short, I spent the morning disassembling the laptop, and on the phone with a Dell sale rep, to see if I could get a new LCD screen, I was told they had to check availability and price, he asked me to call back in a few hours. hanged up, went back to my desk, sat at my new chair and ended sitting in the floor! the damn thing broke! Now I was getting a bit pissed, just a bit.

A few hours later I grab my cellphone to call Dell, and the damn thing is dead! it’s unresponsive, does not turn on. At this point I’m really pissed it’s a new phone! Is someone pulling a prank on me or something? Because this does not hold to Murphy’s law, I mean the law is clear, if there are multiple things that can go wrong, the least expected is the one to occur, but man I mean three things! that’s a variation to the law, and not a fun one at all.

When I finally talk to Dell they quote me a whopping $US 1,000.00 for a new LCD screen (My laptop’s warranty expired) plus shipping and insurance.

Next up, get a call from my wife, the family vacation we were planning, had to be canceled, due to her vacation being postponed by her boss! now this is just ridiculous, all in one day! One long, long day.

In short, I have to buy a new computer (because it does not make sense to pay 1k for a screen when I can get a new laptop for that money), a new chair, and my phone is still being repaired, because they didn’t want to exchange it, even though it’s less than a month old!

So if you have any horror stories of Murphy laws or it’s variations, please feel free to share, I’ll feel better If I know I’m not the only one with this bizarre events happening.

Programmer vs. Developer

27-Jun-07

For years I have ignored the programmer vs. developer debacle. For those of you that don’t know of this war of sorts, it’s quite simple: There is a trend in some IT circles to regard programmers as second class citizens, as code cowboys that are trigger happy, and are just good for writing code.

Right now if you Google programmer vs. developer, you will get articles on how developers:

  • Design the application from the ground up.
  • Write specs, and documentation.
  • Write test cases.
  • Write unit tests.
  • Write code.

Instead a programmer:

  • Write codes.
  • Fix bugs; if you are lucky.

Well I don’t know about you but that does not seems accurate to me. People can call themselves whatever they want, you can call yourself a programmer, developer, engineer etcetera. Hell there was guy I used to work with, that referred to me as “Engineer”, don’t have to tell you I’m not an Engineer, and never referred to myself as such.

When I hear some one refer to himself as a programmer I think of people like:

For a more complete list please go here.

If you take the time to visit each of the links above, you will see some are referred to as:

Those who know me, might be perplexed I left out from the list, who to me is a great programmer and someone that I greatly admire, Donald Knuth. Dr. Knuth is to me a master, any other title in my opinion falls short of his achievements.

Now I’m sure you are asking yourself, what is the point? The point talk is cheap, let the code speak for itself.

Computing without a mouse

24-Jun-07

As most of you know I have been dealing with tendinitis for a couple of months now, I have found a way of positioning my hands on my laptop keyboard that enables me to type without any pain, and so far without making the condition worst. I did not invent it, I found a post on a newsgroup, it’s quite simple for those that want to try it.

Instead of placing your fingers on the home row (asdf | jkl;) I place it like so (qwef | jiop) this puts my wrists on a angle similar to what an ergonomic keyboard has, as I said works for me, will probably not work for you, we are all different.

To avoid using the mouse, I’m using a keyboard launcher application called Deskbar, it’s quite nice. In OSX you have: Quicksilver, in Linux/Gnome you have: Deskbar, in Windows you have: Launchy.

For browsing the web I’m using FireFox with Conkeror, this is a keyboard driven FireFox interface, it uses Emacs keybindings by default, but you can customize it to use whatever keybindings you prefer.

For coding/writing/blogging/irc/IM/email I use Emacs, with quite a few elisp code I’ve written to handle repetitive tasks for me, as well as elisp code by other authors.

By no means I am advocating you use or try any of the above programs, or do I think they are the best. They are the best for my use.

Other things I’m planning to do in the shot term is buying myself one of this Aeron Chair I don’t think I need to explain why I’m going to buy one of this, but for those that need the explanation, Google is your friend :).

I hope this post can help those with the same problems I am facing, and making computer use pain and injury free.

Weblogger

23-Jun-07

In my quest for being more efficient, I’ve been playing around with Weblogger.
I know most of you are not interested in Emacs, but just in case someone
besides me uses Emacs as it’s default editor, this might be helpful or just plain cool.

The art of programming

21-Jun-07

There has been a lot said about code being art, and there are quite a few different reasons for this, but I won’t go into them here. There is truth, in that code is art, the problem is that in most cases, programmers misunderstand the term art, and believe that art is whimsical, people look at a painting done by Jackson Pollock using his drip technique and they go:

“Oh, but I can do that!, it just paint splashed in a canvas! How hard can it be?”

The same happens when they hear a cool Rock song:

“Oh! I’m going to be a guitarist, and land me some chicks! How hard could it be to play guitar?”

Well as it turns out, it’s easier to play three chords on a guitar, than to paint like Jackson Pollock or Picasso. But the premise of art being simple, does not make it easy, the same way, that it being complex, does not make it hard. Learning a programming language, is not an easy task, it takes weeks or days to “learn”, but years to use it correctly; just like some one can learn the notes on a pentagram, and the scales, in weeks, but it will take them years for them to write a Symphony.

There is a lot more to just sitting down and banging words out on a keyboard, you need to:

  • plan or design.
  • structure the information your code is going to handle (data structures)
  • the efficient use of said information (algorithms).

There are those that believe, that all the above is only needed for big projects –They believe so because they read articles on how Linus wrote GIT on a few days, or how “X” wrote “Y” in three days. They are wrong.

The truth is that you won’t see me with a UML program, doing diagrams, use case scenarios, and class diagrams, not because I don’t like them, I like them, and use them, when communicating ideas to others, but for the most part I the design in my head, and can visualize it. Before I even consider writing code, I work out the different scenarios in my head, this is easy to do for me, but it might not be easy for you, and that’s fine, sometimes I need to do an outline, or a brain map, before writing code, this is all part of the process of writing.

It’s the same way for a composer when he’s got a commission for a new piece, composers can’t wait for the muse to come when they have a due date for the work –oh, yes composers, writers and painters have due dates.

Composers devise ways of making themselves efficient, and be able to complete their work with enough time, to proof read, re-write, revise, etcetera.. It’s here where some programmers deviate, once the code is written, compiles and runs as expected, only a bug , will make the programmer look at the code again.

Programmers don’t proof read, and they sure as hell don’t like to re-write, and revising is not liked much either. Some do unit testing, which in some cases can cause the programmer to go back, and refactor/revise the code, but in most cases, the programmer just fixes the bug, and does not even care to investigate why the bug was there in the first place, also programmers don’t really look for the most efficient way to code, they avoid making their life easier.

This brings me to the fact that most programmers don’t think about their craft; there are hundreds of books about the craft of music composition, writing a novel, and very few that deal with the craft of programming.

Most programmers don’t even realize that programming, goes beyond the language being use, the language is just a tool; you don’t see painters having flame wars on whether the smaller brush, is better than the bigger brush, for doing a sky line? I’ve never seeing construction workers arguing about which brand of hammer is the best for the job, but you will see that with programmers.

After a long time working on different teams, with different tools (languages) I’ve concluded that most programmers don’t take their craft seriously, and in most cases they sabotage themselves, by not taking the time to look for ways of being more efficient with their time, and their code.

Programming is an art, there is no question about it in my mind, but for it to reach the level of recognition, of the other arts, there is still a long way to go. The knowledge of algorithms, logic, design, and the abilities to do this things well, are worth nothing, if they are not accompanied by thorough, efficient and intelligent coding, do not fool yourself into thinking, that you will be able to make a finished product in a few days. Care for your code, at the end it’s your creation, it exists because you exist, and you made it.

Frederick Brooks had the following to say in his book, “The Mythical Man Month: Essays on Software Engineering”:

The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures.”

I’m so humble…….

20-Jun-07

Today started as most morning, hectic and painful, specially because for some reason my right hand was very sore and swollen, it was all well as I was scheduled to see my Doctor in the afternoon.

I arrived at his office, he was running a bit late, so I sat with the other four patients that were waiting, it wasn’t all bad he has a nice waiting room with WIFI and TV and current magazines and news papers. He got in a few minutes later, and the first thing he does, is notice my swollen hand, and starts questioning right then and there; Was I playing the guitar? Was I over using the computer? What happened?

I’ll tell you what happened I had to change a tire, that’s what happened. He immediately injected something or other to reduce the swelling, and told me we needed to wait a bit, to see if the swelling goes down, to do the treatment.

So here I am, in pain, real pain, when this guy near me try to start a conversation:

The humble guy: Are you a musician?

Me: Yes.

The humble guy: What do you play?

Me: Guitar and Piano.

The humble guy: Who do you play with?

Me: Myself… I don’t play with anyone, I can’t play due to my condition.

The humble guy: You know, I’m a very humble person, I’m so humble that I’m going to tell you something you might not know.

Me: Ok……..

The humble guy: I’m the best guitarist of this country.

Me: Trying not to laugh my ass off. Really? How nice, good for you.

The humble guy: If you need lessons or anything contact me, here is my card.

Me: Thank you, What type of music do you teach?

The humble guy: Bachata, what else? There is nothing better!

Now I know this was really happening because I was quite in a bit of pain. I’ve seen this type of thing a lot, not only with musicians also in the IT field, there are quite a few people that have incredible egos, my experience is that 99% of them are full of manure, but of course I have no prove this guy is in fact full of it, for all I know he can be the Carlos Santana of the Bachata.

It was quite funny though, specially his facial expressions, and when he started mimicking guitar lines with his voice that was precious, I’ve never been so desperate to get on with the treatment (which consist of cortisone injections, not nice I tell you), I also have never seen a room empty so fast in my life! 

Bill Gates finally gets his Harvard degree

08-Jun-07

Yes, that’s right, Mr. Bill Gates, holds a Doctorate degree from Harvard University, In what major you ask? Wait for it…………. well read it for yourself. I don’t know much of Mr. Gates life, or what his major was, when in Harvard, but if I were the Dean, and trustees I would give him the Degree, but not in that major.

That’s just me, opinions are more than welcome, in the comment section.

Source code management craziness

08-Jun-07

What the hell is going on? I am totally for competition, variety and completeness, but the surge of source code management tools is getting out of hand!

  • Git: According to Linus and some kernel developers, it’s IT. There is nothing better, oh and SVN and CVS suck and you are either a sucker or a moron if you are using CVS or SVN! (That’s the gospel of Linus, not mine.)  I agree with him that merging is the key.
  • Darcs: Is another distributed SCM, this one uses, smart; which according to the site, is a unique algebra of patches.
  • Mercurial: Yet another distributed SCM, there are quite a few projects using it.
  • Bzr: Which is yet another, though I find it quite nice in Linux, because it lets you work with existing CVS and SVN repositories, of course you need a plugin that only works in Linux.

And there are many, many, more, commercial, shareware, open source, etc.. The premise of all this, is that CVS sucks, and SVN is not good enough, to tell you the truth I feel these guys are making CVS a more desirable alternative, because while CVS has a lot of issues, they are well known and documented issues, with well known and documented work arounds. I feel more attached to CVS every passing day, It’s true that I’m used to CVS, but I have and still am giving the SCM mention above a shot, and I’m currently using SVN too.

I used to love SVN, until I had to do some real work, that needed to use the full power of the SVN, and it worked ok, but things that I was told were easy, were in fact hackish, and not all that simple. Setting SVN up is a simple affair, but the way to manage keywords and properties is not trivial, as it should be, and there are a few others things that should be simple and easy to use or administer, but in turn are quite difficult.

CVS is alive and well on many projects, both Open and closed, and I believe, it will keep a good share of the market. I’m not saying the above software is not good, it is, but they are bombarding us, and some projects are using different SCM for different modules for reasons I don’t know and will probably wont understand.

I do agree that the distributed model is very appealing and in theory is ideal, that git and the others like it, make merging trivial, and it’s quite smart too.

But that does not mean CVS or SVN is less than the above, in fact some of the largest code bases are served and managed in CVS and SVN (Yes code bases bigger than the linux kernel, a lot bigger), without problems, yes they have policies and standards in place to minimize issues, but that’s not because of CVS, it’s the nature of a big project, you need consistency, and safe guards. So in a organized work model, the distributed system may be more chaotic, and inefficient than CVS or SVN.

The sad part, is the new crop of SCM looks more of a recursive re-envention of the wheel, with very little new or unique features, that would merit one over the other. It’s like a collective exercise on how to make a distributed SCM.

Let’s see what will come out of all this SCM crazyness, hopefully something will make our collective life easier.

Here is the video of Linus on Git.