This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-15
Channels
- # announcements (2)
- # aws (3)
- # babashka (2)
- # beginners (100)
- # calva (3)
- # chlorine-clover (22)
- # cider (7)
- # clj-kondo (1)
- # clojure (240)
- # clojure-france (6)
- # clojure-hungary (2)
- # clojure-spec (7)
- # clojure-sweden (3)
- # clojure-uk (19)
- # clojurescript (21)
- # core-typed (8)
- # cryogen (2)
- # cursive (8)
- # data-science (7)
- # datomic (7)
- # duct (7)
- # fulcro (13)
- # keechma (1)
- # luminus (3)
- # malli (3)
- # off-topic (258)
- # pathom (5)
- # reagent (4)
- # shadow-cljs (111)
- # sql (4)
- # tools-deps (12)
- # vim (1)
- # vrac (1)
- # vscode (35)
Should Table name be plural or singular in database? For example user or users? what are conventions behind this naming?
The best answer I've ever seen on the topic: https://stackoverflow.com/a/5841297/564509
Suppose we have a bunch of N-dimensional shapes. Each shape is composed of amorphous building blocks of a particular size, so there's no true continuity - all shapes are discrete. The task is, among a set of such shapes, find all pairs that can interlock with each other. This got me thinking - is there a way to encode a shape in such a way so that checking if two shapes could be interlocked would be really easy?
how are defined the shapes?
how would be defined interlock? like complementary shapes on different building blocks?
Let's go with 2D for now. A shape is anything that has a surface area. Interlock is harder to define, and its definition can change depending on whether it makes the task any easier. For the simplicity, let's say that we require the shapes to touch each other, there must be only single continuous line where they touch, and that line has some minimum length.
does interlocking between 2 blocks imply that the blocks don’t intersect?
are the blocks convex ?
Nothing intersects - it's just like a physical object. No, they can be concave. They can even have holes in them.
But again - if you can think of some constraint or simplification that makes solving this task simpler - by all means.
holes like donut or like a U?
I was referring to 2D shapes
the U shape is concave
the O shape has a hole
I would approach the problem by looking for what makes 2 shapes not interlock, then define your solution as the complementary set of pairs.
(sorry if it sounds abstract, I can’t do better at that point)
are the shapes made of straight segments?
Not sure what "straight segments" means. Given what I've told about the shapes being discrete, let's imagine that they're composed of quanta, where each quantum is just a teeny-tiny square. That's it. So no smooth perimeter is possible, unless it's a straight line. But the quanta are so tiny, that we can approximate, just like with pixels on your screen, although without antialiasing.
In 2D: I would model each shape by a set of its edges (including absolute positioning), Then I would look for which shapes share the same edges.
You might use a quadtree to rule out most pairs of shapes efficiently.
Does it make sense to you?
Using a quadtree sounds interesting. I've never dealt with this data structure before.
I’m glad that my gamedev background could still be useful 🙂
Personal preference: singular (for data tables), because it makes join table names clearer.
Compare:
user_report
- 1-to-1, one user, one report about the user
user_orders
- 1-to-N, one user may have multiple orders
classes_students
- M-to-N, one class has many students, one student attends many classes
then again, often it makes sense to denorm data these days, so you'll end up with a medley of names anyway
Enjoyed this interview with DHH. If you want to hear some contrarian opinions to popular agile, static typing and microservices trends, listen to this 🙂 https://twitter.com/corecursive/status/1223733771834462210
DHH has some interesting opinions that seem really close to Clojure, but seems to disagree with the priority of "decomplect"
One of his points in that podcast is that programming languages attract people with different preferences which do not have to agree and that's totally fine 🙂
Indubitably off topic.
Wondering how many of you are also a fan of ProjectEuler? This is my favourite passtime. I am currently solving my 119th problem.
if you run which someutil
and the util is found, exit code is 0. if the util is not found, exit code is 1
But have you heard of the high elves where
? Available only in Zsh though, not in Bash.
This command is also called where
on Windows I believe (I came across it when porting something)
This is one of those UNIX-y conventions that leaked into C/C++ where main()
returns an int
and a program returns 0
upon success.
Don't quote me on this though.
on the other hand, I do not assume that every tool is going to behave in a nice way. so "which behaves like a sane tool, returning 0 when expected" was a good thing to share.
Why did you assume I said that in a demeaning way? I was trying to be helpful in general. This convention, once known, can be applied broadly to other things.
0 = success and 1 = failure is a little unconventional in the way that most languages coerce 0 to false and 1 to true.
but it looks like it is unconventional to you and you wanted to help me 🙂 so, cool: I'm guessing I'm way older than you and it doesn't translate.
It is also logical. There can only be one success case. But there can be a various amount of reasons for something to fail.
Did you just assume my age though? Not saying you are wrong, but we can play this game forever.
I also came across this when porting the clojure bash script to clojure: https://github.com/clojure/brew-install/blob/2c5c5d5da1c167248203fc2997e59040c43509ab/src/main/resources/clojure#L128
@lady3janepl what do you want to do actually?
make it so circleci automatically runs the static site generator, pushes to a different github pages repo, and publishes my blog
you'd think, but the build breaks on one specific command (`lein sass` from yogthos' lein-sass plugin)
so I'm now breaking the build locally by choking memory, to see which settings need to be updated
poster child for "it's annoying if you need to install a separate util to build your thing"; I really don't want to use a sidecar image just to have sass
> Like, let's make software that we really enjoy making. Where the art of creating the software is a pleasurable experience in and of itself that can supersede and be more important than all these other attributes we keep talking about
The developer is actually the number 1 factor of influence over both the speed of delivery and the correctness of the program
Somewhere along the way, this idea came out that the developer is just this static constant. Any one dev can replace another. And their output is always jsut the same. A function of their tools and environment
But the data shows differently. Turns out all these other things are much more a static constant with barely any influence on the outcome
Static types, unit tests, functional, oop, tla+, etc. They're mostly interchangeable and barely affect the output if you replace one for the other
But the developers can make or break software. Try the same project with a different team and it might result in something that's much better or worse.
What that means is you need to focus on things that make the devs perform to their fullest. A good team culture, flexible hours, an insistence on craftsmanship and respect for their work, passion, dedication, getting appropriate rest, no overtime, good vacation policies, encourage exercise and healthy habits, and letting them use a language they truly enjoy and have fun with, and that doesn't limit their expressivity
I think with time we should keep zooming out. Forget the little things to be able to focus on the bigger things. C/C++ have its purpose but the vast majority of developers should now move on to higher and still higher levels of abstractions. But tell this to the managers!
That's why Clojure is my favourite language. Simply because it makes programming a fun, joyful and interesting experience, it doesn't limit my creativity, it enables me to express myself in even more ways. That in turn means that my focus, passion, effort, concentration towards the project I'm working on is maximized. This actually leads to real concrete benefits, the code I write is more correct, I'm done much sooner, the performance is better, etc.
I was offered a Clojure position in Toronto. The very high COL deterred me. Someday...
Toronto's not bad compared to where I live 🙂
SF Bay Area $$$ 💵
With high COL places, if salary matches. You need to think about retirement opportunity too. Saving 10% of a high salary will get you much further when you retire and move to a low COL city
Though its true that while you are there, you might accept that your living in a smaller appartment, and can't nexessarily afford a nice car or other luxuries that the salary would make you think you would if it weren't for high COL
Yeah, savings in absolute terms would be roughly the same. I did calculate those things.
This is the magic behind all Lisp. This is the reason for Beating the avg: http://www.paulgraham.com/avg.html Ruby is arguably a Lisp in disguise. People are trained on these languages that dont focus on developer creativity, joy, interactivity, expressiveness. So the curve to re-learn a language that does is higher, Ruby takes a middle of the road approach, one foot in what is familiar, one foot in the world of art and wonders.
I agree: I'm happier writing Clojure than any other language I've ever used (and I've used a lot in production over the decades!).
Before Clojure I had used Scala, Groovy, Java, CFML (ColdFusion), C++, C, COBOL, several assemblers. Some Perl in there too. Plus little bits of other stuff.
Modern CFML is kind of interesting, to be honest: it's run on the JVM since around 2001, it's mostly JS-style syntax, but Java's class model. It had closures before Java, it has metaprogramming capability. Classes can respond to unknown method calls, like Smalltalk/Ruby. Fully compiled (to JVM bytecode on the fly, like Clojure).
Well, I'm kinda biased because I don't like Ruby's syntax. I prefer CFML's script syntax.
The main "downfall" with CFML is that the templating language is also a full tag-based implementation of the language and a lot of (self-taught) devs tend to put way too much logic into their HTML page templates.
(but if anyone thinks Clojure is a "niche" language, then the small industry footprint of CFML these days would horrify them 🙂 )
It's the preponderance of punctuation -- makes me think I'd reading/writing Perl. Ugh!
I dislike ruby’s idea of using a different names for things that are common in other languages
There's a lot of the semantics of Ruby to like. But having all the (system) classes open for extension is... nasty... IMO.
its not try
/`catch`, its begin
/`rescue`
its not filter
, its select
. By choosing a different name for those things I cannot leverage my knowledge of other languages in Ruby
That's why I'm so happy Clojure went with first and rest instead of car and cdr 😋. Though there's still a few names I think could have been better
at least Ruby can be auto-indented. don't get me started on Python or Haskell.. or YAML's whitespaced based indentation
I actually rather like Python and it's significant whitespace 🙂
If Python 3 had been adopted much faster, I think we'd be using it for infrastructure at work. I went to PyCon 2013 to evaluate Python and the big 2.7/3.x split was what put me off -- but I liked a lot of what I saw in Python 3.
I feel it depends. At first it feels nice, but then you get into all the edge cases, copy/pasting, command line, tab vs spaces, etc.
even Scala introduced significant whitespace now with version 3. huge mistake if you ask me
Complex codes in Python are very hard to wrap your head around. It's anything can happen territory. And the class system feels monkey patched (pun intended.)
I'd argue that's a fairer criticism of Ruby -- and part of why I prefer Python over Ruby. The __weird__
way to specify special methods in classes is certainly... weird... and I don't like that much in Python.
Anyone tried aggressive indent mode in Clojure? It was a game changer for me when it came to indentation. And not having to think about it at all
I have grown to dislike Python after a few years. It allows you to do too much, and libraries overuse it. The whole ecosystem now feels... rotten. Celery - at some point, there was not even a single test for some crucial core functionality. An update has broken the whole app. Everything is dynamic to the core - incredibly hard to debug. Pandas - breaks. All. The. Time. I now hate this library, but I still have to use it. Django - ooohhhh, don't get me started. The list goes on, but these are the main offenders.
And now with pip and conda separation. Still no preferred way to create reproducible setups. Pipenv sounds great in theory, garbage in practice.
@p-himik It seems like every single env management thing for every language is pretty much garbage...
I'm not so sure. NPM itself is garbage, but w.r.t. envs it's pretty good! And with Maven or deps.edn you don't even needs envs! Which is even better.
I can't get past how awful JS is as a language 😐
> Es7 semicolon cancer First time I hear about it, and cannot find anything that looks interesting. Have a link?
I have read that one like a week ago. :) But I thought you meant something particular because of the mention of ES7.
No, no. Just the crazy amount of syntactic sugar is getting too much. I did js back when es6 was cool with babel and all that. I think some of ES6 is great. Just too much ()=>{}
Still not even close to C++'s level. :D Actually, now that I think about it, I don't know what I'd rather choose nowadays - JS or C++.
Continued to write SuperHexagon bot I started writing 6 years ago or so in C++.
Such. A. Slog. Even the simplest "find the min value in array" or "multiply every value by N". Think for 10 minutes not about how to solve the task at hand but about how to avoid typing all those .begin()
/`.end()` without devolving to manual loops.
C is nice, when macros and bit magic like 0x5F3759DF are used sparingly.
As someone who spent eight years on the ANSI C++ Standards Committee (J16) -- and was secretary of it for three years! -- I totally understand any and all complaints folks have about the complexity of the syntax etc in C++ 🙂
It also needs a support for virtual environments. It's not good by itself because it's nothing more than a way to install a package.
The point is, it's a separate tool, with its own convention. And its started as an unofficial wrapper, which made many things worse because we now have an unmanageable zoo out there.
This is how my notes on it look like. I didn't even do any proper research to get to that point - just heard stuff around. I stopped updating them long ago.
Back then there was not enough concern, let alone talk, about reproducible setups. But then all hell broke loose and opinions started to appear at an alarming pace, with the core team not paying it due attention.
I may be projecting my preferences onto a larger population of developers as a whole, but are perhaps most developers like me where as long as they can "get by" with a build system / dependency management system / test infrastructure that someone else set up, and you know enough to incrementally tweak it for small changes, but go to the expert for help when you need something more complex, and let them argue about it to their heart's delight?
I don't understand how language creators aren't more obsessed with this. I'm crazy about having a setup that I can reinstall later without problems.
we're constantly having trouble with python dependencies at work, (almost) never with those from the java/maven/clojure ecosystem
I'm not sure whether it is the ones like me who don't pay much attention as long as it usually "just works", or the ones who obsess about it, who make them complex 🙂 (the former group only doing so by adding in occasional hacks to "get something new done")
@U0CMVHBL2 the problem is that sometimes the best install instructions are a bunch of Ubuntu packages, and they conflict with another project on your machine which has to pin at an older version because breaking changes
I have made instructions for a collection of open source tools that are mostly "sudo apt", "git clone", "make" and "make install", across about 6 or 7 packages. I test them once a month on 3 Ubuntu versions, and they usually keep working 🙂
Granted, that is probably a small enough number of software packages that I am not seeing the pain others do with much larger collections of packages
I mean, who wants to write the Windows install instructions? 🙂 (if you do not commonly use Windows yourself, there is a perfectly good reason not to be motivated to write them)
> I'm not sure whether it is the ones [...] It's everybody who wants to attempt to solve any problem in "the correct" way, put the solution out there, and market it a bit. Or quite a lot, in some cases.
I see supporting Windows as a technical challenge, so I actually take (masochistic?) joy in it
"I see supporting Windows as a technical challenge, so I actually take (masochistic?) joy in it". I've sometimes gone to those lengths before, too. Cool. More power to you. I would not be surprised if your preferences change 20 years from now.
@U0CMVHBL2 what's your age if I may ask?
50 years young!
I'm hoping the current crisis is a mid-life one -- bodes well for longevity 🙂
Preferences in 20 years: "Finally, these are the instructions on how to run it on TI-84."
compared to @U09LZR36F we're all old I guess
You guys all surprise me more. How do you manage all the grown up stuff and be awesome on here?
I'm 29, but I'm balding and have quite a few gray hairs in my beard that I just started growing (can't be bothered with shaving anymore). So I at least appear to be in the majority camp. :)
Big inheritance.
That was a joke, by the way. I spend more time than is sane on line, for my own enjoyment.
@U09LZR36F This is like a pub, but with Clojure people, what is not to like?
> How do you manage all the grown up stuff Listening to podcasts while doing chores helps. Can definitely recommend https://fs.blog/the-knowledge-project/ Listening to DOOM 2016 soundtrack when having to deal with JS also helps.
Ya, I'm surprised not more languages go the route of Java and have some classpath instead of relying on implicit environments
What are hierarchical dependencies?
I know "we are not there yet", but isn't being much more strict as a community on backwards compatibility one way to avoid a lot of those problems?
a la "Spec-ulation" talk: https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/Spec_ulation.md
Rich had an interesting talk about dependencies. It mentioned an idea about understanding the reason something depends on something.
E.g. if packages A and B depend on different versions of C just for the function f
where f
does not differ between the versions, then the conflict resolution is pretty trivial.
I have tried taking the idea of backwards compatibility into other areas of software/protocol/standards-writing, and even some people who pay lip service to semantic versioning are OK with backwards-incompatible changes from 1.0.x to 1.1.y, if they feel 1.0.x just had a bug.
This after lots of discussion about when to or not to bump up the major version number, and pointing at the https://semver.org web page, etc.
You mean, you see people paying it lip service, and breaking its own rules, too?
I don't have any hard data collected, but I wouldn't be surprised if lots and lots of standards/APIs/libraries actually followed semver, we would see more version numbers like Firefox web browser.
Oh for sure! But there are other concerns. This is a good short read about them: https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md
Well, Firefox as a browser is a bit different because it's not a dependency of something. Using semver for apps just doesn't make sense IMO since it's hard to even describe what a "breaking change" would be in that case.
That document you linked seems to say they want to adopt something that is just like semantic versioning, except they want to make x.y.z allowed to have breaking versions when they go to x.(y+1). They just added one to the number of decimal points where changes indicate a breaking version. Either that, or they actually have nuances I didn't catch on a quick read.
They don't seem to be saying "throw out semantic versioning", but "let's tweak it"
Also, it allows increasing any version part even if you don't have breaking changes. But yes, the gist is correct.
in that respect, Elm is interesting, they statically check breaking changes and enforce semver based on change of types (interfaces) during libraries publication. Probably the most solid approach out there.
Does "official semantic versioning" say you cannot increase the major version number, if the later version is backwards compatible?
I would think it is allowed, just you might be implying breakage where there actually isn't any.
I mean, he criticizes semver for not recognizing psychological/marketing pressures about version numbers of later releases. His doesn't either, if people widely adopted it.
The psychological/marketing pressures just move a decimal point over
Items 7 and 8 of the spec are not really precise about it, but make it sound like you should not update the major version when you have some non-breaking major change. BreakVer doesn't just move it to a different decimal point though. It completely removes the pressures if the changes are not huge. With SemVer you have to wait till major update before removing some deprecated rarely used stuff. With BreakVer you can just just remove it and release a new minor version without thinking about it.
But BreakVer minor version = Semver major version, so if people widely used BreakVer, wouldn't they be just as much disliking of updating the minor version in BreakVer, as they dislike updating the major version in Semver?
It is just giving you some vague wiggle room in categorizing breaking changes as "small" versus "big", which seems just as likely to turn into wailing and gnashing of teeth over what is "small" versus what is "large", which would differ from project to project.
No, because in SemVer the major version change implies a lot of work for someone that wants to update a dependency because all the changes will be packed tight in there. In BreakVer, a minor update will still require you to look at the changelog, but it will be a small one. You have an ability to update little by little. I think it capitalizes on the psychological effect the major version change has.
Doesn't the difference between a lot of work versus a little work to handle a breaking change, depend a lot upon how you used that library/artifact? The same minor breaking change for 50% of library users could be a "I won't update, ever, because it is too expensive for me to do so" change to the other 50%
A library provider can guess/hope/have-usage-data-statistics on what they think are minor breaking changes, but knowledge of invariants of how things currently work have a way of spreading into other parts of a consumer code, given time.
Yes, maybe. Sorry, I'm not mentally prepared to have an in depth conversation on it right now - it's almost 2AM here. :) And after all, the only reason I linked the BreakVer page initially was that it outlined the issues in SemVer, not because it attempted to provide for a viable alternative.
Sure, no problem. Sorry, not trying to put you on the spot here.
It does make some sense to me that BreakVer's recommendation of having two ways to indicate a breaking change, versus Semver's one way, might help reduce the psychological/marketing pressures that make SemVer not actually followed. It does have an uphill battle of becoming widely known and adopted, and even then, it would remain to be seen if it got the same "not actually followed enough to mean anything" reputation that SemVer does.
Allowing versioned modules is one way. The argument against that is that sometimes, you want to force updates to your dependencies as well, for bug fixes, performance and especially security
I have no history of putting out a widely used bit of code that was gradually evolved over 10 or 20 years of time, but I have a lot of respect for things like the Linux kernel, Java, and Clojure, that have done a better job of it than many other things. Not saying they have 0 exceptions -- just that the effort to avoid breaking changes really shows, if you look.