Tech Trained Monkey

Everyday Problem Solvers

Category Archives: People

Analysing success

As the 1940’s air war in Europe intensified, the Allies faced a major problem. Their bombers would leave England by the hundreds, but too many of them didn’t return, brought down by extremely heavy enemy flak. The Allies desperately needed to beef up the armor on their planes to provide protection, but armoring an entire plane, or even an entire cockpit, involved far too much weight. How could they choose the few especially vulnerable places to be armored?

A couple of clever engineers solved this problem with a counter-intuitive analysis. After comprehensively logging the locations of flak damage inflicted around the fuselages, engines, and cockpits of planes returning from hundreds of bombing runs, they calculated Read more of this post

Why english

As you know (or not) I’m Brazilian. I was born in Brazil, studied in Brazil, I work in Brazil, and (I’m ashamed to say) never been to a English speaking country. Nevertheless my blog is written in English and more often than not I hear the question “Why English? Why not Portuguese?” and I my answer always is “Because I want to reach as many people as possible”. Reaching people is not why I write this blog (my motives are strictly selfish) but it’s the motive why I do it in English.

I also program in English. When people ask me why I reply: Read more of this post

Creativity, Technology and Necessity

Last sunday I watched The Avengers (awesome movie by-the-way, Kudos to everyone involved) and yes The Hulk is awesome, Scarlett Johansson is hot and Thor does have a mighty hammer, yes, but my favorite character is not a human, it’s a software, and it’s know by “Jarvis”. In fact what I like most about Iron Man movies is not the plot, or characters or Robert Downey Jr. What I like most is the tech, specifically Jarvis.  Read more of this post

The “-2000 lines of code” report

First of all I’m sorry I’ve been so absent. I’m working on something of my own and I hope I can make it stable and working properly so I can talk about it here.
Meanwhile I read a nice post and I’m reposting it here:

In early 1982, the Lisa software team was trying to buckle down for the big push to ship the software within the next six months. Some of the managers decided that it would be a good idea to track the progress of each individual engineer in terms of the amount of code that they wrote from week to week. They devised a form that each engineer was required to submit every Friday, which included a field for the number of lines of code that were written that week.
Bill Atkinson, the author of Quickdraw and the main user interface designer, who was by far the most important Lisa implementor, thought that lines of code was a silly measure of software productivity. He thought his goal was to write as small and fast a program as possible, and that the lines of code metric only encouraged writing sloppy, bloated, broken code.
He recently was working on optimizing Quickdraw’s region calculation machinery, and had completely rewritten the region engine using a simpler, more general algorithm which, after some tweaking, made region operations almost six times faster. As a by-product, the rewrite also saved around 2,000 lines of code.
He was just putting the finishing touches on the optimization when it was time to fill out the management form for the first time. When he got to the lines of code part, he thought about it for a second, and then wrote in the number: -2000.
I’m not sure how the managers reacted to that, but I do know that after a couple more weeks, they stopped asking Bill to fill out the form, and he gladly complied.

About “Who should learn programming”

As most of you already know, there’s a buzz about who should learn to program and who should not. I will say now that im in favor that everyone should, and I say this because as you learn to program you learn a set of techniques that will most definitely help you all of your life.

Most people who are discussing this matter are focusing on the question “Ok, I learned to program, now what do I do with it?”. My answer to this question is: “I don’t care!”. Read more of this post

Logging and software development maturity

According to Wikipedia maturity is:

a psychological term used to indicate how a person responds to the circumstances or environment in an appropriate manner. This response is generally learned rather than instinctive, and is not determined by one’s age.

It is a widely know and accepted fact that write logs is a very good thing, since it helps you find out what happened at a given moment of time. It is rule number one on the universal developer book, if it existed… But again and again I find a lot of programs that just don’t do it.

I’m used to clients calling and say that something is not correct with the product, but it makes me cry when I ask for the logs and he says that there are none and I want to kill the dev who didn’t write log. I always find the bastard. If by any chance it is not a intern, oh help me lord, some blood will be shed!

Logging came to me as a very instinctive thing. My firsts programs didn’t write any log, but of course, I was the only one using them. But as I got better and better i felt the need to better control my “world”. I was scared of the fact that a problem would occur and I wouldn’t be able to know about it. In order to really evolve and grow as developer one needs to make more complex and bigger programs and, more importantly, learn from ones own mistakes. Logging is perfect for the learning part, because you don’t need to bother the users with questions and other stuff (if you logged all the information you needed).

One might start to wonder what does it have to do with maturity. Just logging is not enough. Logging for the sake of it does not help. You need to have a consistent, useful, categorized and, most of all (I think), easy to track log message. It takes real-maturity to know how to log. You should log everything that happens but each event must be logged in a particular way. Logging user interactions that same way you log Null Reference Exceptions is not very helpful. Remember that logging provides information and information is gold!

A lot of people do write a bunch of logs. They actually log the entire thing. Take World of Warcraft for example: Everything you do in the entire game can be traced! They can trace every little critter that you killed. They know which weapon you used. They log everything! But, as i said before, just write messages is not enough. You have to write them in a understandable, easy-to-track way. If a developer in your team can’t trace back, for example, the users actions, such as buttons clicked, radio button choices, in-screen info, check-boxes selected, etc, your log is not good. It might help you find and solve a problem, but it could do a lot better. I recently learned a important lesson.

I must say that I have never had a problem with production environment software (Yes, my programs bugs, but always very soon after deploy, so I was always very close by to help). Thank god all programs that I wrote never gave me serious headaches. Until a couple weeks back. Deploy went fine and everything was peachy. So one beautiful morning the client called me and reported a issue. As always I asked for the logs, he sent me and then the my world felt apart. I could not trace what was going on. Everything was there, but i could not set a time-line to the events. Due to multiple front-ends and multiple web services servers it was very, VERY hard to track what happened to a user. I had a special hard time figuring out what messages on the web services logs belonged to whom. It was a nightmare. I wanted to cry. But I managed to do it and I matured a bit… no, I matured a byte… sorry for the pun…

So now I’m developing a new logging lib and a log-reader tool (feel free to “borrow”) that is planned to solve the multi user/thread/server scenarios. The current log lib we use today is perfect to developer and single-user/thread/server scenarios. You can easily “follow” up what and when it happened, what came after what and so on. But when multi-thread/multi-users/async-operations come-out to play things get ugly. Since the current lib only logs the time and severity of the event its very hard to track continuous actions of a user, or even the path of a particular thread.

The lib itself is not enough though. The real magic is the log reader. The reader creates a visual path of the massages. It literally creates a “fork” for multithread visually showing parallel operations and stuff! Its getting very cool when its ready ill post the source code… but now back to maturity…

I must disclose that I’m not the most seasoned developer out there… for christ sake I’m only 24, but this much I can say: Write easy to read and understand log messages. Your kids will be thankful! Ok maybe not, but you will when you need to know whats really going on!

How to Make a Killer Presentation

I know that the internet is full of posts about this, and trust me, I’ve read a bunch of them, and noticed that they’re all basically the same. They all focus on how and what to put on the slides, they compare PPT and Keynote and ultimately try to teach how crowd concentration works and how to retain your audience attention.

The fact is that having perfectly built slides, beautiful pictures, nice videos and demos does not guarantee a killer presentation. A killer presentation is a presentation where you expose whatever you want to expose knowing that the viewer is listening to that info, and that he will remember that info and pass/work it around.

The first and most important topic on how to make a killer presentation is to KNOW whatever you’re talking about. Ask yourself: Can I explain what im trying to say to a 6-year-old? If the answer is no, then you don’t know it yourself. Einstein said that. Steve Jobs is widely known as a presentation master and he also shared this notion. PPT/Keynote were banned from internal meetings, if you presented something using a PPT instead of a whiteboard you would be interrupted and deemed incompetent. Steve only used slides for public presentations. He also was a firm believer that if you know something you don’t need slides to explain it!

The second item in our list is “Be Confident”. Second guessing yourself on stage is a fatal mistake. When you enter the stage you have 70% of the crowd “trust”. This means that they trust you but there’s a silent voice on their heads telling them that things are never as good as they sound. If you’re confident and show that you do know what you’re talking about they won’t question. If you second guess yourself the little voice start to get stronger and eventually it will take over and you will be talking to empty-full room.

The third order of the day is “Be In Love”. Being confident don’t get the other 30% of the crowd’s attention. Showing passion for the topic on the stage does. When you show that you really care about whatever you’re presenting, that you worked your “but-off” to be there and tell them whatever is your saying, the crowd subconscious will notice “the love in the air” and will silent the inner voice.

The fourth tip is very simple but very often overlooked: “You are presenting, not the slides”. In a presentation the slides are not the focusing point. The presenter IS! Slides are helpful but you, the presenter, is the core of the presentation. Doesnt matter if you’re presenting a new Presentation platform. Slides are “support material”. Steve was a master in this point: His slides were always very basic, most times they had only one number, or maybe three words or even only a photo. The focus was always on Steve.

The dessert is: “Don’t fall in love for your own voice”. When preparing the presentation ask yourself: “What if I don’t talk about X?”. Always question the “weight” of your presentation. I usually say that if your slide has more than 10 words a lot can be shrunk. Think clean, think efficiency!

Reinvention of the Real Programmer

In classical computer science the Real Programmer (a.k.a Hardcore Programmer) is a mythical man who writes code almost in bare metal. The most high level language he uses is ANSI – C and he debug code in hexadecimal and things like that…

I don’t know anyone that fits that description but investigating and (mostly) philosophizing I came up with a real-world definition for the Real Programmer:

  • The Real Programmer leaves no broken windows behind. Ever.
  • The Real Programmer works with his project manager, not for his project manager.
  • The Real Programmer does not complain about anything. Never.
  • The Real Programmer knows that fixing bugs is more important than implementing new functionalities. (See first point.)
  • The Real Programmer works because he wants to, and when he wants to.
  • The Real Programmer uses a IDE, and high level languages, but he’s not afraid to go back to Assembly if necessary.
  • The Real Programmer does not re-invent the wheel. The Real Programmer re-engineers and re-implements the entire car.
  • The Real Programmer documents his code, in a way that a six-year-old can understand it.
  • The Real Programmer knows that the currency for computers is performance. He’s always thriving for the best performance so he can pay a beautiful interface and other items.
  • The Real Programmer does not TDD. The Real Programmer knows that only making the “bare minimum” is not enough to get to Carnegie Hall.
  • The Real Programmer delivers, but he’s not afraid to delay milestones if he feels that his work is not finish yet.
  • The Real Programmer does not fear tight schedules and rejoices on phrases like “The client changed his mind completaly”.
  • The Real Programmer knows how to separate trendy frameworks from real groundbreaking frameworks.
  • The Real Programmer doesn’t wear suits.
  • The Real Programmer’s computer is not a desktop nor a server. It’s a workstation with more than 1 monitor.
  • The Real Programmer only uses headphones when he’s working in a noisy environment.
  • The Real Programmer is always on top of the situation. He’s calm and never looses his temper. Like a Zen Buddhist master

Think I forgot something? Please fell free to comment!

Leading by Example

It takes discipline for development teams to benefit from modern software engineering conventions. If your team doesn’t have the right kind of engineering discipline, the tools and processes you use are almost irrelevant. I advocated as much in Discipline Makes Strong Developers.

But some commenters were understandably apprehensive about the idea of having a Senior Drill Instructor Gunnery Sergeant Hartman on their team, enforcing engineering discipline.

Scene from Full Metal Jacket, Gunnery Sergeant Hartman Pointing
You little scumbag! I’ve got your name! I’ve got your ass! You will not laugh. You will not cry. You will learn by the numbers. I will teach you.

Cajoling and berating your coworkers into compliance isn’t an effective motivational technique for software developers, at least not in my experience.If you want to pull your team up to a higher level of engineering, you need a leader, not an enforcer. The goal isn’t to brainwash everyone you work with, but to negotiate commonly acceptable standards with your peers.

I thought Dennis Forbes did an outstanding job of summarizing effective leadership strategies in his post effectively integrating into software development teams. He opens with a hypothetical (and if I know Dennis, probably autobiographical) email that describes the pitfalls of being perceived as an enforcer:

I was recently brought in to help a software team get a product out the door, with a mandate of helping with some web app code. I’ve been trying my best to integrate with the team, trying to earn some credibility and respect by making myself useful. I’ve been forwarding various Joel On Software essays to all, recommending that the office stock up on Code CompletePeopleware, andThe Mythical Man Month, and I make an effort to point out everything I believe could be done better. I regularly browse through the source repository to find ways that other members could be working better.

When other developers ask for my help, I try to maximize my input by broadening my assistance to cover the way they’re developing, how they could improve their typing form, what naming standard they use, to advocate a better code editing tool, and to give my educated final word regarding the whole stored procedure/dynamic SQL debate.

Despite all of this, I keep facing resistance, and I don’t think the team likes me very much. Many of my suggestions aren’t adopted, and several people have replied with what I suspect is thinly veiled sarcasm.

What’s going wrong?

I’m sure we’ve all worked with someone like this. Maybe we were even that person ourselves. Even with the best of intentions, and armed with the top books on the reading list, you’ll end up like Gunnery Sergeant Hartman ultimately did: gunned down by your own team.

At the end of his post, Dennis provides a thoughtful summary of how to avoid being shot by your own team:

Be humble. Always first presume that you’re wrong. While developers do make mistakes, and as a new hire you should certainly assist others in catching and correcting mistakes, you should try to ensure that you’re certain of your observation before proudly declaring your find. It is enormously damaging to your credibility when you cry wolf.Be discreet with constructive criticism. A developer is much more likely to be accept casual suggestions and quiet leading questions than they are if the same is emailed to the entire group. Widening the audience is more likely to yield defensiveness and retribution. The team is always considering what your motives are, and you will be called on it and exiled if you degrade the work of others for self-promotion.

The best way to earn credibility and respect is through hard work and real results. Cheap, superficial substitutes — like best practice emails sent to all, or passing comments about how great it would be to implement some silver bullet — won’t yield the same effect, and are more easily neutralized.

Actions speak louder than words. Simply talking about implementing a team blog, or a wiki, or a new source control mechanism, or a new technology, is cheap. Everyone knows that you’re just trying to claim ownership of the idea when someone eventually actually does the hard work of doing it, and they’ll detest you for it. If you want to propose something, put some elbow grease behind it. For instance, demonstrate the foundations of a team blog, including preliminary usage guidelines, and a demonstration of all of the supporting technologies. This doesn’t guarantee that the initiative will fly, and the effort might be for naught, but the team will identify that it’s actual motiviation and effort behind it, rather than an attempt at some easy points.

There is no one-size-fits-all advice. Not every application is a high-volume e-commerce site. Just because that’s the most common best-practices subject doesn’t mean that it’s even remotely the best design philosophies for the group you’re joining.

What I like about Dennis’ advice is that it focuses squarely on action and results. It correlates very highly with what I’ve personally observed to work:the most effective kind of technical leadership is leading by example. All too often there are no development leads with the time and authority to enforce, even if they wanted to, so actions become the only currency.

But actions alone may not be enough. You can spend a lifetime learning how to lead and still not get it right. Gerald Weinberg’s book Becoming a Technical Leader: an Organic Problem-Solving Approach provides a much deeper analysis of leadership that’s specific to the profession of software engineering.

Within the first few chapters, Weinberg cuts to the very heart of the problem with both Gunnery Sergeant Hartman’s and Dennis Forbes’ hypothetical motivational techniques:

How do we want to be helped? I don’t want to be helped out of pity. I don’t want to be helped out of selfishness. These are situations in which the helper really cares nothing about me as a human being. What I would have others do unto me is to love me– not romantic love, of course, but true human caring.So, if you want to motivate people, either directly or by creating a helping environment, you must first convince them that you care about them, and the only sure way to convince them is by actually caring. People may be fooled about caring, but not for long. That’s why the second version of the Golden Rule says, “Love thy neighbor”, not “Pretend you love thy neighbor.” Don’t fool yourself. If you don’t really care about the people whom you lead, you’ll never succeed as their leader.

Weinberg’s Becoming a Technical Leader is truly a classic. It is, quite simply, the thinking geek’s How to Win Friends and Influence People. So much of leadership is learning to give a damn about other people, something that us programmers are notoriously bad at. We may love our machines and our code, but our teammates prove much more complicated.

Is the ability to use a search engine more valuable than memory itself?

Einstein still amazes me… Quite some time ago (i could not get a precise date) he said

Never memorize something that you can look up. – Einstein

and it got me thinking: Although memory increases our productivity (asking google everything is very time-consuming), is it really necessary? I know that this is a highly radical idea, but today you can easily “load” all the specific info you need to accomplish a task in a couple of minutes! How many times have you caught yourself checking google for semantics of a given programming language??? I find myself googling for LINQ semantics all the time…

There is no doubt that its extremely hard to go by a problem that has not yet been solved. Most of the already solved problems has a How To posted on a blog or something (ok, you may not find out a how to build a nuke…). The difficulty lies on finding the place where the How To is.

It’s a fact that some people know how to make better searchs in google than others. My mother for example usually query google the following: “How can I make a delicious dish using X and fresh tomatoes?”… I would query “X tomatoes recipes” instead… and probably get “better” answers. But the point here is: she doesn’t query “How can I tell that tomatoes are fresh?” or “How can I tell that the potatoes are ready?”… she memorized it already…

I know what you’re thinking. You’re thinking that a lot of times you can’t choose what to remember what to forget, and sometimes doesn’t matter how hard you try, you just cant remember a few simple things. I’m not arguing about that, I know that if you search something over and over again is very likely that at a point you will just memorize it and there’s nothing you can do about it. I just find very odd that some people are really focused on memorizing stuff. I know a couple of doctors that actually say that if you know where to look for information and know how to cross them, a 15 old teen can diagnose almost all deceases.

If information is available and easy to find why people try so hard to memorize them? Learn how to make it more accessible instead! Maybe its a cultural thing… my mother’s, and probably yours too, education was based on memorization! Subjects as history and geography can be really tricky… Few schools notice that understanding why something happened is more important that knowing when it did! To hell with schools, very few people get it! Its like math formulas: If you don’t know when and how to use them it doesn’t matter how many you know.

Google can sure help us remember formulas in a few seconds. But he does take a lot more time to teach us how to apply and use them… if he ever manage to do so…