Packs used in the Travel Brief App
JavaScript Code Links
Pizza metaphor anyone?
Building a pack is similar to making a great pizza. Both efforts require a strong foundation and a defined workflow and structure.
Being new to coding, I copy the sample code for each pack type, and change what I call the ‘variable code’ to achieve my desired result. This is similar to selecting different toppings when making a pizza. The choice of toppings does not change the baking instructions.
For example, with packs, you don’t need to build a string pack like Hello World from scratch but instead, you can change the “ingredients” in the Hello World string pack code to display Goodnight Moon,.
When making a pack, pressing the Build button is much like baking the pizza, but not as yummy. 😋
Here’s another example with dummy code, using a function called makePizza with one parameter named toppings. We can “Pass” different topping values to the makePizza function. The instructions for making the pizza are the same, but the results will be different pizzas, depending on your topping preferences.
Pepperoni and mushroom anyone? Invoking the makePizza(pepperoni, mushroom) function sounds delicious!
(👍 Shout out to the incomparable Maria Marquis for the pizza metaphor inspiration!)