Fork me on GitHub
#off-topic
<
2021-05-26
>
sova-soars-the-sora03:05:58

is it possible to create a chrome extension with clj/cljs?

pez08:05:33

@sova I think this thing might make it almost as easy to set up as using JavaScript: https://borkdude.github.io/sci-script-tag/

pez08:05:38

Random thought: I’ve come to think that many lambdas (in the AWS sense) that I stumble across could better be implemented as static site data. Sometimes data > code, and using a lambda can trick you into not utilising that.

walterl12:05:31

Sounds intriguing, but I don't fully understand. Do you have an example of such a case?

pez12:05:14

I’ve recently converted a lambda that took two string arguments: a locale, and an ID. Then based on these arguments compiled a list of configurations which it returned. I moved the logic the lambda’s logic to a script (that I use babashka for running). It outputs an EDN config per possible ID and locale which is deployed to a static site. Now, instead of rewriting the lambda code for a new or updated combination of locale/ID and redeploy, I add the config to a sheet, and a CI pipeline runs the script and publishes the new/updated configs. (Not sure how much sense this is making, but for me the win here is to minimize the risk for introducing a bug.)

pez12:05:14

It all started with me refactoring the lambda down to it being mostly a data structure, then realizing I didn’t need a lambda to serve the data structure. 😃

valtteri17:05:25

I’ve used S3 for serving json files that don’t change “too often”. No need to run any code if there’s really no logic involved 😉

sova-soars-the-sora23:05:06

so maybe a static html page is better than memoize if you're using something that actually does not change long-term. a solid reminder

Stuart12:05:31

Can anyone beat this request for absurdity, you have a table in a sql database, one of the fields isa GUID field. You get asked to change the GUID in that field for one particular row as it looks too similar to the GUID on the row underneath, if you looked at it part of it upside down (never mind the fact that there wasn't even an order by on the sql query... so the ordering he was seeing was fairly arbitrary anyway). I can't even.

Christoffer Ekeroth14:05:09

Suggested fix: Tell stakeholder to not look at GUIDs 😉

Christoffer Ekeroth14:05:15

Seriously though, it sounds like there’s some root cause that should be solved instead of tampering with GUIDs. In my experience when you field requests like this you’re sort of acting like a primary care physicians; if someone bursts into your office asking for prescription drugs you have to sort of walk them back up the chain of reasoning to get to the actual problem

Stuart14:05:41

This was from a tech lead 😞

Stuart14:05:36

he knows the guids are references, that no user will ever have to see or interact with a guid and nobody should ever be looking at that table in the db anyway. But still ¯\(ツ)

Christoffer Ekeroth14:05:28

Maybe politely suggest he look at a hash instead 😅

mauricio.szabo18:05:20

I remember once that we had an internal XML payload. Inside that payload, there was a link to an IP, for another internal service to download a cover from a magazine and keep on their service. The PM asked us to add a DNS for that IP, because he could not understand what's that supposed to mean. Remember: it was an internal URL inside an internal XML that was only used to sync two internal services...

😢 3
mauricio.szabo18:05:24

There was another situation where we had a very lengthy discussion about validations. The workflow was the following: 1. Service A sends us an UUID with some data 2. Service B asks us to validade if that UUID did get the data they sent us 3. One of the validations we had to do is that if that UUID was a valid UUID-version-whatever. The catch: only "Service A" would be able to generate these UUIDs. They wanted the "Service B" to validate if THEY did generate a valid UUID...

😄 6
mauricio.szabo18:05:12

I once had a boss that had a PhD in software development (in Brazil). He asked us to make a system where every role was a different class. So, for example, you would have an AdminHandler class that would concentrate every URL, handler, etc that an Admin needs. An GuestHandler, what the guest need... and so on.

Stuart19:05:00

Worked someplace that interviewed a guy with a physics PhD for software developer role. That was a very short interview when he refused to do tue technical test, his reasoning being he has a PhD. He isn't doing tests... Id kinda get it if his PhD was in computing...

mauricio.szabo19:05:09

Yes, I also have to make a disclaimer: most of my "bizarre stories" were from when I was working in a public company in Brazil. Everything is so outdated that sometimes you measure the "deprecation time" in decades...

mauricio.szabo19:05:32

I remember once that a person asked me if our software would be secure. I talked a little bit about SSL, Two-factor auth, etc, and they asked "but will it have username/password"? Afraid of the answer, I said "yes..." and the person continued: "Oh, thanks, ours only had usernames and they were auto-generated, so people were discovering their bosses' logins and..."

Stuart19:05:37

Not much better here, i spend significant time at work still maintaining old visual basic legacy application.

mauricio.szabo19:05:39

Which version of Visual Basic? 😄

Stuart19:05:04

Vb. Net, we actually have a file in the solution called javascript.vb, it's vb that's strings together javascript to send to frontend... I hate it.

sova-soars-the-sora23:05:25

Is there any reason to have them human readable? iPod serial numbers, for example, do not use L or i because it can be confused with 1 and there is no "o" because it can be mistaken as a zero...

sova-soars-the-sora23:05:54

Bitcoins also have a similar optimization going on for addresses, because it's desirable for them to be human-readable.

pinkfrog12:05:51

I would like to know the status of Datomic. Actually how many companies are using it (except Nubank). Seems the discussion in the #datomic slack channel and also the activity on its offical forum are very quite.

tvaughan12:05:00

Perhaps because it's a proprietary product with a support contract people are using different mediums? (We're also using Datomic in production in a manufacturing related product.)

pinkfrog13:05:11

Haha. Thanks. That gives more courage again.

seancorfield16:05:46

I think they do a lot of their either direct/1:1 or via this forum? https://forum.datomic.com/

pinkfrog23:05:34

Yup. That was the thing that confuses me because it is not active by any measure.

manutter5112:05:35

Well, we're using it in production, and we're a fairly large logistics management company.

pinkfrog15:05:22

How do you perform unit test with the database? Loading the in-memory database ?

manutter5116:05:16

No, we use mocks (i.e. with-redefs).

Stuart14:05:19

Whats some of the dumbest code you've seen in production? I nominate these examples from a hideous old code base here: Thankfully at least this function was never actually called:

Stuart14:05:20

Checking if a list doesnt contain only a single item, obviously means you have to count it twice:

Stuart14:05:51

A pattern that gets used a lot here that I've come to call if - meh - else.

😄 3
Stuart14:05:17

So paranoid:

Stuart14:05:10

I know naming is hard, but c'mon

delaguardo14:05:11

beware of calling someone’s code “the dumbest” )) there are always a person behind it and sometimes there is a reason to put it like you see it.

👍 27
3
p-himik14:05:28

I'm pretty sure this deserves a very unapologetic "the dumbest" label. Yes, saw it in real code. It was a fun place to work at.

private static boolean check(Boolean flag) {
    if (flag.toString().length() == 5) {
      return false;
    }
    return true;
  }

😮 6
😂 3
Jeff Evans14:05:36

apparently is still online! this was my old “go to” for this sort of thing

☝️ 6
Jeff Evans14:05:53

but yeah, I agree, you lose the context when looking at a snippet like this

Jeff Evans14:05:35

and I’d venture to guess in most of these cases, someone didn’t write that block in one sitting. it probably got changed and tweaked a hundred times from something else

3
☝️ 3
Ben Sless16:05:40

(list (symbol 'foo) (str "bar") ,,, )

Ben Sless16:05:45

Real code, in prod

lsenjov20:05:06

A "wait for one second" routine that counted to 1 million. Then on inspection realised the JVM optimised it out

😆 12
Ben Sless11:05:07

This rand really reminds of of the premise behind Urbit "everything is a mess", and Urbit's answer was "let's rewrite it from scratch" (kinda) It's a VM, compiler, OS, and more which is small enough for one person to understand and hold in their head. Pretty interesting from a technical perspective

ksd01:05:46

I hadn’t heard of Urbit!

Ben Sless02:05:22

It's certainly esoteric and controversial (don't mention it on HN), yet it doesn't make it less technically interesting

ksd03:06:20

yes, it looks that way, from the little I've read

ksd03:06:34

I thought it was a bit odd to bring cryptocurrency wallets into the mix

ksd03:06:53

but otherwise I thought they had some interesting ideas

Ben Sless05:06:33

I think the bitcoint wallet, besides being a cool goal, is a pretty nice way of integrating identity and payment systems. sort of like wechat does it, but with crypto