Replies: 2 comments 1 reply
-
I actually agree with you, and if we were creating a net-new function, I would advocate for |
Beta Was this translation helpful? Give feedback.
-
I agree with the proposal, just a nitpick about:
This is how it was taught indeed, although since then voices have raised to temperate this (notably in error handling). Plus obligatory Ken Thompson quote for what it's worth:
Nevertheless |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The
goto()
function has always felt off to me. Here's why I think the name causes more harm than good:goto
isn’t even a real word – it’s a mashup of "go to" mostly seen in old-school programming languages. It doesn’t clearly describe what the function actually does.For experienced developers, the name carries historical baggage. In languages like C and BASIC,
goto
is something you’re explicitly told not to use. Seeing it as the client routing method in a frontend framework just feels wrong.For newer developers, the meaning isn't obvious. A junior I worked with once assumed it had something to do with scrolling – and honestly, that confusion makes sense. The name doesn't communicate navigation clearly.
It overlaps with Playwright’s
page.goto()
, which refers to full page reloads. When working in projects that use both SvelteKit and Playwright, this can cause real confusion. And while Playwright’s naming may not be ideal either, the collision doesn't help.The name even breaks consistency inside SvelteKit. You already have
beforeNavigate
andafterNavigate
– both descriptive and intuitive. Then suddenly, for actual navigation, it’s justgoto()
? That’s inconsistent and jarring..Semantically,
goto
feels too abrupt. It reads like a low-level control-flow jump, not like part of a smooth, user-driven route transition. Navigation is not usually a "jump"; it's part of an interaction flow.The name feels like it was chosen to be clever or different – and sometimes that works – but in this case, it sacrifices clarity.
Naming may seem like a small issue, but it significantly impacts:
Now, English isn’t my first language — but that’s exactly the point. A good name should feel clear and intuitive to everyone, not just to native speakers or people with specific programming backgrounds. If I have to stop and think about what it means, that friction is real — and I’m probably not the only one feeling it.
Anyway, thank you for all the incredible work on Svelte — truly. This isn’t criticism for the sake of it, but a small push toward a bit more clarity, consistency, and a smoother experience for everyone!
Maybe I’m overthinking. Or maybe I’m just thinking — because names matter more than we think.
Beta Was this translation helpful? Give feedback.
All reactions