Javier Candeira / @candeira
Watch video /
Get Code
Pycon Australia. Brisbane, 1 August 2015.
I help people solve their business needs with code.
She needs to validate some data from an energy regulator.
She has a compete description of the validation rules.
In a spreadsheet.
He needs to test a medical instrument.
He has a compete description of both the instrument to be tested and the dedicated tester hardware.
In a spreadsheet.
Users often evolve strong conventions
to help them organise their information...
You can pick either or both.
Their spreadsheets become informal specs
Maybe we can use code to interpret these specs.
(By metaprogramming).
Preventing errors... of a certain type.
Reducing bugs by reducing lines of code.
Making bugs consistent by making asumptions explicit.
Clarifying ambiguous specifications.
Reducing turnaround latency in response to changes.
Giving more time to new features and less to solving defects.
(Like TDD, it involves an upfront investment of time, returned later with interest).
(via code generation)
(via reflection)
Preventing errors... of a certain type.
Reducing bugs by reducing lines of code.
Making bugs consistent by making asumptions explicit.
Clarifying ambiguous specifications.
Reducing turnaround latency in response to changes.
Giving more time to new features and less to solving defects.
(Like TDD, it involves an upfront investment of time, returned later with interest).
(via code generation)
(via reflection)
| Problem | Technology | Solution |
|---|---|---|
| Data Validation | Django | Code Generation |
| Hardware API | LabJack Device | Reflection |
| Yours | !! | ?? |
| Code Generation | Reflection | |
|---|---|---|
| Compile-time | Spreadsheet read | |
| Run-Time | Spreadsheet read | |
| Code written by | Your program | You |
- Code generation with Django (Tutorial)
- API design and implementation via Reflection (Tutorial)
- API design and implementation via Reflection (Tutorial)
- Code generation with Django (Demo) (Maybe)
javier@candeira.com
@candeira
http://hiperactivo.com/talks/