1 / 31

Do Meta Better

Adrian Slade Principal Pattern Engineer aslade@synon.com. Do Meta Better. Schedule. Too much code Too little code Code you didn’t expect Good practices Common mistakes & gotcha’s Meta ‘Debugging’ techniques. A quick re-cap. ‘+’ - meta conditions & loops ‘++’ - results in code

Download Presentation

Do Meta Better

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Adrian Slade Principal Pattern Engineer aslade@synon.com Do Meta Better

  2. Schedule • Too much code • Too little code • Code you didn’t expect • Good practices • Common mistakes & gotcha’s • Meta ‘Debugging’ techniques

  3. A quick re-cap • ‘+’ - meta conditions & loops • ‘++’ - results in code • ‘+++’ - concerned with meta variables • For current or budding meta coders & library builders

  4. Too Much Code Call a date validation function to check for errors

  5. Too Much Code ?

  6. Too Much Code Line moved

  7. Too Much Code

  8. Too Much Code • First subroutine • 63 lines of executable code • Second subroutine • 33 lines of executable code • Nearly 50% reduction • Warning : Loops in Loops

  9. Too Little Code Set an error flag if mandatory fields are empty

  10. Too Little Code

  11. Too Little Code

  12. Too Little Code

  13. Code You Didn’t Expect Call a relation validation function and get its name if its call fails

  14. Code You Didn’t Expect

  15. Code You Didn’t Expect

  16. Code You Didn’t Expect

  17. Good Practice • Use conditioning where possible • Test for a verb before using it

  18. Conditioning

  19. Good Practice • Use conditioning where possible • Test for a verb • Try to exclude unwanted iterations • An example from the User Guide

  20. Unnecessary iterations Retain the last field with focus - could be used to get virtuals on lost focus

  21. Unnecessary iterations

  22. Unnecessary iterations

  23. Unnecessary iterations

  24. Common Mistakes & Gotcha’s • Checking for view keys

  25. View Keys

  26. Common Mistakes & Gotcha’s • Checking for view keys • The missing loop • +For each attribute • A missing +++Define • Code sequence

  27. Meta ‘Debugging’ Techniques • Using ++Name • ++Name <meta variable>,Environment<*Object name> • Comments • Gen & View • Iterate • Make Real • Read User Guide - Chapter 8

  28. Enhancement queue • Inline expansion of AD • Meta instructions generated as comments • +For Each Variable <variable> • ++If Lost Focus

  29. And Finally Everyday In Every Way My Meta Will Get Betta!

  30. Questions?

  31. Adrian Slade Principal Pattern Engineer aslade@synon.com Do Meta Better

More Related