Fork me on GitHub
#clojure-uk
<
2016-09-19
>
mccraigmccraig07:09:15

@maleghast http://yapster.info - we are a company directory, whatsapp style chat, and structured messaging flows (e.g. for shift-swap) on top of the chat foundation

maleghast07:09:34

@mccraigmccraig I shall take a look 🙂

mccraigmccraig07:09:27

very little, if any, tech info on there @maleghast

maleghast07:09:03

Sure @mccraigmccraig Just really great to see another business / product built on top of Clojure

maleghast07:09:34

Very encouraging 🙂

mccraigmccraig07:09:00

i was thinking i'm a fake clojurian because i'm not totally sold on the idea of clojure - it's been a very pragmatic choice, but it has definite weaknesses which could be addressed (by another language - too later for clojure now). in particular the lack of static-typing

jasonbell07:09:05

I just said one day over coffee, “I’d like to learn Clojure”, but it happened to be with @otfrom so there was no escape from knowledge and hugs from that point on 🙂

mccraigmccraig07:09:22

knowledge should always come with hugs!

jasonbell07:09:10

@mccraigmccraig I feel queezy now when I look at java 🙂

mccraigmccraig07:09:04

but it seemed like such a good idea in the 90s @jasonbell

jasonbell07:09:54

1995, I was there man!

jasonbell07:09:17

I was jazzercising because Kim Polese told us to.

thomas07:09:22

nothing is perfect… and there is always room for improvement.

thomas07:09:53

if that wasn’t the case we wouldn’t be learning anymore and that would be really scary.

jasonbell08:09:07

Always be learning.

thomas08:09:46

So clojure won’t be the end-all. let’s see how clj(s).spec works out

thomas08:09:11

and it will be a few years I suspect before we really have enough experience with it.

korny11:09:03

It’s funny - I somewhat agree with @mccraigmccraig - but it’s not static typing that I see as the weakness 🙂 My biggest issue, which isn’t really clojure’s fault at all, is the high barrier to entry for so many programmers, which mostly comes down to syntax I think.

mccraigmccraig11:09:11

dyu mean high barrier to entry for users who are used to macro-incompatible syntaxes @korny (as opposed to new users where i would think that clojure's relatively small syntax is probably an advantage)

korny11:09:18

yep, precisely. The millions of programmers who have learned a macro-incompatible syntax as their first, second, third and so-on language, are often just plain unwilling to move to a lisp-like syntax

korny11:09:54

If they are already enthusiastic, smart programmers will get over the hump and learn it. But if they see it as being inflicted on them from without, it’s a huge battle.

korny11:09:36

Some people are won over once you show them how powerful macros are - but by no means all

mccraigmccraig11:09:22

that might be a disadvantage if you are trying to improve the practises of a large enterprise @korny , but looking on the bright side it's a great recruitment filter 🙂

korny11:09:30

true 🙂

korny11:09:16

I’m by no means close to giving up on clojure - I think it will always be a primary tool for me and for any high-power teams of enthusiasts (until something even better and still lisp-like comes along!) - but I used to think I could convince people to do everything in clojure, now I’m back to “you could build 90% of your services in (X imperative language) but you should build these services in clojure, because they benefit from the power"

korny11:09:58

Also I note that JavaScript at least seems to be moving towards more macro-esque behaviour - every build pipeline has stages that play with the code at AST-level to do things like ES6 transpiling, linting, and the like...

thomas12:09:54

I have heard that lisp like syntax makes it simpler/easier for none programmers to learn it…

thomas12:09:28

my wife for instance found x = x + 10 most confusing… how can the value of x change… and what is it.

thomas12:09:50

having imutable values makes things simpler

thomas12:09:55

(as we all know now)

kevin4212:09:22

I don’t know for you or others but that’s probably linked to the way I’ve learned to resolve equation in math. From this angle x - x = 10 -> 0 = 10 and we don’t have a solution for this one.

kevin4212:09:06

and maybe (+ x 10) doesn’t look as close to an equation

korny13:09:56

My wife has made positive comments about clojure code - she has a pure maths background, and the expressions make sense to her. But I’m not sure how it goes for non-maths non-coders 🙂

korny13:09:40

Immutability thankfully is another thing that is taking over other languages - Java and JavaScript have growing numbers of immutable data structure libraries

agile_geek14:09:49

@jasebell with me it was over wine with @otfrom rather than coffee, I blame the alcohol...and @otfrom of course! 😉

agile_geek14:09:13

Just found out consultancy proposal I put forward to a client is probably not going to happen until next year so I'm looking for a contract to pay the bills starting in October. Give me a heads up if you see anything folks.

seancorfield15:09:12

I find people's objections to the syntax very interesting since Clojure has such minimal syntax and mostly it's just swapping obj.func(a,b,c) to (func obj a b c) -- but many seem to find this a big obstacle.

korny15:09:41

yeah - I found the syntax easy, and once I got my head around let and the various -> macros, quite straightforward. I’ve abused both of those a fair bit too, but having these building blocks made everything else straightforward. I don’t think it’s a logical barrier - it’s more emotional.

mccraigmccraig16:09:24

you can lead a semicolon user to parentheses, but you can't make them think

glenjamin17:09:29

i find in JS-land, immutability and re-use of names is often conflated

glenjamin17:09:05

eg. x = x + 10 is more about names than immutability imo (although it requires a mutable environment)

seancorfield18:09:30

let x = x + 10 in … 😈

glenjamin18:09:41

shadowing should be banned 😄

dominicm19:09:20

I tried to explain shadowing today. Wasn't easy.

glenjamin20:09:37

treating names and variables as distinct ideas might help?

dominicm20:09:12

My point got across, but code like:

(loop [foo [1 2 3]]
  (let [foo (or (do-thing foo) foo)]
    (if (something? foo)
      (recur foo)
      foo)))
just isn't generally comprehensible

seancorfield20:09:04

Hahaha… that code should be taken out and shot! ‼️

seancorfield20:09:59

I think there are occasionally good arguments for very, very limited shadowing but in general it should be avoided.

seancorfield20:09:05

About the only case where I can think of justifying it is if you have a function argument that you need to preprocess at the top of a function:

(defn do-stuff [thing]
  (let [thing (preprocess thing)]
    … thing …))
and even there I’d probably want to restrict that to a small handful of exceptions to the "don’t do it!" rule.

seancorfield20:09:51

Perhaps:

(defn do-stuff [raw-thing]
  (let [thing (preprocess raw-thing)]
    … thing …)))

thomas21:09:11

just watched @malcolmsparks talk from ClojuTRE. great talk

otfrom22:09:53

got a good way of integrating clojure.test and spec (sure others have it)

otfrom22:09:56

(defn passes? [sym]
  (-> sym
      stest/check
      first
      :clojure.spec.test.check/ret
      :result))

(t/deftest conformer-testing
  (t/testing "Checking the conformer"
    (t/is (true? (passes? `sut/my-specced-func)))))

seancorfield22:09:23

Do you need the call to true? in there — doesn’t passes? return true / false already?

otfrom22:09:19

the problem is that :result returns truthy things

otfrom22:09:01

though things went a bit weird on me later today so I really should verify that

seancorfield22:09:18

Hmm, I thought is? worked with truthy / falsey…?

seancorfield22:09:48

I'd also suggest looking at clojure.spec.test/abbrev-result — I think you can run the result of stest/check through that and get something more manageable?

otfrom22:09:24

I hadn't seen abbrev-result

otfrom22:09:43

abbrev-result looks good. still returns truthy things