the 5 people in your organization that grow legacy code

42
The 5 people in your Organization that grow Legacy Code Roberto Cortez JavaOne 2014 #CON4255

Upload: roberto-cortez

Post on 27-Nov-2014

1.341 views

Category:

Technology


1 download

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!

TRANSCRIPT

Page 1: The 5 People in your Organization that grow Legacy Code

!

The 5 people in your Organization that grow

Legacy Code

Roberto Cortez JavaOne 2014

#CON4255

Page 2: The 5 People in your Organization that grow Legacy Code

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

twitter: @radcortez !

mail: [email protected] !

blog: http://www.radcortez.com

Page 3: The 5 People in your Organization that grow Legacy Code

This presentation is NOT about

• Testing

• Tools

• Refactoring

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

Page 4: The 5 People in your Organization that grow Legacy Code

It’s about

• Knowing yourself

• Knowing others

• Dealing with each other differences

Page 5: The 5 People in your Organization that grow Legacy Code

“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?

Page 6: The 5 People in your Organization that grow Legacy Code

Movie Time!

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

Page 7: The 5 People in your Organization that grow Legacy Code

What is Legacy Code?

• Is it old code?

• Is it code no one wants to use?

• Or is just badly written code?

Page 8: The 5 People in your Organization that grow Legacy 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 ("???"); }

Page 9: The 5 People in your Organization that grow Legacy Code

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; }

Page 10: The 5 People in your Organization that grow Legacy Code
Page 11: The 5 People in your Organization that grow Legacy Code

Legacy Code is

• Unknown

• Scary

• Ignored

Page 12: The 5 People in your Organization that grow Legacy Code

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

Page 13: The 5 People in your Organization that grow Legacy Code

How many frameworks?

Page 14: The 5 People in your Organization that grow Legacy Code

Identify the Source!

• Code is written by developers

• Tools can help, but they are not enough

• Developers are the main contributors!

Page 15: The 5 People in your Organization that grow Legacy Code

The Overly Energetic Engineer !

The Technology Enthusiast !

The Firefighter !

The Smartass !

The Intern

Page 16: The 5 People in your Organization that grow Legacy Code

The Overly Energetic Engineer

Page 17: The 5 People in your Organization that grow Legacy Code

The Overly Energetic Engineer

• Perfectionist

• High standard for Quality

• Ask a lot of questions

• Focus on key details

• Very critical

• Study a lot

Page 18: The 5 People in your Organization that grow Legacy Code

The Technology Enthusiast

Page 19: The 5 People in your Organization that grow Legacy Code

The Technology Enthusiast

• Very enthusiast about their work

• Friendly and open

• Speak a lot

• Optimist

• Wish to be recognised by their skills

Page 20: The 5 People in your Organization that grow Legacy Code

The Firefighter

Page 21: The 5 People in your Organization that grow Legacy Code

The Firefighter

• Enjoy helping others

• Like to work in teams

• Patient

• Calm people in stressful situations

• Investigate facts

Page 22: The 5 People in your Organization that grow Legacy Code

The Smartass

Page 23: The 5 People in your Organization that grow Legacy Code

The Smartass• Focus on instant results

• Demands from others

• Impatient

• Like to accept challenges

• Impose their rules

• Lead other people

Page 24: The 5 People in your Organization that grow Legacy Code

The Intern

Page 25: The 5 People in your Organization that grow Legacy Code

The Intern

• Developers starting their own career

• It’s a temporary stage

• They need to learn

Page 26: The 5 People in your Organization that grow Legacy Code
Page 27: The 5 People in your Organization that grow Legacy Code

Golden Rule?

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

WRONG!

Page 28: The 5 People in your Organization that grow Legacy Code

Golden Rule!

• Everyone is different!

• Everyone have different needs!

• Psychology is tied with everything we do

• Learn how to handle each profile

Page 29: The 5 People in your Organization that grow Legacy Code

Everyone is Different!

Page 30: The 5 People in your Organization that grow Legacy Code

The Overly Energetic Engineer

• Delegate them important tasks

• Give them opportunities to show their skills

• Provide freedom to explore

• Assign investigation work

Page 31: The 5 People in your Organization that grow Legacy Code

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

Page 32: The 5 People in your Organization that grow Legacy Code

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

Page 33: The 5 People in your Organization that grow Legacy Code

The Smartass

• Have all relevant information with you

• Provide them with end solutions

• Present alternatives

• Give them facts and direct answers

Page 34: The 5 People in your Organization that grow Legacy Code

You have the tools!

Page 35: The 5 People in your Organization that grow Legacy Code

Remarks

• People are not exclusive to one profile

• They can adopt any behaviour or even a

combination

• Usually, one profile more predominant

Page 36: The 5 People in your Organization that grow Legacy Code

Proof? !

Empirical Data!

Page 37: The 5 People in your Organization that grow Legacy Code

Inspiration

• Heavily inspired in DISC

• Behaviour assessment tool

• Dominance, Influence, Steadiness,

Conscientiousness

Page 38: The 5 People in your Organization that grow Legacy Code

Wait! The Intern?

• Invest

• Promote peer code reviews

• Quick presentations about technology

• Teach them!

Page 39: The 5 People in your Organization that grow Legacy Code

Last Words!

Page 40: The 5 People in your Organization that grow Legacy Code

Golden Rule?

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

person unique characteristics!

Page 41: The 5 People in your Organization that grow Legacy Code

Questions?

Page 42: The 5 People in your Organization that grow Legacy Code

Thank you for Attending!

twitter: @radcortez !

mail: [email protected] !

blog: http://www.radcortez.com