Fork me on GitHub
#clojure-uk
<
2016-08-22
>
reborg09:08:37

morning… otfrom quite interesting discussion on twitter around spec/types… I think I have some sort of mental block when I think about going type-first designing an app. It remembers me of around 2000 when to develop Java apps I fired up ToghetherJ, modeled my domain and start changing the generated code.

reborg09:08:56

Then it happened again with a Haskell project one year ago, with the impression of having to constantly chase type changes after the initial design to accommodate features. It is possibly this additional required effort that keeps in me in dynamic land

otfrom09:08:37

I miss you TogetherJ and Model Driven Development you crazy CASE idea

otfrom09:08:28

reborg: it is my punishment for not understanding that spec can do coercions the way plumatic/schema can ;-)

otfrom09:08:04

and I'm still trying to find the right trade offs for spec/typing in my practice (which I think is quite different from some others given my role)

reborg09:08:59

otfrom same… attracted by the generative testing aspect of it but at the same time distracted by spec-ing all way down. Spec-Schema at the boundaries seems the healthier approach at the moment, especially because it overlaps with the effort to keep different teams in synch about design of interfaces, something that I need to do anyway (on paper at least).

otfrom09:08:17

reborg: from what I can tell you don't have to spec everything just the things you want/need to

otfrom09:08:40

and I like that the specs can be used for coercion and for generative testing. (the tip from seancorfield yesterday was great for that)

glenjamin10:08:25

I’ve seen some discussion from the elm camp that one of the biggest benefits of the strong type systems is you don’t have to get the types right at the start

glenjamin10:08:42

with dynamic, you’re often stuck with your bad decisions because the refactoring cost is high

korny10:08:27

I just think type systems are a drug that keeps luring people back to them… Wake up sheeples! Break free of your type chains!

reborg10:08:13

maybe also some form of https://en.wikipedia.org/wiki/Illusion_of_control. Not always of course, but I’ve thought that of some type obsessive behaviour

otfrom10:08:18

glenjamin: I think UIs are one of those places where types are designed up front more than others

glenjamin10:08:59

i’m not sure I follow

otfrom10:08:05

there might be some discovery when using some apis, but designing the type is probably part of designing the form

otfrom10:08:48

glenjamin: most of my coding is going from String|JSON|Excel -> String|JSON|Excel and I end up discovering a lot about what is coerceable by experience rather than up front thought (as I usually don't control the input)

otfrom10:08:24

whearas when I'm designing a page, I have a good idea of what the inputs will be and what types they should be

glenjamin10:08:06

ah ok, i was thinking about the output types

glenjamin10:08:12

that makes more sense now

otfrom10:08:07

I usually have more control over the output types ;-)

agile_geek11:08:05

I've found my perceptions of what a type is evolve over time and the only reason I might know that in UI would be because I don't do UI first. Even when I control the input and/or output my initial thoughts about the details usually evolve into something else. However, I frequently know what high level types I may have early in design. I've found the danger with thinking about types too early is more to do with the same danger as designing using noun analysis too early. The focus on structure before behaviour leads to misconceptions that sometime sour designs for years.

agile_geek15:08:31

Just talked to an ex-colleague when being shown around after interview for a prospective client. He's a .NET dev cross trained to Scala but working with a Clojurian and they been doing Clojure Driven Development this afternoon. Implement in Clojure then translate to Scala!

thomas15:08:48

@agile_geek that sounds like a rather painful process...

mccraigmccraig16:08:11

@agile_geek: an innovative process!

thomas16:08:29

and also as quite a waste as well.. why build something that works, and then re-implement it. (regardless of language)

otfrom16:08:30

ʕノ•ᴥ•ʔノ ︵ ┻━┻

mccraigmccraig16:08:36

plan to write everything twice - you are going to anyway!

thomas16:08:45

(performance could a reason I guesss)

agile_geek16:08:06

@thomas: they wouldn't be doing it if there wasn't value. I.e. they find it easier/faster to reason/explore problem in Clojure

mccraigmccraig16:08:15

your snippets are something of a mystery @otfrom

agile_geek16:08:30

@mccraigmccraig I agree it's innovative.

agile_geek16:08:55

also agree everything from @otfrom is a mystery 😉

mccraigmccraig16:08:50

@agile_geek: what's the reason for re-implementing in scala tho ?

thomas16:08:04

yes, I was wondering that as well

agile_geek16:08:12

@mccraigmccraig oh how naive to think that working in a large bureaucracy as a developer that you can just pick what language to implement in....oh bless

agile_geek16:08:36

It's not on the list it's not getting in

thomas16:08:44

how well does idiomatic Clojure translates to scala?

thomas16:08:52

just add another .jar file...

thomas16:08:58

no one will notice 😉

mccraigmccraig16:08:01

@agile_geek: microservices! language is irrelevant!

agile_geek16:08:05

Ah but they do

thomas16:08:22

Clojure is just a “wrapper” round Java 😇

agile_geek16:08:24

@mccraigmccraig aww you are thinking logically...bless

agile_geek16:08:45

@thomas Java's not allowed either

agile_geek16:08:03

I love that you think these dev's have a choice

thomas16:08:06

in that case it is just another wrapper round Scala!

mccraigmccraig16:08:07

but do they have a more interesting reason than "clojure's not on the list", or is that it ?

agile_geek16:08:54

@mccraigmccraig I suspect it's no more than 'thou shalt write everything in Scala'. That's what I normally see.

agile_geek16:08:45

The commandment comes from London as do a number of things the Newcastle centre have to conform to that they think are nonsense.

agile_geek16:08:23

They were complaining about these constraints in my interview to me!

agile_geek16:08:39

And I'm the one they're supposed to be interviewing!

otfrom16:08:47

anyone know which file on a mac you tweak $PATH in?

otfrom16:08:49

this is for lein

agile_geek16:08:37

@otfrom I seem to remember a .plist file being involved but can't remember what it's called

mccraigmccraig16:08:53

@otfrom: ~/.profile or ~/.zshrc etc

otfrom16:08:05

agile_geek: that's mad

minimal16:08:26

i’ve never touched a plist for my path

otfrom16:08:31

tweaking .plist files

mccraigmccraig16:08:36

if you want it to work from an emacs inferior shell though you might have to jump through some more hoops... can't remember

agile_geek16:08:54

@otfrom might have been something else

otfrom16:08:05

there is an emacs get env from shell bit that works for that

thomas16:08:11

@agile_geek sounds like a great employer to me...

agile_geek16:08:23

Been scanning the talk submissions so far for #clojurex they are all awesome. Need a few more, especially art/music ones but I think conf is shaping up to be really interesting.

agile_geek16:08:02

@thomas same as every single employer I've ever worked for. Never had a choice of languages.

otfrom16:08:53

I suppose I don't give peole much of a choice of programming languages at MC

agile_geek16:08:35

I didn't even get to choose as CTO!

agile_geek16:08:20

Thou shalt do what the client asks....and be grateful!

thomas16:08:00

we have a bit more room now, python and Go for instance… but no clj 😞

thomas16:08:12

we got jRuby as well

agile_geek16:08:49

What I find endearing about this conversation is that you think language choice is ever anything but political.

thomas16:08:14

ooh and plain Java of course… and some teams have even migrated to java 8!!!

seancorfield16:08:52

When I joined my current company (part-time contract in 2009, full-time contract in 2010, then FTE later that year), I got to introduce Scala and when that really wasn’t working out I switched us to Clojure… So some places let engineers make those choices!

thomas16:08:52

@seancorfield why wasn’t scala working for you?

quentin16:08:27

I don’t know how it is for bigger companies, but for startup my whole experience revolves around the “let’s use language that allows us to get lots of junior devs easily”...

agile_geek16:08:34

@quentin: interesting to target jnr devs...cost?

thomas16:08:41

in bigger companies the thought is more like : can any team across the world take over this project tomorrow.

thomas16:08:09

(that is at least my suspicion)

quentin16:08:09

I think a mix of cost and this fallacy of more people > more work done

otfrom16:08:21

agile_geek: I think more political economy than just politics, but yeah

agile_geek16:08:40

@thomas Or can I get 100 X devs for $30 per day per head

agile_geek16:08:58

@seancorfield I'm not saying you can't influence smaller companies but it's not common in larger orgs

seancorfield16:08:33

@thomas: we went through the 2.7 to 2.8 migration and it was unbelievably painful so we abandoned it rather than go through the 2.9 migration — but there were other reasons

otfrom16:08:26

...other reasons... ;-)

seancorfield16:08:27

We had a team used to dynamic languages and being able to edit-reload-debug — so Scala’s edit-compile-deploy-debug cycle was a pain, esp. with such a slow compiler.

seancorfield16:08:50

And the compiler error messages were beyond incomprehensible for some of the team.

thomas16:08:09

ok makes sense in that case. and yes I heard about the incompatibilities…

seancorfield16:08:41

We also, as one of the first things we built, had an actor-heavy app… and the built-in actor library was very leaky… so we had to restart processes regularly.

thomas16:08:51

not a good story… but I assume that things have improved in Scala land as people are using it in production.

otfrom16:08:54

thomas people were still using in prod w/those problems

agile_geek16:08:48

@seancorfield: interesting about compiler error messages. I've been reading Java stack traces for 19 years and Clojure ones are hard for me to debug.

agile_geek16:08:40

Thomas: I suspect ppl are now locked into a point version for the foreseeable future!

agile_geek16:08:51

Being in a larger consultancy as a head of development for 2 years taught me that those companies think of developers like toasters or washing machines. I need 100 units of X developers by next month. Put in an order to head of dev to get them.

mccraigmccraig16:08:58

how many units are there in a whole X developer @agile_geek ?

mccraigmccraig16:08:13

do they blend ?

otfrom16:08:30

mccraigmccraig: they do, but they don't work very well after that

otfrom16:08:36

no matter how many times I tried

mccraigmccraig16:08:32

ah well @otfrom at least you got to practice your evil laugh

korny16:08:44

"I assume that things have improved in Scala land as people are using it in production” - ha!

korny16:08:48

I also went through scala pain back in 2011 or so - every version was “things will improve in the next release”. A very familiar refrain all over my career.

korny16:08:18

“J2EE is better now, it’s light-weight” particularly got repeated every 2 years for about 10 years.

thomas16:08:23

ok, thank you for the update regarding Scala… I would have hoped the scala folks had improved on that, but maybe not

korny16:08:24

For me, the killer in scala was sbt - the worlds most horrible build tool, I remember reading the source and thinking “surely this will die under the weight of it’s own technical debt one day, and will be replaced with something better”.

korny16:08:54

“the S is for Simple” was the best part.

mccraigmccraig16:08:56

"J2EE is light-weight .. compared to the black hole at the center of the galaxy"

mccraigmccraig16:08:48

"J2EE is light-weight ... in zero gravity environments"

korny16:08:52

I’d still use Scala over Java, if (and only if) I had a mature dev team who could define a good “Scala - the good parts” definition and stick to it. There’s some really nice language features in there - amidst the dross.

thomas16:08:55

I did build kafka from source a few weeks ago… took over an hour and lots of fan spinning 😉

thomas17:08:03

and J2EE is very special shall we say (can’t be to negative as my employer is one of the main vendors 😉 )

thomas17:08:55

I think I need to go on holiday again 🙂

thomas17:08:07

just to recover from the last one

otfrom17:08:23

korny: I'm not sure I'd use scala now that java has lambdas

otfrom17:08:46

choosing a subset of scala sounds like the bad old days of c++

seancorfield17:08:50

(sorry, got distracted by work) Yes, @thomas the actor issues got resolved as of Scala 2.10 I think? And the painful binary incompatibility issues around versions have improved (but still not gone away).

seancorfield17:08:01

@agile_geek: The Clojure stack traces are just very very long, but they are at least linear. The Scala compiler error messages are sort of like clojure.spec failure messages but on steroids 🙂 I think with practice you just get used to reading them… However, it was a big culture shock for some of my team...

seancorfield17:08:03

I tried to do one of the online MOOCs based on Scala last year and it was just too painful after years of Clojure… Scala seems spiky and irritating compared to Clojure’s smoothness and flow...

agile_geek18:08:57

@seancorfield: I've done two coursera MOOCs and had same experience

djtango22:08:51

Why not try Racket - then you can have types, parens and no JVM 🙂