Learning Julia for scientists who are beginning programmers

I see that you made the statement “[m]oreover, declaring types sometimes may make your code run faster” in your introductory section on variables. However, I believe it seeds an incorrect heuristic due to the design of the Julia complier. With relatively few exceptions, it will result in longer runtimes. It can also result in unintuitive runtime errors and bugs if ones mental model of the typing system is that of a static type check rather than the dynamic typing embedded in the design philosophy of Julia.

I’m sure that someone starting out doesn’t need the details of the explanation, but they would be better served (in my opinion) to understand up front that “excessive” type assignments in Julia code is recommended against (per the official manual) if one is prioritizing speed of execution (which is often not the priority for a project up front but can become more important over the a project’s development cycle). And while helpful for reasoning about code for correctness, the dynamic typing design has some nuances that may unintuitively diverge from other programming languages (in particular, languages using static type checking compliers).I find this aspect of Julia difficult to explain in a consice and understandable way to someone with little to no prior experience with programming languages.

If you could find a way to express this simply, I think you would be doing your readers a favor since this whole typing business is part of what makes Julia stand out from many popular languages. There are, necessarily, tradeoffs that are embedded in these design decisions. A beginner shouldn’t be expected to understand those tradeoffs but having a good foundation includes being generally aware of significant distinctions in design so they can be explored over time as one gains experience with the language.

2 Likes