Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
First time right coding
how to stop wasting time
fixing compiler errors
Dr. Ir. Philippe Faes
http://xkcd.com/303/
Overview
● First time right coding
○ what
○ why
● Protect yourself
● Don’t waste time / money
○ catching bugs early
● How ...
What is first time right coding?
● Each commit (in version control) can be
compiled and executed.
● Every project has
exac...
Why you need tools?
If you don’t make mistakes, you spend
too much time
proofreading your code.
Why?
The only purpose
of compilation and simulation is to
validate behavior.
Not to find syntax errors.
Protect yourself from
● evil colleagues who check in broken code
● looking bad in front of your colleagues
● wasting time ...
Protect yourself from
evil colleagues
My former colleague —let’s call him “John”—
used to break the build all the time.
He...
Do you know how silly you look
when your file is missing a semicolon?
;
Protect yourself
from public shame.
Don’t waste time / money
Catching defects earlier
is cheaper
Catching defects earlier
is much cheaper
How to fix this
options:
4. run build scripts before you commit
3. regularly run your (incremental) build scripts
2. autom...
Your own (incremental) build
Custom scripts
● bash, Tcl, Python, ...
Incremental building:
● Makefile
Works in:
● standard Eclipse
● Sigasi Free Starter Edition
● (and maybe in other tools too)
Use custom builder,
with Marke...
Type-time
Standard technology in many software IDEs
For VHDL:
Available in Sigasi Pro,
with better (linting) checks in Sig...
Types of errors
that can be caught
● Syntax errors (obviously)
● Datatype errors
● Style guide violations
● Even some kind...
What to do next?
1. compile before you commit
2. compile each time you save
3. compile before you save
Upcoming SlideShare
Loading in …5
×

Plc2 2015 first time right coding

  • Be the first to comment

  • Be the first to like this

Plc2 2015 first time right coding

  1. 1. First time right coding how to stop wasting time fixing compiler errors Dr. Ir. Philippe Faes
  2. 2. http://xkcd.com/303/
  3. 3. Overview ● First time right coding ○ what ○ why ● Protect yourself ● Don’t waste time / money ○ catching bugs early ● How to catch bugs early ○ Types of things that you can find at type-time ● [Demo] ● What to do next?
  4. 4. What is first time right coding? ● Each commit (in version control) can be compiled and executed. ● Every project has exactly zero syntax errors at all times. ● Never save files that will not compile
  5. 5. Why you need tools? If you don’t make mistakes, you spend too much time proofreading your code.
  6. 6. Why? The only purpose of compilation and simulation is to validate behavior. Not to find syntax errors.
  7. 7. Protect yourself from ● evil colleagues who check in broken code ● looking bad in front of your colleagues ● wasting time fixing compilation errors
  8. 8. Protect yourself from evil colleagues My former colleague —let’s call him “John”— used to break the build all the time. He always insisted it was not his fault.
  9. 9. Do you know how silly you look when your file is missing a semicolon? ; Protect yourself from public shame.
  10. 10. Don’t waste time / money
  11. 11. Catching defects earlier is cheaper
  12. 12. Catching defects earlier is much cheaper
  13. 13. How to fix this options: 4. run build scripts before you commit 3. regularly run your (incremental) build scripts 2. automatically compile when you save 1. compile while you type
  14. 14. Your own (incremental) build Custom scripts ● bash, Tcl, Python, ... Incremental building: ● Makefile
  15. 15. Works in: ● standard Eclipse ● Sigasi Free Starter Edition ● (and maybe in other tools too) Use custom builder, with MarkerManager plugin Save-time compilation
  16. 16. Type-time Standard technology in many software IDEs For VHDL: Available in Sigasi Pro, with better (linting) checks in Sigasi Premium
  17. 17. Types of errors that can be caught ● Syntax errors (obviously) ● Datatype errors ● Style guide violations ● Even some kind of elaboration errors! ○ check bus widths, even using symbolic lengths (live demo)
  18. 18. What to do next? 1. compile before you commit 2. compile each time you save 3. compile before you save

×