Very thorough. Some comments / suggestions after a read through. Just personal opinions.
Immutable types are passed around by value (i.e. copying), whereas mutable types are passed by reference.
Iām not sure this is really true. Since you canāt modify an immutable struct it doesnāt matter if you copy it or not to pass it as an argument, and the compiler can chose what to do. Also, I donāt think there is anything called āpass by referenceā in Julia. What I think it is typically called is āpass by valueā and this is true both for mutables and immutables.
Free up memory for large arrays with arr = nothing
I feel like this is rarely needed. If you have no use for arr
anymore then it typically would have dropped out of scope and be cleaned up by the gc anyway.
Use named instead of anonymous functions.
Donāt think this is true anymore.
Use type annotation rather than tests for function arguments.
I donāt think this has a performance impact.
Split functions into smaller components to aid the compiler.
Not sure if this is true, or helps performance. (Note that the link in this text leads to a suspended account).
Type alias typealias Nerd Programmer
typealias
is deprecated in 0.6.
Moreover, using only loads exported names by default while import loads all names defined in the module.
Iām not sure what this means. What does loading a name mean?
Statically sized arrays ImmutableArrays
Should probably change this recommendation to StaticArrays.
Test framework Test
Iām not sure what package this references but Base own Test is pretty good now.
type Hacker <: Programmer
name::AbstractString
birth_year::UInt16
fave_language::AbstractString
end
Perhaps put String
instead of the abstract type AbstractString
as the fields. Also, I think just using an Int
for birth_year
might be preferable.
Dictionaries are mutable; when symbols are used as keys, the keys are immutable.
Not sure what this means. How are symbols as keys special?
Julia has many built-in mathematical functions, including special functions (e.g. Airy, Bessel, Gamma), and supports complex numbers right out of the box.
Airy and Bessel are no longer built in (in 0.6).