The 5 People in your Organization that grow Legacy Code

Preview:

DESCRIPTION

Have you ever looked at a random piece of code and wanted to rewrite it so badly? It’s natural to have legacy code in your application at some point. It’s something that you need to accept and learn to live with. So is this a lost cause? Should we just throw in the towel and give up? Hell no! Over the years, I learned to identify 5 main creators/enablers of legacy code on the engineering side, which I’m sharing here with you using real development stories (with a little humour in the mix). Learn to keep them in line and your code will live longer!

Citation preview

!

The 5 people in your Organization that grow

Legacy Code

Roberto Cortez JavaOne 2014

#CON4255

Roberto Cortez Freelancer, Speaker, RebelLabs Author, Blogger, Passionate Developer

twitter: @radcortez !

mail: radcortez@yahoo.com !

blog: http://www.radcortez.com

This presentation is NOT about

• Testing

• Tools

• Refactoring

• Or any other thing that you heard before (hopefully)!

It’s about

• Knowing yourself

• Knowing others

• Dealing with each other differences

“In historical terms, a legacy is something that is handed down from one period of

time to another period of time.”

(from Wikipedia)

What is Legacy?

Movie Time!

https://www.youtube.com/watch?v=PF7EpEnglgk

What is Legacy Code?

• Is it old code?

• Is it code no one wants to use?

• Or is just badly written code?

public static String getDayOfWeek(String data) { switch (getDOWNum(data)) { case 1: return "Monday"; case 2: return "Tuesday"; case 3: return "Wednesday"; case 4: return "Thursday"; case 5: return "Friday"; case 6: return "Saturday"; case 7: return "Sunday"; } return ("???"); }

public static int getTokenCounter(String[] tokens) { int j = 0; if (tokens.length >= 5) { j = 5; } else if (tokens.length == 4) { j = 4; } else if (tokens.length == 3) { j = 3; } else if (tokens.length == 2) { j = 2; } else if (tokens.length == 1) { j = 1; } return j; }

Legacy Code is

• Unknown

• Scary

• Ignored

Legacy Code is everywhere

• Huge investments in software are to solve

business problems, not code problems

• Technology evolves way faster than software

• New frameworks are released every year

How many frameworks?

Identify the Source!

• Code is written by developers

• Tools can help, but they are not enough

• Developers are the main contributors!

The Overly Energetic Engineer !

The Technology Enthusiast !

The Firefighter !

The Smartass !

The Intern

The Overly Energetic Engineer

The Overly Energetic Engineer

• Perfectionist

• High standard for Quality

• Ask a lot of questions

• Focus on key details

• Very critical

• Study a lot

The Technology Enthusiast

The Technology Enthusiast

• Very enthusiast about their work

• Friendly and open

• Speak a lot

• Optimist

• Wish to be recognised by their skills

The Firefighter

The Firefighter

• Enjoy helping others

• Like to work in teams

• Patient

• Calm people in stressful situations

• Investigate facts

The Smartass

The Smartass• Focus on instant results

• Demands from others

• Impatient

• Like to accept challenges

• Impose their rules

• Lead other people

The Intern

The Intern

• Developers starting their own career

• It’s a temporary stage

• They need to learn

Golden Rule?

“Treat others the way you want to be treated!”

WRONG!

Golden Rule!

• Everyone is different!

• Everyone have different needs!

• Psychology is tied with everything we do

• Learn how to handle each profile

Everyone is Different!

The Overly Energetic Engineer

• Delegate them important tasks

• Give them opportunities to show their skills

• Provide freedom to explore

• Assign investigation work

The Technology Enthusiast

• Don’t let them rearchitect

• Clarify how things should be done

• Research facts for the problems

• Need to be included in decision making

The Firefighter

• You shouldn’t pressure them

• They need to feel confidence

• Provide them with accurate information

• They may need a step-by-step plan to proceed

The Smartass

• Have all relevant information with you

• Provide them with end solutions

• Present alternatives

• Give them facts and direct answers

You have the tools!

Remarks

• People are not exclusive to one profile

• They can adopt any behaviour or even a

combination

• Usually, one profile more predominant

Proof? !

Empirical Data!

Inspiration

• Heavily inspired in DISC

• Behaviour assessment tool

• Dominance, Influence, Steadiness,

Conscientiousness

Wait! The Intern?

• Invest

• Promote peer code reviews

• Quick presentations about technology

• Teach them!

Last Words!

Golden Rule?

You can drive people’s behaviour by learning how to accommodate each

person unique characteristics!

Questions?

Thank you for Attending!

twitter: @radcortez !

mail: radcortez@yahoo.com !

blog: http://www.radcortez.com

Recommended