Sunday, May 5, 2013

Being a software engineer in Mexico

We come out from school calling ourselves engineers, but get a job and we become code monkeys.

This entry intends to be a description of my professional trajectory as a software developer living in Mexico.

The university years

Like most of my classmates I came from a non-computer school so I knew close to nothing about computers. Due to my tight budget I got my first PC at the end of my first semester, so I passed my first programming courses by using my friends computer, and actually making him program for me since he was two semesters ahead of me. I never really got programming that semester so I kind of hated it.

In the course of my years at the university I gradually started understanding what programming was all about, to tell the computer what to do so that it does something useful for you. That I could understand.

I have always been a really slow thinker, so my coding skills were not up to the challenge when it came to class projects and I almost always failed at delivering them on time but somehow I never failed at passing my courses.

I rediscovered mathematics after failing at calculus, those were my first days in a library in which I actually studied and learned something. Unfortunately it seems it was too late for me and I never really could develop above average skills in math though I find them utterly interesting, beautiful and AWESOME!

In retrospective I believe that's what made me value programming in latter years, when the true origin of computers was revealed to me. Mathematicians spent their better years trying converge to a formal definition of what an algorithm was, and that enabled them to develop the theory of computation which grew naturally from mathematics.

Of course most most students ignored this as it could be seen from the fact that many of my classmates could say things like: "Computers don't have anything to do with mathematics I don't know why they want us to learn this stuff." when referring to our discrete maths course.

I had the fortune of meet a couple of persons that really influenced me in developing this taste for maths and science in general, in my first semester I met Prof. Miguel Olvera who remind me you can get goose bums from understanding gradients, rotational, and deducing Kepler's equations of planet motion.

Then in my third semester I met Dr. Genaro Martínez who technically taught us nothing from the syllabus (Data Structures) but it was thanks to him that I discovered I actually liked doing research. I learned what a Turing machine was and the theory of automata and formal languages. Thanks to him I never really knew what the heck a ADT (Abstract Data Type) was until later.

He used to invite us to summer research camps with Dr. Harold V. McIntosh in which every student was given the freedom to investigate on a topic of his interest as long as show the results of their work at the end of the summer. Professor McIntosh really gave me perspective, that was the first time I met a person with a lifetime interest in science who actually had done real science in multiple fields (physics, computation & chemistry). After a couple of summers I knew it was possible to have an appreciation for science even if you yourself were not able to work as a scientist. Science became very important to me.

From then on the later half of my university years were disappointing because I felt I wasn't in the right place, I wanted to work on math, but I didn't want to start all over because I didn't have the financial resources and I really didn't have the courage to switch to math because I knew my maths sucked.

I needed to find a job as quick as possible since money was scarce and a very needed resource, so I finished the university and went directly to work as a code monkey, or that was the idea...


My first job and running away from programming

At this moment I didn't want to work as a programmer because most of my acquaintances explained to me how bad the working conditions were, the non-payable extra-hours, working on weekends, pressure from your boss and all that stuff. So I found a job as a Quality Assurance Analyst in which I really didn't need to write code at all and that was good... for a time.

As it became obvious, a friend of mine and I were the only people with programming experience in the team who could automate some very time consuming tasks and we started programming to avoid doing things manually. The time came when I had to learn how to automate funcional and performance tests.

The working conditions were just as bad as I have heard. I couldn't make sense of it: why is it that programmers and pretty much all the technical guys are the ones with the worst working hours even when the business actually depends on their ability to create solutions and fix things? Many of my colleagues were mistreated by their bosses in a way that was beyond what I could bare, fortunately I was not officially a programmer so I was actually quite relaxed and comfortable in my job.

Since I was not technically neither a tester nor a programmer there was no ladder to climb for me there, I was stuck in a position that didn't exist, a hybrid between tester and programmer, so I decided to quit and work as a developer.

The return to the source

In interviews I had to justify my move from QA to programming and this was my rationalization:
"I have been in the world of testing what other people builds, and now I have the urge to build things my self."

Even though I didn't believe it at the time, it was good enough to get me my first job as a developer. This was a very small company that builds software for brokerage firms. I had my first encounter with purely writing code as my main activity during the day and it hurt ... a lot. Finally a couple of months later the AHA! moment came and everything went much easier after that.

The cool thing about that company is that they developed stuff in multiple programming languages, C#, Java, Tawk, Ruby, C++, Perl, JavaScript. The projects were assigned depending on their priority so it was common for some developers to have to switch languages many times in a day. That made my fear of learning a new language go away.

I started to understand the meaning of the phrase: "using the right tool for the job"

I changed jobs two more times, now as a developer, going through a mix of different technologies like Bash/KSH, XSLT&XML, Web Development with JSF and Hibernate, Javascript, Objective-C with Cocoa Touch which is my current main programming language.

The more I worked as a developer, the more I like the process it self, research, analyzing, designing, and testing... I still hated the development part of it. I had solved the problem, it was not a job for me to implement the solution.

The more contact I had with code from other developers the more unsatisfied I was with the quality of my code and their code, so I started to get strict about some things like:


  1. comments: I tried to write comments so that if I ever needed to go back an change something I didn't have to re-read all my code to find what to change. Reading code is in many occasions slower that reading good comments, 
  2. readability & length of lines of code: I tried to write code that was easy to understand with just a glance and that meant short and simple sentences, 
  3. the size of methods & modularity: divide your goal in as many goals as you can and make each subgoal as simple as possible, this leads us to the next, 
  4. reusability: if you have small modules that do simple tasks, chances are high that they will be useful in the future and that will make your life easier, 
  5. cleanness: don't include unrelated code. Make each module as independent as possible and as agnostic as possible, another way to say this is try to use loose coupling when coding, your module shouldn't care who is calling it to be able to perform it's task correctly, 
  6. elegance & concreteness: your code should be pleasant to read and convey a sense of elegance such as that you see in mathematical proofs, in fact you can see each program as a proof to a theorem, the shorter and the more concise the better, one should not have to write more code than what is absolutely necessary to solve the problem at hand but don't get me wrong this doesn't mean you will write less code, just that the final product should be as concrete as possible. 
  7. refactoring: improve your code, abstract, simplify, generalize. Usually you end up writing many times more code than you would normally do, but it's for a good cause, refactoring improves cleanness, reusability, size of methods, modularity & readability and you should try to do it as much as possible. After a number of iterations your product will have better organization and perhaps a smaller footprint.
  8. version control: be it centralized or distributed you should try to have a way to know the history of your code. It comes in handy for solving bugs, adding or removing features managing different versions of your product, etc. Besides is an excellent source of information on developer performance, you can get all kind of useful stats from a repository.
  9. unit testing: the latest but not less important is automated unit testing and all the possible techniques to make unit testing as useful as possible. You shouldn't need to load in memory the whole system just to test a small submodule. Always try to create code that is easily testable in an automatic manner so you can find bugs faster.
There are many other recommended practices such as continuous integration, code auditing, etc. And ALL THAT without event mentioning a methodology. There are so many things to learn and to improve  that it is overwhelming.

I really started to improve my code quality and I'm still working on it but all of these truths that I learned from more experienced programmers such as Donald Knuth became the source of a lot of frustation as you will find out soon...


Of finding love and deception

After I reconciled my self with writing code, I saw everything with new eyes, it no longer was necessary to fight the code, I could make reading and writing it a pleasurable experience.

The problem was that I was the only one seriously concerned about code quality.

As it turns out I have never worked in a IT company but only in the IT area of financial firms and those are two very different stories. An IT company has to find ways to enforce quality in their products, since in many cases the code is The Product. In contrast an IT area of a financial firm is usually not so worried on how things are being done, but that they're being done on schedule.

In Mexico there are no big IT companies, and most of the people coming out of universities go to work in the financial sector: banks, brokerage firms, bonding companies, or end up working for consulting companies whose clients are financial institutions. It's all about money.

The main reason to go to the financial sector is that the paycheck is bigger, though the work conditions are markedly worse than in other sectors. Bad infrastructure, connectivity limitations due to security concerns, awful office space, uncomfortable chairs and very high levels of stress among other things.

To all of this you have to add the very lacking educational level with wich students come out. My algorithms and data structures knowledge sucks and it hasn't improved much in the almost 6 years I have been working in IT, four as a software developer.

Even though most of us programmers in the financial sector are payed above average our level is rather low when it comes to code quality. That plus the fact that research, analysis and design are terms unknown or even Taboos when it comes to developing software. I cannot ask my boss for more time to design, or test without getting strange looks, even my colleagues believe that if the code compiles and runs then there's nothing else to do and you can forget about it.

Developers are kept in ignorance about design and analysis, working in independent cells. Many times each cell reproduces the work already done by other cell, and this goes on ad nauseam. 

Most developers I know have not improved their code quality even after 8-10 years of experience in the industry. Their code is abstruse, hard to read, monolithic, uncommented, hard to maintain, etc, etc. I believe it's mainly due to the fact that the incentive to change that is little or non-existant, as I've said before no boss I have ever had cares really much about the how, they just want their application ready for a given date.


And the problem is...

All of this becomes a problem when you want to take the next step and jump to the next level, when you are genuinely interested in working for a company that makes a difference, you don't have the level required to be accepted easily.

The last two or three months I have been sending my resume to foreign companies with the hope to acquire international experience, improving my skills and improving my quality of life but so far I have only tasted the bitter truth of my situation. I currently don't have the level those companies need.

I'm still struggling to accept the possibility that the knowledge gap is really that big when it comes to software developers.


... and that my friends is the bitter truth about being a Code Monkey in Mexico.









Thursday, January 24, 2013

What do prominent scientist & thinkers of our time have to say about TVP, TZM, etc.

It's been a while since I've been wondering: if the main proposal of TVP is to use the scientific method to solve social problems, then why is it that no prominent scientists/thinkers have been drawn to support it publicly?

Anyone has any thought on this?

Supposing some of those people are even aware of TVP: what is it that prominent scientists & thinkers of our time see that most of us don't about the flaws of the proposals of TVP?

Those people are really smart, so I think it would be nice to hear a strong attack from scientists and thinkers on those flaws.

As of today I haven't read or heard of any recognized intellectual associating himself with TVP, there must be a reason, other than not being aware of it, right?

Please let me know if have any useful information on why TVP has almost no support from the scientific community.

Sunday, September 18, 2011

Thoughts on trust

I always find it frustrating to realize that our civilization is based on many very important concepts such as respect, love, trust, justice, honesty and truth, which are most of the time and by most people misunderstood, misused or even unknown. Most people uses them in their daily lives but have never stopped to question them, this post is about one of them, Trust.

After reading for a while on the web, I finally reached a definition that seems to be good enough, at least for the moment, to start with. I think it may change the more I understand about it, but lets keep it simple for now.

Trust (Definition). The ability of a person to predict the future behavior of another person, or object. 

I now analyze the logical implications of this definition. First, trust is not something that we can give to another person or object, it is something we develop by improving our ability of predicting 
future behaviors.

How we gain trust 

Trust can be increased by experience. This is done by a series of experiments in which have a set the initial conditions and try to predict the outcome, if it fits your expectations, then you gain trust in that person or object. The better you are able to predict the more confident you feel about the person or object. 

In the case of predicting the behavior of people, experience may give us unrealistic ideas about our ability to predict future behaviors. Predicting another person’s actions is rather difficult, that’s why for some people it’s so hard to trust someone.  

Explicit and implicit trust agreements

I want to analyze two scenarios in which is common the misuse of the concept of trust. For example, take two persons, they met, start getting along, and after a while they start to share with each other all sorts of information, personal, shameful, funny, confidential, etc.

The first scenario is when there’s not an explicit consensus about what is implied when trusting someone. Depending on their background, they may have different views, for example, about which information is confidential. Thus it may happen that one of the persons shares confidential information with a third person, which may be regarded as a betrayal. 

The second scenario is when there is an explicit contract in which one of the persons asks the other to not share a given information with other persons, then if that person still shares that information then it could be seen as a betrayal on purpose. 

In any case, the person that feels betrayed has no right to blame the other. You cannot blame other persons because you weren’t able to predict his behavior. No one is to blame. It’s not the betrayed person's fault that he cannot predict the other persons behavior. And it’s not the betraying person’s fault that the betrayed person wasn’t able to predict his behavior. 

Self-confidence 

It’s also possible for a person to not be able to predict his own behavior. We know our abilities, but we also tend to overestimate our strengths, and underestimate our weaknesses. It is very common for humans to fail at trying something because we had unrealistic expectations 
about ourselves. 

We gain self-confidence in the same way as we gain trust in other persons or objects, by experience. The best way to know our limits is to put them to test many times, and have the honesty to accept when your performance matched your expectations when it didn’t. Keeping track of this may help us plan strategies to carry out bigger projects each time, since we’ll have the hindsight of knowing which mistakes we made, and try to correct as many of them as possible.

Conclusions 

If you agree with this way of seeing trust and try to be honest with yourself, you should never blame other for betraying your trust, ever. This is the most important consequence of this view of trust, and the most hard to accept given that most of us has used the term trust in a not well-defined manner for a long time. 

You cannot blame other people for your inability to predict their behavior. Even when it comes to the expectations about ourselves. 

We shouldn’t dive into desperation when failing to predict, one way to improve our ability to predict our behavior or performance is by carrying out lots and lots of experiments and analyze with the benefit of hindsight what actually happened. 

Even though we can conceptually accept these ideas about trust, it’s easy to feel down because we feel betrayed, even if we are able to rationalize it. That, I haven’t been able to find a way to counteract, but I 
think rationalization and the  study of depression of this kind may actually help overcome it, or at least 
transcend it while you’re are analyzing it. 

Monday, July 11, 2011

Why we don´t need democracy. What we need is Science.

Democracy: a form of government where all the people have equal say in the decisions that affect their lives.

The world is full of all kinds of people, all kinds of ideas, beliefs, superstitions, prejudices and more...
If we were ever to implement a democracy we would have to accept and respect ideas that are direct in opposition with our own.

We would have to give equal validity, for example, to the ideas of people proposing to use science as a tool to improve our lives and to those who want to take decisions based on the readings of the testicles of a goat.

We don´t need a democracy because not all ideas have the same validity.

Furthermore we should not be shy when declaring that someone else´s ideas are wrong,  as long as we have the proper evidence to prove such an affirmation.

A natural approach to a form of government would be one that takes the evidence into account for any kind of decision making process, for example the one proposed in the Zeitgeist III movie, part 3 (1:29:20):


Method of government

I say government but what I mean is not a group of people creating and enforcing rules. I mean a global management system which is able to determine the best course of action given the current information about the issue it is to decide about.

Now, the method is simple and we have used is for a little more than three centuries with awesome results (unfortunately not as a form of government); its name Science. 

Science offers many desirable features of any type of government, it is open, self-correcting, free, evidence-based, testable, reproducible, and its finding are free from opinion and bias towards any special group of people, and even when an advantage is sought by fallible humans, it is openly exposed for everyone to see and challenge.


Sunday, March 27, 2011

RFC: The venus project

It's been a couple of months since I've been wondering:
What do people think about the ideas proposed by The Venus Project?


It is possible that people may have never heard of it,
in that case here's the link to it's site but don't worry the premise is very simple:
The objective of the Venus Project is to use the scientific method
with social concern.


What they propose is rather simple to state:
to actually use evidence as the basis for our decisions.


Now there are many views out there, many opposing the ideas
put forward by TVP, unfortunately many of them are uninformed.


I can identify mainly the following arguments:
  • It is not possible. We'll never be able to get along.
  • It is not worth the effort. 
    • What we have works good enough.
    • I won't be around to see the results
  • It doesn't make any sense.
    • Their premises are flawed and thus their conclusions are false.
  • It is not necessary to do anything, we'll get there anyway, its' the only choice we have, .... that or extinction.
The more I think about it the more convinced I am that I'm in the last category.
I will email this post to some people and see what happen, hopefully someone
will comment. Although my personal experience tells me that most people are
too lazy to read something they are note interested in, and unfortunately most people
are so busy living their lives that they're note interested in improving the world they live in.


Anyway I would like to know what you believe. Let me know with your comments.

Saturday, March 27, 2010

The Zeitgeist Movies: My Personal View

This is first from a series of posts about my personal views on the Zeitgiest movies and related topics such as the Zeitgeist movement, the Venus project, and more. 

The first thing I would like to address is the fact that so many people focus on trying to demonstrate the invalidity of the movies. 

True or not?

Whether or not every statement in these movies or any movie of the kind is true doesn't change the fact that the world as it is now is really screwed. Be it because of the monetary system, cultural superstitions, governments incompetency or many any other causes, the problems are not going to be solved by pointing the finger at each other only.

The point is not to agree with the movies or discredit them. Many people concentrate all their efforts in trying to demonstrate the invalidity of the movie and they are happy when they show that there's a statement that is false or taken out of its original context to make it fit the purpose of the movie. Many of them use variations of the following excuse to avoid going through the rest of the material presented:
"This and that statement are false, so everything else is false, even the things that the authors of the movie might say in the future. Oh, and everything associated with it is also a conspiracy theory, and so on ...." 
And I cannot blame them since I myself have use a similar excuse when I find something that doesn't make sense at all because there's nothing to back up it's validity. So in that sense I understand them but, the general idea of the movies doesn't require you to search for a lot of evidence since you have it all in front of your eyes. Some examples:

Similarities among religions. It is not hard to realize that many religions have common origins since obviously we (people) have common origins. So it is reasonable to expect some similarities. Denying that is a fruitless endeavor, a much more productive approach would be to try to understand why are there similarities instead ignoring them.

Nevertheless, arguing about religion is itself useless since religion, although it was a necessary step in our evolution as a species sounds now more like a bunch of crazy superstitions and senseless rules, not based in any evidence, all that mixed with a lot of moral principles supposedly given to us by some supernatural entity since we're not intelligent enough to come up with them since they're very very complex, e. g., "Don't kill me and I won't kill you", that's pretty hard to come up with, Isn't it?

Corrupted behavior. Common sense, there's people who would do almost anything for money or as a revenge, so it is very possible that the 911 attacks were planned by any of the two sides. Both sides had what I would say are  "good reasons" to justify those acts, only the US couldn't admit its "reasons" to the American people.

Whether or not we'll ever know the whole truth behind those attacks, it won't change that many people lost their trust in their government. Which is good since most people in governments of the different nations are even more stupid than the average person, why should we trust them more that we trust ourselves?

Just like religions, governments are only one more treatment for the symptoms of the sickness, they won't be able to reach the root of it.

Corrupted behavior (Take 2). This is my favorite and I want to make this separate points:
  • Take the whole world as a single system. This system produces a thing called "Money". The systems lends itself this money, which is a bit stupid. How in the hell can you be indebted with yourself?
  • In the history of money it is well known that there has been times when governments print money (to fund a war for example) that is not backed up by anything. The only thing that could stop a government from printing money was the lack of the resources to print it. Money can be printed by these people at any time, who's going to stop them anyway? They're the "government". 
  • Now that most of the financial operations are being done electronically, the limit to how much money governments or other institutions (e. g., banks) can create is the amount of memory available on their servers.

So, there's no need go on very complex arguments to try to explain why the movies are right or wrong, we're not blind, we're able to see how bad things are with respect to societies.

But that's not even the tip of the things that happen in our universe. Many species have come and gone during the last four billion years approximately, we're just one more species, or maybe not. Something that makes us special with respect to the other species is that, we seem to be the first that can actively change its environment significantly. Unfortunately we've been too lazy when it comes to foreseeing the consequences of our actions. We're still a very short-term minded species. Hopefully we'll be able to change that before it's too late, or maybe natural selection will help us with that.

For the moment that's it. I hope to have the time to continue this series soon.