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.

programmerhumor

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

andrew , in Gender.js
@andrew@lemmy.stuart.fun avatar

Joke’s on you because they’re all still mutable objects behind the reference.

Phen ,

Last one can be freely changed by anyone, the middle one still has some restraints.

soloner ,

Reassignment isn’t the same as mutation. But mutation depends on the type of value. If gender was a string like “female” it wouldn’t be mutable cuz strings are immutable in JS.

andrew ,
@andrew@lemmy.stuart.fun avatar

Yeah this is true. My joke makes an assumption about the type not being a primitive type.

andrew ,
@andrew@lemmy.stuart.fun avatar

var isn’t global unless it’s not inside a function. var is just function scoped, with declaration auto hoisted to the beginning of the function. let is a little more intuitive since you can’t refer to it before it’s been declared and has block scope rather than function scope.

Klaymore ,
@Klaymore@sh.itjust.works avatar

Wait… you can use a variable before you declare it?

andrew ,
@andrew@lemmy.stuart.fun avatar

<span style="color:#323232;">var a;
</span><span style="color:#323232;">(function() {
</span><span style="color:#323232;">  a='hoisted';
</span><span style="color:#323232;">  console.log(a);
</span><span style="color:#323232;">  var a;
</span><span style="color:#323232;">})()
</span><span style="color:#323232;">console.log(a);
</span>

Should log hoisted and then undefined, showing that you’ve assigned to the later-declared var a which was hoisted vs the external global a.

CheezyWeezle ,

Kind of. With hoisting, the compiler/interpreter will find variable declarations and execute them before executing the rest of the code. Hoisting leaves the variables as undefined until the code assigning the value to the variable is executed. Hoisting does not initialize the variables.

For example:

console.log(foo); var foo; //Expected output: console logs ‘null’

foo = ‘bar’; console.log(foo); var foo; //Expected output: console logs ‘bar’

console.log(foo === undefined); var foo; //Expected output: console logs ‘true’

This means you can essentially write your code with variable declarations at the end, but it will still be executed as though the declarations were at the beginning. Your initializations and value assignments will still be executed as normal.

This is a feature that you should probably avoid because I honestly cannot think of any good use case for it that won’t end up causing confusion, but it is important to understand that every variable within your scope will be declared at the beginning of execution regardless of where it is written within your code.

shotgun_crab ,

Classic javascript doing javascript things (this is why they introduced let and const)

lseif ,

typescript: const as const (readonly) ‘pretty please dont mutate it’

Baizey ,

// @ts

Bishma , in question, When were programmers supposed to be obsolete?
@Bishma@discuss.tchncs.de avatar

The earliest I can think of (from personal experience) is 4GL languages; the early low-code platforms that first started to get traction in the early 80s. They wouldn’t have replaced programmers but some thought/hoped they would usher in an age of “low skill” programmers that companies could get away with paying minimum wage to.

Ephera ,

Oh yeah, low-code platforms in general are pretty much always a thing, in every industry for various tasks.

I’ve also never seen any of them that were not horribly abused with ridiculous workarounds or custom code snippets, which effectively made them as complex as a real program.

chad , in My debugging experience today: Quantum Debugging

I’m a contractor at a rocket launch service provider. The final build of the ground control software is compiled and deployed to the launch pad with debug flags enabled because of a “fly like you test” mandate.

Millions of dollars and tons of time invested by brilliant people are riding on rockets that are launched using software with debug flags because of an “if it ain’t broke don’t fix it” mentality and archaic test strategies.

henfredemars ,

I’ve worked on ground systems and it’s actually come in handy two times in five years, usually where we had a hard-to-reproduce bug. Getting the info when the problem happens can occasionally be all the difference.

Addendum: And usually we didn’t care about performance. Basically never.

ambitiousslab , in My debugging experience today: Quantum Debugging
@ambitiousslab@lemmy.ml avatar

Perfect, now you just have to wrap your program inside a debugger in production!

henfredemars , (edited )

We test AND develop in production. Get on my level.

leisesprecher ,

One of our customers does that. It happened multiple times already that one dev fixed an issue in production, and the next regular deployment overwrote everything.

But fortunately, it’s just critical infrastructure and nothing important.

henfredemars ,

When I left my last job they were using the zip file method for version control and one creative developer managed to link two versions of libc at the same time.

Software is so useful that the standard for utility is extremely low.

ChickenLadyLovesLife ,

There’s a name for that: DEVELOPMESTUCTION

davel , in Dealing with tech debt
@davel@lemmy.ml avatar

I blame every gray hair on Jenkins Pipeline’s so-called DSL, a.k.a. Groovy.
You’d have to pay me a seven-figure salary to work with that again.

yogthos OP ,
@yogthos@lemmy.ml avatar

yup, that thing’s a nightmare alright

AlecSadler , in Dealing with tech debt

2 years? More like 3-6 months.

Cysioland , in Dealing with tech debt
@Cysioland@lemmygrad.ml avatar

Nah, our tech stack is a loan shark who’ll come collect technical debt in a month’s time

Quacksalber , in My debugging experience today: Quantum Debugging

Aren’t those almost always race condition bugs? The debugger slows execution, so the bug won’t appear when debugging.

anhkagi ,
@anhkagi@jlai.lu avatar

sometimes it’s also bugs caused by optimizations.

xthexder ,
@xthexder@l.sw0.com avatar

And that’s where Release with debug symbols comes in. Definitely harder to track down what’s going on when it skips 10 lines of code in one step though. Usually my code ends up the other way though, because debug mode has extra assertions to catch things like uninitialized memory or access-after-free (I think specifically MSVC sets memory to 0xcdcdcdcd on free in debug mode).

BlueKey OP ,
@BlueKey@fedia.io avatar

Turned out that the bug ocurred randomly. The first tries I just had the "luck" that it only happened when the breakpoints were on.
Fixed it by now btw.

Skullgrid ,
@Skullgrid@lemmy.world avatar

bug ocurred randomly.

Fixed it by now btw.

someone’s not sharing the actual root cause.

BlueKey OP ,
@BlueKey@fedia.io avatar

I'm new to Go and wanted to copy some text-data from a stream into the outputstream of the HTTP response.
I was copying the data to and from a []byte with a single Read() and Write() call and expexted everything to be copied as the buffer is always the size of the while data.
Turns out Read() sometimes fills the whole buffer and sometimes don't.
Now I'm using io.Copy().

dunz ,
@dunz@feddit.nu avatar

I had a bug like that today . A system showed 404, but about 50% of the time. Turns out I had two vhosts with the same name, and it hit them roughly evenly 😃

vortexsurfer ,

Had a similar thing at work not long ago.

A newly deployed version of a component in our system was only partially working, and the failures seemed to be random. It’s a distributed system, so the error could be in many places. After reading the logs for a while I realized that only some messages were coming through (via a message queue) to this component, which made no sense. The old version (on a different server) had been stopped, I had verified it myself days earlier.

Turns out that the server with the old version had been rebooted in the meantime, therefore the old component had started running again, and was listening to the same message queue! So it was fairly random which one actually received each message in the queue 😂

Problem solved by stopping the old container again and removing it completely so it wouldn’t start again at the next boot.

ExtraMedicated ,

I had one years ago with internet explorer that ended up being because “console.log” was not defined in that browser unless you had the console window open. That was fun to troublshoot.

RedWeasel , in The C++ learning process

I started to learn C++ once, had semester and couldn’t wrap my head around the object oriented part. At some point I looked at learning objective C on my own, though I didn’t really use it. I had a 1000x better understanding after an hour.

ChickenLadyLovesLife ,

I learned it while at the same time learning (or really enhancing my previous knowledge of) javascript, thanks to an insane mostly-Finnish app development platform known as Qt Creator, which for no rational reason uses C++ for the under-hood-stuff and javascript for the UI front end. Just an absolutely horrible mismatch of mental states. For bonus points, the company that I worked for that used this monstrosity for its suite of apps got purchased by a huge west coast company and the apps were shut down and everybody was fired, after two years of my working on this shit.

tiredofsametab ,

Something like ruby is a pretty quick way to get up and running with something easy and object-oriented. Groovy if you already have a jvm running (though ruby might be easier depending upon your background)

FlorianSimon ,

Is Groovy still a thing?

tiredofsametab ,

I would assume so. Grails basically died to SpringBoot (which I thought was sad from years ago as I thought grails did some things better), but I mainly have worked in Go for the last 5 years and a lot of PHP and Java in the 5 before that (then Grails, J2EE, Perl, ASP (pre-dot-net), etc. before all that).

stefenauris , in question, When were programmers supposed to be obsolete?
@stefenauris@pawb.social avatar

It’s not happening, ever. Someone has to build the AI after all

Maeve ,

Was thinking that may be why it's taking so long. It's akin to knowing you have to train your human replacement before you're fired. You can't possibly teach a program or human everything you know in a limited time; and a great many don't want to do.

mokus , in The C++ learning process

I actually just started learning C++ today.

If Lovecraft were alive today one of his stories would start with this line.

tacosplease , in The C++ learning process

The image doesn’t open for me. But I guess the joke still works in a way.

unionagainstdhmo OP ,
@unionagainstdhmo@aussie.zone avatar

Does Ignatius in the post body?

brbposting , in My debugging experience today: Quantum Debugging
mosiacmango ,

He worked for the gmsin site/podcast “Giant bomb” years ago. Pretty sure the image macro is pulled from one of their podcast videos.

WhiskyTangoFoxtrot ,

I always thought it was Cary Elwes.

whoisearth , in My debugging experience today: Quantum Debugging
@whoisearth@lemmy.ca avatar

When I write APIs I like to set endpoints to return all status codes this way no matter what you’re doing you can always be confident you’re getting the expected status code.

scrubbles , in question, When were programmers supposed to be obsolete?
@scrubbles@poptalk.scrubbles.tech avatar

It’s happened a few times in my career where people tell me I’ll be obsolete, but it’s always been some company hyping their new product and suits frothing at the prospect of not having to pay me anymore.

So far they’re like 0 for 8 or so.

Now I will say the goalposts move. What I’m doing now is for sure not what I was doing 10 years ago. I’m definitely heavier in devops and infra than where I was before (ironic because they said we’d never have to worry about that stuff again if we moved to the cloud). AI is still basically machine learning, just in a while loop, so I’ve spent time learning that. So, in a way, yes we’re obsolete in the sense that if I was the same engineer I was 10 years ago I wouldn’t be worth nearly this much, I had to grow and evolve with technology.

UnsavoryMollusk , (edited )

“Don’t worry the salesman told me I would not need an infra team anymore ! Also do you know what is a vpc ?”

scrubbles ,
@scrubbles@poptalk.scrubbles.tech avatar

Oh don’t worry, you can just pay <<cloud provider>> 30x what you were your infra team before, or if that’s too expensive just pay a consulting form 10x what you would have before. Then they can go dine on steaks while they have the same infra guy you had hired before doing the same stuff just now in “teh cloud”, but making less money

leviticoh OP ,

@scrubbles
cool

but it's always been some company hyping their new product and suits frothing at the prospect of not having to pay me anymore

i half expected it, after all it's what's happening right now

What I'm doing now is for sure not what I was doing 10 years ago.

that's right, i guess some aspects of programming have really been made obsolete

corsicanguppy ,

some aspects of programming have really been made obsolete

I’d agree that some specifics have been made obsolete. Some habits and routines are currently being ignored or skipped, but the amount of skill that’s gone away is very small.

As mentioned before, we downsized brutally after Y2K. The people most affected were the highest-paid who weren’t the best code-grinders, and these were the documenters, the programme people, and the mentor types. We lost our guides, our structure, and our historians. We’ve been growing again like feral children rebuilding society from the wasteland like it’s Mad Max, and there’s a LOT of the Why that we either don’t know, that we ignore, or that we skip in the interests of (insert manufactured urgency here).

We are re-learning some of the whys, but we haven’t yet seen the half-assedry chickens come home to roost on that. The symptoms are there: Boeing’s Gilligan’s Island in Space, supply-chain sploits in waves, personal information lost weekly, all these things that are clipboard hassles we stopped doing that pelrevent massively expensive things later.

Crowdstrike may die now, mainly because they were marauding leopards we allowed to eat our face. Solarwinds before that, same issue but they seem to be okay. There are dozens of ohShit moments that could lead to similarly preventable problems, that we knew not to do … once.

Well get there again but we’ll be rediscovering a lot of what some techbro will claim is obsolete, old-practice, too-cautious, hand-wringing in our neu and moderne go-hard/break-lives paradigm.

themoonisacheese ,
@themoonisacheese@sh.itjust.works avatar

DevOps was a lie pushed on devs to make them become sysadmins, unfortunately.

corsicanguppy ,

It was a fancy lie about their spare time, but especially in dotcom, there IS no spare time to learn architecture.

What I’ve seen of dev AND ops is that their knowledge is focused well on their own things. And when it comes to the other half of devops they just want the shortest path back to doing their thing. This has caused absolute princess devs to be nearly screaming about the hassle of security and change control and infrastructure and proper code deployment and testing and … Well, a lot of things.

It doesn’t pay to have people learning to half-ass dev because ops is your thing. You need advocacy on both sides of that line, still.

leisesprecher ,

And DBAs. I’m currently working on a project where I said from the very start, I can set up this DB in k8s and I can get it to work decently, but I have neither the knowledge nor the time to get it right. Please give me someone who knows how this works.

No, don’t worry, it’ll be fine, we don’t need that, this kuverneles thing I keep hearing about handles that!!!

Six months of hard contact with the enemy on production later:

Well, we’re currently looking for someone who actually knows how DBs work, because we have one of those issues that would cost a proper DBA 5min and me 5 months.

scrubbles ,
@scrubbles@poptalk.scrubbles.tech avatar

I feel like there is a lost art of DBAs, where in their mystical knowledge rests how to make perfect cheap and scalable databases, and business cast them away because “Why not pay Google twice that amount?”

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