2. Obligatory “About Me” Stuff
Chief Consultant / Owner, South Of Shasta
Stuff: ColdFusion, C/C++, PHP, WordPress,
Android, jQuery, Ruby, .NET, AngularJS,
On-site Training, etc.
SacInteractive Co-Manager
Reformed video game developer
Music junkie
3. Today's Agenda
What is a “Best Practice”?
An Explanation of “Technical Debt”
Sometimes I've Had to Break The Rules
How To Fix Things Later
Other Resources
5. I run a consulting business
Often includes taking over legacy projects.
Can't always rebuild from scratch.
Have to make decisions.
Developers are paid to solve problems
Does the client care how I solve it?
What can I fix, given the resource
constraints?
6. I run a consulting business
Some factors to consider:
– Being able to draw a line in the sand.
– Good. Cheap. Quick.
● Pick two.
– The 80/20 Rule.
7. I run a consulting business
Make it work now and make it elegant in
version 2 if need be.
Don't Let Perfect Be The Enemy Of Good
8. What is a “Best Practice”?
Google says this:
Commercial or professional procedures that
are accepted or prescribed as being correct
or most effective.
9. What is a Best Practice?
But it is still a practice
The practice of medicine
Because sometimes...it's wrong
10. What is a Best Practice?
● Today's “Best Practice” is tomorrow's “Bad
Idea”.
● Best Practices sometimes come and go
quickly.
● Good Practices might be better than Best
Practices sometimes.
11. What is a Best Practice?
Your mileage may vary – deadlines are real
Client doesn't care what's recommended
Just want it how they want it
StackOverflow: “Well I would never do it
THAT way!”
Reality: sometimes you HAVE to do it
THAT way
12.
13.
14.
15. What is “Technical Debt”?
No project is perfect
Shortcuts are sometimes inevitable
Shortcuts cause “Technical Debt”
16. What is “Technical Debt”?
A dam has a leak.
Can stick a finger in the leak.
Eventually you run out of fingers.
Remove the brick and replace it.
17. StackOverflow: Well, I would never do it
that way!
These are the times that I had to do it that
way.
24. When the problem isn't in code
So... my hands are completely tied and I
have to change all of the URL strings that
are passed with "Alter" in them (of which
there are many) to "altr".
– Poor guy on a Google forum, recently
25. When the problem isn't in code
Find a stakeholder, outside of IT
Communicate the issue
– In a non-technical way
– Users have a lesser experience
– Magic phrase: “Lower click-thru rate”
– Magic phrase: “Lower conversion rate”
26. How To Fix Things Later
Bootstrap
– “works” fine in table-based websites. Minor
side-effects, nothing crazy.
jQuery
– can just “sit there” for later.
LESS / SASS
– to refactor old CSS.
27. How To Fix Things Later
Source Control.
Task tracking / ticket systems.
Testing tools.
Tools for automating.
“I don't have time”.
– 30 minutes a day works wonders!
Seriously.
28. How To Fix Things Later
Don't be afraid to ask questions
Post on Google Groups, StackOverflow,
whatever.
Talk to people at the conference!
29. How To Fix Things Later
“But when I post on StackOverflow, I get
yelled at for doing it wrong!”
Senior Developer != Great Communicator
<rant>”how to ask questions”</rant>
33. Obligatory “About Me” Stuff
Chief Consultant / Owner, South Of Shasta
Stuff: ColdFusion, C/C++, PHP, WordPress,
Android, jQuery, Ruby, .NET, AngularJS,
On-site Training, etc.
SacInteractive Co-Manager
Reformed video game developer
Music junkie
18 years software development
Chief Consultant / Owner, South Of Shasta
Consulting for 7 years
Teach classes.
Stuff: ColdFusion, C/C++, PHP, WordPress,
Android, jQuery, Ruby, .NET, AngularJS, etc.
SacInteractive Co-Manager (formerly
Sacramento CFUG)
Reformed video game dev – Lucas, Maxis
Music junkie
34. Today's Agenda
What is a “Best Practice”?
An Explanation of “Technical Debt”
Sometimes I've Had to Break The Rules
How To Fix Things Later
Other Resources
36. I run a consulting business
Often includes taking over legacy projects.
Can't always rebuild from scratch.
Have to make decisions.
Developers are paid to solve problems
Does the client care how I solve it?
What can I fix, given the resource
constraints?
37. I run a consulting business
Some factors to consider:
– Being able to draw a line in the sand.
– Good. Cheap. Quick.
● Pick two.
– The 80/20 Rule.
Being able to draw a line in the sand.
A skill I struggle with.
When is “good enough” truly “good enough” but won't
come back to bite me (at least not SOON)?
38. I run a consulting business
Make it work now and make it elegant in
version 2 if need be.
Don't Let Perfect Be The Enemy Of Good
39. What is a “Best Practice”?
Google says this:
Commercial or professional procedures that
are accepted or prescribed as being correct
or most effective.
40. What is a Best Practice?
But it is still a practice
The practice of medicine
Because sometimes...it's wrong
41. What is a Best Practice?
● Today's “Best Practice” is tomorrow's “Bad
Idea”.
● Best Practices sometimes come and go
quickly.
● Good Practices might be better than Best
Practices sometimes.
42. What is a Best Practice?
Your mileage may vary – deadlines are real
Client doesn't care what's recommended
Just want it how they want it
StackOverflow: “Well I would never do it
THAT way!”
Reality: sometimes you HAVE to do it
THAT way
43.
44.
45.
46. What is “Technical Debt”?
No project is perfect
Shortcuts are sometimes inevitable
Shortcuts cause “Technical Debt”
Working on a project, come across a bug/change you need to make.
The “best practice” might involve adding a “big chunk” of code
(relatively speaking). (i.e. updating to a new version of a 3rd party
library, making reconfiguring how some old functions work, maybe all
of the above.)
The deadline is approaching, or the client is getting antsy (same thing).
So you throw a “short cut” into the code – maybe hack a “global”
variable or 2 into the code to get it DONE now.
Short term: that might work fine.
Longer term: you've incurred some “technical debt” into the application.
Taking a “loan” out at the bank; eventually that loan has to be paid
back.
47. What is “Technical Debt”?
A dam has a leak.
Can stick a finger in the leak.
Eventually you run out of fingers.
Remove the brick and replace it.
If a dam springs a leak, we can
a) stick our finger in the hole (quick) – technical debt
you eventually run out of fingers!
b) remove the offending brick, rebuild a better, stronger one.
Might take more time, but is better long-term decision.
48. StackOverflow: Well, I would never do it
that way!
These are the times that I had to do it that
way.
49. Some real-world bad situations
Stuff happens.
The following are true stories from different projects
I've worked on.
In which the “best practice” wasn't a viable option.
50. When might you use CFML
Instead of CFScript?
Site was under source control (good).
Client knew how to hand edit small bits of HTML (links, bold,
underline, new paragraphs of verbiage, etc).
Did not want to change his work flow. Refused.
This is the guy signing the checks and approving my budgets.
You can't always just say “no, that's not a best practice”.
Solution: installed Git on the server.
Created a link that ran a BAT file, doing a “git commit” for recent
changes.
Could run this script periodically on Production.
Or client could run it to let me know he was finished changing
things (i.e. just click this link when you're done making edits.)
Yes, we are changing code on Production.
No I'm not happy about it.
And neither are the StackOverflows.
...but the guy approving the budgets was.
(and everything got added to source control...eventually)
Longer term: he needed a WYSIWYG and some changes to the
app, but this worked for now, and we finished the app!
51. When the client demands the ability to
change HTML in the source code via FTP
...in Production!
Site was under source control (good).
Client knew how to hand edit small bits of HTML (links, bold,
underline, new paragraphs of verbiage, etc).
Did not want to change his work flow. Refused.
This is the guy signing the checks and approving my budgets.
You can't always just say “no, that's not a best practice”.
Solution: installed Git on the server.
Created a link that ran a BAT file, doing a “git commit” for recent
changes.
Could run this script periodically on Production.
Or client could run it to let me know he was finished changing
things (i.e. just click this link when you're done making edits.)
Yes, we are changing code on Production.
No I'm not happy about it.
And neither are the StackOverflows.
...but the guy approving the budgets was.
(and everything got added to source control...eventually)
Longer term: he needed a WYSIWYG and some changes to the
app, but this worked for now, and we finished the app!
52. ColdFusion: When I used CFForm/CFSelect
on a recent project
...and it was the right thing to do
US Post office
when you’ve got 2 DAYS to train 3 NON-developers
on how to maintain a ColdFusion applicaiton
already in place….taht’s already using CFForm,
CFSelect etc.
They had ZERO coding experience
But Dreamweaver made sense and “clicked” for
them.
Is it REALLY the best solution to try and teach them
OO and Model-Glue in a position like that?
Probably not.
53. When an open source MVC framework
wasn't the right answer
and “rolling my own” framework
was the correct decision
Large scale web app for the semi-conductor industry.
Had quickly approaching deadlines (conf's and client
demos).
Leadership gave me a budget for 3 junior developers
(I “inherited” the team.)
2 junior web guys
1 retired Fortran / Assembly developer
...but they all knew what XML was and how it worked.
Teaching 3 people OO + MVC + Mach-ii would have taken
lots of time.
Instead, we wrote a DSL in XML.
The junior devs could help “describe” the different pieces of
the app in XML and tell me what they needed the
language to do.
I wrote the DSL “engine”
(which actually was OO, just not at the level the junior dev's
cared about.)
54. Is emailing errors to the team always a
bad idea?
No.
Fusion. Non-technical clients
NO idea what happens on their server
Showing them a bar graph of “bad IIS requests per hour
that hit the ColdFusion connector via HTTP” (or some
such thing) wouldn’t have added any VALUE to the team
But the team lives and dies by email.
So we set up a simple onError() that emailed myself (IT)
and 2 others on the leadership team.
Short term -- immediately increased IT budget to get the
server under better control (it was throwing a LOT of
errors and getting more traffic than they realized).
Longer term -- the non-techie guys (that were in charge of
the MONEY) started thinking about forward planning, and
maybe it was time to rebuild these apps so the code was
fresher, had better browser/mobile support etc.
55. When the problem isn't in code
So... my hands are completely tied and I
have to change all of the URL strings that
are passed with "Alter" in them (of which
there are many) to "altr".
– Poor guy on a Google forum, recently
56. When the problem isn't in code
Find a stakeholder, outside of IT
Communicate the issue
– In a non-technical way
– Users have a lesser experience
– Magic phrase: “Lower click-thru rate”
– Magic phrase: “Lower conversion rate”
57. How To Fix Things Later
Bootstrap
– “works” fine in table-based websites. Minor
side-effects, nothing crazy.
jQuery
– can just “sit there” for later.
LESS / SASS
– to refactor old CSS.
58. How To Fix Things Later
Source Control.
Task tracking / ticket systems.
Testing tools.
Tools for automating.
“I don't have time”.
– 30 minutes a day works wonders!
Seriously.
Source Control
(Subversion, Git, PerfForce, Team Foundation Server, etc)
Don't let the Git people fool you – any of them will work.)
Task tracking / ticket systems
Great places to store “todo” lists for later so everyone on
the project can see.
Jira, Lighthouse, anything that's NOT “just sending email”
Unit Tests
...and any other testing (framework) that you can use.
Tools for automating parts of the build process.
Grunt, Maven, Ant, whatever.
Don't have to learn them all at once.
Pick 1 thing you don't know and try it out.
Make a “pet project” outside of work so you have
something fun to expiriment with.
“I don't have time” – 30 minutes a day works wonders!
Seriously.
59. How To Fix Things Later
Don't be afraid to ask questions
Post on Google Groups, StackOverflow,
whatever.
Talk to people at the conference!
Don't Be Afraid to Ask Questions
Post on Google Groups, StackOverflow,
whatever.
Talk to people at the conference!
Client: brought in to do “pair programming”.
He'd worked there for 15 years, wrote most of their
CF code, but done so by himself mostly. Hadn't
used OO/MVC at all, but at least knew of Ben
Nadel's blog. :)
Semi Rant: these “how to ask smart questions”
posts on Google Groups...take them with a grain of
salt. Authors, please work on wording these in non-
snarky tones.
60. How To Fix Things Later
“But when I post on StackOverflow, I get
yelled at for doing it wrong!”
Senior Developer != Great Communicator
<rant>”how to ask questions”</rant>
But sometimes when I post on StackOverflow I get
yelled at for doing it wrong!
That's THEIR problem (the yeller) not yours.
Everybody makes mistakes, even THAT guy.
A Senior Developer != A Great Communicator.
Don't be afraid of doing things wrong. That's
how we learn.
61. Other Resources
JoelOnSoftware.com
Ben Nadel's blog
“Secrets of the Rockstar Programmers”
“Head First Java”
“Head First Design Patterns”
Any “Head First” books, really.
JoelOnSoftware.com (his books too)
Book: Secrets of the Rockstar Programmers
BenNadel.com – for CF and JS stuff, asking questions that
get a polite, professional response. (Seriously, Ben is the
nicest guy ever.)
“Head First Java”
Even if you're NOT a Java developer.
Or if you're already a 'senior' developer.
Read it anyway. Learn new, clear, different ways of
explaining what code does to non-developers (or just
people other than yourself that have a different brain than
you do, and approach problems differently).
Pretty much any “Head First” book for that matter.
“Head First Design Patterns”
– Same idea, but for higher level OO concepts.
Super easy ways to explain OO designs to non OO folks.
I use this book when I teach any intermediate/advanced
OO class. It works wonders!