Tag Archives: training

When Does Counting Lines of Code Make Sense?

ALERT: I’m not pulling any punches with this one. If you are looking for a balanced argument including thoughts on some potentially good reasons to measure LoC, you won’t find it here. The best reasoning I can give for the existence this article: it gives me something to point people to when they ask for my opinion on the topic.

Counting Added Lines of Code as a Measure of Productivity

“Any process or procedure that incentivises based on creation or destruction of lines of code is missing the point entirely.”

David Adsit
Software Craftsman – Pluralsight

Counting LoC drives bad behavior and is easily manipulated. It leads to developers being less concise and writing code that is difficult to maintain. There are so many ways to write code less efficiently and these are exploited in a scenario where LoC are measured for productivity.

Here is one extremely simple example of code inflation:

Arrays.fill(array, -1);

and

for(int i = 0; i < array.length; i++)
{
  array[i] = -1;
}

The above examples logically equivalent in Java. They both work. They both do the exact same thing. In C# the first could look like the following:

array = Enumerable.Repeat<int>(-1, array.Length).ToArray();

We could also write our own C# extension method to match the simpler Java method and use it throughout the code in future improving readability and maintainability.

public static void Fill(this int[] array, int fillValue)
{
  for(int i = 0; i < array.length; i++)
  {
    array[i] = fillValue;
  }
}

Once complete, it would be executed as follows:

array.Fill(-1);

This approach would lead to a couple of additional lines when it is first written ONCE and then only one line to do the same work forever after. Assuming of course that people know the extension method exists and they use it… another discussion perhaps.

One of the reasons we use modern programming languages is because they are expressive and easy to read. Even in a current modern language, older and more verbose approaches are still valid in code (to enable us to customize better approaches on our own that are not supported by the framework) and can easily be exploited by developers looking to boost their LoC written.

Counting Added LoC as a Measure of Productivity Must be Based on False Assumptions

“[Counting lines of code as a measure of productivity] presumes that each day or week or month is the same as the last day, week, or month, and that the thought stuff we actually get paid to do doesn’t matter.”

Dwayne Pryce,
Senior Software Engineer Microsoft Research

Measuring added LoC also assumes the work completed before, after, and during the coding process to determine best/cleanest/most maintainable/efficient approaches are meaningless and that testing to verify that the code does what is was intended to do is a waste of time.

Additionally, less-experienced junior developers are always going to write more lines of code than senior people for a variety of reasons.

  1. Junior people often take the easiest, most brute force approach because they haven’t learned to do it better. Yet.
  2. Junior people are given less complex tasks to solve that can be done more quickly.
  3. Progressively more experienced people have additional increasing responsibilities (for example mentoring and training less experienced people, doing more code reviews, being involved in architecture/design discussions, taking on difficult roles like security guild, creating documentation, etc.

1 and 2 are arguably best solved by pair programming. Another discussion. Another time.

Counting Removed LoC as a Measure of Paying Technical Debt

“Simplicity is the ultimate sophistication.”

Leonardo da Vinci

Same as measuring added LoC, counting removed LoC drives bad behavior and can lead to developers writing code that is intentionally overcompact and difficult to read. However, in a large and unwieldy application, we want to remove lines that serve no purpose at every opportunity while maintaining the same functionality. If this were trivial, we could simply automate programming and developers would no longer be needed. Making things simpler is, simply put, not easy.

Counting LoC as a Measure of Quality

In the history of computer science, there has never been a valid correlation between LoC and quality in any programming language in existence. Check the textbooks, the internet, or anywhere else you can think of. This correlation does not exist.

The Burden of Unnecessary LoC is Non-trivial

“Measuring programming progress by lines of code is like measuring aircraft building progress by weight.”

Bill Gates

I’ll use a slightly exaggerated example here, but it isn’t too far off, so please bear with me. Let’s assume we have two people attempting to solve a difficult problem.

Persona A

  1. may be less experienced or expert beginner
  2. just get’s it “done”
  3. tends to solving problems hastily without concern for introducing bugs
  4. often works quickly and on their own without taking time for design discussion, planning, and refactoring
Persona B

  1. may be more experienced
  2. cares about quality and hates bugs
  3. aims to understand the scope of the problem before starting to solve it
  4. involves others (seeking real input) to suss out design flaws and make take more complex problems to a mentor

I’ve seen real life scenarios where Persona A will solve a similar problem in 2000-3000 LoC where Persona B would solve it with 200-300 LoC. That may not seem so bad. Maybe Persona A finished their effort in less time than Persona B. Now consider, from the time this code goes into production until it is replaced/removed/refactored/decommissioned, we have to pay to maintain the code that was written. When we want to make a change in the behavior of the

Maybe Persona A finished their effort in less time than Persona B. Now consider, from the time this code goes into production until it is replaced/removed/refactored, we have to pay to maintain the code that is written. When we want to make a change in the behavior of the code or add a new feature, Persona A’s code may require days of review to understand and will also require many changes to achieve. To make a similar change to Persona B’s code, it could be understood in an hour, perhaps. The changes should take considerably less time depending on their complexity.

When we want to make a change in the behavior of the code or add a new feature, Persona A’s code may require days of review to understand and will also require many changes to achieve. To make a similar change to Persona B’s code, it could be understood in an hour, perhaps. The changes should take considerably less time depending on their complexity. Of course, this scenario is hypothetical. This is my one apology for rhetoric.

Coda

For clarity’s sake, I’m in no way arguing against hiring junior people. Fresh blood is vital for tons of reasons I won’t go into here. However, the effective incorporation of junior people must be accompanied by the correct structure and support from more experienced people in order for them to succeed. I AM against hiring expert beginners who’ve been doing this work for many years and thinks the “just get it done” approach is the best/only way.

 

2014 Developer Learning Guide: Part 3

This is the 3rd and final post in my series on continuous developer learning. I recommend you read 2014 Developer Learning Guide Part 1 and Part 2 if you haven’t already.

When I started writing about this subject, I thought I would cover all of the options in one post.

I.

Was.

Wrong.

One of the wonderful things about learning, is that there is a lot to learn about it! I’m in the process of recording a new podcast with a friend of mine and one of our first episodes will iterate just exactly why we believe continuous learning is so important. Stay tuned!

Now, the finale…

In-Person (Larger Groups/Formal Training)

Hackathons/Hack Nights

Hack-er
Um… wrong kind of hack!

This is one that I need to get more involved in. I’ve heard great things about hackathons. I only attended my very first one a couple weeks ago and it was a good experience (all WiFi issues aside).

Additional personal experience is more related to startup work even less formal than these events. There have been a couple of times I’ve tried to put together a quick app or program in a short amount of time using the MVP or “Minimum Viable Product” approach from The Lean Startup. I found that I learned a remarkable amount in a short amount of time.

I learned even more when I did this together with some friends who ranged in skills from entrepreneur to systems admin to programmer to business development.

Code Camps/Large Conferences

I’ve considered writing an entire post about these. There is nothing like being surrounded by others who are looking to improve and be awesome at what we do.

This kind of event can run from half a day to a full week. They tend to be a little heavier on the pocketbook, but you can find lower cost options as well. If you live in an area with a very active tech community, you will probably have many great local options that at least save you on the travel costs.

Conferences really get the creative juices flowing and keep you fired up about your work. Most major tech companies have at least one developer conference per year (Google, Apple, Facebook, Microsoft).

WWDC

Employers with a decent training budget send their developers to 1-2 larger conferences per year (almost never 3+).

I try to mix it up like so:

  • 1-2 out of town conferences. I enjoy travel and this is a nice opportunity to get out of the state for a few nights.
  • 2-3 local conferences. To help keep the budget down.
  • As many code camps as I can reasonably attend.

Why so many? There are a lot of topics I’m interested in and it just so happens that they are all related to my work. This year, I attended an AngularJS conference (ng-conf), an Agile conference (AgileRoots was amazing), Utah Code Camp, and DevFest Family. I’m still planning to attend a large UX conference and a more hard-core software engineering/architecture conference.

I’ve also found it extremely valuable to speak at some of these events. No one learns more than the person who stresses over getting in front of a bunch of smart people to tell them about something!

On-site Training

This type of training is great when you have a team that all needs to get on the same page.  Schedule a trainer to come out to your company on your schedule. I will turn you loose on Google for this one… do a little research and you will find many companies offering this type of service.

My experience here is positive. On-site training sessions can be highly valuable just make sure you get a great trainer. Interview them first or suggest a trial session.

Costs, I’m not super sure on but what is published online is $1000-5000 per session. If you think you will have an ongoing need for this, negotiate a better rate.

Certifications/Degrees

Certifications are highly valuable for IT people although they are not be as well recognized in development circles. I have a former boss who refused to interview candidates with Microsoft’s developer certification on their resume…

MIT
MIT. Yes, I know there’s a TARDIS on it.

Advanced degrees are valuable if you are specializing in certain areas of our field. Machine learning, concurrent programming, and human computer interaction are all excellent examples.

Both certifications and advanced degrees become considerably more valuable if your company is willing to pay for part or all of the tuition. Without that, I would probably avoid them because your return on investment may not be very good.

Conclusion

As you can see, the options for learning run the full gamut of price, time, and commitment. The great news is, even if your company has little or no budget for training, all you need is a couple committed developers to get started with the less expensive (free) types of training. Even better if your company agrees to a budget or commits to learning in other meaningful ways (time/food/support).

I recommend that you seek out employers who understand and value learning. I have and I couldn’t be more glad.

Remember to read 2014 Developer Learning Guide Part 1 and Part 2 if you haven’t already. Follow me on Twitter (@dubmun) for comments about development and other shenanigans.

Image credits:
Egg seller
A visit to Amsterdam always, always involves coffee
https://www.flickr.com/photos/bbcamericangirl/

 

2014 Developer Learning Guide: Part 2

In Part 1 of this sequence of blog posts, we covered online and print learning. Part 3 is now available as well. This time we will review some of the in-person options for learning and focus in on smaller groups. But first…

An Elaboration On “The Best”

I suggested in 2014 Developer Learning Guide: Part 1 that A-players, top developers, etc. only want to work for companies that have a great learning culture. This doesn’t necessarily mean that they already ARE working for these companies. The point is that, given the choice, the best developers know the value of learning and want to be part of groups where everyone is actively engaged in it. If you are already working for a company like this, I congratulate you on your outstanding choice!

The most common argument I’ve heard for choosing or sticking with a company with poor learning policies/funding: “If a company pays well enough, I can afford my own learning/training.”

Money Vortex
Don’t get caught in a money vortex that leads to stagnation.

This is true. The fallacy is that all of the developers will use their “extra money” for this purpose. We all have obligations and sometimes paying off that credit card or taking a family trip might take priority over paying for our own training. When the employer provides budget and opportunity specifically for training, the entire team is far more likely to take advantage of it. This leads to the entire team learning and growing together. You avoid the situation where stragglers are content to stagnate and contribute a steadily degrading quality of work (and contribute steadily degrading quality of feedback on teammates’ work).

TL;DR I stand by my original statement with a few caveats.

This is not to say that everyone should try to learn in the same ways. Some people don’t take much away from certain types of training and learning opportunities. There is absolutely nothing wrong with this, in fact, it is the purpose of these posts to provide a comprehensive list of the options that are out there! My hope is that you won’t focus on only one type of training. A rich selection of options awaits. I encourage you to try many and find out which work best for you.

In-Person (Smaller Groups)

Book Clubs

Start or join a book club/group/discussion. If you don’t like the word “club” find something different. Oprah won’t mind… why do you even care what she thinks? oprahAndDubmun Hopefully your company is willing  to sponsor a  book group with lunch provided and books paid. This is a minimal expense and provides a great return on investment. Reading books alone often isn’t enough. Having discussions with peers (who will definitely have takeaways you didn’t consider) is a great way to help maximize learning. In addition, adding coding exercises that pertain to the book topic occasionally really helps to cement the knowledge. More on that later…

One thing I’d like to call out here: if your group is larger than six people, consider breaking out into smaller groups for the majority of your discussion time. This is a neat trick I picked up from Mike Clement at Utah Software Craftsmanship meetups. Large groups tend to lend themselves a couple of antipatterns:

  • At best some participants may not participate because the more dominant voices in the room are taking up too much time.
  • At worst, you may have people napping in the back.

We implemented the breakout approach at my current company with great success. We get back together for an overall discussion for 10-15 minutes at the end of the hour and cover the points each group thought were most important.

Selecting the right kind of book is a very important concern here. Voting as a group is a nice way to get an idea of what people are interested in. Always be sure to select titles that will be good for discussion. Code cookbooks are an outstanding example of what not to read. I tend to prefer books grounded in theory, patterns, practices more than how-to books on specific technologies. If you aren’t sure where to start or don’t have money for books initially, there is a lot of great free material for discussions available online. Many blog post make for excellent discussions (hint, wink, nudge).

Presentations/User Groups/Meetups/Open Space

This section is a little more broad. Intentionally. There is an entire class of in-person interactions that can be extremely valuable learning tools. Many are existing groups and some you’ll have to go out of your way to create.

IPresentToYouTheOceanPresentations – The most formal entry of the section. Presentations are sometimes more valuable for the presenter than they are for the people watching. Nothing cements knowledge in your brain like stressing over sharing it with 5 to 500 other people all at once (for me anyway).

What you will take away from attending a presentation depends on your own personal learning style, the effectiveness of the presenter, and how much attention you actually pay to the presentation. I get nuggets from attending presentations but in general they have moderate value for me. So, “Present, present, present!” becomes my mantra.

“But where can I present?” you ask? The opportunities are out there. Present at work, user groups/meetups, coding dojos, code camps, large conferences, or just record yourself and post it online. Not sure how to get started? Go and watch someone present and ask them how they did it. This is also a topic I may write more on in the future.

User Groups/Meetups – Unfortunately I missed a great one of these (Utah Software Craftsmanship) last night because of pressing matters elsewhere. These groups are somewhat hit and miss, but if you find a few that are a good cultural fit and really match your interests they can be fantastic. User groups/meetups are a great place to learn, practice presentation skills, mingle with fellow techies, and often get free food.

Meetup LogoIf there isn’t a local user group that fits your interests, start your own. The most difficult part is securing a venue but local colleges and businesses are often willing to host your group. In addition, larger groups will attract sponsors who may provide swag for giveaways and/or food.

The best current place to look for a public group (or start one) is on Meetup.com.

Open Space Technology – I’ve only participated in one open space-style of meeting/collaboration unfortunately. It was at an Agile Roots conference back in 2009 and had a fairly profound impact on me. If you have the opportunity to attend an open space, I highly recommend it.

For more info check out OST on Wikipedia.

Coding Exercises/Katas

Coding exercises are a general term for writing code following a format lead by a presenter. There are many different subsets of exercises including design, gamified, and code katas. All of these have value, but I’m going to focus on the latter.

If you aren’t familiar with the term code kata, here is what Wikipedia says:  “code kata is an exercise in programming which helps a programmer hone their skills through practice and repetition.http://en.wikipedia.org/wiki/Kata_(programming). I like to compare it to a martial arts kata where we work to develop the equivalent of “muscle memory” for certain coding techniques. Kata Coding dojos are specialized meetups of people who perform code katas as a group. Participating in a coding dojo is something I look forward to every week. I always learn something new and almost always have the opportunity to help others do the same.

I have a future blog post queued up about my experience with starting a coding dojo at HealthEquity over the past year.

Part 3

It turns out I have too much to say for a 2 part post. In the third and final part of this post I will cover more in-person options for learning. It focuses on larger groups and formal training. Find it here: Part 3.

Also, be sure to check out Part 1 if you missed it.

I’d love to see your thoughts and comments below or to @dubmun on Twitter.

So You Think You Want To Write Code?

Intro

I had the opportunity to present a couple of sessions at the inaugural Dev Fest Fam conference today.

I’ll predict your next question: “Is this what has been keeping you from posting  the sequel to 2014 Developer Learning Guide Part 1?” The honest answer is no. I’ve been busy, it’s true, but I want the next installment of this post to be very good so I’ve been particular about publishing it until it is 100% ready.

#DevFestFam

http://devfestfam.com/#sessions

This conference is a fantastic idea! It was put on by a couple of local Google User Groups and hosted at Utah Valley University. For a first time conference, it was great and I have the feeling it will only get better. The beauty of it, was that coders/programmers/developers/engineers were to bring not only their spouse or significant other, but also their kids.

I took 3 of my own and they LOVED IT. My 10-year-old daughter coded all night long until it was time for her to go to bed after we came home! So cool!

My first session, “So You Think You Want To Write Code?” was a big hit and well attended:

session attendance
Almost a full house!

 

The second was at the end of the day and was titled: “Websites for Smarties”. It was a beginners hands-on-session teaching the basics of HTML. I used w3schools and Google Sites  as resources for teaching. I won’t post more on that here.

So You Think You Want To Write Code? Resources

The slides from my session “So You Think You Want to Write Code?” at Dev Fest Fam 2014 for kids age 8 and up.

 

The videos played:

 

I also handed out a flyer with the following information.

Online Resources
Code.org – code.org
Codecademy – codecademy.com
Pluralsight: Free Courses for Kids – http://www.pluralsight.com/training/Kids
Kids Ruby – kidsruby.com

Languages/Platforms
Scratch – scratch.mit.edu
Hopscotch – gethopscotch.com
Alice – alice.org

Other
BOOK: Snake Wrangling for Kids – http://briggs.net.nz/snake-wrangling-for-kids.html
GAME: Hakitzu Elite: Robot Hackers – Google Play and iTunes
MORE RESOURCES: http://happynerds.net/

2014 Developer Learning Guide: Part 1

Background

This is part 1 of a now complete series of blog posts. Be sure to read 2014 Developer Learning Guide Part 2 and Part 3.

I originally wrote on the subject of developer training in 2010. It was with the idea that I would convince management of the importance of training technical employees. I wrote an internal document for my boss and we implemented a couple of the ideas. My boss was understanding although his boss was less so and that limited some of our options. One year (and one move to Texas) later and I was back in the same boat; I was handing a document off to my boss and trying to convince him of its validity and importance. We eventually started some great traditions at that company and I ended up publishing my Guide To Developer Training For Managers on my blog around the same time. As I started looking into moving back to Utah in late 2012, I was despairing that I would forever have to sell leadership on the value of developer training every time I came to a new company… can you say facepalm?

facepalm

It occurred to me that I might be taking the wrong approach. As I ramped-up  on interviews I noticed that a couple of companies stood out because they already had begun to establish a culture of learning. I’m happy to say that I chose one of those companies and today I enjoy a work environment where leadership not only “gets it” but is an active promoter of learning and training. Ideas that are brought up to improve training are not only appreciated but are also seriously considered. And I don’t even have to write a long and windy proposal first.

What a difference!

I’m still going to talk briefly about a few of the reasons developer and technology employee learning is important. Convincing managers will no longer be the major focus of the article. As you may have noted from the updated title, I’m refocusing to list learning options that are possible, valuable, and current. I’ll also post an updated list each year.

Importance

The anecdote I’ve heard several time goes like this:

Decision Maker 1: What will happen to our company if we train our technology employees and they leave to find better jobs elsewhere?
Decision Maker 2: What will happen to our company if we do not train our technology employees and they stay?

Two varying points of view obviously.

On a team where learning is not important, developers tend to stagnate or move on. Will the best talent stay in an environment like this? I’ll spare you the A, B, and C-Player talk. It should be sufficient to say that a lack of learning isn’t healthy for development culture.

Ultimately, it is the responsibility of the developer to seek learning and the best developers know this. Are the best developers going to be working for companies without a great learning culture? That scenario seems unlikely to me.

Learning Options

What if I told you that a classroom isn't always the best learning environment?
Developer training doesn’t necessarily begin or end in the classroom.

There is a wide spectrum of cost among differing methods of learning. A good mix assures plenty of coverage without completely breaking the bank.

This list is meant to be only as inclusive as I could make it given my current knowledge. Please leave a comment or contact me if you know of options I’ve missed.

Online/Print

Videos

This is usually one of the best places to look for technology-specific and implementation-specific training. There are multiple options and they are growing all the time.

Free – YouTube, Vimeo, Egghead.io, Channel9, etc.
The quality of free videos varies. The only advice I can give, is to avoid wasting time with something that doesn’t seem valuable pretty quickly.

Subscription – Pluralsight, Wintellect Now, Lynda.com
Subscription-based video training tends to be pretty well curated by the company selling the subscriptions. They rely on ongoing subscriptions for revenue so new high quality content is constantly being released (or the model is not successful). Pluralsight (http://pluralsite.com/) in particular has an enormous and constantly updated library… and no, we aren’t affiliated. Pluralsight has purchased several of the smaller players to help build out their library over the past couple of years. Subscription may cost as much as $499 per year, and is a good return on investment if you learn well this way.

Purchase – Udemy, Cleancoders.com, etc.
These tend to also be of higher quality than the free options in my experience. There are some great sources out there… but you may have to hunt for them. Word of mouth has been valuable to me here.

Social Media/Blogs/Podcasts

If you enjoy this blog, follow me on Twitter.
If you enjoy the blog, follow @dubmun on Twitter.

There are a wide variety of options here. Find people who talk about things you are interested in and subscribe to their blogs or follow them on Twitter/Google+. In my experience, many of the thought leaders in the developer community are on Twitter. This has the added benefit of allowing interactions if you have a question about someone’s latest tweet or blog post.

Podcasts can also be very, very good as long as they aren’t too sales/technology focused. Choose wisely. I find them particularly useful for long commutes. HerdingCode (http://herdingcode.com/), Ruby Rogues (http://rubyrogues.com/), and Writing Excuses (my SF/Fantasy writing guilty pleasure) are among my personal favorites. A good podcast app is a must as well… downloading all the episodes manually can get tedious.

This is where the cutting edge lives and breathes. If you want to know what is really happening you should be reading and hopefully contributing to this kind of content.

Open Source Repositories

This is the section for Github, Codeplex, Google Code, and Sourceforge. Github is definitely the current leader and you can find awesome and interesting code in any of these repositories.

Looking at how other people code is a great resource for learning. Additionally, submitting a pull request to an open source project can be the fast track to learning (albeit a potentially humbling one). Humility is a good thing, it lets us know where we can improve.

Books

I’ve heard a lot of varying opinions on books as a training resource. Yes, technology-specific books are often outdated before they are printed. I generally avoid the latest C#, Java, Clojure, Javascript, etc. books (with a few exceptions). The flip side of this is… if you do choose to read tech-specific books, be sure to get the latest version.

What a library!
Some options here…

My thought is that when you are really looking to deepen your knowledge on something specific, books are a great resource.

There are also many classics that are as close to timeless as you can get in this industry. I highly recommend books like The Pragmatic Programmer, Clean Code, The Art of Unit Testing, Design Patterns, and Domain Driven Design as examples of excellent resources for learning practices and patterns or as reference material.

Books are available in several formats as well: hard-copy, ebook, and subscription.

Hard-copy and ebooks are basically just a matter of preference. I find that I like having a hard copy of books I might lend to others, but nothing beats the convenience of an ebook that you can read on multiple devices. When I have the option, I get both.

Subscription to a service that provides ebooks can be really handy as well. Particularly if you find yourself reading a lot of technology-specific books. Safari Books (http://www.safaribooksonline.com) offers hundreds of titles on technical subjects for $199 or $460 annually.

Remember…

…to read 2014 Developer Learning Guide Part 2 and Part 3.

I’d love to see your thoughts and comments below or on Twitter (@dubmun).