ANN: Julia Cheatsheet updated for Julia 1.0

We’ve updated the JuliaDocs Cheatsheet for Julia 1.0!

Or at least we think we have – if anyone spots problems or changes we missed, please feel free to submit a PR!

15 Likes

@nickeubank: Thanks for this.
In the parallel computing section you have use @parallel keyword for parallel processing. I understand in julia 1.0 we need to use @distributed instead of @parallel.

1 Like

I like the visual of the cheat sheet but some commands are out of date. See my PR: https://github.com/JuliaDocs/Julia-Cheat-Sheet/pull/34

linspace is deprecated to range

The more I read, the more problems I see with this.

  • Really old commands like cell which was deprecated in 0.5 are still on it.
  • The amount of deprecated functions.

Stating that is ready for 1.0 isn’t very helpful, because cheat sheets are often used by people coming from other languages to play around and the experience they will have with this is foreseeable bad. And most likely they will dismiss Julia instead of the cheat sheet…

2 Likes

From a very brief glance:

replace("Julia", "a", "us")

should be

replace("Julia", "a" => "us")
List supertype	super(TypeName)

should be

supertype(TypeName)

Opinion-based:

a = [1:10; ]

It’s a general issue that people are always needlessly collecting ranges into arrays, and this example tends to reinforce that by showing it to beginners. I suggest replacing this (and other examples) with e.g. a = [1, 3, 6]. In fact, in the Array section there is no example of ordinary vector construction as a comma separated list of elements.

Elementwise operation:

[1, 2, 3] .+ [1, 2, 3] == [2, 4, 6]
[1, 2, 3] .* [1, 2, 3] == [1, 4, 9]

Since the point is to demonstrate elementwise operation, it makes more sense to make the comparison elementwise too:

[1, 2, 3] .+ [1, 2, 3] .== [2, 4, 6]
[1, 2, 3] .* [1, 2, 3] .== [1, 4, 9]
1 Like

In general, I think it’s a good (well, actually, necessary) idea to run automated tests on all examples, to make absolutely certain that they succeed.

7 Likes

Those two at least are fixed in: Fix Strings and Arrays by laborg · Pull Request #36 · JuliaDocs/Julia-Cheat-Sheet · GitHub

1 Like

A very nice idea. Any suggestions for implementation? I know it’s easy to do in docstrings and such, but not sure how to implement here. As you can see, this is just an HTML doc that’s been passed down for many years from author to author, so don’t have any “infrastructure” backing it.

2 Likes

Well, thanks so much for your help in fixing many of those problems!

Re: being helpful: I haven’t been able to get others particularly invested in updating it, so was just doing my best till now. I think that outside the manual, documentation of the julia ecosystem is really, really bad (a constant gripe from new users on discourse). This is just my attempt to try and improve the situation, and, as noted in the original post, ask for help where I can get it.

In opensource, sometimes you just get the best of what the people willing to put in the time can generate, which is where we are.

2 Likes

I believe the following code in the cheat sheet:

abstract type Programmer
    name::AbstractString
    birth_year::UInt16
    fave_language::AbstractString
end

is wrong, since Julia does not allow abstract types with fields yet

4 Likes

Also, the following reference, in the cheatsheet

should be removed, since that project is dead now.

Fixed here: fix IDEs and subtypes by laborg · Pull Request #73 · JuliaDocs/Julia-Cheat-Sheet · GitHub

As a newcomer to the language one of the issues I had was with understanding the scoping behavior. Maybe add a box for scoping rules?