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.

henfredemars , (edited ) in Life is hard

Missing type or identifier.

A const what?

Also, I read that you have to assign a const when it is declared. Something doesn’t feel right about this statement.

hypertown OP ,

:any

Kaboom ,

Its javascript, itll just let you do that

vithigar ,

it’ll just let you do that

Pretty much sums up JavaScript’s entire philosophy.

Kaboom ,

Imo, its better for it. A tool shouldnt tell the user what to do

Ephera ,

I think, most of us consider it part of the job of a good tool, that it prevents us from using it wrongly. Allows us to use it much more recklessly.

Ziglin ,

But the CPU would be thoroughly confused in many cases. Like if you added a number with a string. This means low level tools have too and therefore people who do low level programming are confused and the generally carefree has rules can make it difficult to debug js.

Also I think rust making you write “safe” code unless you explicitly tell it otherwise is a great thing.

So I think that tools telling the user that they’re doing something wrong is great, tools telling the user to stick with physical limitations for better performance are completely valid but what js does seem really weird with having constants be reassignable, making them nothing but labels combined with HTML I find it even more annoying.

Justas ,
@Justas@sh.itjust.works avatar

[‘a’] + [‘b’] = ‘ab’

Gets me every time.

Ziglin ,

I’m always more confused by adding integers to strings or something being an empty object because something else was undefined and the console didn’t bother to tell me.

skulbuny ,
@skulbuny@sh.itjust.works avatar

You’re downvoted, but you’re 100% right. The web is designed to not break. Engineers who can’t accept that don’t get to complain

jaybone ,

Let me just coalesce these types for you.

pipe01 ,

Ackshually you don’t need a type qualifier in C

henfredemars ,

Really? TIL.

zaphod ,

Defaults to int if I’m not mistaken.

Static_Rocket ,
@Static_Rocket@lemmy.world avatar

Well, assuming you meant type specifier, at least not before C99. After that it is required. C23 explicitly states that a type specifier is required for all declarations.

If you actually meant type qualifier, then no. That was never required.

jaybone ,

Huh?

9point6 ,

void

S0UPernova ,

Maybe…


<span style="color:#323232;">const pain = Infinity
</span>
TurtleTourParty ,

const long pain = 1;

jaybone ,

1L

pelya , in Stop comparing programming languages

C++ is OVERWHELMINGLY SUPERIOR, if you ask any professional C++ developer.

BatmanAoD ,

I was a professional C++ developer for several years, and came to the conclusion that any professional C++ developers who don’t acknowledge its flaws have a form of Stockholm Syndrome.

eco ,

This is true of every language. If you can’t think of things you don’t like about the language you’re working in (and/or its tooling) you just don’t know the language very well or are in denial.

BatmanAoD ,

Ehhh, I mean this more strongly. I’ve never met people more in denial about language design problems than C++ adherents. (Though admittedly I haven’t spent much time talking to Lisp fans about language design.)

pelya ,

It’s made worse by the fact C++11 made a lot of solutions for the deep problems in the language. As the C++ tradition dictates, the problems themselves are carefully preserved for backward compatibility, the solutions are like a whole different language.

And Lisp is small - the first Google result provides a Lisp interpreter in 117 lines of Python code.

BatmanAoD , (edited )

C++11 also introduced new problems, such as the strange interaction between brace-initialization and initializer-lists (though that was partially fixed several years later), and the fairly arcane rules around move semantics with minimal compiler support (for example, it would be great if the standard required compilers to emit an error if a moved-from object were accessed).

I know Lisp is minimal, I’m just saying that I expect there are Lisp fans who won’t acknowledge (or would excuse) any shortcomings in the language, just as there are C++ fans who do the same for C++.

Chadus_Maximus ,

Can confirm. Chose to focus on C++ because it literally makes me superior to other people.

embed_me , in Happens all the time
@embed_me@programming.dev avatar

That’s what makes us humans different from computers. We don’t ask how high, we just do it. Now, if it were a C pointer it would jump anywhere from 0 to 2^32-1. That’s why C is more suited for artificial intelligence than it might initially seem. Thanks for coming to my tedx talk

crispy_kilt ,

Pointers are ackshully 48 bits on amd64 (which is most PCs and servers)

___qwertz___ ,

Well ackshully newer CPUs support 5-level-paging which uses 56 bits.

embed_me ,
@embed_me@programming.dev avatar

I was mostly joking about a stray pointer of type uint32_t*

So the size of the pointer itself doesn’t matter

LucidNightmare , in Naming is hard

Outlook (New) is such garbage. Web app, and doesn’t support plugins. Less functionality over all. Pathetic.

MangoPenguin ,
@MangoPenguin@lemmy.blahaj.zone avatar

IIRC it also stores your account password server side and stores your emails there too, it’s literally just webmail.

COASTER1921 ,

New outlook is less functional but much better UI design (it’s just outlook web access after all). Outlook hasn’t changed in forever because so many corporate high ups use it and think they know how it works. They always respond to emails that are already answered because they didn’t see the newer reply in their inbox. I suspect this resistance is why it’s a totally separate program to the old outlook. Yes, there are settings to group threads in outlook, but the interface is still pretty unintuitive and the vast majority of these users don’t change their default settings anyway. In my experience the terrible defaults create more problems than outlook solves. And the server syncing can be really slow at times. Personally, I’m very happy that MS is finally showing some interest to modernize outlook, the more people who use it the easier my job will get.

Also ya the name is stupid. Teams (New) gets me the most. Idk who possibly thought this naming scheme was a good idea.

olafurp , in new preference war just dropped

I prefer everything to be how you would read it as text. So create_file_dialog it is. Honorable mention is to have it namespaced in a class or something which I think is best. file_dialog.create or dialog.create_file or even dialog.file.create

brunofin ,

I agree. I say open door so the function should be named openDoor.

Honestly nowadays none of that matter if you’re using any remotely modern IDE with good indexing and a sensible search, you can start typing however you mind works and it will find it no matter how it’s named.

sudo ,

My method names are the same way but I aggressively sort things into modules etc so it comes out the other way.

But if I was staring down dozens of these methods and no way to organize them, I’d start doing the sorted names just for ease of editing. L

fckreddit , in Responsive Design Go Brrrr

I am a backend dev, but this shit is why I have utmost respect for frontend devs, also because they know how to center a div.

coffee_poops ,

With flexbox and grid there is no excuse for not knowing how to do that at this point.

Beetschnapps ,

There wasn’t an excuse in the first place. It’s kinda amazing anyone can say centering a div was ever hard, especially if you have a computer science degree.

I mean sure it’s different from say object-oriented programming… but it’s frankly weird in a professional setting hearing grown adults with plenty of experience struggle over basic front-end work.

Miaou ,

Computer science doesn’t have much to do with making websites but ok

coffee_poops ,

Not web sites but certainly web applications.

umbrella ,
@umbrella@lemmy.ml avatar

honestly a lot of the people trying to pass as big pros on the internet are beginners. however its the most common issue with css, so its solution is dead easy to fucking find.

with that said, if i havent been using css in a while ill probably have to look it up.

tiredofsametab ,

<center><table><tr><th>best</th><th>layout</th></tr></table></center>

stage_owl , in "I want to live forever in AI"

Soma is a wonderful game that covers this type of thing. It does make you wonder what consciousness really is… Maybe the ability to perceive and store information, along with retrieving that information, is enough to provide an illusion of consistent self?

Or maybe it’s some competely strange system, unkown to science. Who knows?

Halosheep ,

I don’t think anything gave me existential doom quite as much as the ending of that game.

GnomeKat ,
@GnomeKat@lemmy.blahaj.zone avatar

I think the definition of consciousness needs to not be solely about abilities or attributes. It needs to account for the active process of consciousness. Like a hair dryer can burn things… but a fire is things burning. Without the active nature its simply not conscious.

intensely_human ,

Maybe consciousness is everywhere, and has nothing to do with mechanisms.

intensely_human ,

Provide the illusion to whom?

GammaGames ,

Self? Seemed pretty clear in their comment

random9 , in STOP USING GITHUB

I thought this was going to be a FOSS discussion, comparing GitHub and it’s current owner - Microsoft - to the ethics of other hosting services like codeberg.org or something.

Then I saw where this was posted.

itsnotits ,

and its* current owner

random9 ,

Yes, I normally speak english good, but your corect to, i make a typo then.

Eyck_of_denesle ,

I am new here. Can you kindly elaborate.

random9 ,

A lot of people associated with Free and Open Source Software (FOSS) have major objections to GitHub. Here’s one summary: sfconservancy.org/GiveUpGitHub/

But the TLDR; version is roughly:

  • Your source hosted on GitHub is being used to train AI, and you are possibly giving up rights to algorithms you may have written (IANAL, and AI training is a fuzzy topic at the moment)
  • GitHub itself is proprietary, closed-source software, while they claim to be pro-FOSS. Aside from not being in the spirit of things, closed-source means you also don’t know what happens with your code/data once up upload it.
  • Microsoft has a history of being anti-FOSS, while some people will say it’s been changing, I think many are still rightfully concerned what their future decisions regarding GitHub might be, especially if they are a near-monopoly.

Alternative do exist, and some like codeberg.org are specifically open sourced, and pro-open source, so many people are pushing to move hosting away from GitHub and onto other options.

Eyck_of_denesle ,

Thanks for explaining it in such good detail but I was referring to your last sentence. I’m new to lemmy and I’m still looking for good communities and blocking the bad ones. I apologise for not being clear enough in the first reply.

random9 ,

Oh - this isn’t a bad community, that isn’t what I meant by my last sentence - this is just a place for memes and jokes more than serious discussion, hence my expectation of a serious discussion was subverted. But programmer humor is still a great place.

redcalcium ,

The previous Microsoft’s CEO truly hates FOSS, famously calling it cancer. Then the next CEO reversed Microsoft’s stance on FOSS, acquiring the largest FOSS collaboration site. Naturally, many view this move with suspicion since Microsoft has a history of embracing something only to extinguish it later.

OsrsNeedsF2P , in Release notes of an open source app. Someone is pretty mad at Canonical for Snap

Canonical could have done a lot better with the explanation message here. The idea is to push apps towards XDG compliance and the use of things like Portals.

That said, unlike Wayland, portals really aren’t there yet from a UX perspective, especially for an app that is heavy on file transfers.I prefer what Flathub does where it puts a nice green checker beside your app for XDG compliance - it’s an encouragement, but not an enforcement.

Melatonin , in I'll just be a quick 3h

Hey! I just started looking at SQL and this is the first SQL joke I’ve ever seen or at least ever gotten!

So, congratulations me!

Dave ,
@Dave@lemmy.nz avatar

Welcome! Please complete your setup by placing this on your wall: xkcd.com/327

Melatonin ,

Lolz got that one too

dauerstaender , in thisIsGoingToBeASeriousDebate

Unsafe block detected. Extermination initiated. There is no hiding from memory safety!

SquishyPandaDev , in The temptation is always there
@SquishyPandaDev@yiffit.net avatar

Obligatory, mutable global variables are evil.

magic_lobster_party ,

The definition of a variable is that it’s mutable. If it’s immutable it’s constant.

marcos ,

There’s no ISO standardized definition for variable. People use that word with all kinds of meaning.

Yen ,

This is needlessly obtuse. The definition of the word is that it’s non-constant. There isn’t an ISO definition of the word no, but there are many reputable dictionaries out there that will serve as an alternative.

marcos ,

Well, starting with the definition from algebra, where it’s not something allowed to vary…

I guess more people know about math than use imperative programing languages.

SkyeStarfall ,

Except that’s exactly what it is allowed to in algebra.

Sure, in most equations you solve in early algebra school there is only one possible value for the variables. But in many equations there can be multiple, or even infinite. It’s an unknown, and the contents can vary (depending on other constraints, ie. The rest of the equation(s)).

marcos ,

There’s no time in algebra for your variables to vary.

When you have a non-unitary set of solutions, you have a constant non-unitary set of solutions.

drcouzelis ,
@drcouzelis@lemmy.zip avatar

Waaaait a minute… isn’t it called a variable because the contents are, you know, variable?

BassTurd ,

It started as a variable, then ended as a constant.

Walnut356 ,
@Walnut356@programming.dev avatar

I feel like it’s like pointers.

“Variable” refers to the label, i.e. a box that can contain anything (like *ptr is a pointer to [something we dont know anything about])

Immutable describes the contents, i.e. the stuff in the box cant change. (like int* ptr describes that the pointer points to an int)

Rust makes it very obvious that there’s a difference between constants and immutable variables, mainly because constants must be compile time constants.

What do you call it when a variable cant change after its definition, but isnt guaranteed to be the same on each function call? (E.g. x is an array that’s passed in, and we’re just checking if element y exists)

It’s not a constant, the contents of that label are “changing”, but the label’s contents cant be modified inside the scope of that function. So it’s a variable, but immutable.

QuazarOmega ,

As opposed to immutable variables

confused screaming

yiliu ,

Or mutable constants…

Eufalconimorph ,

<span style="color:#323232;">int const golden = 1.618;
</span><span style="color:#323232;">int* non_constant = (int*)&amp;golden;
</span><span style="color:#323232;">golden = 1.61803399;
</span>

Casts are totally not a danger that should require a comment explaining safety…

Eufalconimorph ,

And more generally mutable aliasing references of any sort are evil. Doesn’t mean they’re not useful, just that you need magic protection spells (mutexes, semaphores, fancy lock-free algorithms, atomics, etc) to use them safely. Skip the spell or use she wrong one, and the demon escapes and destroys all you hold dear.

AbsolutelyNotCats , in The birth of JS
@AbsolutelyNotCats@lemdro.id avatar

Just a reminder that JavaScript was developed in 10 days, the same amount of time i spend fixing bugs when i just miss a “,”

SnipingNinja ,

The world was made in 7 days, so it should have been 3 days left to develop js

AbsolutelyNotCats ,
@AbsolutelyNotCats@lemdro.id avatar

This sounds more credible than the big bang theory. I no longer believe in science

dukk ,

Physics was written in JavaScript?

…checks out.

CeeBee , in Planning is for the weak

I had almost this exact scenario.

I was given a ticket for something I was still unfamiliar with at the time, as I was only about 6 months into the job. The thing I was working on was fairly complex in a very specific and niche subject, so it’s the kind of thing literally no one would know until you work at this place.

I made the requested changes per the ticket as best as I understood them and fired the ticket back to the BA. Almost a month goes by and the project lead calls me up telling me it wasn’t done properly. After going through what the issue is I remark that now I understand better and will update it. He started on a rant about how if I don’t know something I should be asking and these kinds of changes shouldn’t be left to the last minute only a day before deployment.

I merely replied that it’s difficult to ask about something when you aren’t even aware of its existence (too hard and too difficult to explain here). But what really set him off was me saying “why am I hearing about this an entire month after I finished the ticket?

He didn’t know what to say and just hung up the call.

Ghostalmedia , in Who is this "Jenkins" and what now has broken him?
@Ghostalmedia@lemmy.world avatar

“Leeroy Jenkins” is what my backend guys say right before they huck a major DB upgrade into prod without testing it in staging.

steal_your_face ,
@steal_your_face@lemmy.ml avatar

Our old Jenkins box is called Leroy, and my old place it was called Jankins. Thankfully we’ve moved on from that trash.

intelati ,

Always Friday at 16:59 right?

Ghostalmedia ,
@Ghostalmedia@lemmy.world avatar

Right before a long weekend where Monday is a government holiday.

Also, Leeroy tried to optimize his PTO and hooked a backpacking trip onto the long weekend. He will be out all week and will have no phone reception.

Eufalconimorph ,

But he will have chicken.

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