Category: Elegance

OOP Behavior

When designing in Object Oriented Programming (OOP) the question I always ask myself when trying to figure out where some piece of code should go is, "Who does this behavior belong to?". If our class names are nouns, such as Orders, Books, ProductColors…

Design, Elegance

Read article →

Make is Simple

Complexity is only Simplicity x 1000 -- A mathematician friend once told me that. The idea struck a chord with me and has stuck with me ever since. Everything in this world is complex. When we design computer systems our goals should be to encapsulate that…

Design, Elegance

Read article →

Successful Computer Programmer

So we're all computer programmers, but what makes you successful? What makes you an excellent contributor to your team or company? I discovered the importance of these traits little by little over the years. They are progressively more important as you move…

Elegance

Read article →

Less Is More

You know you're doing a great job when, adding new functionality to a code base, and you wind up removing more code then you've added. Less is More. I once heard boast a programmer that he'd written million lines of C code. That seemed undesirable to me…

Design, Elegance

Read article →

SQL Formatting

Let's standardize how we write SQL. What joy. Rarely, have I seen consistency in how SQL is formatted, and often it is not even considered. Here is the standard I use which makes it easy to read both simple and complex queries. Here is an example: select b.id…

database, Elegance, SQL

Read article →

Programs should be like Gardens

I believe programs should be like gardens. They should be lovely to see. Gardens are things we walk around in and return to often. Gardens are things we wish to spend time in with others - to relax in and enjoy its beauty. If we strive to make your programming…

Design, Elegance

Read article →

Variable Naming Conventions

A simple rule to help improve convention and maintainability: Camelcasing should be used when dealing with Objects, Everything else should use underscores. Objects Class definitions should be CapCase Objects should be mixedCase Class Methods should be…

Design, Elegance, SQL

Read article →

Defensive Programming is the way to go.

Defensive programming is like defensive driving: Anticipate everything that might go wrong. If a function is passed an Id to a database table, do not assume that it is a valid Id, or an integer, or even that it has a value. What is most important in defensive…

Design, Elegance

Read article →

Working Towards the Ideal

Whether building a new system, or trying to untangle some untenable rats nest of code -- One should have an image of the ideal state in their mind. If we draw up the best plan we can, thinking in terms of the perfect - regardless of its immediate feasibility -…

Design, Elegance

Read article →

Libraries over Frameworks

What is the benefit of using a framework like Ruby-on-Rails, Pylons or Drupal? Simply put, it helps us start and develop code from nothing quickly. But it does not have long lasting staying power. If you plan to be using the system for years to come - the…

Design, Elegance

Read article →

Pull Requests improve Quality

A Pull Request, which might more sensibly be called a Merge Request, is the act of a someone asking another to merge his or her code into theirs. It is all so civil. It solves an age old problem of how to do code review, in a more effective less disruptive…

Elegance

Read article →

MVC is Overrated

The Model-View-Controller Pattern ( MVC ) is not the only game in town. In fact it is awkward and cumbersome in some cases. MVC is a D esign Pattern , and Design Patterns show us how to solve common problems with common solutions. However we should not just…

Design, Elegance, MVC

Read article →

What is in a Name?

What should we call it? Call it whatever you like. I hear that a lot. As coders and builders of systems, we should take the time needed to come up with the best names for the systems , databases , tables , columns , filenames , modules , classes , methods …

Design, Elegance

Read article →

Stitch in Time

A stitch in time saves nine, is a fundamental principals we should use to write code and build systems. It might be said, a stitch in time saves you from being stuck forever with unruly software. People just want to get the job done. But any small mistake or…

Design, Elegance

Read article →

False Optimization

So often I hear tech folks talking about some implementation as being better than another because "It is more efficient ". Efficient? Efficient for who? The computer? Are we shaving milliseconds off processing time? That's ridiculous. We should be in the…

Design, Elegance

Read article →

PHP vs Python

$What is $easier to $read? {A $document of $commands in a $pseudo $English $language $strewed with ($dollar $sign $symbols ($$), $French $Braces ({), and $semi-colons)? Or a $document $without all $that?} What is easier to read? A document of commands in a…

Elegance, PHP, Python

Read article →

Elegance in Programming

Ask yourself, is it Elegant? Is it a thing of beauty? If this is some important piece of code that others will be using then it should be written well. I read once in an old programming book, "Born to Code in C", that first you need to make it work, then make…

Design, Elegance

Read article →