Archive for the 'Career Related' Category

The Important Things

I’m still working on my project to restructure the application where the original programmer cut and pasted thousands of lines of code.  So far, my fellow programmer, Steve, and I have eliminated over 100,000 lines of code.  In the process, we’ve improved performance and added functionality.

So, what are the important things mentioned in the title of this post?

1. Write decent code in the first place.  How?

  • Make good base classes to hold common functionality.
  • Constantly design and refactor code to keep it flexible, reusable, modifiable, and understandable.
  • Comment your code!  It’s usually obvious when a comment is out of date or inaccurate, but the value of an accurate comment, especially for confusing or complicated code is immense.
  • If you think you need to copy a fragment of code, think about putting it in its own method, base class, or separate class.
  • No, you won’t think of everything.  We all write code that we later regret, but the closer you get to good, the easier it will be to get to excellent later.

2. Think ahead.  That doesn’t mean that you should build in tons of functionality you don’t need now or may never need.  It means being conscious of what could come in the future.  Using reasonable data hiding to keep internal functionality flexible is a great way to start.  If you expose all of your data directly to other code, you have more places to change it if you find performance bottlenecks.

3. Stay creative.  Even when you’re working from a specification or set of requirements, you often have some flexibility in your coding.  Some amount of flexibility is usually included in the functionality.  If you work on consumer software, there’s usually a lot more flexibility.  It can’t hurt to bring it to someone’s attention or sometimes, to just go ahead an implement it.

4. Think globally.  It’s not just your code and your little part of the world.  Your personal value increases when you pick your head up out of your code and look at the application as a whole.  As long as you don’t step on everyone else’s toes, you’ll make the whole team look good.

Take away that man’s copy and paste

dctr

Looking for the perfect gift for a programmer or software engineer?  Try Design, Code, Test, Repeat.  It’s a fun, funny, and helpful read.

Now, on to today’s post.  I recently started working on a new project which involves modifying a large application.  After talking with the boss about what needs to be done, the first task became obvious.  The large application needed to get smaller.

To give you an idea of he horrors in this project, let’s start with the UI code.  There are three types of interactions you can have with the UI and they all look similar, but with slight modifications.  This UI is essentially duplicated for two units which you are interacting with.  So, what’s the best way to handle this?  Well, any normal programmer would write a bunch of methods or subroutines and divide the work, reusing the common code and making some exceptions here or there.  Or you might want to create a few classes and use some object-oriented way of differentiating the mechanics.

But, no.  Here’s what our hero did:  he copied all of the code.  So now, there are five extra copies of a ton of code that need to be maintained and modified for future work.

Next, there is a massive amount of data that is read from a database, put into an in-memory structure, and then set in the UI.  When the user wants to save, the data is read from the UI, put back in the in-memory data structures, then written back to the database.  There are hundreds of possible pieces of data to read and write.  Is any of this work done with a clever class or technique that uses a lookup table(s) or some other maintainable/enhanceable manner?  You already know that the answer is: no.  It’s all done one piece of data at a time, copied five more times.

I won’t tell you that I haven’t copied code; of course I have.  But, all of us have our tolerance for doing this.  Every time I copy a small section of code, I think, is this the time to add a method or class that does this job?  If it’s a large chunk of code, the answer is always yes.  If it’s just a few lines, I’m likely to say, next time for sure.

Here’s the real issue.  If you find yourself having to repeat the same procedure constantly to handle differences in names of data and their UI counterparts, it’s time to get creative.  I’ll be doing this shortly and I’ll let you know what I come up with.  Be sure it won’t be a copy and paste answer.

Driven to Distraction

I do double duty writing – software and fiction.  Some days I find myself more productive than others and it’s usually due to one thing – my internet connection.  It’s not what you think, actually.  Most of the time when my connection is good and I have several tabs open in my browser, my productivity sucks.  I keep waiting for something interesting to happen: an email from a colleague or friend, a good post on one of the blogs I follow, a good link posted on facebook, etc.

It’s too easy to while away a spare hour with this crap (let’s face it, it’s not a productive use of time.)  I find myself most effective when I shut down my browser.  That way, I can’t even notice that a new email has arrived (it’s probably just spam anyway).  No matter what work I’m doing, if I don’t need the internet to do it, I’m probably more productive not even being distracted by it.

A while ago, I had a discussion on the Comments section of Coding Horror about email.  The issue was about whether to send and read emails versus calling, and this leaked into the issue of checking email all the time.  The person on the other end of the discussion said he wasn’t distracted by looking at his email because Outlook pops up a little message in the corner of his screen when a new email arrives.  The problem with that is that it still interrupts your flow and writing anything is all about getting into flow.  It takes time to get your brain fully focused on an activity and any interruption, however slight, can keep you from operating at optimal capacity.

If you think you’re operating at full capacity, try shutting down your browser for a while and working and see if you get more done.  If you don’t think you’re focused enough, do the same thing.  I’ll be your productivity improves.

Computer Science Majors – Part 1

As a computer science major, you have certain advantages over other students.  You have ready access to the technology that’s used in the industry.  Unlike some types of engineering, you can build worlds entirely inside of the computer that’s probably sitting on your lap or at least on your desk.

If anything, it should also be clear that the next billion dollar idea might be only a few days coding away (think Facebook).  That’s not to say that you’ll make your fortune in software.  Most of us don’t become millionaires, but most of us do make a good living and it’s hard to think of a more flexible, enjoyable one at that.

In school, however, it’s easy to get lost in the just the coursework that you’re given and not think about the endgame (getting a job), but in fact, you have many opportunities to make that easier as well.  Each project is an opportunity to put a principal into practice.  Every homework assignment that involves writing code is a chance to practice the art of writing code.

The first step towards your career in software, starting from college, is to think about each class and each project like a something you did on the job.  When it comes time to write a resume for an entry-level software job, yours can stand out as more than a list of classes taken.  Add these projects to your resume and it will look like the resume of someone who has actually done something, which you have.

Next stop:  side projects, internships, summer jobs, and volunteer work.

Breaks and Creativity

dctr

Don’t forget to buy Design, Code, Test, Repeat.  It’s a fun, funny, and helpful read.

In one section of my book, I talk about taking a step away from your desk when you’re trying to figure out a tricky solution to a problem or are trying to think creatively.  If you don’t believe me, here’s an interesting article about different types of thinking.

I solve most of my creative problems and have most of my epiphanies when I’m not staring at the computer screen.  That’s not to say that I don’t come up with good stuff when I’m actively working – I do.  But it never ceases to amaze me how many great (well, I think they’re great, just allow me that) ideas I have when I’m taking the dog for a walk, taking a shower, or sitting at the dinner table – anytime I’m letting my mind wander.

Just yesterday I had an idea for a new project at the dinner table, then I came up with some more ideas related to it when I was watching TV later in the evening.  Next time you have a tough problem, try taking a break and taking the pressure off yourself.  Talk to yourself – explaining the problem to yourself or someone else can open up these same creative pathways.

Oh Yeah? Prove it!

It’s been a while since I’ve interviewed for a job.  The last time was when I was working at Lockheed and wanted to find something closer to home.  I went to a small, local software developer and two guys put me through the ringer with test questions.  At the end of a day of work, I was tired, uninspiring, not very sharp, and I didn’t get the job.  Some things are just as well, I suppose.  You won’t get every job you interview for because you’re not right for every job.  I probably wasn’t right for that job anyway.

In my 24 years of software development, I’ve given and received numerous types of interviews.  From grueling take home tests, on the spot tests, mind puzzles, behavioral interviewing, mindless “what did you do at your last job” questions, “what’s your greatest weakness”, etc.  In my experience, they all suck.  Interviewing just plain sucks.  I participated in the hiring of my new manager many years ago.  We put several guys through a two day process, finally chose one, and he still was clueless.  The fact is: interviewing is a crap-shoot.

Your best bet with interviewing is to try a combination of things.  If it’s for a programmer, then you have them do some programming.  They can do it at home or on paper during the interview, but it should be something that’s not a trick problem.  The purpose of something like this should simply be to make sure that this person can actually write some code.  Have them design a simple class to do a simple job (some people can code a procedure, but class design is beyond them).

Skip the mind game problems.  They’re dumb and all they prove is that they can either remember the answer or can figure out a mind game problem.  What color is a newborn African-American baby’s teeth?  Really?  The answer isn’t white.  It’s nothing – babies don’t have teeth when they’re born.

Your job when you’re interviewing someone is to find out if they can work with you and do the work.  Yes, make them do some coding.  Show them your code and ask them about it.  You might try some pair-programming with them.  Give them a demo of your product and see what their reaction/questions/comments about it are.  Are they engaged?  Interested?  Do they have a clue about your domain?  Can they understand what you’re talking about?

Talk about their previous work.  Find out what they’ve worked on – in detail.  What pieces of a product did they actually code?  In what language?  With what tools?

Finally, remember this is a two-way street.  Don’t treat your interviewee like a child.  You want them to want to work with you at your company.  I’ve been on many interviews where companies treat you like they’re the last hope you have of finding work, rather than courting you, and I’ve turned down jobs because of it.  Who wants to work for people who seem like they enjoy putting you through a ringer?

Managing Coach

I chose the title Managing Coach to point out the difference between this type of management and Managing First Class.  You might argue that it’s a horrible analogy, but let’s see where it goes.

I’ve had the pleasure of working with and for some wonderful managers, and conversely the pain and misery of working for bad ones.  A First Class manager sits separately from the rest of the crew (they’re all in cattle class, packed into cubicles, after all).  They hobnob with upper management and periodically make announcements during staff meetings about the status of the flight (or product release).  Then they go back to First Class, have another drink, and work on a presentation or other high-level document.  They have little knowledge of the daily activities of the developers and sometimes have little knowledge of the technology either.

The First Class manager, on the other hand, knows a lot about what’s going on in the rest of the company – the role their project plays, deadlines that others are facing, and their relationships to the ones his group is facing.  He’s able to stay on the radar of other company managers and his superiors.  Because of this, he’s able to hear about projects that his group might participate in, or that may affect the future of his group.

A Coach manager (there’s a double meaning to ‘Coach’) has more interaction with the passengers (developers).  He (or she) takes an active role in the day to day activities, providing guidance and inspiration.  He knows what people are working on, what’s moving and what’s not moving, and why.  If a developer is stuck, he knows enough to ask some pertinent questions and make a suggestion or two that might get the developer unstuck or walk away himself with a task to remove an obstacle.

Regardless of where a manager sits, it’s his activities that matter.  Some managers concentrate only on one aspect or another.  The best managers do both.  Just because a manager doesn’t have extensive knowledge of technology doesn’t make him useless in being a Coach.  There have been times in my career where my manager could have steered me in the right direction with a very non-technical conversation, if he had taken the time.  I can also remember numerous times when I was a manager, when developers would knock on my door, describe a problem in detail until my mind and eyes glazed over, then have an inspiration, thank me for listening, and leave with a solution in hand.  What role did I play?  Just a sympathetic ear.

You might gather from my last example that availability is a good trait to have.  If your manager is in meetings all the time, they’re probably a First Class manager (this is not a rule, by any means).  To be an effective development manager, being available to your developers and seeking them out for informal updates can make for a less intimidating and more informative and productive relationship.

If you’re a manager, think about what you can do to enhance both aspects of your management skills.  If you’re a developer, show this article to your manager to give him some food for thought.  Even managers need a coach.

Marketeering

Marketing people tend to get a bad rap, especially in software.  Just read a few Dilbert comics about the soulless folks in marketing and you’ll get a gist of their status.  I’m not suggesting that it’s entirely undeserved either, but not all marketing folks are dishonest, horrible people.  On the contrary, I’ve worked with many bright, knowledgeable folks who made a big impact on the company I was working for.

This post will deal mostly with an overview.  There are generally two kinds of marketing: inbound and outbound.  Inbound is the art of determining customer needs and producing products to meet those needs (i.e. taking in information).  Outbound is taking the products that you have and presenting them to the customers in the form of websites, webinars, presentations, brochures, advertising, trial software, etc. (i.e. sending out information).

Ideally, you’ll have folks at your company that are concerned with both inbound and outbound marketing.  Good inbound marketing is key to producing the products that customers will actually buy.  It should involve conversations with customers, and involve them in the testing of your software in alpha and beta stages of development.  I’ve always been leery of know-it-all people who come into the company and try to turn the place upside-down without any experience in the domain of the products (i.e. they’ve got 10 years of marketing experience, but they don’t know anything about building construction or software that supports it, for example).  That’s not to say that you shouldn’t hire someone not familiar with your domain, but you should expect them to, and encourage them to learn about it.  In the absence of this, your products can easily be led down a path of uselessness in the field.  It’s seriously hard to listen to folks who’ll pontificate on the direction your software should take when they haven’t a clue how it’s really used.  Expecting that your software will create a complete shift in how your customers will do business is a recipe for disaster.  Most companies are like slow-moving barges.  Having them move quickly because you’ve changed entire processes will likely result in a loss of sales.  When in doubt, ask several customers.

Good outbound marketing is essential to support sales and must be done at the appropriate level for your software and customers.  For example, if you write highly specialized software that costs thousands of dollars per license and will likely sell only a few copies per year, buying a Super Bowl ad is probably not a good use of your advertising budget.  Of course, the biggest bang for your buck is quality website.  When your customers find you, you save time and money.  Ensure that your site is clean and makes it easy to find out the information a user will want to know.  If possible, allow them to download a trial, preferably fully functioning.  After that, the marketing folks will have to figure out what to spend their money on to best increase awareness of your product and attract customers.  In my experience, huge booths at huge conferences are not cost effective if your software is high cost and long sales time.  For lower cost, easy to justify sales, it might work better.

This column isn’t the place to do a complete breakdown on marketing.  Besides, I’m a software guy and you probably are, too.  The point is to arm you will a little knowledge about what your marketing folks are supposed to be doing.  If they’re not, maybe you can nudge them in the right direction.  It can be hard to see the big picture when you’re in the middle of a detailed project.  Asking questions about what’s going on can lead everyone to think harder about the big picture and where the focus of effort should be.

Eating Your Own Cooking

There’s nothing like eating your own cooking to tell you how the food is.  Unfortunately, the pride we get from doing it ourselves can sometimes cloud our judgment.  The same thing applies to just about any other human endeavor.  People often have an inflated opinion of themselves and what they have or can accomplish (I’m no exception).  If you need any proof, just watch the first few weeks of American Idol.

Those of us in the software business tend to think that our own software is way better than anyone else’s.  Of course it is – you wrote it yourself, didn’t you?  Unfortunately, your competitors are filled with people just like you.  They’re probably just as smart as you and have the same pride in their work and their resultant software.  No one is beyond this kind of thinking – not even Joel Spolsky.  He wrote this a few months ago:

I had to wonder. We do have a large competitor in our market that appears to be growing a lot faster than we are. The company is closing big deals with big, enterprise customers. And the wheels are falling off the donkey cart over there as the company stretches to fulfill its obligations. Meanwhile, our product is miles better, and we’re a well-run company, but it doesn’t seem to matter. Why?

Step One, I think, is to pluck off our biggest competitors. We’re pretty certain that we’ve already built a great product that meets our customers’ needs — but there are still too many cases where we find out that, for some reason, someone went with the other guy. So that’s the development team’s mission for 2010: to eliminate any possible reason that customers might buy our competitors’ junk, just because there is some dinky little feature that they told themselves they absolutely couldn’t live without. I don’t think this is going to be very hard, frankly. Developing great software is something I’m pretty sure we’re good at.

Those are strong words. “Competitor’s junk”?  That’s a very common way of looking at your competition and it clouds your judgment because it’s usually wrong.  “Pluck off our biggest competitors”? If that’s so easy, why hasn’t it happened already?  I love Joel’s blog and admire his goals for his company, but there’s a lot going on and going wrong here.

The responses to his article were interesting. One in particular shows how personal our feelings are about our own software:

JIRA [a competitive product to Joel's Fogbugz] is a great product. I last used Fogbugz in June 2008, and then moved to a company using JIRA. It’s a real pleasure to use, which is good, because I use it for hours every day. Fogbugz was not a pleasure to use. Maybe Fogbugz is way better now, but if I were in a position to choose for another company, I’m pretty sure it would be JIRA all the way.

So, how do you get past this? One option is to eat your own cooking and the cooking of others. Get a copy of your competitor’s software. Dive into it and really examine its strengths and weaknesses. Find out what their customers like about it. Find out why they didn’t buy yours. Your sales and marketing staff is supposed to do this at your company.

On a more personal level, what can you do to improve your software? Use it yourself. If you can get a copy of your competitors, use it as well. What takes less time to get similar tasks done. How easy is it to do the job? What bugs do you find? Are there dead ends? Are there features missing? Does it take multiple steps to get a simple job done? Is there a method that’s counterintuitive or that requires users to change their way to doing business (this is big roadblock for some people)?

As a solo developer, I have the benefit of being the product designer as well as the coder. If I don’t find something easy to do in my products, I change it. If I can’t do something in the product, I add a new feature. If I run across a bug, I fix it. Note: when you run across a bug in your software, make sure that you either fix it or enter it in the bug database. It’s too easy to ignore bugs you live with every day because we developers are more tolerant of our own bugs – don’t be.  And don’t assume because you and everyone else lives with the bug that it’s in the database unless you check.

Finally, try to be objective. Stop pretending you love your own software so much and pretend you’re an end-user working with it for the first time. Then you’ll get an idea of why it’s so good or why it needs improvement.

Community

Gads, I’ve been writing software for a long time.  I started my professional career in 1986, writing LISP on Symbolics machines.  Back then, there was no web (well, not as we know it today) on which you could look up easy answers to coding problems, share toolkits, or converse with other developers (well, there was usenet, but it wasn’t the same world as it is today).

Today, we have a virtual community of developers.  While our companies may compete, it wouldn’t be unusual for two developers to accidentally help each other by responding to messages on a help board such as Stack Overflow.

Recently I posted a question there that I knew would elicit responses such as, “Why are you trying to do that?”  I know what I’m trying to do might be loony, but it seemed to make sense at the time.  Working alone at home, I don’t have the same personal networking with my colleagues that I used to have at previous jobs.  Sometimes I miss the interpersonal relationships, the banter, and the ability to bounce a nutty idea off another developer.  Instead, I do web searches and ask questions on forums.  At times, it can even be a little embarrassing to ask a question on a forum, but the fact is, everyone’s in pretty much the same boat.  Most developers are just like you and me – nice people, willing to help or give you and hand, and expect the same in return.

It’s a community of software developers, who write toolkits, utilities, sample code, and free applications that help us all get our work done.  I don’t know if Richard Stallman is right about all software being free, but I do know that with the free exchange of ideas we all write better software.  A big thanks to my fellow developers around the world.

« Previous PageNext Page »