Fork me on GitHub
#clojure-uk
<
2017-03-01
>
Rachel Westmacott09:03:15

If I say good morning, every morning, am I booting useful comments out of Slack history and into /dev/null?

agile_geek09:03:33

Bore da, Dydd Gŵyl Dewi Hapus!

tcoupland09:03:57

@peterwestmacott but wishing everyone a good morning is a useful comment 🙂

dominicm09:03:32

If you don't see a message disappear, does it really disappear?

yogidevbear09:03:19

dominicm: Is that like when a tree falls in the forest and no one is around to see it fall, does it make a noise?

dominicm09:03:52

Exactly like that

dominicm09:03:08

Also, I'm pretty sure you can't view old history, unless you pay, at which point the history reappears.

yogidevbear09:03:38

If they didn't disappear, then they wouldn't be history as they'd still be present

agile_geek09:03:24

but by definition they're history as soon as you've typed them

yogidevbear09:03:16

Heresy! That's like saying code is legacy code the moment you've typed it 😉

mccraigmccraig09:03:11

maaning > /dev/null

yogidevbear09:03:55

@tcoupland re "good morning is a useful comment", that reminds me of the Dr Seuss Happy Birthday book: >"If we didn’t have birthdays, you wouldn’t be you. If you’d never been born, well then what would you do? If you’d never been born, well then what would you be? You might be a fish! Or a toad in a tree! You might be a doorknob! Or three baked potatoes! You might be a bag full of hard green tomatoes. >Or worse than all that...Why, you might be a WASN’T! A Wasn’t has no fun at all. No, he doesn’t. A Wasn’t just isn’t. He just isn’t present. But you... You ARE YOU! And, now isn’t that pleasant! >Today you are you! That is truer than true! There is no one alive who is you-er than you! Shout loud, “I am lucky to be what I am! Thank goodness I’m not just a clam or a ham Or a dusty old jar of sour gooseberry jam! I am what I am! That’s a great thing to be! If I say so myself, HAPPY BIRTHDAY TO ME!

jasonbell09:03:41

Is the 10,000 across all channels? Meaning history wouldn't be visible for that long anyway.

yogidevbear09:03:50

P.S. Morning Jade

mccraigmccraig09:03:31

yes, 10k across all channels @jasonbell ... you can personally save some messages by starring them and then they won't disappear, which is kinda useful

dominicm09:03:54

what happens when you hit 10k stars?

agile_geek09:03:38

@yogidevbear but it is....and legacy is not a 'dirty' word. In the real world it means leaving something (usually of value) to future generations. This is actually a theme of some blogs I'm planning to write. Every time you write a line of code you're making a design decision and imposing some paradigm and/or abstraction on a future developer...maybe you... and there's a cost to that.

dominicm09:03:23

I thought agile meant I should just write stuff & then if it doesn't work for some future developer they write more code in their sprint until some PM, sorry, 'Scrum Master' agrees to allow someone to refactor it. Then it starts again.

yogidevbear09:03:32

I like that definition: "In the real world it means leaving something (usually of value) to future generations." :thumbsup:

jasonbell09:03:02

@yogidevbear <<P.S. Morning Jade>> Let's not encourage these kinds of thing 🙂

yogidevbear09:03:13

hahaha ok 🙂

glenjamin09:03:56

has anyone used http://lambda.cd yet btw? I forget what the answer was after it was mentioned the other day

glenjamin09:03:24

agile_geek legacy code has to be valuable, otherwise we’d just turn it off

yogidevbear09:03:26

I thought it looked really promising

yogidevbear09:03:38

Saw it before I really started getting into Clojure and was thinking of experimenting with it for our code deploys at work (non CLJ)

agile_geek09:03:28

@glenjamin I agree. The trick is making the right decisions about abstractions to apply and when/where to apply them to make it easier to turn off or delete in the future.

mccraigmccraig09:03:30

nope, i was looking at it a short while ago, but discovered i could do everything i wanted (CI/CD with multiple independent system components running on a cloud service) with docker compositions on codefresh or docker-cloud

maleghast10:03:54

@glenjamin - I wanted to use it, but I've not had the chance / work buy-in... May well change that VERY soon; if I get it going I will let you know.

agile_geek10:03:12

@jasonbell well you know these memes take on a life of there own!

jasonbell10:03:06

@agile_geek when you're in the room, yes.

yogidevbear10:03:06

The irony is that I originally typed "Jase" thinking I was using the meme version, so guess it's started to stick

agile_geek10:03:21

@glenjamin unhelpfully my answer was, not used http://Lambda.cd in the wild yet, but looked at it briefly. In my experience the major blocker to adoption in most clients is that there's a separate 'devops' team who don't know Clojure.

agile_geek10:03:48

BTW a separate devops team is just ops.. not devops

agile_geek10:03:43

@jasonbell but you make it soooo easy!

Rachel Westmacott10:03:17

I thought having a separate DevOps team was “Oops!"

glenjamin10:03:38

I’ve seen “devops” embedded into dev teams work badly

glenjamin10:03:01

because the knowledge is spread apart and they just end up doing niggly little things instead of anything strategic

glenjamin10:03:17

to me devops = ops with a focus on business outcomes, not uptime

glenjamin10:03:55

and having a small central team support platform and tooling, and provide training and expertise to dev teams works well

agile_geek10:03:00

@glenjamin I don't disagree with your statements above. I just meant that in my opinion it's still a separate 'ops' team using different tools that include code. I wasn't implying that 'ops' works best when embedded in dev teams, simply that a separate team should just be called 'Ops'. Although I think you have actually come up with the best reason for calling them 'DevOps' that I've seen > devops = ops with a focus on business outcomes, not uptime

glenjamin10:03:29

also “Operations” often means business operations

agile_geek10:03:42

Yep it can do

glenjamin10:03:45

which i think is why WebOps became a term

agile_geek10:03:20

Hmmm, WebOps is an interesting term...I always found definitions of it a bit restrictive.

agile_geek10:03:43

Is there anything wrong with aligning the technical "Operations" team with the business "Operations" team? In some orgs there may be large overlap with tech "Operations" supporting business "Operations"?

maleghast10:03:41

I thought "DevOps" was the culture / practice of Developers also doing Ops work and essentially being responsible for the deployment / shipping of the code that they develop..? Am I mistaken?

Rachel Westmacott10:03:54

that was my understanding too

Rachel Westmacott10:03:14

an integration of development and operations, by having the same people do both

maleghast10:03:50

Which I find myself very much in favour of in small teams / orgs at least...

Rachel Westmacott10:03:57

none of this “and then we throw it over the wall to the Ops team to try and keep it running” business

agile_geek10:03:38

That was the definition I was applying but @glenjamin has an interesting take on what works, regardless of what we call it.

glenjamin10:03:08

I think that’s part of it too, but in larger orgs / estates that can be difficult - a very wide set of skills would be required. So to me alignment in outcomes is more important than sharing individuals

maleghast10:03:24

I like the sound of that too @glenjamin

Rachel Westmacott10:03:44

alignment of outcomes is super important

maleghast10:03:46

let's face it dogma is less useful than the ability to do what works in any given situation anyway

Rachel Westmacott10:03:02

putting the devs on the On-Call rota is one way to achieve this

agile_geek10:03:13

I used to be on-call as a COBOL programmer but I was never Ops....they were the people who mounted tapes and disks!

agile_geek10:03:49

Seriously tho, supporting your own code in a live environment is a great learning experience and is how it used to be.

maleghast10:03:55

@agile_geek - Not the "same", but my first two years as a webdev I had the same experience as I was working for the little company that me and 3 mates ran and I did a LOT (by which I mean all) of the sysadmin work.

maleghast10:03:40

I learned a LOT about FreeBSD, "rolling your own" and why having scripts to do things is broadly a good thing, but can be a very bad thing(tm) if you also don't test things... 😉

agile_geek10:03:48

I've supported my own code in 'start ups' in modern times too 😉

agile_geek10:03:31

I need a Dinosaur emoji for moments like this...I remember submitting jobs on punchcards...

agile_geek10:03:13

Mind it was when I was in Uni on very old equipment and at the knee of my Father when he was in work on a Saturday when I were a young 'un

maleghast10:03:17

Let's just be thankful that punchcards are a think of history, no..?

maleghast10:03:06

Right, I am heading to a bar with colleagues - my last day at work in PH today - on Saturday we are off on vacation and by mid-March we'll be back in Blighty!

maleghast10:03:13

waves Have a good one y'all 🙂

agile_geek10:03:45

Punchcards....Immutable data!

glenjamin10:03:15

you can add more holes 😛

agile_geek10:03:25

I knew you would say that!

agile_geek10:03:35

Usually ended in disaster tho

agile_geek10:03:44

just like all mutation

agile_geek10:03:25

My favourite trick was punching rude words on papertape then making an infinite loop....

agile_geek10:03:51

using sellotape!

agile_geek10:03:20

And running it thru punchtape reader on school teletype.

Rachel Westmacott10:03:57

you can patch up existing holes to remove them as well

agile_geek10:03:09

Sellotape to the rescue!

agile_geek10:03:25

Proper hardcore bug fixing

agile_geek10:03:14

Although you also had to watch out for undesirable side effects...paper cuts..breathing in the punched 'holes' when emptying the hole collector on the punch machine..

otfrom12:03:46

I am a big believer in "Run what you build. Build what you run"

dominicm13:03:17

I have a question about parsing, and this channel usually has interesting views on this stuff. Regex scares me, if I see a regex for urls or emails, I consider it wrong, without thinking. I've learned not to trust regex for parsing, ever. So, what are my alternatives for parsing everything, when do I pick each?

agile_geek13:03:44

@dominicm apart from being an arcane black art, any reason for 'fear of regex'?

dominicm13:03:08

@agile_geek I don't think I've ever seen one that parses anything completely! http://stackoverflow.com/a/1732454 this also comes to mind.

dominicm13:03:47

Every time I'm told that a + isn't allowed in my email by a site I get annoyed. They're using a dumb regex again :face_with_rolling_eyes:

agile_geek13:03:22

Not used it but I remember glancing at this ages ago https://github.com/Engelberg/instaparse

agile_geek13:03:52

How's your BNF notation?!

agile_geek13:03:34

While we're talking about parsing. I have to parse some XML (I know, yeuch, right). I know about clojure.xml and https://github.com/clojure/data.xml . I think hte main difference is laziness in data.xml but anyone got any better suggestions?

dominicm14:03:55

@agile_geek BNF is really good, for truly contextless grammars. I've found that a lot of grammars are not (😱)

dominicm14:03:35

https://github.com/lambdaisland/uri/blob/master/src/lambdaisland/uri.cljc this is what got me thinking, specifically how they do uri parsing via regex it seems

dominicm14:03:49

I have no idea how java.net.URI is implemented though

dominicm14:03:41

I think this project is OK, and it passes a good list of tests & is based on studying the RFC. But is there a "correct" way to parse a URI, I am left wondering.

agile_geek14:03:05

the implementation of java.net.URI is very simple. It breaks a URI into strings e.g. scheme, authority, path, query etc. but path (for example) is opaque

not-raspberry14:03:27

path and query parts are painfully underspecified, unfortunately

agile_geek14:03:10

basically they're not specified

not-raspberry14:03:48

they are - e.g. no / allowed in the qs

dominicm15:03:00

@agile_geek but how does it find the delimiters of those things?

dominicm15:03:13

Also, how could you break down path further?

agile_geek15:03:17

@dominicm lots of charAt and substringcode basically

dominicm15:03:40

@agile_geek that sounds… bad.

dominicm15:03:48

yet it is clearly very stable

agile_geek15:03:05

It's ugly... but it's efficient

agile_geek15:03:42

and remember it is applying a standard for URI's so it would be stable

dominicm15:03:21

I mean that it doesn't encounter valid URIs that it cannot parse

agile_geek15:03:23

It doesn't really do anything to help break down the components further though i.e. path is just a string

agile_geek15:03:59

@dominicm that can happen but it just throws an exception

dominicm15:03:32

@agile_geek are there (m)any known instances of j.n.u not parsing a valid uri?

agile_geek15:03:10

Only in bad code really. Obviously if you're server side the URI must have got you there and therefore will be valid. If you're constructing a URI you would presumably use the URI class so it must conform to even instantiate.

agile_geek15:03:41

Basically you'll catch it in test and compile

dominicm16:03:57

@agile_geek well, the browser will allow me to send a lot more URIs than j.n.u will necessarily accept

agile_geek16:03:47

It would have to resolve to the http servlet on the server so it can only be a valid URI.

agile_geek16:03:42

Of course you could input any string as data in a query string or request body and try and coerce that to a URI

dominicm16:03:48

Okay, sure. Let's say I've got a URI from a csv file then.

agile_geek16:03:01

You'd read the string representing the URI and try and instantiate a java.net.URI using the constructor that takes the string and it will throw an exception if it's not a valid URI

dominicm16:03:16

@agile_geek sorry, I think I've not expressed my point very well 😆

dominicm16:03:28

If it is a valid URI, but has a 1% usage character in, that j.n.u missed or was hard to implement, or something to do with not following proper escaping rules. It doesn't seem like there are any cases of that in j.n.u (that I know of! there may be, part of my question)

dominicm16:03:58

That is, the URI is spec compliant, but j.n.u cannot parse it for whatever reason. There doesn't seem to be many of those.

agile_geek16:03:00

Probably cos the source for URI's is usually via an http/ftp/etc. request or code that captures the exception if it occurred

agile_geek16:03:54

j.n.u has been tested to death in production around the world so I think they got the bugs out of all the escaping rules it applies so it's pretty solid. If you do give it something with invalid escaping rules etc. it would throw exception.

yogidevbear16:03:22

Interjecting something unrelated here, but thought this was interesting: https://www.oreilly.com/ideas/2016-software-development-salary-survey-report Some mentions of Clojure further down the survey results

agile_geek16:03:04

I think I have a hard copy of that from OSCON 2016

glenjamin16:03:50

i think a regex is a sensible tool for parsing an email address

glenjamin16:03:23

the problems are when you get overly specific regexes, or exactly spec-compliant ones

glenjamin16:03:18

^[^@]+@[^.]+\.[^.]+$ should be good enough

glenjamin16:03:39

although tbh, lately i tend to go for indexOf(”@”) as close enough

dominicm19:03:13

I like the approach that weavejester came up with

dominicm19:03:45

I'm pretty sure I've seen one that goes onto the mail server and does an MX against it

weavejester19:03:48

I had completely forgotten I’d written those two functions.

weavejester19:03:12

Maybe I’ll factor them out into an email predicates library.

glenjamin19:03:33

i’ve heard second-hand that one of the best email validations approaches you can do is to warn about misspellings of common email providers

dominicm19:03:12

@weavejester I've been thinking about a library of "really useful form predicates" independent of valip

dominicm19:03:19

Probably very useful for working with spec 😉

yogidevbear20:03:11

Anyone know how the ClojureX Bytes events differ from the dojos in terms of structure, etc? The Integrant talk next week looks interesting

yogidevbear20:03:00

Is it just talks/presentations?