DaedTech

Stories about Software

By

CodeIt.Right Rules, Explained Part 5

Editorial note: I originally wrote this post for the SubMain blog.  You can check out the original here, at their site.  You can also read a lot more, both on that blog and in their documentation, about CodeIt.Right’s analysis rules.

Today, I’ll do another installment of the CodeIt.Right Rules, Explained series.  This is post number five in the series.  And, as always, I’ll start off by citing my two personal rules about static analysis guidance, along with the explanation for them.

  • Never implement a suggested fix without knowing what makes it a fix.
  • Never ignore a suggested fix without understanding what makes it a fix.

It may seem as though I’m playing rhetorical games here.  After all, I could simply say, “learn the reasoning behind all suggested fixes.”  But I want to underscore the decision you face when confronted with static analysis feedback.  In all cases, you must actively choose to ignore the feedback or address it.  And for both options, you need to understand the logic behind the suggestion.

In that spirit, I’m going to offer up explanations for three more CodeIt.Right rules today.

Read More

By

Spring Cleaning Your Code Review

Editorial note: I originally wrote this post for the SubMain blog.  You can check out the original here, at their site.  While you’re there, have a look at the automated code review tool, CodeIt.Right.  

Many of us have a natural tendency to let little things pile up.  This gives rise to the notion of the so-called spring cleaning.  The weather turns warm and going outside becomes reasonable, so we take the opportunity to do some kind of deep cleaning.

Of course, this may not apply to you.  Perhaps you keep your house impeccable at all times, or maybe you simply have a cleaning service.  But I’ll bet that, in some part of your life or another, you put little things off until they become bigger things.  Your cruft may not involve dusty shelves and pockets of house clutter, but it probably exists somewhere.

Maybe it exists in your professional life in some capacity.  Perhaps you have a string of half written blog posts or your inbox has more than a thousand messages.  And, if you examine things honestly, you almost certainly have some item that has been skulking around your to-do list for months.  Somewhere, we all have items that could use some tidying, cognitive or physical.

With that in mind, I’d like to talk about your code review process.  Have you been executing it like clockwork for months or years?  Perhaps it has become too much like clockwork.  Turn a critical eye to it, and you might realize elements of it have become stale or superfluous.  So let’s take a look at how you can apply a spring cleaning to your code review process.

Read More

By

Are Code Rules Meant to Be Broken?

Editorial note: I originally wrote this post for the NDepend blog.  You can check out the original here, at their site.  While you’re there, take a look at the NDepend’s code rules.  Interested in me writing for your site?  Get in touch through our content marketing business.

If you’ve never seen the movie Footloose, I can’t honestly say I recommend it.  If your tastes run similarly to mine, you’ll find it somewhat over the top.

A boy from the big city moves to a quiet country town.  Once there, he finds that the town council, filled with local curmudgeons, has outlawed rock music and dancing.  So follows a predictable sequence of events as the boy tries to win his new town over and to convince them of the importance of free expression.  You can probably hear his voice saying, “come on, Mr. Uptighterton, rules are made to be broken!”

Today, I’d like to explore a bit the theme of rules and breaking them.  But I’ll move it from a boy teaching the people from American Gothic to dance and into the software development shop and to rules around a codebase.

Perhaps you’ve experienced something similarly, comically oppressive in your travels.  A power mad architect with a crazy inheritance framework.  A team lead that lectures endlessly about the finer points of Hungarian notation.  Maybe you’ve wanted to grab your fellow team members by the shirt collars, shake them, and shout, “go on, leave the trailing underscore off the class field name!”

If so, then I sympathize and empathize.  Soul crushing shops do exist, seeking to break the spirits of all working there.  In such places, rule breaking might help if only to shake people out of learned helplessness and depression.  But I’m going to examine some relatively normal situations and explore the role of rules for a software team.

Read More

By

How You’re Probably Misunderstanding TDD

Editorial note: I originally wrote this post for the TechTown blog.  You can check out the original here, at their site.  While you’re there, take a look around at their training courses.  

Let’s get something out of the way right up front.  You might have extensive experience with test driven development (TDD).  You might even practice it routinely and wear the red-green-refactor cadence like a comfortable work glove.  For all I know, you could be a bonafide TDD expert.

If any of that describes you, then you probably don’t actually misunderstand TDD.  Not surprisingly, people that become adept with it, live, and breathe it tend to get it.  But if that introductory paragraph doesn’t describe you, then you probably have some misconceptions.

I earn my living doing a combination of training and consulting.  This affords me the opportunity to visit a lot of shops and talk to a lot of people.  And during the course of these visits and talks, I’ve noticed an interesting phenomenon.  Ask people why they choose not to use TDD, and you rarely hear a frank, “I haven’t learned how.”

Instead, you tend to hear dismissals of the practice.  And these dismissals generally arise not from practiced familiarity, but from misunderstanding TDD.  While I can’t discount the possibility, I can say that I’ve never personally witnessed someone demonstrate an expert understanding of the practice while also dismissing its value.  Rather, they base the dismissal on misconception.

So if you’ve decided up-front that TDD isn’t for you, first be sure you’re not falling victim to one of these misunderstandings.

Read More

By

Becoming a Freelance Developer and Taxes

It’s been a while since my last reader question post.  That was the one where I confusingly announced on a Tuesday that I’d be doing reader question Mondays.  Well, today I start a new streak of doing reader question posts on Mondays.  My apologies for dropping the ball on that, but I took on a full time consulting gig for a few weeks while also running my content business evenings and weekends.  It was a busy run.

Anyway, let’s get down to business.  Both in the Developer Hegemony Facebook group and through other media, people have asked about some nuts and bolts freelancer/entrepreneur type things.  And, after recent videos about creating an EIN and filing for an LLC, the pace of those questions has increased.  So, apologies to those who come to this blog looking for rants about the perils of global state or unit testing.  Today, we talk taxes.

If I’m thinking of going off on my own, how do taxes work?

Nobody has asked me the question in these exact words.  Rather, this is a composite of what various people have asked.  So, without further ado, let’s dive right into the least interesting subject on the planet.  I’ll do what I can to make it fun.

Obligatory Disclaimers

Mercifully, I am neither a lawyer nor an accountant.  Nothing against either profession, per se — they’re just not for me.  I mention that here so that you understand the context of this advice.

I am going to describe what I have, myself, done, along with my understanding of how it works and various other options that I might have.  I’m pretty confident that I have a relatively complete understanding for a layman in those fields.  But there may be finer points that you’d need an accountant or lawyer to illuminate.

In the context of the software world, think of me as a the equivalent of a guy with 3 years of .NET experience teaching newbies.  I’ll get enough right to help them a lot, but I might not nail some of the more arcane language points or sophisticated design strategies.  Caveat emptor.

Non-US readers, this is also entirely US-centric.  I hope some of it helps, though.  I’ve had people from other countries tell me in the past that some of my videos/posts along these lines are helpful.

Taxes in the Wage Labor World

For the sake of easy math, let’s say that you take a job for $120,000 per year.  Let’s also say that the employer pays you monthly, at a nice, round $10,000 per month.  That should make it easy to figure out how much you’ll pay in taxes, right?

Wrong!  There’s no figure round enough to make it easy to figure that out in the US.  You go to a calculator like this, expecting to type in $10,000 per month and seeing that you owe something like $2,200 per month in taxes.  Instead, it wants to know whether you’re single, how many “dependents” you have, and something about “exemptions.”  And that’s a simple one.  Some probably ask you about your mortgage, whether you live in a flood plain, and how many blind uncles named Dwayne you put in rest homes last year.

Read More