Skip to content

Conversation

@DilumAluthge
Copy link
Member

@DilumAluthge DilumAluthge commented Dec 13, 2025

Preview URL: https://julialang.netlify.app/previews/PR2415/

Inspired by this Discourse thread.

For Slide 1:

  1. Change the slide title from "Multiple Dispatch" to "Functions"
  2. Put the two invocations of greet() on separate lines (inspired by this Discourse comment).
  3. Make the two methods of greet() more different from each other, to make it easier to quickly notice the visual difference.

For Slide 2:

  1. Create Slide 2, with the title "Multiple Dispatch"
  2. Add the "cats and dogs" example (from https://www.youtube.com/watch?v=kc9HwsxE1OY, timestamp 7:47)

@github-actions
Copy link

Once the build has completed, you can preview your PR at this URL: https://julialang.netlify.app/previews/PR2415/ in ~15 minutes

@DilumAluthge
Copy link
Member Author

DilumAluthge commented Dec 13, 2025

Also, it was pointed out in the Discourse thread that technically this example is only single dispatch. Maybe we rename this example to simply "Dispatch", and then add another example that shows multiple dispatch?

EDIT: I've implemented this. Slide 1 is now titled "Functions", and I've added a Slide 2 titled "Multiple Dispatch".

@DilumAluthge DilumAluthge changed the title Several small tweaks to the "Multiple Dispatch" code example on the home page Code examples: Tweak the first example ("Functions"), and add a new "Multiple Dispatch" example Dec 13, 2025
@DilumAluthge DilumAluthge marked this pull request as ready for review December 13, 2025 23:26
@IanButterworth
Copy link
Member

Needs vertical space after the prompt returns.

@DilumAluthge
Copy link
Member Author

Needs vertical space after the prompt returns.

Done

@IanButterworth
Copy link
Member

IanButterworth commented Dec 15, 2025

It didn't change here, but for the first one it strikes me now that #$(x)! could look really weird to those unfamiliar with julia syntax. Maybe change it to "Nice to meet you, number $x" ?

Functions is a bit of a plain title.. like the first thing we advertise is that julia allows you to have functions? Maybe something about the function syntax? Straightforward syntax?

And I'd add this to the end of the multiple dispatch one

julia> greet(Dog(), Cat())
"chases"

@DilumAluthge
Copy link
Member Author

It didn't change here, but for the first one it strikes me now that #$(x)! could look really weird to those unfamiliar with julia syntax. Maybe change it to "Nice to meet you, number $x" ?

Done!

@DilumAluthge
Copy link
Member Author

And I'd add this to the end of the multiple dispatch one

Done!

@DilumAluthge
Copy link
Member Author

Functions is a bit of a plain title.. like the first thing we advertise is that julia allows you to have functions? Maybe something about the function syntax? Straightforward syntax?

Done. I've changed the title to "Straightforward syntax", but I'm open to bikeshedding it.

@DilumAluthge DilumAluthge requested review from IanButterworth and removed request for IanButterworth December 16, 2025 21:40
@digital-carver
Copy link
Contributor

"Straightforward syntax" sounds like a bit of tongue twister to me, and maybe sounds (subjectively) a bit defensive as the first thing one sees in the carousel. "Clear & Readable Syntax", "Easy & Natural Syntax", or some other combination of those adjectives, would sound better IMO. (I'm using the ampersand to match the other example titles so that they all feel coherent.)

@DilumAluthge
Copy link
Member Author

What if we do the following:

  1. Rename the current Slide 1 from "Straightforward syntax" to "String interpolation".
  2. Move the "String interpolation" slide from being Slide 1 to somewhere else (maybe even at the end of the deck).
  3. Make the "Multiple Dispatch" slide (the cats and dogs example) the first slide

@Zentrik
Copy link
Member

Zentrik commented Dec 16, 2025

to nitpick/bikeshed, it seems unfortunate that the default example requires scrolling down on it (not even just scrolling down on the page) to see the whole thing (or at least it does on my pc).
image
And scrolled down a bit on the page
image

@DilumAluthge
Copy link
Member Author

to nitpick/bikeshed, it seems unfortunate that the default example requires scrolling down on it (not even just scrolling down on the page) to see the whole thing (or at least it does on my pc).

Yeah, it also requires scrolling for me.

Hmmm. Should we make the "terminal" taller?

@IanButterworth
Copy link
Member

Whatever the first one is called should be defendable as "the first thing we want to show off is our great X"

"The first thing we want to show off is our great string interpolation" doesn't make sense IMO.

Regarding the layout, I saw it as a pro that it's a little off screen. Promptes scrolling. Design by committee is hard.

@DilumAluthge
Copy link
Member Author

I think "multiple dispatch" is a good choice for "first thing we show off", but I think the dog/cat example is better for showing that.

@jakobnissen
Copy link
Member

Bikeshed, but I don't think multiple dispatch is a great selling point for Julia. I'm myself of the opinion that it's wildly overrated, but even to those who love it, its advantages are not visible in a small example. People who haven't already bought in don't know why they should like MD.

Instead, I'd have a cool unicode + math + broadcasting example to attract the Matlab crowd, or else a multithreading or a "performance" example (low-level optimisation or a performance-critical for loop)

@ViralBShah
Copy link
Member

I would generally agree that people come to Julia for things like performance, ease of use, package ecosystem etc. Multiple dispatch is what they discover and learn (and perhaps even love), but is not why they come.

I think it is good to have an example for multiple dispatch in the rotation, but we could definitely have more end-user exciting features in the first 2-3 examples in the carousel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants