Skip to main content

Posts

Showing posts from July, 2012

Managing Programmers

Working with other programmers is tricky.  That said, it's nothing compared to the job of managing programmers.  One of my favorite quotes about Perl is that (paraphrased) "a Perl developer is like a rockstar.  Now imaging having a bunch of rockstars in one room together and you will understand why you don't want an entire team of Perl developers."  It's not about Perl here though. What's important to understand is that any developer worth his salt is going to be like a rockstar.  And yes, there are a lot of professional developers out there who aren't worth their salt, but that's for another post another day.  Rockstar may not be the right term here, but think of it this way.  These guys are smart.  They may not be geniuses, but there's going to be things that they know that you don't and probably never will.

I've seen it more than once and it's not going to make some Product Managers happy, but I'm going to state a fact, an eleph…

More Books and Code Fun

Make a regex for this...

I started this blog as more of a generic overall view of coding, more perspective on higher level ideas rather than line by line code (though I suspect I'll post some of that too) mostly because of how much time I spend on StackOverflow.  I figure, if you need an example of some bit of code, you can find it there, or other places on the net.
This post is inspired by about 50% of the questions I see on StackOverflow which are extremely easy to answer, because they start with "How do I make a regular expression for" and then some random bit of text. I have some decent scoring answers on these because I can answer them in just a couple of minutes with my trusty internet.  So here's a couple of my favorite resources.
First, get a bit of the basics of Regular Expressions down, use Regular-Expressions.info, it's a great site with the best detail in explaining Regular Expressions I've ever seen.  Then, make sure you have a decent test client.  For almost all example…

Why use KnockoutJS

I put together a bit of a proposal for my team and thought I'd post it today.
THE GOAL As far as I know, we’re all in favor of decoupling.
Decoupling code has the purpose of separating code into pieces so that changes are easy.  MVC is an example, in that its purpose is to separate the logic layer (controller) from the view, and pull the objects out into their own little place (the model) so they can pass between the two.
We do this with N-Tier applications as well, as we’ve started pulling our model and logic out into separate projects in visual studio, creating a logic dll and a model dll that is used by the web application (or other application) front end, and separating the database from the webservice from the front end.
THE PROBLEM In decoupling, some people get a bit too gung ho and try to decouple everywhere.   In fact, you’ll see this on Stack Overflow a lot.  The problem I see is that we’re decoupling at the wrong place much of the time.  If you think of decoupling like m…

So you want to code for the house?

Another question inspired this blog post.  When you're a developer, the toughest part of learning new things is finding a project that's both interesting enough to want to do, and simple enough that you won't get frustrated and quit half-way through.  While every early developer probably wants to code the next first person shooter and make millions, most give up and settle for pong, or a text based game.

Finding that niche, that interesting bit of code to write can be challenging, so here's my advice.  Automate.  Code for things that you find tedious.  Code for things that you see other people finding tedious.  Not only are you able to create a time-saver in the process, but you're also creating a valuable product that may later sell.

One of the replies to the question named a few good ones.  Why not host a database to enter your monthly bills?  Then you could calculate power usage, and figure out whether the AC in the summer or the heater in the winter is costing …

Breaking Changes? Don't!

Sometimes other developers give me a funny look when I spend extra time decoupling code, or adding some extra configuration.  I explain to them that it allows for future changes to be easier, and they agree, but sometimes I get push-back and it just doesn't seem worth it to them.  So here's some perspective.

I have a confession to make: I hate python.  I can't stand it.  I haven't always been this way about it though, particularly, the things I hear about it on XKCD consistently make me take another look at it time and again.  The problem is, every time I go to look up some basic tutorials, I plug them into the interpreter and they break.  Even Hello World!

Why?  Because the makers of Python accepted a major breaking change into their code base after the language started to get popular.  In my personal opinion, if you make changes to your language that break a hello world tutorial, then your language can't be trusted long enough for me to spend time learning it.

Th…

Dependency Injection for Dummies

In the OOP world, everyone is all the rage about this Dependency Injection stuff.  So what is it?  In order to explain DI, I have to use the term Inversion of Control, so perhaps we should start there?  Well, the truth is, the whole thing is purely about *drumroll please* Decoupling.

When decoupling code, you have to identify the links between pieces of code.  For example, when attaching an arm to a robot, you would have to plug it into a slot in the shoulder.  The decoupled part has to plug into the rest of the code somehow.  However, as with robots, this would get really complicated.  Each piece plugs in uniquely, so if we're plugging in a leg down at the bottom, but it's not working right, we have to check the connection there.

IoC is like having all of the plugs in the robot's head.  The parts might be shaped differently in order to plug into the head, but they're the same parts.  In programming, IoC is the concept of selecting the decoupled parts at the beginning o…

Debugging? Write more tests!

I see alotofpeople on the internet talking about writing unit tests.  While they can provide tons of advice on when you need unit tests, I don't see a lot of people talking about how to start.  I mean, you're not suddenly unit testing on a brand new project.  You're going to likely start with a few thousand lines of spaghetti code.

So where do you start with that?  How do you test the untestable, extremely tightly coupled code that throws errors on every page?  Do you even bother?  Shouldn't you fix it, refactor it, then test it? ABSOLUTELY NOT!*

Unit Test First!
I cannot emphasize enough how important it is to test the code before you change it.  How are you supposed to ensure that existing functionality is kept if you don't find out what the existing functionality is?  Sure, it threw a bug on every page, but they were expected bugs.  They might be accounted for elsewhere in the code, and your change could break everything.

OK, that's out of the way.  You can r…

Prepare for a Programming Career

This post is a result of a question asked on one of my favorite tech forums.

As a programmer I spend a lot of time making sure I'm current.  I like to know what the industry thinks of my choices of languages and I try to make sure I'm learning the most profitable ones.

When I'm looking to keep current, it's important to know how skilled my potential future interviewer will be when I go to sit down for a programming interview.  Sometimes there is a great deal of variance, but overall, this site is a great reference for what types of questions you might get in an interview.  I can't count the times I've been asked about the differences between a class and a struct.

It's important to prepare for fizzbuzz questions.  If you can't answer a fizzbuzz question in the language, then you shouldn't be listing it on your resume.

I thrive on the internet and the massive information that streams about.  That's why I keep up so closely with Stack Overflow and

Decouple that Decoupled Code

Decoupling code is the process of separating concerns. In programming, it refers to separating the code into pieces and ensuring that each piece works on its own. Kind of like a robot might have a robotic arm that can work independently of the rest of the robot.

While not the first, Ruby on Rails has made decoupling popular in Web applications.  Everyone decided to get on the bandwagon here, so even Microsoft came out with an MVC Framework, now in it's 3rd edition.  Developers seem to love MVC.  It's simple, elegant, and most importantly, it's decoupled.

If you ever do Enterprise development, you'll quickly learn that MVC isn't the only way that apps are decoupled.  In many applications, particularly on the .NET side of things, you'll find that code is compartmentalized into components that plug into each other.  It's because of this that I am starting to perceive decoupling as happening in layers.

Let me try to map this out.  In a very very very broad vi…

Starting a Programming Blog

I'm not a big fan of blogging.  I have severalfailedattempts in the past, mostly because I don't have the time for it.  I had pretty much sworn off blogging for good pretty recently.  I had mostly stopped reading my RSS feeds from Google Reader.  The only evidence on the internet that I existed was starting to be my site and my Stack Overflow reputation.

But then, SO is kind of a blog isn't it?  I've been posting quite a bit, on multiple Stack Exchange sites.



I do it, in part because of Eric Lippert's comments,
answering the questions I didn't know the answers to, because those are the ones I would learn from. Mostly though, I prefer Albert Einstein's reason.
If you can't explain it simply, you don't understand it well enough. I got a new job...at NASA...as a Senior Developer, and I wanted to be good at it.  I started researching concepts like User Stories in SCRUM and Agile.  I started to monitor things like ISC and DZone much more closely than I h…