The namespace stuff sucks with Clojure 💔 Instead of (go 'north) I need to (go :atlas.earth.frobnicated.potassium-derived.map-directed/north)

You don't have to use the namespaces in Clojure, it's possible to ditch them with refer all and similar shenanigans. But the intent, idiom, and culture is to use them, and if you're maverickingly ditching them you only make it even more complicated and inconsistent. One of the many problems with the namespace system is that it's hard to grep for things, and that's just gonna be even harder if it there's even more inconsistency between (status foo) and (frobnication/status foo). I like Clojure, world's easiest language, but, definitively aspects of it that I'm really sick of. Namespaces being the biggest.
That's a way bigger pain than cosmetic peeves like how `unless` is named `when-not`. (If I wanted (when (not foo)) I knew where to find it…)
Follow

@Sandra I quite like them actually. I think refer all thingy is not good. coz just by reading a code i won't know where different functions are coming from. beside that unlike traditional langs with no ns, in clojure ns is kind of a unit for compilation so i can reload a namespace just by it's name and it doesn't matter where it is coming from.
in my experience a NSless lang can lead to weird fn name for large project. Like in elisp 😜

· · Web · 1 · 0 · 0
@lxsameer I like how namespaceless can encourage reuse and mix&match. Namespaceless also makes the functions feel more like tools directly.

Like, if I wanna hit a light switch in my room I don't first have to open a li'l hatch labeled "home.electric.wiring". I can just hit the light switch directly because its interface has been made available to me as resident in the room.

The more time I spend with Clojure, the more bugged I get by the namespaces. Yeah, they prevent key collisions in maps but that wasn't exactly an every day problem in the before-fore.
They make it so that...

• I need to remember what namespace a name (function or keyword) is in when I wanna use it
• I need to remember how the namespace is canonically aliased throughout the project and manually and carefully keep that aliasing consistent
• I can't grep for stuff since names aren't prefixed with a namespace inside their own namespace, only when imported.

Three pretty big costs of namespaces that collectively eat up a ton of time and effort.

@Sandra I totally understand how frustrating it can be.

I think at the end of the day it is down to personal preference.

Regarding to greping, I curious to know what editor are you using for Clojure?

@Sandra brilliant. If you're using the LSP with clojure, then you won't need to grep anymore. xref-find-definition and xref-find-references will do the job (I might misspell the names). Unless your needs are different than mine in that area 😜

@lxsameer Installing all of LSP just to find some references seems like killing a mosquito with a bomb.

@Sandra 😂 that was funny, I'm going to use that.

Well that's true. but in my case I use LSP for other langs as well so it's more convenient i guess

Sign in to participate in the conversation
lxsameer's backyard

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!