plc2 2015 first time right coding
TRANSCRIPT
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?
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
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 fixing compilation errors
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.
Do you know how silly you look when your file is missing a semicolon?
;
Protect yourself from public shame.
How to fix this
options:
4. run build scripts before you commit3. regularly run your (incremental) build scripts2. automatically compile when you save1. compile while you type
Works in:● standard Eclipse● Sigasi Free Starter Edition● (and maybe in other tools too)
Use custom builder, with MarkerManager plugin
Save-time compilation
Type-time
Standard technology in many software IDEs
For VHDL:Available in Sigasi Pro, with better (linting) checks in Sigasi Premium
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)