Fork me on GitHub
#off-topic
<
2021-05-27
>
Stuart09:05:49

For people that use stored procs rather than sql in your app, how do you manage dependencies for stored procs? i.e. I have a stored proc spFoo and it's called by application A and application B. A developer is working on Application A and needs to change spFoo, how does he know that he is potentially breaking application B. Other than just be disciplined in putting this informatoin in the stored proc comment header?

Sigve10:05:05

I cannot answer generally. But specifically for that problem i would make app A call a new function spBaz instead of altering spFoo. If the two functions have a lot of code in common this can potentially be moved to a third function they both call.

Jimmy Miller12:05:53

I'll just say that more than one application talking to the same database is something I'd be really suspicious of. As your system grows, everything becomes coupled to the database schema and things become harder and harder to change. Of course this is a hard and fast rule. But I've seen so many systems suffer because of this. So I'd really consider if it isn't possible to have an API in front of the db and have other apps call it.

Thomas13:05:58

At one of my previous employers, stored procs were mandatory for data access (the services could not do a SELECT for example.) They versioned the stored procs using a suffix like getData_V1. Basically what @U01E4ELDYM9 said.

Stuart13:05:45

The reason this has come up is moving from not having sql calls in the apps themselves, and moving to only accessing db via stored procs, but there would invevitably be people looking at an existing stored proc and knowing they could call it. but then someone doesnt know that someone on another team is calling their stored proc now, changes it and breaks the other app. Unfortunately a db per app is infeasable right now.

Thomas13:05:54

The scheme I described avoided this because the stored procs were managed in a separate git repo, PRs had to be validated by DBAs who then created them (and they refused any modification to existing stored procs.)

emilaasa13:05:49

I guess all the same things apply as for other shared dependencies. Out of curiosity why go from plain old SQL to stored procedures?

Thomas14:05:34

In our case ? DBAs wanted to review the SQL code to ensure there won’t be any perf issue.

Stuart14:05:05

Easier to code review sql, easier to configure perms on a per stored proc basis, easier to see history of a query.

Stuart14:05:05

Easier to see what dependencies are on a table, it's all in the dB rather than scatters through various apps

emilaasa14:05:40

Well then a decent tradeoff might be to not break stored procedures (ever).

emilaasa14:05:54

Treat it like a public api of any kind?

nenadalm17:05:45

Each app could also have procedures in the app namespace (in postgresql it's called schema, if your db doesn't support that, you could just prefix procedures with <app_name>_. In case you would really want to share some procedures, you could put them in some shared namespace (in which case they should never be broken or each app using the db should be checked if it uses the procedure) I don't use procedures much though. So I don't have much experience with it.

vncz14:05:50

Is anybody here using Github Enterprise Cloud in their company by any chance?

Rob Haisfield20:05:18

I was thinking to myself “huh, parentheses, brackets, and curly brackets sort of shape data, so what if they expanded to take as many lines as they encapsulate?” Never mind this idea is ugly lol

Rob Haisfield20:05:53

I kind of like it tho

Darin Douglass20:05:54

for a few lines it may be nice to see the grouping, but the wider {} gets the more they start looking like () which i could see being confusing

respatialized20:05:43

Scratch blocks are kind of like this, but with boxes instead of brackets.

phronmophobic20:05:57

It is kind of interesting

phronmophobic20:05:00

I experimented with https://blog.phronemophobic.com/treemap/treemaps-are-awesome.html to visualize medium size edn data. I tried using colors to represent types, but I never colorized based off of containers (only leaf types. see below) which might be worth experimenting with.

sova-soars-the-sora21:05:44

That werkbank thing is very intriguing. The rainbow levels actually looks hella useful. If keywords and stuff could still somehow keep a color, or maybe a glow, or outline color, or even just a slight change in Light (Hue, Saturation, Light = brightness)

Rob Haisfield21:05:40

Doo doo doo alternative versions

❤️ 6
Rob Haisfield21:05:01

Woah werkbank looks really cool. I wonder if it would be possible for Clojure to use Fructure for a structural editor? https://www.youtube.com/watch?v=CnbVCNIh1NA

sova-soars-the-sora21:05:18

Hmmm. It would be cool to have a repl set up to a visual coding canvas so you can see results of "map" and "filter" operations instantly on observed data

sova-soars-the-sora21:05:27

ide of the future: coloring book

Rob Haisfield21:05:27

Yeah @U3ES97LAC @UJY23QLS1 the rainbow indentation is cool but I think would work better if it were a translucent background color for the text instead of replacing syntax highlighting

Rob Haisfield21:05:01

Sove re coloring book you’ve got to watch the Fructure video it’s so cool

phronmophobic21:05:12

It's not too hard to get a basic insta-repl setup. The biggest missing pieces I've found are: 1. pretty printing results in within bounded screen space and bounded time 2. being able to pause/stop run away executions (eg. (last (range))) Would love to know if anyone has good solutions for 1 or 2.

sova-soars-the-sora22:05:46

Runaway calculations would be a big thing to address correctly. That's a really great question. How can we terminate a function that's maybe never going to halt ? Maybe add an escape clause to every function via macro that waits on a keypress combo or something? Naive idea

sova-soars-the-sora22:05:17

Damn it would be great to see the errors as something other than EOF BRO while you're typing

sova-soars-the-sora22:05:34

like "java.lang.hay not valid but keep going i guess

phronmophobic22:05:54

the EOF thing would be less of an issue if I was using paredit

sova-soars-the-sora22:05:51

yes that is true -- my comment about seeing errors as more friendly "waiting" lines still pertains to any incomplete code ... did you make that little demo ?

sova-soars-the-sora22:05:10

That's one reason I really enjoy LightTable... inline evaluation of expressions. I think someone will soon nail it with the canvas'd clojure development experience

phronmophobic22:05:12

there's a couple of options that I think might be able to address run away calculations: • run everything in a separate process. you can always kill a process • write an interpreter that allows you to preemptively pause execution • modify an existing interpreter (eg. sci) to preemptively pause execution • use cljs and use a js interpreter that allows you to preemptively pause execution

sova-soars-the-sora22:05:48

dig it. process per function might be a lot but also maybe all good

phronmophobic23:05:12

you could reuse processes that don't need to be terminated.

sova-soars-the-sora23:05:26

Fair point. That way you are only hot-loading what is novel.

walterl00:05:13

@U02108ERRU5 My train of thought took me from that screenshot of yours → "can we do that with the braces/brackets taking up less horizontal space?" → "lines will still need to be easily differentiable" → "different line styles?" → "different colors" → "levels!" 😝

walterl00:05:20

It's a really interesting idea, though 👏

Rob Haisfield00:05:27

@UJY23QLS1 I was thinking about different line styles too! Maybe squigglies for curly brackets, long curves for parens, and square squiggles for brackets. What do you mean by levels?

walterl00:05:13

Sorry, meant "rainbow levels" (the link I shared above)

Rob Haisfield03:05:06

@U7RJTCH6J what are we seeing here? That looks cool

phronmophobic17:05:49

These are several visual representations of https://raw.githubusercontent.com/t-mon/selffinding-chronicles/cb24e067579ba755c26ef642b24f9d2a8d3b45b9/gamedata/savegames/test-savegame.json for different sizes. The visualization works with any edn data. Color represents depth, and each box is a leaf value (ie. strings and non-collections like numbers, keywords, symbols). Map keys are given priority space.

phronmophobic17:05:58

I've tried a bunch of variations for "screen space bounded pretty print". I haven't tried background colors or otherwise to outline collections which is why I thought your initial suggestion was interesting.

djblue16:05:25

I'm partial to rendering that data like this portal

Rob Haisfield17:05:07

@U1G869VNV what would that experience look like if that was an editing interface?

djblue18:05:00

I haven't implemented edit in any capacity, but I think editing would be driven by the viewer. For instance, if you have a table view, I could image a ghost row at the bottom where you can start filling out new values for known keys, probably as an edn string that will get parsed. You could reorder/delete rows and add a new column.

djblue18:05:17

For string: textarea, for boolean: checkbox, for number: slider, for inst: calendar. For anything novel, you can enter the value directly as edn or maybe you choose a type, get a default value for that type, then edit it like any other existing value.

phronmophobic18:05:00

What would “edit” mean in this context? You would need either a reference to an identity or place to put a new value

💯 3
djblue18:05:14

Yeah, that's the hard bit, especially editing recursive values. That's why I've avoided this problem 😅

phronmophobic19:05:02

I think tracking references is doable. You could use a lens-like library to do a lot of the heavy lifting (eg. specter, clojure.zip), but once you "edit" a value, your source code is no longer the source of truth. If you did want a reproducible program state (I think you do), then you would either need to do source editing, have a way to save program state (eg. smalltalk), or something else.

Rob Haisfield18:06:30

This is a bit busier but solves the problem of the different shapes blending together when the parens span many lines

walterl20:06:55

You're "collapsing blocks" away from a kick-ass EDN/code browser 🙂

phronmophobic21:06:03

It's a little intense with nested maps, but seems like an interesting direction

> (backend/draw-to-image! "boxes.png"
                          (depth-draw
                           (read-string
                            (slurp ""))))

😍 6
Rob Haisfield23:06:29

Could the idea of “many visualizations to the same blocks of data” be incompatible with things like Portal, Reveal, or the REBL? Why not just mix it?

Rob Haisfield23:06:19

What other structures would have a distinct color? Anonymous functions, maybe?

Rob Haisfield23:06:02

I’m not just thinking depth as a replacement for rainbow parens.. I was thinking about color coding the blocks based on whether the borders indicate it’s a vector, a map, a list, or a quote. I think shading for nesting is good too, but imagine if vectors had shades of a different color than parens. Like, how can we communicate more than the various types of parens, indentation, and rainbow parens?

mauricio.szabo20:06:58

Coming late to the party, but in theory what we are showing here (different ways to render EDN) is already possible with Chlorine and Clover, with a little bit of effort. I'm working on getting a better customizer for the rendering of EDN

mauricio.szabo20:06:34

Also, @U02108ERRU5 I would love to know what are you thinking about this strucutural editing of Clojure code. Do you already have some ideas?

mauricio.szabo20:06:49

(Specially because the current Chlorine/Clover code is already 100% separate from any specific text editor, so if you decide to re-think text editing, I'm almost 100% sure that we can port Chlorine to it for example)

borkdude20:05:54

Btw is it possible to switch between the markup editor of Slack and the non-markup editor? I have turned it off by default, but for such a long link it would have been nice if I could have formatted it as [foo](bar)

phronmophobic21:05:19

on the desktop app, you can just type foo, select the text, and paste the link and it will automatically turn it into a link

borkdude21:05:42

no, that doesn't work when you have turned off the formatting stuff

phronmophobic21:05:10

oh, right. 😳

Jeff Evans21:05:06

Yeah you have to change your preferences for that single message, currently

sova-soars-the-sora22:05:21

If the JVM were a human being, what would be some of their favorite pastimes?

Ben Sless09:05:04

So all the good people who volunteer to clean up public parks on weekends are actually running java? :thinking_face:

scriptor23:05:38

Putting things together just in time?

Stuart23:05:46

being very vague when it comes to telling you what's wrong?