Posts

Showing posts from 2013

Web application framework popularity over time

I thought I'd do a quick comparison of web frameworks to see how popularity is trending nowadays per google trends. I realized this is has some serious drawbacks, but as a person who has been in the j2ee space for years, I find the trend very interesting. The trend is clear, if you're an ace J2EE super guru, you are about in the same position as a yii developer. While you're experience might be transferrable, the days of java containers ruling the universe appear to be numbered. To do some other interesting comparisions, let's look at java specifically. This roughly supports my observation that Struts is dying off, spring is holding stead, and gwt...while making a big splash a few years ago seems to be tapering off. These numbers are a little deceptive because back in 2005 a lot of the "up and coming" frameworks, languages, and tools didn't even exist. So let's take a look at just the upstarts. I've included rails because it's...

Running off the jetway or how to make decisions under pressure

The hazards of the unknown unknowns or how to avoid Running off the jetway This scene illustrates an all too common problem in any field, and is one that I've encountered over and over again. We often entrust major decisions to folks who don't have enough information or are working with major assumptions about the situation that are incorrect. In this example, Jim Carrey's character is running furiously to get a briefcase back to it's owner, and when stopped (because the airplane has left), he assumes that his status as a Limo driver entitles him to board the plane even when no one else is allowed. The critical piece of information he was missing was that it wasn't simply his lack of status that was the reason he couldn't board the plane, but the fact that the plane had already left. This is a lot like many computer 'experts' who claim that because of their status, they can ignore warnings or requests from others because 'They know better...

Running and software development

I have a long love/hate relationship with running and I think that it's a great metaphor to help explain the subtle differences between agile practices and traditional development. My kids have been bitten by the running bug and they devote a lot of time to cross country and track. More importantly, they have trained for running longer distances and therefor better understand the importance of preparation, pace, and form. As a person who spends a lot of time playing soccer, the idea of NOT running as fast as possible still requires a LOT of mental energy. On the rare occasion that I still get out running longer distances with my kids, they routinely tell me to slow down for the first mile... then they scratch their heads because I burned myself out blazing through the first mile in 7-8 minutes. In software development, agile practices are the equivalent of the type of running done in soccer... you are actively changing direction, reacting to things on the field and using s...

Using Olark online chat component

So I thought I'd investigate SAAS online chat components and I consulted the almighty google and selected my first contender. boldchat seemed like a good option until I discovered it seemed to need an exe to function. As I'm a max/linux snob, this immediately removed it from the running. My next contender was selected from a post on Stack Overflow was olark . I'll have to say that from the get-go, this seems like a very fully featured and easy to use tool. I was up and running within 5 minutes. After toying with this for a bit, I'm really quite impressed. If you need a quick and easy online chat on your web property, olark is a great way to get moving quickly. Questions? Feedback? powered by Olark live chat software

Fun with character encoding and when to use ISO8859 instead of UTF-8

What character encoding are you using? Most folks nowadays settle on UTF-8 for web centric type applications, but things can get squirrelly if you use this encoding and start working with non-unicode systems. Recently, we had a situation where we took the string representation that started out with an array of 17 0xff values. In a unicode aware system, using UTF-8, this will translate into a character sequence of 17 0xfffd values. What happened? How did an array of 8 bit values get magically translated into an array of 16 bit values? It requires a bit of digging, but the short version is that if your source system is using 8 bit characters (something like iso 8859-n) and you translate to unicode, you will fail on certain byte values because they are invalid in UTF-8 and other character encodings. The only thing that can then happen is to change the character to the "invalid character" which is 0xfffd. For reference, in UTF-8 the values 192, 193, and everything ove...

MQTT over websockets with javascript apache and active mq

Reading up a big about MQTT I decided to set up a test bed to see how it works and if it lives up to it's potential. The use case was simple, I wanted to build a multi-user chat system that would use MQTT over websockets connected directly to an apache activemq server. First off, I fired up an ec2 instance with ubuntu-13.04 and tried to apt-get activemq. It turns out, however, to use mqtt over websockets, you need version 5.9 of activemq. So I pulled a snapshot version of activemq. Enabling mqtt over websockets is a snap, you simply add the following configuration to your activemq.xml <transportConnector name="mqtt+ws" uri="ws://0.0.0.0:1884maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> Next, download the eclipse paho mqtt client . And create a web page to send traffic back and forth. One last thing I did was install apache on the same server as the activemq instance. I did this to avoid any potential problems with same ...

An unflattering commentary on Rackspace cloud server security

I recently needed a new server instance for some testing. Normally I would go back to AWS as I've had problems with Rackspace in the past . Being open minded and assuming things have changed in the last couple years I thought I'd go back and try out Rackspace cloud for my testing (for reasons I will not name here). My first and most shocking revelation is that they have NOT fixed a key security problem. I'm going to outline this right now and hopefully somebody can fix it Problem #1: Login as root via ssh Guys...guys...guys(or gals)... It is baffling to me that you still allow this. Yes I get that you have a wonderful "Blacklist the my server ip when something goes wrong" and "then disable access to my console to fix" routine going on to protect your network if MY machine gets compromised due to your silly lackadaisical security. Wait, that's actually a negative thing too :) please stop, I'm not going to use you as a provider un...

Java's problem is that Jidigava idigis gididibidigeridigish

I posted a while back about how ruby's syntax is better for designing software than java because it removes extra language cruft and enables developers to write more succinct and direct code. A common response to this from detractors is that "it's only three extra characters" and "my IDE can automatically generate that code for me". Sitting at the train station today reading a comment from someone that said something similar to "geeze, if you've got thousands of lines of code, why do you care about a couple of letters and a parenthesis or curly brace here and there?". I started thinking about why I care and discovered the reason: With those little three letters here and there, your code literally becomes a type of Gibberish In gibberish, you use simple rules to add extra characters here and there (sounds familiar) to create and quite confusing language that is a 1 for 1 direct translation to/from english. While gibberish, pig latin, an...

Software is design, how ruby is better for that job than java

As a long time java developer and ... well ... at this point also a long time ruby developer, I've found some things about the ruby language are much less bothersome than in java. Groovy takes an interesting middle road, but only gets about halfway in my mind. I'll leave the runtime differences and the dynamic/static compiled/interpreted debates for other forums and just focus on the Focus on this one irksome quirk. Property Accessors are too verbose Java Definition class Car { private Color color; public Color getColor() { return color; } public void setColor(Color color) { this.color = color; } } and to use it: Car car = new Car(); Color blue = car.getColor(); car.setColor(blue); The whole getter setter thing is a pain to me. The bean pattern used by java is just overly verbose. For all the OO purists, I get it, we need to hide the private variables and put them behind methods to abstract away the inner structure, but I'm so...

Fixing Perverse Incentives in Software Development

I read with interest an article about picking the right metric to incentivize desired behavior and thought I would add a little of my own personal insight. One problem with many (maybe most) software development organizations is that they inadvertently create perverse incentives , rewarding undesireable behavior and creating confusing and chaotic environments that, despite best efforts of all involved, seem to only on a hit or miss basis produce the desired result. Just as important, often the rewards are implicit and it isn't obvious that developers are actually being rewarded for the errant behavior. Some short examples of widely used, but poor metrics I've observed as well as some simple and arguably better alternatives follow. For example: Rewarding developers for "count of bugs fixed". Without accountability for who created the bug, this simply incents developers to release buggy half finished softwa...

When to refactor code

As a die hard refactorer, but also pragmatic programmer, I often have a tough time articulating to other developers when a refactor is important and when it is gratuitous. I can imagine many people look at decisions I've made about when it is and isn't appropriate and think it's simply a whim or "when I feel like it". To clarify this for both myself and any future victims/co workers involved with refactoring decisions I may make, I submit this 10 item checklist. Is the cyclomatic complexity of the function below 5? Did you completely understand what cyclomatic complexity was without following that link? Do you have an automated test or documented test case for every path through the function? Do all of the existing test cases pass? Can you explain the function and all it's edge cases to me in less than 1 minute? If not, how about 5 minutes? 10 minutes? Are there fewer than 100 lines of code in the function (including comments)? Can you find two o...

Apologetic Agile Development

Having lived through numerous attempts to build software embracing the concepts behind the agile manifesto , I feel there are three large categories folks fall into when talking about agile principles. The curmudgen - these folks have been writing code since punchcards where the state of the art, OR they have been brainwashed by large consulting organizations into thinking that a large heavyweight process is the only way to succeed. Note, a subset of these folks believe that "no process" is actually OK and are quite happy to cowboy-code their way through life. The fanboy - these folks think "everything agile all the time" and will rename status meetings to "scrums". These are folks who are used to working solo on projects that they can do in their heads... or they are simply not clued into the implications of actually having a repeatable process or delivering working software. The apologetic - these folks understand the principles and the value they...

java static fields

A great many people starting out with java development have only a vague understanding of the difference between a "public static String", "public String", and the difference between a class and an object. As this was confusing to me at first, I thought I would give a quick overview. A class defines a template for what data and operations are available when you tell the JVM to create an object. So, for example: class BlogPost { public BlogPost(String inString) { text = inString; BlogPost.latest = this; } public String text = ""; public static BlogPost latest; } When you do the following BlogPost myPost = new BlogPost("Hello"); You're telling the JVM to allocate some memory on the heap to store a reference to a memory location and from now on, when I refer to myPost, it means that memory location. BlogPost is a class, myPost is an Object that is a reference to a memory location that is an ins...

Database pagination on mySql and Oracle

Having studiously avoided Oracle for over 20 years, I'm now working in a shop that uses it almost exclusively. Aside from the general overall expense of the product I'm routinely amazed at how many features other DBMS's I've used (DB2, MSSQL, MySQL, PostGres) are either missing or syntactically difficult to understand. The most recent example is server side pagination… or more specifically, having the DBMS limit the results returned to for specific subsets of rows. In oracle to do this, one must run a query something like this: select * from (select name, rownum rn from (select name from users order by name) where rownum 5; I realize that this is a legacy syntax, but I personally find the new way just as obtuse. The new way (I guess) is supposed to be: select * from (select name, row_number() over (order by name) rn FROM users) where rn between 5 and 10 order by rn Compare this with the syntax for mySql (also now...