melreams.com

Nerrrrd

Tip of the day

Remember how great Authenticator Plus is? Recently a coworker told me about another great thing it can do – categories! If you have 2FA set up for many accounts like I do, it gets to be a pain scrolling through that list to find the one you want. Categories to the rescue! From the settings menu go to manage categories, from there you can create new categories and put authenticators.. Read More

Be a better programmer while still having a life: part 9

Don’t reinvent the wheel! I’ve touched on this before, but it definitely merits its own post. A huge part of becoming a better developer is understanding when you don’t need to write new code to solve a problem. The more code you write, the more code you have to maintain, the more chances you have to screw it up, and the more time it takes to write it. So before.. Read More

Code smell: long parameter list

Today’s code smell is long parameter lists. If you have lotsĀ and lots of parameters, something is likely going wrong. Odds are good your method is just doing too much, which leads to confusing code that’s hard to understand and change. Another reason lots of parameters causes problems is that when you call that method, it’s very easy to accidentally get two parameters of the same type in the wrong order.. Read More

Code smell: feature envy

Today’s code smell is feature envy. Feature envy is when one class uses the methods of another class to excess. It’s called feature envy because classes that use methods from another class excessively look envious of that class’s features. The problem with that, as usual, is the way your logic gets spread around between multiple classes. If you have one method that’s using another class so much that it’s hardly.. Read More

Link of the day

Jessica Kerr has a really interesting blog post about how code reuse is often overrated. Back in college I learned all about how important code reuse was and how duplicated code was the worst, but we never (probably because we had a lot of material to cover in a limited time) talked about how code reuse can cause problems. Jessica gives a great explanation of how bad code reuse can.. Read More

Code smell: switch statements

Today’s code smell is switch statements. Long switch statements or complicated if statements often (but not always!) mean that something has gone wrong with your design. Objected oriented languages give you a lot of tools to avoid big complicated switches, if you aren’t using one of those there needs to be a good reason for it. If you’re not using an object oriented language, on the other hand, I’m honestly.. Read More