Mar 14 2010

Zombie Code

In this conversation tweet snippet I rant about dead code when someone noted that in a Murphy’s Law sort of way, you don’t need dead code until you delete it. Thank goodness for version control systems.

Zombie Code

  • @techknow: It is a dead end maintaining dead code, unused, and unreachable code.
  • @archiloque There is something schrödingerian about dead code: it is often unreachable *until* you remove it.
  • @techknow: LOL my question is, if you have dead code in a live site is that considered zombie code or sleeper cell code?

Here I question how evil Google really is when a friend warns me that whatever you say about Google may be used against you by going viral. Google is big brother and it’s CEO thinks we can place our trust in it before our governments. I can’t wait until Google hires Hilary Clinton as the Senior Vice President of the Division of State at Google.

Indexable

  • @techknow Google, if you are not evil why you have to make that your motto? Who are you trying to convince?
  • @vladgur: Don’t hate Google on an indexable medium.
  • @techknow: Good advice, Google’s cache does not forget.

Spaghetti Code is when the code is so convoluted that it’s code path resembles a plate of entangled spaghetti. Here I rant about working with code base that smells like a bad plate of spaghetti.

Code for Dinner

  • @techknow: It is possible to make Spaghetti Code out of Obeject Oriented Programmmmmming. Om nom nom.
  • @mcory1: Possible? Heck, its pretty easy sometimes, even if you know what you’re doing ;)
  • @techknow: I’m working on some code that looks like a cross between Spaghetti Code and Lasagna Code. I need a bottle of wine to digest/debug this.

Chat Roulette is one of those ideas that are so simple that they are genius. Here a friend and I compare and contrast between Chat Roulette and the MTV television show Jersey shore.

Jersey Roulette

  • @techknow: MTV or VH1 should do a reality show based on chat roulette.
  • @jzy: It’s called Jersey Shore.
  • @techknow: LOL from what I have seen of Jersey Shore, I would think they used chat roulette to cast the show.
  • @jzy: I was just joking of course, no offense to Chatroulette.
  • @techknow: All kidding aside, I think chat roulette is a great idea. It reminds me of the early days of Twitter, I wish they had an open API.

Mar 8 2010

Top Worst Java Errors

I’ve had my fair share of Java bugs. There is a stage in a programmer’s career that he or she either knows that they rather manage a convenience store or that they can debug common Java errors just by the way the code smells. Here are my list of worst common Java bugs I have been frustrated to solve. These issues have come up more than once, most often in code that I inherited, and had to fix under a time crunch or tight deadline.

mkdir
I’ve had to fix a few bugs related to the mkdir() method in the File class. The mkdir() method creates or makes a new directory. The mkdir() method only creates one directory. But in many situations, especially if the end user is supplying the path of the directory to be created, you will need to crate a whole new directory hierarchy. Often times you will create a directory and subdirectories at one time. In these situations, you want to use the mkdirs() method instead.

Index Of
Most software bugs are caused by assumptions made by the programmer. One common assumption I see developers making is that file names have only one period to separate the file name from the file extension. It is common to see code that finds the first period and everything after that period is assumed to be the extension. Other assumptions regarding file names include that extensions are three characters long or that the file name does not have special characters. The following code snippet is a dramatization of code I have seen in the field, which incorrectly tries parse the file extension.

String filename = "a.file.path.ext";
int index = filename.indexOf(".");
String extension = filename.substring(index);

A different approach, which would have the desired result is to use the lastIndexOf() instead.

Null Equals
I’ve seen a whole slew of null pointer exceptions due to this sort of Java bug where a possibly null object reference will be used to check the equality of a hard coded constant. Here is the code snippet of what I mean.

boolean equals = maybeNullObjectReference.equals("CONSTANT");

The object reference may be null, so you need to check for null values. I found that if you switch your thinking, you can write less code and still achieve a better solution that having to constantly check if the object is null. A safe approach is to use a object that you know is not null, the constant value.

boolean equals = "CONSTANT".equals(maybeNullObjectReference);

Equals
Yet another Java bug that can be easy to miss is the use of the Java equals operator instead of the equals() method. The equals operator returns true if the two object references you are testing point to the same object instance. The equals operator compares the equality of the object references, not the object values but since it reads the same it is easy to overlook.

Map Key
The worst Java bug that I had to ever deal with involved the use of mutable objects as keys in hash maps. The implementation of the Java HashMap is really simple, the hash code of the key is used to locate the bucket in which to store the map entry, which consists of the key/value pair. Once you put a key/value pair in a hash map you should not change the value of the key, ever, in any way that changes the hash code. If the key is changed where it generates a new hash code, you will not be able to locate the correct bucket in the HashMap that contains the key/value pair. I had a scenario where key/value pairs were stored in a HashMap, then the keys where updated generating a new hash code, and there after the value was not able to located.


Mar 6 2010

Retweet February 2010

From time to time I just blast tweets about software development, project planning, team dynamics, or whatever else comes to mind. Here is a synopsis of recent tweets and rants. If you want to follow the conversation follow me at techknow and/or juixe and I’ll be sure to follow back.

Software Development

  • Androids dream of electric sheep and I of bytecodes.
  • A large number of performance issues can be tracked to overuse of for loop, sequential search.
  • I hate it when a fatal critical defect gets assigned to me after 5:30PM. I think QA does this on purpose, some sort of revenge.
  • Carpenters’ rule: measure twice, cut once. Programmers’ rule: design twice, code once, refactor as many times as necessary.
  • You can’t do real-time software engineering where you fix bugs as they are discovered.
  • Compilation cycle costs productivity.
  • It is unbelievable the amount of work, time, and meetings are dedicated to features that are useless in the field and limit usage.
  • SEO Secret Sauce: Always be writing good content.
  • I consider an interview good where the interviewee talks more than the interviewer, and where the answers are more profound than the questions.

Team Leadership

  • To be a leader be easy to follow.
  • Inspiration has no expiration.
  • The recipe to success is that when you are missing one ingredient in that recipe, you don’t quit. Improvise and make the dish your own.
  • Waiting until the last possible moment is not a plan.
  • Strategy, execution, luck. Pick any two.
  • Profits, Passion, Purpose. Pick any two.
  • Imagination is a renewable resource.
  • New Motto: Heads Down, Focus Up!
  • Doing a thing does not preclude you know what you are doing.
  • When things get tough, get smarter then tougher.
  • The worst thing you can be on a team is being inconsistent.
  • Right understanding, with right effort, on the right direction, at the right time makes for the maximum results with the least effort.
  • Build up your immunity to failure, just like you build up your immunity to the cold flu.
  • If you can find joy in a dilapidated studio you will find joy in a palace.
  • If you are still trying you haven’t failed yet.
  • The only response to fear is no fear.
  • If you love what you are doing, you are successful.
  • If you believe you can’t, most likely you won’t. If you believe you can, you might.

Product Placement

  • Is Google working on a GPad based on Android?
  • Google, if you are not evil why you have to make that your motto? Who are you trying to convince?
  • A more appropriate name for Chipotle Mexican Grill is Burrito Factory, since is not Mexican or a Grill or have chipotle salsa.
  • Will the iPad make a better kindle reader than the Kindle?
  • The iPad will be the Gitmo of gadgets.
  • Why is Tumblr so slow? Is Tumblr the Goecities of our generation?
  • The should have American Idol for bad comedy and acting… Oh they already have it, it’s called Saturday Night Live.
  • It used to be that people stop and smell the flowers, now if at all, people stop, take a picture, and post it on Facebook.

Question

  • Was the crotch bomber a false flag?
  • Is the US a mute-cultural smorgasbord or a assimilating melting pot?
  • Is life an individual sport or a team sport?
  • Why would a fully charged cell phone that was turned off for a week have it’s battery drained?
  • What does SEO stand for? Spam Engine Optimization?
  • If love is supposed to be patient why do people rush into love?
  • Is life a journey, adventure, game or scoreboard?
  • Are you a samurai or rice farmer?
  • Is God from outer space or from inner space?
  • What is the secret sauce to your success?
  • which is your favorite bear: yogi bear or pooh bear?
  • If everyone cheats is it still cheating?
  • If everyone cheats are you cheating yourself if you don’t?
  • Does God have Buddha nature?
  • How much Buddha nature does the Buddha have?
  • Which is more satisfying, physical joy or spiritual joy?
  • Is there duct tape for the heart or super glue for the soul?
  • Do you think dogs suffer from autism?

Feb 7 2010

Retweet January 2010

From time to time I just blast tweets about software development, project planning, team dynamics, or whatever else comes to mind. Here is a synopsis of recent tweets and rants. If you want to follow the conversation follow me at techknow and/or juixe and I’ll be sure to follow back.

Software Development

  • If your code works not because of your programming intentions but because of bug side effects and your client doesn’t care, it is not done.
  • I need a software development bug repellent.
  • Design fail if you fix a log message and you break some functionality.
  • If a carpenter’s rule of thumb is to “measure twice, cut once” then a programmer’s rule of thumb should be “design twice, code once, refactor a few times, and optimize only if you have to.”
  • Saying you know programming is like saying you know how to read, a first grader knows how to read!!
  • Requirements gathering is not creative writing.
  • I love requirements: The initial instruction should completely initialize the initial value.

Team Leadership

  • The only two requirements for a manager is that he is breathing and that he can communicate with his team in their language.
  • What happens to you is not other people’s fault, it is your opportunity.
  • There is nothing worse than a perfectionist that doesn’t know what he wants.
  • The worst thing you can so when you make a mistake is lie about it.
  • Every once in a while you have to recalculate, reshuffle, and/or remix your priorities.
  • Embrace the edge.

Product Placement

  • In Google We Trust.
  • Google claims their motto is to ‘do no evil’, put I suggest they change it to ‘do no customer support.’
  • If you use Google search to find Google Mail customer support and still can’t find it, is that a fail in their customer support or search?
  • There should be Freedom of Information Act for corporations. I want to know everything that Google knows about me and how that info is used
  • Can’t believe the AT&T website is not iPhone/mobile friendly.
  • Apple should develop a dual screen iPhone, iPhone GS3 DS.
  • I imagine a time when Zynga will have in-game ads for Monsanto genetic modified seeds on FarmVille or Foster Farm turkeys for Cafe World.
  • Facebook saves everything you create/post/save/click/delete, it can reverse engineer what you where thinking.
  • Doing four square drive-by check-ins.
  • Does Craigslist have an iPhone app?
  • Do you have multiple twitter personality disorder?

Quote

  • If we let things terrify us, life will not be worth living. – Seneca
  • If I could make the same amount of money but wake up until when I can’t hold in my pee any longer, I will be a success. – Phil Kaplan
  • The answer to the question “where do good ideas come from” is always the same, the come from bad ideas. – Seth Godin
  • Only the mediocre are always at their best. – Jean Giraudoux
  • From pitch perspective, the more you wear your idea, the more it fits you… – Brad Feld
  • Nothing fails like success. – Arnold Toynbee
  • I totally question the conventional wisdom of the American dream. – Anil Dash
  • If we wait for the moment when everything, absolutely everything, is ready, we shall never begin. – Iva Turgenev

Dec 31 2009

TechKnow Year In Review 2009

It is that time of year where we reflect on the accomplishments of the passing year and look forward to the one to come. Here is a window into the past year in technology through this year’s popular posts on TechKnow Juixe.

Top Favorites

Fav Tutorial

Memorable Quotes

Twitter

Twitter Conversations

Year in Review


Dec 31 2009

Retweet 2009

From time to time I just blast tweets about software development, project planning, team dynamics, or whatever else comes to mind. Here is a synopsis of tweets and rants from 2009. I started collecting and organizing programming related tweets into blogs posts early in the year. If you want to follow the conversation follow me at techknow and/or juixe and I’ll be sure to follow back.