Fork me on GitHub
Ahmed Hassan09:02:08

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:


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?

Vincent Cantin18:02:42

how are defined the shapes?

Vincent Cantin18:02:32

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.

Vincent Cantin18:02:59

does interlocking between 2 blocks imply that the blocks don’t intersect?

Vincent Cantin18:02:07

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.

Vincent Cantin18:02:35

holes like donut or like a U?


What is "hole like a U"?


A horseshoe does not have a hole, if that's what you mean.

Vincent Cantin18:02:47

I was referring to 2D shapes

Vincent Cantin18:02:13

the U shape is concave

Vincent Cantin18:02:24

the O shape has a hole


Can be concave, can have holes.

Vincent Cantin19:02:16

I would approach the problem by looking for what makes 2 shapes not interlock, then define your solution as the complementary set of pairs.

Vincent Cantin19:02:07

(sorry if it sounds abstract, I can’t do better at that point)


That does sound too abstract. :)

Vincent Cantin19:02:37

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.

Vincent Cantin19:02:13

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.

Vincent Cantin19:02:15

You might use a quadtree to rule out most pairs of shapes efficiently.

Vincent Cantin19:02:42

Does it make sense to you?


Using a quadtree sounds interesting. I've never dealt with this data structure before.

Vincent Cantin19:02:06

I’m glad that my gamedev background could still be useful 🙂


Oh for sure. Gamedev has a lot of stuff that can be used elsewhere.


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 🙂

👍 8

I'm not saying that I agree with everything, just an interesting interview.


Maybe he should be invited to some Clojure conference as the keynote speaker 😉


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 🙂


Oh wait, we're supposed to agree.


new predicate in library polite-clj: (def agree? (constantly true))

😂 4

Have you seen manners?


It's rather fantastic


Really well designed




> The compiler, appropriately named "ick"


Now there's a language that teaches you to be polite


I love it XD


so victorian


> The `manners.really` defines two public macros, `really` and `verily`. 😂


Also need: indubitably.


I love the off-topic-ness today

Marcus Pemer17:02:13

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)


wiki says there is a which on windows


in any case, this is for an automated build pipeline


the less I have to install, the better 🙂


yes, a lot of unix commands give useful exit codes


In the world of shell scripting, 0 always means success.


Or a failure to report about an error.


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.


thank you, I know


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 needed to be told about 0 means success etc?


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.


you imagined the "demeaning"


it is not unconventional for people who have grown up using unix


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.


But peace.


When I look this up, I feel like I'm told command -v is more portable or something


:thinking_face: how little memory can I give lein before it chokes?


There's also #leiningen channel.


thinking out loud / sharing misery, sorry 😄


@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


circleci has 4gb, should be sufficient? 😉


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


LEIN_JVM_OPTS was needed in circleci options, rather than JVM_OPTS.


> 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


I think this is an understated point


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.

👍 4

Are you writing Clojure professionally? Guess you are among the few lucky ones then.


I am 😋, for 3 years now. Feel very lucky that I am.


I was offered a Clojure position in Toronto. The very high COL deterred me. Someday...


What's COL ?


Sorry, COL = cost of living


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: 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).


How does it compare to JRuby for example?


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 🙂 )


Haha, I hate Ruby's syntax too 😋 Can't stand word delimited blocks


It's the preponderance of punctuation -- makes me think I'd reading/writing Perl. Ugh!


I see a pattern! It's the syntax of Ruby that turns me off too.



Lennart Buit22:02:31

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.

☝️ 4
Lennart Buit22:02:45

its not try/`catch`, its begin/`rescue`

Lennart Buit22:02:17

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 🙂


each their own 😉


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

💯 8

and a total waste of time

💯 8

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.)

💯 8
☝️ 4

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.

💯 4
☝️ 4

And now with pip and conda separation. Still no preferred way to create reproducible setups. Pipenv sounds great in theory, garbage in practice.

😂 4
☝️ 4

Pretty happy that I can now use Sci or Joker instead of Python for scripting 😊


Just miss HEREDOC


And doctest.


@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.


This particular XKCD issue kinda scratches the surface.


Well, node is good, which makes npm good


How can you say such vile things.


Node is good about how it loads packages


Oh, I'm talking about that "which makes". And "npm is good". :)


Sorry. I mean. I'm clarifying what I mean.

👍 4

😩 I'm sleepy.


Same. But not enough. :(


I can't get past how awful JS is as a language 😐


Oh, that's a given.


In any conversation. :D


@p-himik your timezones makes the gap bad :(


JS ecosystem seems worse than the language.


Es7 semicolon cancer notwithstanding.


> Es7 semicolon cancer First time I hear about it, and cannot find anything that looks interesting. Have a link?


> Alan Perlis, "Syntactic sugar causes cancer of the semicolon.''


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++.


I stand by K&R ansi C. It's not many things. I like that.


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.


Yes. I find on clojure an element of C.


C is a small book. Not like C++. Clojure is really a small book.


I have a small palette in clojure, and much I can do with that.


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++ 🙂

👏 8

The cleaner, more elegant language hidden within C++ is called C, 😛


Pip is almost good. All it needs to do is track explicit vs transitive.


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.


Yes. But virtualenv was good in my day


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.


I always forget it's in core now. Why is it a zoo, or virtual env is the standard?


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.


When I did this, there was strong consensus


This was before it was in core


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.

☝️ 4

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


Oh, and you run windows so no instructions for you.


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


Exactly. But poor Sean has to figure it out himself .


I'm on a different Linux, so I have to translate the packages to my machine.


Different package names are fun.

👍 4

"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 🙂


just turned 39 last week


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


I learned his age at ClojuTRE, I was really surprised 🙂


Hold on, my mum says it's past my bedtime.

😄 12

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?


I see it as a win all round :)


> How do you manage all the grown up stuff Listening to podcasts while doing chores helps. Can definitely recommend 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's the temperature on hierarchical dependencies?


Isn't it a problem in principle, and not specific to Java in any way?


All that typing though!


What does rust do? Has it tied it's fate to cargo now? How much?


What are hierarchical dependencies?


Your dependencies can have different versions than you


They have their own dependency on X


Allows for breaking changes.


The problem is that the types don't match up


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?


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 web page, etc.


Semantic versioning is a very well marketed myth, it seems.

❤️ 4

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:


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.


That's why Java still resist versioned modules


Its to push people to patch their dependencies