off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
sova-soars-the-sora 2021-05-26T03:27:58.134700Z

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

sova-soars-the-sora 2021-05-26T03:49:24.135200Z

apparently, yes. https://github.com/binaryage/chromex

pez 2021-05-26T08:21:33.136300Z

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

pez 2021-05-26T08:25:38.138300Z

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.

walterl 2021-05-26T12:18:31.138400Z

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

pez 2021-05-26T12:42:14.139600Z

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

pez 2021-05-26T12:43:14.141100Z

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

2021-05-26T12:43:31.141700Z

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.

2021-05-26T12:43:51.142100Z

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.

2021-05-26T12:43:53.142300Z

quiet.

2021-05-26T12:45:35.142800Z

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

tvaughan 2021-05-26T12:47:00.143Z

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

2021-05-26T13:26:11.143200Z

Haha. Thanks. That gives more courage again.

Christoffer Ekeroth 2021-05-26T14:02:09.143500Z

Suggested fix: Tell stakeholder to not look at GUIDs 😉

Christoffer Ekeroth 2021-05-26T14:05:15.143700Z

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

2021-05-26T14:05:41.143900Z

This was from a tech lead 😞

2021-05-26T14:07:36.144100Z

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 ¯\(ツ)

2021-05-26T14:12:19.144900Z

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:

2021-05-26T14:13:20.145Z

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

Christoffer Ekeroth 2021-05-26T14:13:54.145300Z

wow

2021-05-26T14:14:51.145600Z

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

😄 1
2021-05-26T14:16:17.145800Z

So paranoid:

2021-05-26T14:17:10.146Z

I know naming is hard, but c'mon

2021-05-26T14:18:11.146200Z

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.

👍 9
1
Christoffer Ekeroth 2021-05-26T14:24:28.146700Z

Maybe politely suggest he look at a hash instead 😅

p-himik 2021-05-26T14:26:28.146900Z

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;
  }

😂 1
😮 2
2021-05-26T14:44:36.147300Z

apparently <https://thedailywtf.com/> is still online! this was my old “go to” for this sort of thing

☝️ 2
2021-05-26T14:44:53.147500Z

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

2021-05-26T14:45:35.147700Z

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

☝️ 1
1
2021-05-26T15:51:22.148500Z

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

seancorfield 2021-05-26T16:19:46.148700Z

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

Ben Sless 2021-05-26T16:30:40.149Z

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

Ben Sless 2021-05-26T16:30:45.149200Z

Real code, in prod

2021-05-26T16:52:16.149600Z

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

valtteri 2021-05-26T17:31:25.153Z

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 😉

mauricio.szabo 2021-05-26T18:51:20.153300Z

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

😢 1
mauricio.szabo 2021-05-26T18:53:24.153500Z

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

😄 2
mauricio.szabo 2021-05-26T18:58:12.153700Z

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.

2021-05-26T19:06:00.154200Z

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.szabo 2021-05-26T19:09:09.154500Z

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.szabo 2021-05-26T19:10:32.155600Z

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

2021-05-26T19:10:37.155800Z

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

mauricio.szabo 2021-05-26T19:11:39.156600Z

Which version of Visual Basic? 😄

2021-05-26T19:27:04.156800Z

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.

lsenjov 2021-05-26T20:43:06.157Z

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

😆 4
2021-05-26T23:13:34.159100Z

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

Ruy Valle 2021-05-26T23:54:13.159700Z

interesting talk: https://www.youtube.com/watch?v=kZRE7HIO3vk

Ben Sless 2021-05-30T11:07:07.217400Z

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

Ruy Valle 2021-05-31T01:04:46.222700Z

I hadn’t heard of Urbit!

Ben Sless 2021-05-31T02:56:22.222900Z

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

Ruy Valle 2021-06-02T03:19:20.263800Z

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

Ruy Valle 2021-06-02T03:19:34.264Z

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

Ruy Valle 2021-06-02T03:49:53.264200Z

but otherwise I thought they had some interesting ideas

Ben Sless 2021-06-02T05:36:33.264500Z

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

sova-soars-the-sora 2021-05-26T23:58:06.159900Z

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

sova-soars-the-sora 2021-05-26T23:59:25.160100Z

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-sora 2021-05-26T23:59:54.160300Z

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