off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
2021-02-25T13:27:15.044700Z

what do you do with developers that always go straight to "The compiler is broken" when their code doesn't work?

2021-02-25T13:28:57.046500Z

From someone I work with I've had (in C# land), that string equality is broken (he was comparing "foo" with "foo "), try catch and exceptions were apparently broken (they weren't, he just was misunderstanding how exceptions work) and now today - booleans are defaulting to true on initialization, (they aren't, his bool is static so it's being set elsewhere). But he wont listen, it's always the compiler or Microsoft has broke something...

ghadi 2021-02-25T13:31:27.047300Z

fire them eventually

👌 7
2021-02-25T13:31:41.047900Z

I mean, you think that your thought process would be "if microsoft released a version of .net where string equality was broken, everyone would be jumping up and down and running around in chaos", they aren't, so it's probably my code... but that thought process doesnt seem to ever fire

2
ghadi 2021-02-25T13:31:50.048300Z

tools users should endeavor to understand their tools

👍 2
Matheus Serpellone Nash 2021-02-25T13:32:27.049800Z

Might be a bit confrontational, but: remind them every other time they blamed the compiler and it was their own fault?

borkdude 2021-02-25T13:32:47.050800Z

And it's a plus when this tool is a compiler you can actually understand because it's quite small :) (I'm hinting at Compiler.java et al). I'm ignoring the JVM for a moment ;)

2021-02-25T13:33:47.052900Z

“Experience has taught me that whenever I think the compiler is broken, it’s almost always true that I’m looking in the wrong place for the problem.”

😆 3
2021-02-25T13:33:47.053Z

even yesterday, they needed me to talk them through some code that wasn't working, they were calling a method .Width() that sets a width of an object. But passing a string "25px", Width() just wants a number. I told him to just pass 25. It started working but he says that can't possibly be the reason. SOmething weird must have been going on with caching code or something... I dunno...

😆 2
4
2021-02-25T13:34:49.053200Z

99.9% of the time the bug is in the newest code added. The compiler and libraries one is using, especially if they are popular and widely used, are old code. What you are working on is new code.

2021-02-25T13:35:51.053900Z

Every good developer must eventually gain the humility of accepting that they likely caused the problem (or someone on their team, if working on a team).

👍 5
2021-02-25T13:36:14.054400Z

“Whenever __ I’ve learned that __” is a good way to frame things so that you can tell someone they’re doing it wrong without being confrontational about it.

👍 4
2021-02-25T13:37:16.054700Z

Or at least I’ve had fairly good luck with that in the past.

2021-02-25T13:40:05.056300Z

In some cases, dev tools do introduce N levels of caches, which if you do not know where they all are and know how to clear them and start empty, confusing things happen. If someone has become gun-shy from learning there is yet one more level of caches that no one taught them about in their tools, I can imagine that one can become often suspicious that such a thing is happening yet again.

2021-02-25T13:41:07.057500Z

For that, I would suggest simplifying the dev environment, or at least have a good team dev tool page explaining how to clear them all out and start fresh (and perhaps intermediate levels of "clear out steps 1 through 4, so I know I only need to repeat 5 through 6 when I make this category of code changes".

2021-02-25T13:41:23.057800Z

and/or consider simplifying the tool flow for everyone.

2021-02-25T13:43:13.059Z

Even the Clojure CLI tools introduce a new cache that if you don't know about it, leads to very confusing behavior if you rm -fr ~/.m2 and run again without also deleting relevant .cpcache directories, or use appropriate command line options to ignore the contents of the .cpcache directory.

🤯 1
vemv 2021-02-25T16:18:38.060700Z

make Intelectual humility (https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=intellectual%20humility&sort=byPopularity&type=story) a reified team-wide policy without pointing out at the individual I think that it's a style that everyone can pick up, and for those who don't bother, it should be easy to see that they're deviating from team expectations

bronsa 2021-02-25T20:38:25.063Z

ugh z3

[~]> z3 -in
(declare-fun f (String) Int)
(declare-fun y () String)
(declare-fun x () String)
(assert (= 3 (+ (f x) (f y))))
(check-sat)
sat
(get-model)
(model
  (define-fun y () String
    "")
  (define-fun x () String
    "")
  (define-fun f ((x!0 String)) Int
    3)
)

2021-02-25T20:40:14.064Z

"oi, jobs done!" dusts hands and walks off

2021-02-25T20:54:17.064900Z

What does the (x!0 String) part mean? Unless that means something really special, it looks like both calls to f return 3, so the sum would be 6?

dpsutton 2021-02-25T20:55:35.065200Z

makes me want to go to another will byrd talk

😎 1
2021-02-25T20:56:30.066100Z

I've used Z3 a bit on a project to solve equations on bit-string / bit-vectors, and was amazed at what it is able to do, and usually how quickly (although it isn't difficult to find examples where you aren't gonna live to see the answer).

bronsa 2021-02-25T21:04:06.066300Z

yeah it's a bug in z3, seems related to model extraction with strings

bronsa 2021-02-25T21:04:32.067Z

not even involving the arithmetic solver

(declare-fun f (String) Bool)
(declare-const x String)
(declare-const y String)
(assert (not (= (f x) (f y))))
(check-sat)
sat
(get-model)
(model
  (define-fun y () String
    "")
  (define-fun x () String
    "")
  (define-fun f ((x!0 String)) Bool
    true)
)

bronsa 2021-02-25T21:05:31.067300Z

nothing special, x!0 is just an identifier

bronsa 2021-02-25T21:05:39.067500Z

and yes, that's the problem :) the model is incorrect!

bronsa 2021-02-25T21:07:21.068700Z

it's pretty amazing tech for sure, we use it extensively

bronsa 2021-02-25T21:08:33.069400Z

as long as it doesn't crap itself on small examples that is :simple_smile:

bronsa 2021-02-25T21:26:12.069700Z

phew, looks fixed on master

2021-02-25T21:59:35.070500Z

I mean, 2+2=4 is pretty basic, and probably works. But x+y=3? You may be asking a bit much of it there 🙂