SlideShare a Scribd company logo
1 of 18
Download to read offline
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 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 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 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.
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. automatically compile when you save
1. compile while you type
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 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)
What to do next?
1. compile before you commit
2. compile each time you save
3. compile before you save

More Related Content

Similar to Plc2 2015 first time right coding

Testing & should i do it
Testing & should i do itTesting & should i do it
Testing & should i do itMartin Sykora
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own languageAndrea Tino
 
Austin Python Learners Meetup - Everything you need to know about programming...
Austin Python Learners Meetup - Everything you need to know about programming...Austin Python Learners Meetup - Everything you need to know about programming...
Austin Python Learners Meetup - Everything you need to know about programming...Danny Mulligan
 
Autotools, Design Patterns and more
Autotools, Design Patterns and moreAutotools, Design Patterns and more
Autotools, Design Patterns and moreVicente Bolea
 
2015 msu-code-review
2015 msu-code-review2015 msu-code-review
2015 msu-code-reviewc.titus.brown
 
Topic production code
Topic production codeTopic production code
Topic production codeKavi Kumar
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)Nacho Cougil
 
Services, tools & practices for a software house
Services, tools & practices for a software houseServices, tools & practices for a software house
Services, tools & practices for a software houseParis Apostolopoulos
 
Typescript for the programmers who like javascript
Typescript for the programmers who like javascriptTypescript for the programmers who like javascript
Typescript for the programmers who like javascriptAndrei Sebastian Cîmpean
 
Productive Android developers (Meetup slides)
Productive Android developers (Meetup slides)Productive Android developers (Meetup slides)
Productive Android developers (Meetup slides)Michal Juhas
 
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)ssusercaf6c1
 
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)Nacho Cougil
 
TDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - OpensouthcodeTDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - OpensouthcodeNacho Cougil
 

Similar to Plc2 2015 first time right coding (20)

Testing & should i do it
Testing & should i do itTesting & should i do it
Testing & should i do it
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own language
 
Austin Python Learners Meetup - Everything you need to know about programming...
Austin Python Learners Meetup - Everything you need to know about programming...Austin Python Learners Meetup - Everything you need to know about programming...
Austin Python Learners Meetup - Everything you need to know about programming...
 
PHP - Introduction to PHP Bugs - Debugging
PHP -  Introduction to  PHP Bugs - DebuggingPHP -  Introduction to  PHP Bugs - Debugging
PHP - Introduction to PHP Bugs - Debugging
 
12 tricks to avoid hackers breaks your CI / CD
12 tricks to avoid hackers breaks your  CI / CD12 tricks to avoid hackers breaks your  CI / CD
12 tricks to avoid hackers breaks your CI / CD
 
Autotools, Design Patterns and more
Autotools, Design Patterns and moreAutotools, Design Patterns and more
Autotools, Design Patterns and more
 
X page developer
X page developerX page developer
X page developer
 
Bug Hunting Safari
Bug Hunting SafariBug Hunting Safari
Bug Hunting Safari
 
2015 msu-code-review
2015 msu-code-review2015 msu-code-review
2015 msu-code-review
 
Types of errors 2019
Types of errors 2019Types of errors 2019
Types of errors 2019
 
Topic production code
Topic production codeTopic production code
Topic production code
 
Debugging
DebuggingDebugging
Debugging
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)
 
Services, tools & practices for a software house
Services, tools & practices for a software houseServices, tools & practices for a software house
Services, tools & practices for a software house
 
Typescript for the programmers who like javascript
Typescript for the programmers who like javascriptTypescript for the programmers who like javascript
Typescript for the programmers who like javascript
 
Productive Android developers (Meetup slides)
Productive Android developers (Meetup slides)Productive Android developers (Meetup slides)
Productive Android developers (Meetup slides)
 
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
 
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
 
TDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - OpensouthcodeTDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - Opensouthcode
 
Rapid prototyping
Rapid prototypingRapid prototyping
Rapid prototyping
 

More from Sigasi

The future of teaching hdl with Sigasi Studio
The future of teaching hdl with Sigasi StudioThe future of teaching hdl with Sigasi Studio
The future of teaching hdl with Sigasi StudioSigasi
 
Domain specific languages in eclipse with Xtext (Zeus, UGent)
Domain specific languages in eclipse with Xtext (Zeus, UGent)Domain specific languages in eclipse with Xtext (Zeus, UGent)
Domain specific languages in eclipse with Xtext (Zeus, UGent)Sigasi
 
Creating your own coding style
Creating your own coding styleCreating your own coding style
Creating your own coding styleSigasi
 
Shortening the feedback loop: faster and better code development
Shortening the feedback loop: faster and better code developmentShortening the feedback loop: faster and better code development
Shortening the feedback loop: faster and better code developmentSigasi
 
Graphical Programming is Dead
Graphical Programming is DeadGraphical Programming is Dead
Graphical Programming is DeadSigasi
 
Building a software business — lessons learned
Building a software business — lessons learnedBuilding a software business — lessons learned
Building a software business — lessons learnedSigasi
 
EclipseCon Europe 2011
EclipseCon Europe 2011EclipseCon Europe 2011
EclipseCon Europe 2011Sigasi
 

More from Sigasi (7)

The future of teaching hdl with Sigasi Studio
The future of teaching hdl with Sigasi StudioThe future of teaching hdl with Sigasi Studio
The future of teaching hdl with Sigasi Studio
 
Domain specific languages in eclipse with Xtext (Zeus, UGent)
Domain specific languages in eclipse with Xtext (Zeus, UGent)Domain specific languages in eclipse with Xtext (Zeus, UGent)
Domain specific languages in eclipse with Xtext (Zeus, UGent)
 
Creating your own coding style
Creating your own coding styleCreating your own coding style
Creating your own coding style
 
Shortening the feedback loop: faster and better code development
Shortening the feedback loop: faster and better code developmentShortening the feedback loop: faster and better code development
Shortening the feedback loop: faster and better code development
 
Graphical Programming is Dead
Graphical Programming is DeadGraphical Programming is Dead
Graphical Programming is Dead
 
Building a software business — lessons learned
Building a software business — lessons learnedBuilding a software business — lessons learned
Building a software business — lessons learned
 
EclipseCon Europe 2011
EclipseCon Europe 2011EclipseCon Europe 2011
EclipseCon Europe 2011
 

Plc2 2015 first time right coding

  • 1. First time right coding how to stop wasting time fixing compiler errors Dr. Ir. Philippe Faes
  • 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. 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. Why you need tools? If you don’t make mistakes, you spend too much time proofreading your code.
  • 6. Why? The only purpose of compilation and simulation is to validate behavior. Not to find syntax errors.
  • 7. Protect yourself from ● evil colleagues who check in broken code ● looking bad in front of your colleagues ● wasting time fixing compilation errors
  • 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. Do you know how silly you look when your file is missing a semicolon? ; Protect yourself from public shame.
  • 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. Your own (incremental) build Custom scripts ● bash, Tcl, Python, ... Incremental building: ● Makefile
  • 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. Type-time Standard technology in many software IDEs For VHDL: Available in Sigasi Pro, with better (linting) checks in Sigasi Premium
  • 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. What to do next? 1. compile before you commit 2. compile each time you save 3. compile before you save