Fork me on GitHub
#clojure-europe
<
2024-06-28
>
ray05:06:07

Good morning

๐Ÿช‚ 3
daveliepmann07:06:55

good morning, what a lovely bright day

schmalz07:06:29

Morning all.

teodorlu08:06:45

:thunder_cloud_and_rain: but kinda nice, especially the sounds. (morning!)

thomas08:06:44

mogge TGIF!

teodorlu09:06:37

Do you put trailing question marks on keywords that map to true/false? 1๏ธโƒฃ - no question mark - :browse true โ“ - question mark - :browse? true

1๏ธโƒฃ 3
โ“ 8
daveliepmann09:06:44

2, though I've seen 1 argued by people I respect and I'm willing to be persuaded

๐Ÿ‘ 1
vemv09:06:54

Although there isn't necessarily a relationship between them, I'd say that ? especially makes sense if your Clojure flavor of choice involves asserting that :foo? is a boolean (and not just truthy/falsey), with Spec/Malli

๐Ÿ‘ 1
teodorlu09:06:00

Any idea what the arguments for no question mark is? I presume one situation could be if one decides later that a true/false value should have multiple truthy values. But in that case one could also introduce a different attribute without the question mark.

simongray09:06:18

@U04V15CAJ once convinced me to drop the question mark, but I forgot why ๐Ÿ˜…

๐Ÿ‘ 1
borkdude09:06:07

question marks originally were just used for predicate functions

borkdude09:06:39

clj core also doesn't use question marks on keywords, e.g. not :macro? true but :macro true

๐Ÿ‘ 1
borkdude09:06:51

another argument is that instead of booleans you may want to use other values as well

๐Ÿ‘ 1
borkdude09:06:14

I also just find it very ugly to use question marks on keywords.

1
daveliepmann09:06:40

> I also just find it very ugly to use question marks on keywords. i find everything else at least mildly convincing. not this ๐Ÿ™‚

๐Ÿ˜„ 2
borkdude09:06:09

sure, just wanted to vent my opinion for once which I usually oppress several times a week

๐Ÿ˜„ 3
๐Ÿ˜‚ 3
teodorlu09:06:17

I thought I'd read borkdude code without question marks - I even thought I'd found commits removing the question marks. But when I went looking today, I found more question marks: https://github.com/borkdude/carve/blob/e02b65f9de679450176a3fa26c89ffd5600d7eb8/test/carve/main_test.clj#L43

borkdude09:06:55

@U3X7174KS I distinguish between public API and internal. Interally I'm not consistent with this

๐Ÿ‘ 1
vemv09:06:58

> another argument is that instead of booleans you may want to use other values as well That's precisely how ? can shine - if there's a ? I know it's a boolean, if not, I'll check doc/specs to see if it's some composite type (of couse, if the convention is not followed, then it's useless)

โž• 1
๐Ÿ‘ 1
borkdude09:06:08

the reverse is that you're just locking up your public API too tightly, I've seen several times that :browse true becomes :browse :always or :browse (fn [...])

๐Ÿ‘ 1
teodorlu09:06:00

Right, keeping the public api extensible (unknown number of consumers, prefer compatible changes) makes sense.

๐Ÿ‘ 1
borkdude09:06:12

anyway I think it's already a lost battle since most people slap question marks on anything nowadays

๐Ÿ˜” 1
borkdude09:06:20

and it has lost its original meaning

interrobanghugs 1
vemv09:06:48

> the reverse is that you're just locking up your public API too tightly, I've seen several times that :browse true becomes :browse :always or :browse (fn [...]) Yeah it relates to the flavor of Clojure you may want to foster Most times I enjoy a tight flavor, where changes are conveyed through a new name for instance But that's certainly just my preference

daveliepmann09:06:18

"question marks originally were just used for predicate functions" seems like the most notable thing that was lost?

๐Ÿ‘ 1
borkdude09:06:56

yes. also consider that in the rest of the world, almost nobody uses question marks in config files (JSON etc). It seems it's gotten out of hand in our little bubble ;)

1
borkdude09:06:35

{"browse?": true}

daveliepmann09:06:08

reminds me of the discussion around namespaced keywords interfacing with JSON

borkdude09:06:30

@U05092LD5 exactly, the underscore thing

teodorlu09:06:33

Right, a single question mark on a key is going to make that data weird to use from Javascript, not config.browse, but config["browse?"]. Or Go or Java or Kotlin or Haskell or Elm.

thomas09:06:18

I have used ? on keywords and recently coming back to old code it did confuse me for a few seconds.

slipset10:06:02

โ€œA boolean is just an enum waiting to happenโ€ - Zach Tellman (I believe)

๐Ÿ‘ 2
๐Ÿ˜‚ 2
slipset10:06:47

So rather than :browse? perhaps the solution is {:interaction :browsing}

slipset10:06:04

or whatever reason you need to know wether to browse or not.

borkdude10:06:27

or localize keywords so everyone can see their own preferred name :P

๐Ÿ˜ฑ 1
borkdude10:06:23

(I listened to a podcast about Hedy recently and I learned Hedy has localization so people can program in their own native language)

slipset10:06:42

CoRecursive?

thomas11:06:58

so just like Excel then? @U04V15CAJ

thomas11:06:11

(or VBA or what ever it is called)

borkdude11:06:24

I guess thatโ€™s a good example

teodorlu09:06:42

I love how silly questions like "do you put question marks on keywords?" can lead to interesting design discussions ๐Ÿ˜„

โž• 2
thomas09:06:58

which kinda proves it wasn't a silly question....

๐Ÿ‘ 1
teodorlu10:06:44

It felt like kind of a silly question when I asked it. At least it felt a bit silly. I mean, who cares about that question mark?

teodorlu10:06:13

Unrelated silliness attached

otfrom10:06:30

:wind_blowing_face:

Thomas Moerman11:06:01

wtf, the weather forecast for the Germany-Denmark football match mentions possible tornado ๐ŸŒช๏ธ๐Ÿ˜ฑ

thisisfine 1
thomas11:06:49

makes it more exciting

Thomas Moerman11:06:43

yeah, the last belgian match was rather sleep-inducing tbh

๐Ÿ˜‚ 2
1
grav08:06:40

Yesterdayโ€™s match was difficult to sleep through ๐Ÿ™€

thomas14:06:48

And I got another test working for my MQTT broker.... Friday afternoon achievement!! (Took only a week or so)

plexus14:06:46

Good morning! Gratuitous promotional cross post! https://gaiwan.co/blog/announcing-first-speakers/

๐ŸŽ‰ 6
Ben Sless14:06:29

>HumbleUI workshop ๐ŸŽ‰

โž• 5