JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.58k stars 5.48k forks source link

Add a few Julian examples in the manual #37527

Closed logankilpatrick closed 4 years ago

logankilpatrick commented 4 years ago

It would be awesome to be able to include some examples in the docs of code that works and then corresponding "Julian" code that takes full advantage of Julia.

(In line with the idea of writing pythonic code)

Cc @alanedelman

JeffBezanson commented 4 years ago

The question is, is Alan the most Julian Edelman?

KristofferC commented 4 years ago

I don't really understand what this means. Like random pieces of runnable Julia code that are well written? Feels a bit like https://rosettacode.org/wiki/Category:Julia.

bramtayl commented 4 years ago

If they don't already exist, I think some examples illustrating alternatives to common patterns in other languages that are not so useful in Julia (R-style vectorization, object oriented programming patterns) might be nice.

logankilpatrick commented 4 years ago

@KristofferC the idea is to have some comparative examples like: "Here's how you might write a for loop but this is the Julian way to do it that takes full advantage of the languages features" (that might be a bad example but that's the idea).

alanedelman commented 4 years ago

Students in our class have reported that when they write code, they feel there are a few ways they could write them, and there is no guidance as to best practices. Think about learning to write English -- students learn from experiencing good examples.

alanedelman commented 4 years ago

and by the way, people ask me all the time if I'm related to Julian Edelman image

ViralBShah commented 4 years ago

This feels like a very open ended issue and unclear what actually needs doing. It would be best to close this and just open specific PRs. Also, this sort of thing may better belong outside the Julia manual.

logankilpatrick commented 4 years ago

Sure, if you think that's best.