Fork me on GitHub
#off-topic
<
2020-04-22
>
borkdude09:04:57

I'm bike-shedding with myself over some keyword names in a library... :debug vs :debug? :throw vs :throw? The reason I'm leaning towards the first ones is: what if I want to extend the value to more than a boolean later? like {:throw {:exclude #{400}} Then the question mark suddenly doesn't make sense anymore.

Reut Sharabani10:04:50

it still looks like a predicate. why does the ? stop making sense?

borkdude10:04:25

because ? implies that the value you pass to it is a boolean?

Aron10:04:30

does it? ๐Ÿ™‚ I thought it implies that it returns a boolean

borkdude10:04:52

yeah, that's also not true, so there you have it: two reasons not to use the question mark?

Prakash10:04:17

I use the non ? version generally when there is extra information because I will find (:excludes throw?) harder to understand later

slipset10:04:43

A boolean is just an enum waiting to happen.

๐Ÿ’ก 12
seancorfield17:04:29

For keywords, I'd definitely avoid ?. For (local) symbols that represent pure Boolean values, I'm on the fence. For function that return pure Boolean results, use ?. Years ago, clojure.java.jdbc had some keywords that ended in ? and several of them eventually came to allow non-Boolean truthy values. So when I wrote next.jdbc I decided that none of the keywords/options would end in ?` even if they only accept true/false today.

๐Ÿ‘ 20
seancorfield17:04:18

Yeah, I think it took me seven or eight years to arrive at that position but it hasn't changed much in the last two to three years ๐Ÿ™‚

borkdude17:04:24

At work we have several question marks in API options, but it looks pretty weird if you call that API with JSON

seancorfield17:04:37

Yeah, we have legacy code that calls into Clojure from the JVM so even with predicates you end up calling stuff like $foo__QMARK__( x ); ๐Ÿ˜

๐Ÿ˜ฑ 4
chrisulloa19:04:10

I want to set up an online ordering website for my dadโ€™s bakery

chrisulloa19:04:25

anyone got success stories for setting up something quickly?

chrisulloa19:04:16

I was looking into using Hugo with some CMS tools

jlmr19:04:26

@christian.gonzalez I did something similar recently, using Hugo, forestry and snipcart. Worked great ๐Ÿ‘

โค๏ธ 4
include11:04:04

can we take a look at it? (url) ๐Ÿ™‚

jlmr20:04:23

Sure, donโ€™t expect too much, itโ€™s a simple site for my niece: https://github.com/jelmerderonde/ester

๐Ÿ‘ 8
๐Ÿ‘ 4
chrisulloa21:04:09

it looks great!

chrisulloa21:04:13

thanks for sharing