Getting Started with EK9
A Beginner's Guide to Programming in a Language That Won't Let You Fail
The whole book, a page per chapter. Every listing in it was compiled and run with the EK9 compiler, and every output shown is the output it printed.
Contents
- Copyright
- Preface
- How to use this book
- 1. Hello, EK9
- 2. Values and the Three States
- 3. Making Decisions and Repeating Work
- Making a choice with if
- Giving a program a value
- The same idea, spelled when
- Joining conditions
- Choosing among many values with switch
- Repeating with a range
- Repeating while something is true
- Running at least once: do / while
- The features that are not here
- A map of what is coming
- Try it yourself
- Recap
- 4. Functions
- 5. Testing as You Go
- 6. Reading the Compiler's Guidance
- 7. Text, Numbers, Time and Money
- 8. Speaking Every Language
- 9. Collections
- 10. Guards and Safe Code
- 11. Optional and Result
- 12. Streams and Pipelines
- 13. Two Ways to Build: Data, Functions and Objects
- 14. Records and Enumerations
- 15. Constrained Types
- 16. Classes
- 17. Abstract Types, Subtypes and Polymorphism
- 18. Traits and Composition
- 19. Components
- 20. Using Generics
- 21. Using Operators
- 22. Programs, Input and Output
- 23. Build a Game, End to End
- A. The Operator Reference
- B. Constructs at a Glance
- C. The Evidence: the research behind the rules
- No null; values are absent, unset, or set
- No return; name the result instead
- No break or continue; use streams and guards
- No fall-through in switch
- Copy at the boundary; no leaking your insides
- Traits, not tangled inheritance
- The compiler measures coupling and cohesion
- Named, typed message placeholders
- More sources cited in the chapters
- The two big payoffs
- D. Installing and Running EK9
- E. Glossary