Tic Tae Game at YouTube

Posted in Software Development | Leave a comment

Code Smells

Code smell é um sintoma que indica que o código posui problemas profundos, que causarão dificuldades na manutenção do código ou  a ocorrência de problemas intermitentes na aplicação. Aconselha-se refatoriar o código até que estas falhas sejam removidas.

Code Smells Comuns

  • Código Duplicado
  • Métodos muito longos
  • Classes Muito Longas
  • Classes usando métodos de outra classe excessivamente
  • Classes dependendo de detalhes de implementação de outra classe.
  • Não obediência ao Principio de Substituição de Liskov
  • Classes que não fazem quase nada
  • Complicados design onde simples design atenderiam.
  • Nome de identificadores excessivamente longos.
  • Uso excessivo de literais ao inves de constantes

 

Posted in Software Development | Leave a comment

What is SOLID

SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion). Quando este pricnipio deve ser aplicado quando o programador pretende escrever um sistema que seja fácil de manter e criar extensões no futuro.

Os principios do SOLID são guidelines que podem ser aplicados para remover “code smells”, refatorando o código continuamente até todo o código estiver legível e extensível.

Initial Stands for
(acronym)
Concept
S SRP
Single responsibility principle
the notion that an object should have only a single responsibility.
O OCP
Open/closed principle
the notion that “software entities … should be open for extension, but closed for modification”.
L LSP
Liskov substitution principle
the notion that “objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program”. See also design by contract.
I ISP
Interface segregation principle
the notion that “many client specific interfaces are better than one general purpose interface.”
D DIP
Dependency inversion principle
the notion that one should “Depend upon Abstractions. Do not depend upon concretions.”
Dependency injection is one method of following this principle.
Posted in Software Development | Leave a comment

Thoughts on when to use Canvas and SVG

HTML5 Canvas and SVG are two exciting graphics features introduced in IE9. Both were covered in sessions at last week’s MIX11 conference in Las Vegas (see Deep Dive Into HTML5 <canvas> and Modernizing Your Website: SVG Meets HTML5).

These technologies can be used to address a range of graphic scenarios on the modern Web. With a lot of excitement around Canvas, there has been a tendency to ignore SVG, which, in many cases, is the better choice. Here I offer some thoughts on when to choose Canvas, SVG, or a combination of the two.

High Level Summary of Canvas and SVG

The following is a high-level summary of Canvas and SVG meant to frame a discussion of when to use one particular vector graphic technology over the other.

A Comparison of Canvas and SVG
Canvas SVG
Pixel-based (canvas is essentially an image element with a drawing API) Object Model-based (SVG elements are similar to HTML elements)
Single HTML element similar to <img> in behavior Multiple graphical elements which become part of the Document Object Model (DOM)
Visual presentation created and modified programmatically through script Visual presentation created with markup and modified by CSS or programmatically through script
Event model/user interaction is coarse—at the canvas element only; interactions must be manually programmed from mouse coordinates Event model/user interaction is object-based at the level of primitive graphic elements—lines, rectangles, paths
API does not support accessibility; markup-based techniques must be used in addition to canvas SVG markup and object model directly supports accessibility

SVG is known as a retained mode graphics model persisting in an in-memory model. Analogous to HTML, SVG builds an object model of elements, attributes, and styles. When the <svg> element appears in an HTML5 document, it behaves like an inline block and is part of the HTML document tree.

Canvas is a bitmap with an immediate mode graphics application programming interface (API) for drawing on it. Canvas is a “fire and forget” model that renders its graphics directly to its bitmap and then subsequently has no sense of the shapes that were drawn; only the resulting bitmap stays around.

One way to think of these is that Canvas resembles the Windows GDI API, where you programmatically draw graphics to a window, and SVG resembles HTML markup with elements, styles, events, and DOM-based programmability. Canvas is procedural whereas SVG is declarative.

The Scenarios

The following sections describe the technical benefits and limitations of both technologies, including a common sense approach to determining when one is appropriate for a given task. The illustration below illustrates where each scenario falls on a spectrum from Canvas to SVG with a clear cross over point in the middle.

Spectrum of Web vector graphics from canvas to SVG
Vector Graphic Spectrum

High Fidelity Complex Vector Documents

High fidelity complex vector documents have been, and will continue to be, the sweet spot for SVG. Highly detailed for viewing and printing, standalone or those embedded in a Web page. The declarative nature of SVG provides for tooling or client or server side generation of shapes from databases.

From the Real-world Diagrams demo on the Internet Explorer Test Drive:

Portion of SVG image zoomed out

The first image shows the diagrams, while the second image shows these diagrams zoomed in to 1000%

Portion of SVG image zoomed in

When you consider the usefulness for observing a large schematic, but the need to drill into the detail, or print the entire document for engineering purposes, the “scalable” in Scalable Vector Graphics becomes abundantly clear. For these reasons, we put high fidelity complex vector documents at the SVG end of our spectrum.

Spectrum from canvas to SVG showing high fidelity documents at SVG end of spectrum

SVG as an Image Format

Another common use for SVG is for static images within a Web page. With present-day high DPI monitors, developers must take into account the quality of graphics. The images below represent potential <li> bullet images styled via CSS. The following images are almost identical in presentation and file size.

Two circles zoomed out that look similar
SVG graphic on left, PNG rendering of it on right

If the developer wishes to reuse that image on a larger scale, or if the end user uses a high-DPI screen, the raster image becomes pixilated, or the need for a larger version of the file is necessary to preserve the fidelity.

Two circles zoomed in. SVG circle is crisp; PNG circle is blurry.
Zoomed SVG graphic on left, zoomed 4K PNG on right

SVG can thus serve as a nice image replacement format for even the simplest of images on a Web page. A suitable replacement by Canvas is not available.

Spectrum from canvas to SVG showing static images at SVG end of spectrum

On the other side of the spectrum, canvas brings speed to scenarios that don’t require retention of what was drawn. When Canvas was first introduced, many fun experiments were developed. I break these into three different scenarios.

Pixel Manipulation

Because Canvas is all about drawing and manipulating a pixel-based drawing surface, several experiments and showcases of Canvas include sophisticated algorithms to achieve impressive graphic effects such as ray tracing or filters.

The example below was written by Adam Burmister. The experiment creates an image by tracing the path of light through pixels on an image plane and simulating the effects of its encounters with virtual objects.

Spheres on checkboard background showing reflections

The author himself includes the following warning: “This is very CPU intensive. Your browser may appear to stop responding.” Therefore, though the Canvas API is capable of generating pictures such as this, it may not be such a good idea. As site author Adam Burmister summarizes, “Ray-Tracing [is] The Worst Application of JavaScript Ever.”

The same can be said for other scene-wide pixel manipulation. The following function replaces green pixels in one canvas with pixels from another, identically-sized canvas. A function such as this could be used with to create a video “green screen” effect.

function GreenScreenAtoB(a, b) {
    var aImageData = a.getImageData(0, 0, a.canvas.width, a.canvas.height);
    var bImageData = b.getImageData(0, 0, b.canvas.width, b.canvas.height);
    var aPixels = aImageData.data;
    var bPixels = bImageData.data;

    if (aPixels.length != bPixels.length) {
        window.alert("Canvases do not have the same number of pixels");
        return bImageData;
    }

    var pixelCount = bPixels.length;
    for (var pixelIndex = 0; pixelIndex < pixelcount; pixelIndex += 4) {
        // grab the RGBA components of each pixel in b
        var r = bPixels[pixelIndex + 0];
        var g = bPixels[pixelIndex + 1];
        var b = bPixels[pixelIndex + 2];
        var a = bPixels[pixelIndex + 3];

        // if the b pixel is green, replace it with a pixel from a
        if (r == 0 && g == 255 && b == 0 && a == 255) {
            bPixels[pixelIndex + 0] = aPixels[pixelIndex + 0];
            bPixels[pixelIndex + 1] = aPixels[pixelIndex + 1];
            bPixels[pixelIndex + 2] = aPixels[pixelIndex + 2];
            bPixels[pixelIndex + 3] = aPixels[pixelIndex + 3];
        }
    }

    return bImageData;
}

It was a fun experiment, but like the ray-tracing example above, performance on today’s machines falls short. I call these out though for one primary reason: such pixel manipulation is simply not possible with SVG. It is the differentiating factor between the two technologies. One manipulates pixels while the other manipulates a model.

Whether creating realistic images from otherwise simple vector graphics or creating green screen effects with video, these graphic scenarios are, in most cases, simply not ready for prime time deployment on the today’s Web. However, certain scenarios are responsive enough (such as applying filters to remove red eye in photos). These pixel manipulation scenarios fall on the far left on the spectrum as a canvas scenario.

Spectrum from canvas to SVG showing filters and ray tracers at canvas end of spectrum

Hybrid and Crossover Scenarios

The most interesting set of use cases didn’t indicate a clear winner. These are illustrated with two primary scenarios: Charting/Graphing/Mapping and Two-dimensional Gaming.

Charts and graphs require vector graphics and either Canvas or SVG will work. However, SVG is the often then better choice due to its intrinsic capabilities.

SVG Charting/Graphing/Mapping Scenarios

A popular subset of charts and graphs on the Web include:

  • Interactive Organizational Charts and Flow Charts
  • Interactive maps – path finding
  • Building floor plans
  • Engineering schematics
  • Seat maps for airlines or event venues
  • Generic data or financial charts (column, bar, line, scatter, donut, etc.)

For all of these SVG is the technology of choice because:

  • They can be generated easily from existing data by transforming XML to SVG
  • Static versions can be exported from Tools (including Inkscape, Adobe Illustrator, Microsoft Visio, and various CAD programs)
  • They require precise user interaction
  • Third-party content providers can customize for Web authors using CSS styling
  • They have a need for accessibility

To illustrate more precisely, let’s examine the scenario of selecting a state on a map of the United States.

Image of the state of Alaska

The detailed map of Alaska shown above is public domain and available on Wikimedia Commons.

In SVG, the state of Alaska is represented by one <path> element with about 162,500 characters of geometric data in its “d” attribute.

<path id=”AK” fill=”#cdc3cc” d=”M 777.5514,1536.1543 C 776.4904,1535.0933 776.7795,1530.0041 777.9416,1529.2859 C 781.3258,1527.1943 787.2657,1532.4522 784.8317,1535.3849 …” />

For canvas, this shape could be created using a series of JavaScript calls:

function drawAlaska() {
    var canvas = document.getElementById("myCanvas");
    var ctx = canvas.getContext("2d");
    ctx.beginPath();
    ctx.moveTo(777.5514, 1536.1543);
    ctx.bezierCurveTo(776.4904, 1535.0933, 776.7795, 1530.0041, 777.9416, 1529.2859);
    ctx.bezierCurveTo(781.3258, 1527.1943, 787.2657, 1532.4522, 784.8317,1535.3849);
    //
    // 2,875 more path-drawing directives
    //
    ctx.bezierCurveTo(1689.8261, 12.13753, 1689.1395, 12.17333, 1685.8848, 10.52683);
    ctx.closePath();
    ctx.fillStyle = "#cdc3cc";
    ctx.fill();
}

In fact, it requires 2,878 path-drawing directives (moveTo, lineTo, and bezierCurveTo) to draw this complex map of Alaska. Of course, lower resolution versions of this map are possible. Considerably fewer lines of code would be required for Wyoming and Colorado. :-)

SVG mapping-based applications typically include an interactive experience involving hover effects, selection, tabbing between items, and scaling. These operations require only lightweight HTML concepts when using SVG, for example, for processing a mouse event:

<path id=”AK” fill=”#cdc3cc” onmousedown=”window.alert(‘Alaska’);” d=”M 777.5514,1536.1543 …” />

or creating a hover highlight effect using CSS:

path#AK:hover { fill: yellow; }

An example of this type of interactive map can be seen in the Test Drive demo Atlas zur Europawahl 2004 in Deutschland, a visualization of the 2004 European election results in Germany.

In canvas, creating either of these effects requires you code your own hit detection using the event object’s mouse coordinates. You no longer have the context of the shape. While there is the isPointOnPath() API, it only applies to the last path created.

Code can and does exist in the form of graphing libraries to enable specific hit detection on graphs using pixel data to identify hits and hovers and are functional. They also exist for SVG and will have better performance if designed to take advantage of the SVG features.

Spectrum from canvas to SVG showing interactive charts and graphics at SVG end of spectrum

Canvas Charting/Graphing Scenarios

Canvas has its place for charting and graphing scenarios. To set context for this, we need to examine the performance characteristics of both SVG and Canvas.

Sometimes there are outside influences that require a choice of technology that is, or is mostly, independent of functionality. For SVG and Canvas, there are two primary differentiators.

Developer knowledge, skill set, and existing assets will play a significant role into the choice of technologies. If while creating a game, the developers have deep knowledge of low-level graphic APIs and limited knowledge of Web technologies, the likely technology to choose is Canvas (more on this later). In porting games, there are tools that support moving from third party implementations to Canvas.

If performance is critical, often down to milliseconds, it is necessary to compare the performance characteristics of the two technologies. This does not mean that Canvas, typically considered highly performant, is the obvious choice. However, for applications with large amounts of data that must be drawn at the pixel level, Canvas is by far the better choice.

The weather map below does not require a large surface area, and the number of objects on the screen is considerably high. With Canvas, these can be quickly drawn without the cost of updating a DOM.

Weather map image

While the above image could be fully created in SVG using circle or ellipse elements for the dots, the time to load many thousands of elements into the DOM would simply be too slow. Wherever you see a large number of pixels or images, this is a good clue that Canvas is the technology to use—whether this is astronomy, biological cellular movement, or voice modulation displays. The limits here on how fast data can be visualized are the speed of the CPU, the speed of the Canvas implementation, and the speed of the JavaScript implementation.

Spectrum from canvas to SVG showing real-time, high-volume data presentation at canvas end of spectrum

Two-Dimensional Games

Casual gaming was the most complicated scenario to explore. Some initial observations:

  • Gaming libraries have leveraged lower level graphic APIs
  • Developer skillsets for the gaming industry are tuned towards these lower level APIs
  • Many games are largely image- or sprite-based
  • Vendors such as Adobe are beginning to support Canvas as an export
  • Casual games do not often require sophisticated hit testing
  • Casual games do not usually have a prohibitively large number of “objects”

In gaming libraries, for example, popular physics engines, the graphics model is independent and graphics becomes an implementation detail. Graphing geometries such as boundaries, velocities, sizes, and positions are delivered to engines that subsequently respond with velocities, collisions, and positions. Graphics are used only to get the computed scene to the screen.

The concept of graphics being independent of the gaming logic is demonstrated by two games, developed by the same author, intended to highlight both SVG and <canvas>: SVG-oids and canvas-pinball.

While the game and demonstration logic is different, both are leveraging the same physics engine, which tracks positions, collisions, velocities, and other physical aspects of the gaming components. In the end, one utilizes SVG to draw (or move) the elements of the game and the other redraw them with Canvas.

Most 2D casual games that are built today for HTML5 are using Canvas so we place this scenario toward the Canvas side of the cross over point.

Spectrum from canvas to SVG showing 2D casual gaming near the center of spectrum

The Hybrid Scenario

Casual gaming also falls into the hybrid scenario is because there is an advantage to leveraging the best of both technologies. For easy hit detection and user interaction, a mostly opaque layer of SVG geometries can be used to position elements while the underlying Canvas can more quickly position relevant images and provide real-time animations.

There is a growing number experiences outside the casual gaming segment that are finding it compelling to use a hybrid. When a scenario contains both the need for visually intense dynamic graphics and animations (Canvas) as well as rich user interaction (SVG), both of these technologies can and should be used. This is represented by theBrain Power site from one of our partners showcased on The Beauty of the Web site. This Brain Power site—and others featured on The Beauty of the Web—have found this delicate balance.

For user interaction and displaying portions of the brain, the site leverages the higher-level geometries of SVG:

<polygon id=”SensoryCortex” points=”253,80,266,93,…” style=”fill: rgba(0,0,0,0)” />

For real time animations and special effects, canvas is used:

<canvas id=”cnvDisplay” width=”1920″ height=”1099″ style=”position:absolute;” />

Conclusion

The analysis of existing vector graphic technologies available in the latest modern browsers shows new scenarios can be created using standard Web technologies in an interactive way.

Spectrum from canvas to SVG showing "the graphically rich Web" at the center of spectrum

The ongoing evolution of the Web continues to include richer graphics at its heart. We’ve presented one point-of-view about applying these technologies to particular scenarios. In the end, both Canvas and SVG are important components of the HTML5 graphically rich Web.

We’d love to hear how you’re applying these new HTML5 technologies to your Web sites. Include URLs and, please, make sure your page works in IE9 by including the HTML5 doctype, <!DOCTYPE html>, and using feature detection not browser detection to know if SVG or Canvas are supported.

—Patrick Dengler, Senior Program Manager, Internet Explorer

http://blogs.msdn.com/b/ie/archive/2011/04/22/thoughts-on-when-to-use-canvas-and-svg.aspx

 

Posted in Software Development | Tagged , , | Leave a comment

Building Windows 8

Posted in Operational System | Tagged | Leave a comment

Inside Windows Azure, the Cloud Operating System with Mark Russinovich

Posted in Cloud, Software Development | Leave a comment

Verify if Site is online – Python

If you manage several web sites, do you need a simple way to see if everything are ok.

This simple script, look at the list of your domains and try to get every site. if some request return an error, then we record the error message and send an email to administrator.

from BeautifulSoup import BeautifulSoup
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import urllib2
import sys
import smtplib

errorMsg = []

def Send(bodymsg):

	fromaddr = "xxx.gmail.com"
	toaddr = "xx@gmail.com"
	msg = MIMEMultipart('alternative')
	msg['Subject'] = "Monitor Errors"
	msg['From'] = fromaddr
	msg['To'] = toaddr

	html = "<html><head></head><body>" + bodymsg + "</body></html>"
	part1 = MIMEText(html, 'html')
	msg.attach(part1)

	server = smtplib.SMTP("smtp.gmail.com",587)
	server.ehlo()
	server.starttls()
	server.ehlo
	server.login(fromaddr, "pwd")

	server.sendmail(fromaddr, toaddr,msg.as_string())
	server.close()

def ShowError(typeErr, url , msg):
	errorMsg.append("<p>" + typeErr + "<br /><a href='" + url + "'>" + url + "</a><br />" + msg + "</p>")
	print msg

def GetURL(url):
	try:
		page = urllib2.urlopen(url)
		soup = BeautifulSoup(page)
		print "OK ", url
	except urllib2.HTTPError, e:
		ShowError("HTTP  Error", url, str(e.code))
	except urllib2.URLError, e:
		ShowError("URL Error", url, str(e.reason))
	except:
		ShowError( "Error", url, sys.exc_info()[0])

def Verify():
	lstSit = []
	lstSit.append("x1.com.br")
	lstSit.append("x2.org")
	lstSit.append("x3.com.br")

	for page in lstSit:
		GetURL("http://" + page)
		GetURL("http://www." + page)

if __name__ == "__main__":
	Verify()

	if len(errorMsg) > 0:
		Send(''.join(errorMsg))

	print "Finish"
Posted in Python | Leave a comment

Send Email Python

This is a simple example of sending email using python and a gmail account

import smtplib

def Send(msg):
	print "Begin Email"
	print msg
	fromaddr = "xxx.gmail.com"
	toaddr = "xxx@hpcbrasil.com"

	server = smtplib.SMTP("smtp.gmail.com",587)
	server.ehlo()
	server.starttls()
	server.ehlo
	server.login("xxx@gmail.com","pwd")
	header = 'To:' + toaddr + '\n'
                          + 'From:' + fromaddr + '\n'
                          + 'Subject:Monitor Errors\n\n'
	message = header + msg
	server.sendmail(fromaddr, toaddr, message)
	server.close()

if __name__ == "__main__":
	Send("Message Test")
Posted in Uncategorized | Leave a comment

How do you recognise good programmers if you’re a business guy?

It’s not as easy as it sounds. CV experience is only of limited use here, because great programmers don’t always have the “official” experience to demonstrate that they’re great. In fact, a lot of that CV experience can be misleading. Yet there are a number of subtle cues that you can get, even from the CV, to figure out whether someone’s a great programmer.

I consider myself to be a pretty good programmer. At the same time, I’ve spent a fair amount of time on the business side of the fence, filtering technical CVs for projects, interviewing people, etc. Thanks to this, I think I have a bit of experience in recognising good programmers, and I want to share it in this article, in the hope that it may help other “business guys” to recognise good programmers. And, who knows, perhaps some programmers who have the potential to be good but haven’t really exploited this can also read this and realise what they need to do to become good (although, as I’ll argue, that’s definitely not accessible to all programmers!).

In his article The 18 mistakes that kill startups, Paul Graham makes the following point:

“… what killed most of the startups in the e-commerce business back in the 90s, it was bad programmers. A lot of those companies were started by business guys who thought the way startups worked was that you had some clever idea and then hired programmers to implement it. That’s actually much harder than it sounds—almost impossibly hard in fact—because business guys can’t tell which are the good programmers. They don’t even get a shot at the best ones, because no one really good wants a job implementing the vision of a business guy.

In practice what happens is that the business guys choose people they think are good programmers (it says here on his resume that he’s a Microsoft Certified Developer) but who aren’t. Then they’re mystified to find that their startup lumbers along like a World War II bomber while their competitors scream past like jet fighters. This kind of startup is in the same position as a big company, but without the advantages.

So how do you pick good programmers if you’re not a programmer? I don’t think there’s an answer. I was about to say you’d have to find a good programmer to help you hire people. But if you can’t recognize good programmers, how would you even do that?”

I disagree with Mr Graham on this one. I think there are a number of very strong indicators of a “good programmer” (and, conversely, strong indicators of a “not-so-good programmer”) that even a business guy can recognise. I’ll summarise some key indicators and counter-indicators in a list at the end of the article.

#1 : Passion

In my corporate experience, I met a kind of technical guy I’d never met before: the career programmer. This is a person who’s doing IT because they think it’s a good career. They don’t do any programming in their spare time. They’re shocked when they find out I have a LAN and 3 computers at home. They just do it at work. They don’t learn new stuff unless sent on a training program (or motivated by the need to get a job that requires that technology). They do “programming” as a day job. They don’t really want to talk about it outside of work. When they do, they talk with a distinctive lack of enthusiasm. Basically, they lack passion.

I believe that good developers are always passionate about programming. Good developers would do some programming even if they weren’t being paid for it. Good programmers will have a tendency to talk your ear off about some technical detail of what they’re working on (but while clearly believing, sincerely, that what they’re talking about is really worth talking about). Some people might see that as maladapted social skills (which it is), but if you want to recognise a good developer, this passion for what they’re doing at the expense of social smoothness is a very strong indicator. Can you get this guy to excitedly chat up a technology that he’s using, for a whole half hour, without losing steam? Then you might be onto a winner.

#2 : Self-teaching and love of learning

Programming is the ultimate moving target. Not a year goes by without some new technology robbing an old, established standard blind and changing half the development universe. This is not to say that all good programmers pick up these changes and ride the bleeding edge. However, there’s a class of programmers that will never, ever pick up a new technology unless forced to, because they don’t like learning new stuff. These programmers will typically have learnt programming at university, and expect to get by on whatever skills they picked up there, plus whatever courses their company is willing to send them on.

If you’re thinking of hiring someone as a programmer, and he ever utters the words “I can work with that, just send me on a training course for a week and I’ll be good at it”, don’t hire that guy. A good programmer doesn’t need a training course to learn a new technology. In fact, the great programmer will be the one talking your ear off about a new technology that you haven’t even heard of, explaining to you why you must use it in your business, even if none of your staff knows how to use it. Even if it’s a technology he doesn’t know how to use yet.

#3 : Intelligence

Some business people assume that lack of social tact and lack of intelligence are the same. Actually, intelligence has several facets, and emotional/social intelligence is only one of them. Good programmers aren’t dumb. Ever. In fact, good programmers are usually amongst the smartest people you know. Many of them will actually have pretty good social skills too. The cliché of the programmer who’s incapable of having a conversation is just that – a cliché. I’ve been to a few meetings of the London Ruby User Group and I can say that with only a very few exceptions, most people there are smart, talkative, sociable, have varied interests, etc. You wouldn’t look at them chattering away in the pub and think “what a bunch of geeks!” – at least until you approach a group and realise they’re talking about the best way to design a RESTful application with a heavy UI frontend.

This doesn’t mean that they’ll all feel comfortable in every social context. But it does mean that if the context is comfortable and non-threatening enough, you’ll be able to have as great a conversation with them as you would with the most “socially enabled” people (perhaps better, since most good programmers I know like their conversation to revolve around actually useful topics, rather than just inane banter).

Don’t ever hire a dumb person thinking they’re a good developer. They’re not. If you can’t have a great conversation with them in a relaxed social context, they’re very likely not a good programmer. On the other hand, anyone who’s clearly very smart at the very least has a strong potential to be a good or great programmer.

#4 : Hidden experience

This is correlated with the “Passion” point, but it is such a strong indicator that I’d like to emphasise it with its own point.

I started programming when I was about 9, on a Commodore 64. I then migrated onto the PC, did some Pascal. When I was 14 I wrote a raycastingengine in C and Assembler, spent a large amount of time playing with cool graphic effects that you could get your computer to do by messing directly with the video card. This was what I call my “coccoon stage”. When I entered that stage, I was a mediocre programmer, and lacked the confidence to do anything really complicated. When I finished it, I had gained that confidence. I knew that I could code pretty much anything so long as I put my mind to it.

Has that ever appeared on my CV? Nope.

I strongly believe that most good programmers will have a hidden iceberg or two like this that doesn’t appear on their CV or profile. Something they think isn’t really relevant, because it’s not “proper experience”, but which actually represents an awesome accomplishment. A good question to ask a potential “good programmer” in an interview would be “can you tell me about a personal project – even or especially one that’s completely irrelevant – that you did in your spare time, and that’s not on your CV?” If they can’t (unless their CV is 20 pages long), they’re probably not a good programmer. Even a programmer with an exhaustive CV will have some significant projects that are missing from there.

#5 : Variety of technologies

This one’s pretty simple. Because of the love of learning and toying with new technologies that comes with the package of being a “good programmer”, it’s inevitable that any “good programmer” over the age of 22 will be fluent in a dozen different technologies. They can’t help it. Learning a new technology is one of the most fun things a programmer with any passion can do. So they’ll do it all the time, and accumulate a portfolio of things they’ve “played around with”. They may not be experts at all of them, but all decent programmers will be fluent in a large inventory of unrelated technologies.

That “unrelated” bit is the subtle twist. Every half-decent java programmer will be able to list a set of technologies like “Java, J2EE, Ant, XML, SQL, Hibernate, Spring, Struts, EJB, Shell scripting”, etc.. But those are all part of the same technology stack, all directly related to each other. This is possibly hard to recognise for non-programmers, but it is possible to tell whether their technology stack is varied by talking to them about it, and asking them how the different technologies they know relate to each other. Over-specialisation in a single technology stack is an indicator of a not-so-good programmer.

Finally, if some of those technologies are at the bleeding edge, that’s a good positive indicator. For instance, today (November 2007), knowledge of Merb,FlexRSpecHAMLUJS, and many others… Please note that these are fairly closely related technologies, so in a couple of years, someone who knows all these will be equivalent to someone familiar with the Java stack listed in the previous paragraph.

Update: As a clarification to this point, there’s in fact two indicators here:variety and bleeding edge. Those are separate indicators. A good variety of technologies across a period of time is a positive indicator, whether or not the technologies are bleeding edge. And bleeding edge technologies are a positive indicator, whether or not there’s a variety of them.

#6 : Formal qualifications

This is more a of non-indicator than a counter-indicator. The key point to outline here is that formal qualifications don’t mean squat when you’re trying to recognise a good programmer. Many good programmers will have a degree in Computer Science. Many won’t. Certifications, like MCSE or SCJP or the like, don’t mean anything either. These are designed to be accessible and desirable to all. The only thing they indicate is a certain level of knowledge of a technology. They’re safeguards that allow technology recruitment people in large corporations to know “ok, this guy knows java, he’s got a certification to prove it” without having to interview them.

If you’re hiring for a small business, or you need really smart developers for a crack team that will implement agile development in your enterprise, you should disregard most formal qualifications as noise. They really don’t tell you very much about whether the programmer is good. Similarly, disregard age. Some programmers are awesome at 18. Others are awesome at 40. You can’t base your decisions about programmer quality on age (though you might decide to hire people around a certain age to have a better fit in the company; please do note that age discrimination is illegal in most countries!).

As a final note to this, in my experience most average or poor programmers start programming at university, for their Computer Science course. Most good programmers started programming long before, and the degree was just a natural continuation of their hobby. If your potential programmer didn’t do any programming before university, and all his experience starts when she got her first job, she’s probably not a good programmer.

Disclaimer

None of the indicators above or below are sure-fire indicators. You will find great programmers who break some of those moulds. However, my view is, you’ll rarely find a great programmer that breaks all of them. Similarly, you may find poor programmers that meet (or appear to meet) some of these criteria. But I do strongly believe that the more of these criteria a programmer meets, the more likely they are to be one of those elusive “good programmers” that, as a business guy, you need to partner with.

The criteria in bullets

So, in summary, here are some indicators and counter-indicators that should help you recognise a good programmer.

Positive indicators:

  • Passionate about technology
  • Programs as a hobby
  • Will talk your ear off on a technical subject if encouraged
  • Significant (and often numerous) personal side-projects over the years
  • Learns new technologies on his/her own
  • Opinionated about which technologies are better for various usages
  • Very uncomfortable about the idea of working with a technology he doesn’t believe to be “right”
  • Clearly smart, can have great conversations on a variety of topics
  • Started programming long before university/work
  • Has some hidden “icebergs”, large personal projects under the CV radar
  • Knowledge of a large variety of unrelated technologies (may not be on CV)

Negative indicators:

  • Programming is a day job
  • Don’t really want to “talk shop”, even when encouraged to
  • Learns new technologies in company-sponsored courses
  • Happy to work with whatever technology you’ve picked, “all technologies are good”
  • Doesn’t seem too smart
  • Started programming at university
  • All programming experience is on the CV
  • Focused mainly on one or two technology stacks (e.g. everything to do with developing a java application), with no experience outside of it

I hope these help. Let me know below if you have any comments, or anything to add to them!

http://www.inter-sections.net/2007/11/13/how-to-recognise-a-good-programmer/

Posted in Software Development | Leave a comment

Programmer Competency Matrix

http://www.indiangeek.net/wp-content/uploads/Programmer%20competency%20matrix.htm

Posted in C#, Python, Software Development | Leave a comment