There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

Transporter_Room_3 , in Alcohol is my way to turn myself on and off again
@Transporter_Room_3@startrek.website avatar

I have a friend who works for a local, but widespread bank, and got to head up their digital security and IT stuff. Not sure what all it encompasses, but he quickly found out that it was a lot, and the previous guy quit because he had had enough bullshit.

Long story shorter, after a particularly bad week, he decided to just… Stop doing his job.

Kept all their legal stuff and sensitive info under lock and key, but the smaller stuff, he just let it go. Went on vacation, turned everything off, didn’t do everything for a temporary replacement (which isn’t even his job, it’s hr’s) and spent a week playing video games and spending time with his wife and baby.

Several employees just in his building basically ended up doing nothing by the end of the first day because they had locked themselves out of the system.

By day 3 there were several lines that couldn’t be used by the tellers in every branch, older employees were bricking their systems so fast, construction workers started taking notes.

By the end of the week they had people showing up at his door to try and contact him since nobody could get ahold of him. Some legit thought he was dead.

His first words when he got into the office on Monday, we’re “THAT is why you pay me.”

And after that, he was given 3 people to help out (he had been asking for 4) and they had a company come in and redo a lot of the computer systems that year.

Still works for the bank, still has a team although I think they’re bigger now since they’ve opened a few more branches, and still tells that story at every gathering after his one single beer gets him tipsy.

Is it just me, or do programmers only come in “lightweight” and “Rivals Þor in trying to drink the oceans dry” varieties?

joby ,

Is it just me, or do programmers only come in “lightweight” and “Rivals Þor in trying to drink the oceans dry” varieties?

Somehow I manage to be both. My alcohol tolerance is very high (which is great… I like a little buzz but never want to be actually drunk), but for me, one toke is over the line.

Zoop ,

One toke is over the line? Sweet Jesus!

SoleInvictus ,

I’m the same way. I take like a quarter hit and I’m alright. The whole puff? Gone for hours.

bleistift2 ,

Somehow I can tell that this story didn’t go down in the US.

Transporter_Room_3 ,
@Transporter_Room_3@startrek.website avatar

Surprisingly, in the Midwest.

firelizzard ,
@firelizzard@programming.dev avatar

Two cocktails will get me tipsy, two beers if they’re strong, but I can drink an entire bottle of vodka (over the course of 2-3 hours) without blacking out. Or at least I could in college, I’m not looking to try again.

yum13241 , in Please stop

Yes. I love this meme template.

This comment was brought to you by the EndeavourOS gang.

jamietanna , in Trying to understand JSON…
@jamietanna@programming.dev avatar

Had to solve this with Go recently, which was not as straightforward as I’d hoped! www.jvt.me/posts/2024/01/09/go-json-nullable/

Bonje , in Looks good to me 👍
@Bonje@lemmy.world avatar

The trick is that 10 lines of code usually pull in thousands as they are likely function calls.

magic_lobster_party , in Looks good to me 👍

I’m the opposite. If there’s 500 lines I will look closer for issues. If there’s only 10 lines it’s LGTM. I’m not going to reward such behavior.

apprehentice , in Surely "1337" is the same as 1337, right?

“1” + “1”

kionite231 ,

“11”

wesker ,
@wesker@lemmy.sdf.org avatar

int(“11”)

Skua ,

strings are in base two, got it

Rez ,
@Rez@sh.itjust.works avatar

Wouldn’t the answer be “10” in that case?

joyjoy ,

1+1=11 means base 1

Eheran ,

How so?

CanadaPlus ,

1 11 111 1111 11111 111111

That’s base 1. By convention, because it doesn’t really fit the pattern of positional number systems as far as I can tell, but it gets called that.

Eheran ,

Oh, I get it, was reading as base 2 and confused by that. Essentially Roman numerals without all the fancy shortcuts.

docAvid ,

Closer to tally marks without clustering

Klear ,

Based

docAvid ,

Who calls it that? Who even uses that enough to have given it a name? Seems completely pointless…

CanadaPlus , (edited )

Theoretical computer scientists, historians of mathematics.

I’m not sure where I heard the term exactly, but I know I have multiple times.

docAvid ,

Thanks for sharing this, it’s quite interesting. I found a Wikipedia article on it: en.m.wikipedia.org/wiki/Unary_numeral_system

Apparently, as you did suggest, “base 1” is a name that is used, but is somewhat a misnomer.

The article mentions that Church encoding is a kind of unary notation, which I would not have thought of, but I guess it is.

Enjoyable little rabbit-hole to zap my productivity for the day.

CanadaPlus ,

No problem!

Skua ,

yes, if I could do maths

SpaceNoodle ,

That’s unary.

Agent641 ,

Strings are in base whatever roman numerals are.

ID411 , in Looks good to me 👍

Perhaps unknowingly, this is a rehash of an age old comic, where a boss needs to get his secretary to type up a massive report.

MonkderDritte , in Looks good to me 👍

Pycharms warns me about cognitive complexity of functions. Other IDEs too i assume?

jubilationtcornpone , in Looks good to me 👍

Reviewing large PR’s is hard. Breaking apart large PR’s that are all related changes into smaller PR’s is also hard.

If I submit a big one, I usually leave notes in the description explaining where the “core” changes are and what they are trying to accomplish. The goal being to give the reviewers a good starting point.

I also like to unit test the shit out of my code which helps a lot. The main issue there is getting management to embrace unit tests. Unit tests often double the effort up front but save tons of time in the long run. We’re going to spend the time one way or the other. Better to do it up front when it’s “cheaper” because charging it to the tech debt credit card racks up lots of expensive interest.

pageflight ,

Yeah, if you don’t want the next dev (or your future self) to accidentally undo that corner case you fixed, better put a unit test on it.

zalgotext ,

I can’t believe we still have to justify writing unit tests to management in the year 2024

someguy3 , in Junior dev VS FAANMG dev

I thought we decided FAANGM was better as FAGMAN.

MHanak ,

“Pepsiman” started playing in my head, but instead of pepsiman it was f****tman

sheepishly ,

It was the Batman theme for me. Na nanana na na... fagmaaaaannnn

TheKMAP ,

Facebook is Meta, no one cares about Microsoft.

So the acronym is MANGA

neonred , in Junior dev VS FAANMG dev

and CI/CD goes “f*ck you, no deployment today, Linter is unhappy”

jack , in Looks good to me 👍

Ask him to do 500 lines and he will never look at it, making you wait forever

Honytawk ,

Meanwhile, ask a c-suite to do 500 lines, and they party until they overdose.

grrgyle , in Looks good to me 👍

This and bike shedding.

dan , (edited ) in JavaScript
@dan@upvote.au avatar

Use TypeScript, and nonsensical things like adding arrays to objects will be compile-time errors.

CanadaPlus ,

Yup. The libraries underneath will still allow nonsense at runtime, though, and it will now be harder to see, so it’s a partial solution as done in standard practice.

An all-TypeScript stack, if you could pull it off, would be the way to go.

dan ,
@dan@upvote.au avatar

Most libraries have TypeScript types these days, either bundled directly with the library (common with newer libraries), or as part of the DefinitelyTyped project.

CanadaPlus ,

DefinitelyTyped is the exact kind of thing I’m talking about. You put TypeScript definitions over things, but under the hood it’s still JavaScript and can fail in JavaScript ways.

intensely_human ,

It can’t fail in javascript ways that require specific sequences of code to be written, if those sequences of code aren’t in the range of output of the Typescript compiler.

Cethin ,

So a strictly typed language… I think those already exist.

thevoidzero ,

If there was an easy way to use rust or something on webassemly and use that instead of JS. I’d be so happy, but I can’t find how to do it without npm.

ObstreperousCanadian ,
@ObstreperousCanadian@lemmy.ca avatar

It’s in alpha, but there is a Kotlin to wasm compiler in the works.

MaggiWuerze ,

Does WASM do DOM manipulation nowadays?

intensely_human ,

Just use javascript and don’t try to add {} to [].

CanadaPlus ,

Well, you never try to.

ObstreperousCanadian ,
@ObstreperousCanadian@lemmy.ca avatar

Doesn’t look like it, unfortunately. But it’s planned. Kotlin can also compile to JavaScript with DOM manipulation. I’ve not tried either scenario, myself.

MaggiWuerze ,

I can’t wait for the day I can use something like Kotlin to write Frontend code. Maybe there’ll be something like vue or react build on it

rooroo ,

You could use Java ages ago and it was, very rightly so, abandoned.

MaggiWuerze ,

You meanbJavaFX? Yeah the web version of it never was great

rooroo ,

Even worse, I’m old enough to have used GWT at some point.

MaggiWuerze ,

shudder

CanadaPlus ,

Kotlin -> JavaScript would work. I assume there must be a Python version of that as well.

Ephera ,

We use this framework at work: leptos.dev

CanadaPlus , (edited )

Rust would probably be the wrong tool here. This is scripting, so pointers like Rust is built around aren’t really meaningful. Kotlin or Python or something are more on the ticket.

anton ,

Websites have grown beyond mere scripting.
Rust is about more than just nicer pointers, it has a very expressive type system that enables correctness rarely seen outside FP.

CanadaPlus ,

Websites have grown beyond mere scripting.

Parts of them, yeah. WASM in Rust makes total sense.

Rust is about more than just nicer pointers, it has a very expressive type system that enables correctness rarely seen outside FP.

If you say so. I’d suggest Haskell, but it doesn’t work very naturally with interactivity, either user or intersystem.

dan ,
@dan@upvote.au avatar

You can use WebAssembly today, but you still need some JS interop for a bunch of browser features (like DOM manipulation). Your core logic can be in WebAssembly though. C# has Blazor, and I wouldn’t be surprised if there’s some Rust WebAssembly projects. I seem to recall that there’s a reimplementation of Flash player that’s built in Rust and compiles to WebAssembly.

CanadaPlus ,

Yeah, ideally TypeScript would be natively supported. Or maybe just Python, which is sort-of strictly typed, and definitely won’t do “wat”. Alas, it’s not the world we live in, and browsers take JavaScript.

dan ,
@dan@upvote.au avatar

Python supports type hints, but you need to use a type checker like Pyre or Pyright to actually check them. Python itself doesn’t do anything with the type hints.

bleistift2 ,

The libraries underneath will still allow nonsense at runtime

Only if you use a badly written library. Most libraries have types provided by DefinitelyTyped. Those who don’t are (in my experience) so tiny that you probably aren’t using them; or, if you really wanted, can check yourself.

In the end, if you encounter a bug, it’ still 99% of the time not a library’s fault, even if it’s written in plain JS.

CanadaPlus , (edited )

Like I said to the other person, those are just types over top of JavaScript that can still fail if/when coercion happens under the hood.

I don’t even know how to search it now, but a specific example came up on here of a time when JavaScript libraries will cause problems, and problems you can’t even see very well if you’re expecting it to act strictly-typed.

Schadrach ,

By that logic what we really need is a modernization of Ada, where there are no compiler warnings and anything that would generate one in another language is instead a compiler error, everything is strongly typed, etc, etc.

If you aren’t familiar with Ada, just imagine Pascal went to military school.

dejected_warp_core ,

Pascal went to military school.

I’m not in love with the idea, but a language that cuts out the BS has a sudden appeal when on a group/team project.

Schadrach ,

That analogy was chosen for a reason. Ada was originally developed by DOD committee and a French programming team to be a programming language for Defense projects between 1977 and 1983 that they were still using at least into the early 2000s. It’s based on Pascal.

It was intended for applications where reliability was the highest priority (above things like performance or ease of use) and one of the consequences of that is that there are no warnings - only compiler errors, and a lot of common bad practices that will be allowed to fly or maybe at worst generate a warning in other languages will themselves generate compiler errors. Do it right or don’t bother trying. No implicit typecasting, even something like 1 + 0.5 where it’s obvious what is intended is a compiler error because you are trying to add an integer to a real without explicitly converting either - you’re in extremely strongly-typed country here.

Libraries are split across two files, one is essentially the interfaces for the library and the other is it’s implementation (not that weird, and not that different than C/C++ header files though the code looks closer to Pascal interface and implementation sections put in separate files). The intent at the time being that different teams or different subcontractors might be building each module and by establishing a fixed interface up front and spelling out in great detail in documentation what each piece of that interface is supposed to do the actual implementation could be done separately and hypothetically have a predictable result.

laserm , in Life is hard

Mood

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines