GoByte Blog
Engineering lessons and marketing playbooks from the team behind GoByte.
Latest, page 8
RSS-
Java from zero: a record keeps the cents
A record is a small object with fields the constructor sets. Money holds cents. Adding three lattes of 450 prints 1350.
-
Go from zero: an interface is a method list
An interface names the methods a function needs. Labeller asks for Label, Item has Label, and show prints latte $4.50.
-
Go from zero: a method can change the struct
A method with a pointer receiver changes the struct the caller holds. AddTip adds 20 percent to a $4.50 bill, and the program prints $5.40.