Fork me on GitHub
#clojure
<
2020-09-02
>
deadghost15:09:16

Any tips on finding out which tests take the longest to run?

Joe Lane15:09:20

@deadghost Kaocha has a test profiler.

1
👍 1
drewverlee16:09:02

apropos of nothing.... From my perspective

{:youtube.video/title "henry"}
is less information then
{:service "youtube" :media "video" :title "henry"}
sense extra information needs to be justified its reasonable to go with the version that has less. However, In the case where it becomes useful to pull that information apart i think its reasonable to expose both backwards comparable version:
{:service "youtube" :youtube.video/title "henry" :media "video" :title "henry"}
As well as the more destrucutred version, which now carries less information:
{:service "youtube" :media "video" :title "henry"}
I feel i see the advice to namespace everything given as if its a universally better, rather then a trade off. As i see it,
{:title "henry"} 
isn't better then
{:youtube.video/title "henry"} 
because the context matters. I feel this subject is dicey because it's so close to the roots and so it's hard to imagine more ambigiouty (dont we have enough already!). However, this is the best mental model i have of this issue and i wanted to present it to get feedback. It's possible i'm missing some other consideration (performance, language features, etc...) that changes the dynamic.

alexmiller16:09:08

it's hard to talk about this absent context of use - :youtube.video/title is a super useful as an attribute when mixed into a map that also has :company/title

alexmiller16:09:33

but you may have a context where you know that you are working with youtube videos and :title is sufficient in that context

👍 3
drewverlee16:09:17

I agree, the context matters. For some reason I have a fear that if I don't namespace everything I'm some how doing it wrong. Like I added 1 to 1 and got 3.

seancorfield16:09:44

It's definitely about context and the scope of uniqueness required. We still have a lot of stuff at work that uses unqualified keys but, more and more we are using qualified keys to delineate data from subsystems that can end up touching each other. I think if qualified keywords had been common when we got started (a decade ago!), we'd be using them a lot more now. It's particularly nice in the context of database access for joins across multiple tables where you can end up with :site/id and :user/id in the same query and not have to worry about aliasing columns to make them unique.

👍 1
dominicm21:09:13

I think context of map vs key are two tools that we don't understand all of the properties of yet. There's clearly a lot of valuable properties in globally distinct attributes, especially from the perspective of tooling around that. I suspect a large aspect is comprehension of the developer, which is incredibly difficult to measure, especially as an author of code which relies on context.