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.

conditional_soup , in “It’s not that hard”

Quick, somebody teach this man JavaScript.

BoastfulDaedra ,

JESUS CHRIST MAN! Is the internet still not broken enough for you!?!?

hansl ,

Wasn’t PayPal coded in PHP? That might explain a lot of things…

BorgDrone , in call the doctor, the CS doctor

Are you indexing your fingers or counting them ?

Indexing starts ar 0 but counting starts at 1.

FriendOfElphaba ,

This.

One of the reasons indexing starts at zero is because back when we used to use pointers and memory addresses, the first byte(s) of an array were at the address where the array was stored. Let’s say it is at 1234. If it was an array of bytes, the first data element was at 1234, or 1234 + 0. The second element would be at 1235, or 1234 + 1. So the first element is at location 0 and the second at location 1, where the index is actually just an offset from the base address. There may be other/better reasons, but that’s what I was taught back in the 90s.

Counting always starts at 1 (if we’re only using integers). You don’t eat a hamburger and say you ate zero hamburgers.

Sonotsugipaa ,
@Sonotsugipaa@lemmy.dbzer0.com avatar

I do say I ate zero hamburgers if I just started counting and I have yet to eat one

FriendOfElphaba ,

When you’ve eaten more than 50% of the hamburger, do you claim to have eaten one, or do you claim zero? Are you useing standard founding or are you using floor()?

Sonotsugipaa ,
@Sonotsugipaa@lemmy.dbzer0.com avatar

I create a Vulkan instance, a device, a compute pipeline then use an image sampler with VK_FILTER_LINEAR on a single-texel image in order to interpolate the two adjacent values of hamburger eatage, simple as.

Haus ,
@Haus@kbin.social avatar

There was a time when I had to switch back and forth between Fortran90 and C several times a day, and it messed me up so bad that doing simple tasks like counting apples at the grocery gave me anxiety.

BatmanAoD ,

“used to”?

FriendOfElphaba ,

Perchance programming with pointers has plunged as a percentage of programmers.

But thank you. I was hoping someone would notice that.

dukk , (edited )

Well, you don’t really see many people accessing lists with pointers directly. Also 0-indexing does give us an extra number to index with(say 1-255 vs 0-255)

Edit: 0-255, not 0-256

FriendOfElphaba ,

It’s 0-255 when you’re indexing like that. 11111111b = 255.

dukk ,

Oh sorry, you’re right. Amended my comment.

Ddhuud , in It's a mass extinction event

Because the only possible thing to do in c# is unity stuff…

.

.

.

fuck_u_spez_in_particular ,

I mean why else would you want to use C# when there’s Rust 🦀 and all the awesome tooling and libraries around it…

duxuev ,
@duxuev@lemmy.world avatar
areyouevenreal ,

Rust really isn’t all that. Plus C# is used for all kinds of corporate stuff where Rust levels of performance aren’t needed. It’s also used in several other game engines

Wooki , (edited )

Security, performance and most importantly, security. .net updates every week to address security vulnerabilities, stability and enhancements. While the language is lower you just can’t overstate poorly c# lasts. C# Deprecation and dated code make for a pretty high maintenance and frustrating ecosystem at the best of time.

areyouevenreal ,

It being updated frequently just shows it’s being regularly maintained and improved.

C# has many of the same security and safety advantages that Rust does given they are languages with memory management and other safety features built-in.

Rust has exactly the same problems with depreciation as many Frameworks rely on experimental features which are subject to change.

Edit: plus if you have ever used Rust it’s a pain to learn and use compared to C#. C# is so similar to Java and so much easier than C++ that it’s really not much of a jump for programmers new to the language.

Wooki , (edited )

.net is not secure, it’s so far from secure it’s a joke. 503 security patches this year alone, that includes one for each windows version but you get the point.

areyouevenreal ,

Do you not think Rust also has security flaws? At least Microsoft patch theirs.

fuck_u_spez_in_particular ,

There are of course security flaws, we’re humans after all. Unless the compiler and the language can be proven mathematically correct at least.

But as described above, in practice the security flaws are easier to isolate in Rust compared to C# IME. The current story of security flaws in Rust is quite good so far.

areyouevenreal ,

The current story of security flaws in Rust is quite good so far.

That means nothing without knowing who said it. I find it hard to believe it’s anymore secure the C# without security research saying so. It’s a very complex language from what I understand with a lot of moving parts. It’s also dependant on external frameworks in a way that C# just isn’t. If you have a problem with .net there is a company behind it who is responsible. Who is responsible for actix web or seaorm?

fuck_u_spez_in_particular ,

Learning curve is steep in the beginning, I agree (I wouldn’t argue painful though, maybe if you have to unlearn bad practices, like interior mutability though etc.).

But I think it pays off after some time. I’m now faster in Rust than in C# with similar experience, and the quality of the code is definitely higher as well (which can be credited to the strict kinda opinionated design of Rust IMO).

It composes really well, better than most (non-functional) popular languages. I think this is probably the Sell for Rust, as it additionally works remarkably well over the entire stack (kernel -> frontend) (in each abstraction level might be better/easier to use languages to be fair though).

areyouevenreal ,

What’s interior mutability and why do you think it’s bad?

I might have another try at rust some time in the future. I think I tried it in a bad situation having to use it for a web microsevices project when I had limited knowledge of the language. If it had been another language I probably would have been able to pick it up in the time frame required. Using it did cost me in terms of grades, and it was a poor decision to use that language at that time.

The main things I struggled with were all the borrow checking and asynchronous stuff, as well as the lifetimes concept. I still don’t understand how you are meant to specify object lifetimes. In C you assign and free things manually, in Java and Python it’s done mostly automatically, in C++ you choose manual or automatic when it’s assigned. In Rust it seems it’s automatic until the compiler can’t figure it out and then it becomes manual, which is frankly bizarre.

fuck_u_spez_in_particular ,

Rust has exactly the same problems with depreciation as many Frameworks rely on experimental features which are subject to change.

Rust has actually quite a good record with depreciation and backwards-compatibilty etc. They are changing the language in non-backwards compatible way over editions, but the changes are mostly very manageable.

But to not end up being another C++ (syntax-wise it’s a disaster IMHO), a few non-backwards-compatible changes every few years are the way to go, when it’s manageable.

areyouevenreal ,

What’s so confusing about C++ syntax exactly? To me it seems to make a lot of sense given the languages history.

fuck_u_spez_in_particular ,

I’m not speaking for Rust level performance. I’m using Rust nowadays, because it’s generally doing a lot right, that other popular languages struggle with IMO.

Think about error handling. I think even Java is better here than C#. I think it’s quite a mistake, not being required to add all possible exception types that a function can throw to the function signature.

Then the next thing, I really hate about almost every popular language is implicit . To be really safe, you have to check every (non-primitive) variable for null before using it, otherwise you have a potential NullPointerException.

Then take pattern matching, this is a baked in feature of Rust from the beginning and it does this really well (exhaustive matching etc.). There’s “basic” pattern matching in C#, but it just doesn’t really feel right in the language, and is not even close in capability compared to Rusts.

All of this (and more) makes Rust the less error-prone language, which I can say with confidence after long experience with both of these languages (both > 5 years).

I’m honestly not sure why exactly C# was chosen for most of the games, but it’s probably because it’s relatively good to embed, is relatively strong-typed, while being somewhat performant (compared to something like python or other scripting languages).

brezelradar ,
@brezelradar@feddit.de avatar

Yea, there are 50 game engines written in rust - or so I heard.

genoxidedev1 , in They tried
@genoxidedev1@kbin.social avatar

That's gotta be quite some website you visited, if it didn't load at all without cookies. As someone from Germany, who mostly rejects every sites cookies, except for the essential ones most of the time, but sometimes outright rejects all cookies, I've never encountered a website that refused to load upon doing that.

Not defending any webpages that do do that, just contributing my personal experience.

Also: this for chrome or this for fiefrerfx

SanityFM ,

Consent-o-matic is magnificent.

SlopppyEngineer ,

One extension to automatically accept, one extension to automatically delete everything after the tab is closed.

MDFL OP ,

It’s rare to see (probably since someone pointed out it doesn’t conform to GDPR standards), but I ran into a batch of them in short order recently, so it’s been on my mind.

BuddyTheBeefalo ,

www.oekotest.de

www.pcwelt.de

www.saechsische.de

www.wetter.com

All don’t offer cookie rejection.

genoxidedev1 ,
@genoxidedev1@kbin.social avatar

Makes sense, I don't use any of them, at all. I'm pretty sure there's a place where you can report such webpages for doing that though, though I don't know where at the moment.

Edit: possibly this one

BuddyTheBeefalo ,

Netzpolitik.de checked Germany’s top 100 sites. Not many offer a single click rejection of cookies. Many of them only offer a paid ‘pure abo’ to disable tracking.

datawrapper.dwcdn.net/9GFZM/8/ (German)

gamey ,
@gamey@feddit.rocks avatar

Yea, we have the same issue in Austria but technically that’s illegal behaviour and you should be able to report it somewhere!

AceFuzzLord ,

Don’t know if it’s me or what, but I clicked on the first link and when it opened in my mobile browser, everything started shaking vertically like the page was suffering an earthquake. I’ll definitely have to look into that because I’ve never seen it happen before on any website like it.

PopularUsername ,

I’ve seen Italian sites that will put up a pay wall if you refuse the cookies.

Pandoras_Can_Opener ,
@Pandoras_Can_Opener@mander.xyz avatar

Also from Germany. Some american news and media sites do that.

ErwinLottemann ,

some other just block access from the eu completely. (not a news site, but applebee’s does this)

triplenadir ,
@triplenadir@lemmygrad.ml avatar

www.healthline.com - has a two-click “disable all”, but if you choose it you get a static site with 10 of their articles anon.healthline.com

CanadaPlus ,

I exit in the EU a lot. Same, they mostly work fine with no cookies. It’s much more common to see one that just doesn’t let EU residents in.

Konlanx , in I'll just sort it myself

This is due to the default sorter in JavaScript sorting by the string value. The reason for that is that this won’t create errors at runtime. Since JavaScript does not have types, this is the safest way of sorting.

This works:


<span style="color:#323232;">const unsorted = [1, 100000, 21, 30, 4]
</span><span style="color:#323232;">const sorted = unsorted.sort((a, b) => a - b) 
</span>
UndefinedIsNotAFunction ,

Get out of here with your sensibility!

^kidding, ^js ^via ^ts ^is ^my ^life.

jmcs ,

Which is a fine decision if you have a programming language to do silly stuff on a personal geocities page, but a horrible one when you start using that language to handle serious data. Silently ignoring what’s probably a bug is dangerous.

seitanic ,
@seitanic@lemmy.sdf.org avatar

Which is a fine decision if you have a programming language to do silly stuff on a personal geocities page

And that is, of course, what it was designed for.

JS is brilliant considering that it was created by one dude in 10 days. Nobody thought it would become nearly as important as it has become.

AVincentInSpace ,

ah yes, a reasonable solution to that problem that any human would think of

ah yes, a reasonable problem that any human would think of – “what if someone tries to sort a list containing some integers and some arrays, and our interpreter needs to keep chugging instead of telling the programmer they fucked up?”

teamonkey , in Would you agree?

I don’t see anyone outside so it checks out.

MrSlicer ,

They are all learning how to use the terminal.

Agent641 ,

They are inside trying to compile the software thst opens the automatic doors.

CanadaPlus ,

They will die there, because they need a slightly older version of some minor library for compatibility, and nobody cared enough to continue hosting it.

MrSlicer ,

Sudo apt install sliding-doors if that doesn’t work check the snap store, best I can do 🤣

sharkfucker420 ,

Real

ryannathans , in Linux Best Practices
  1. Don’t run any command you don’t understand
upturned8393 ,

That’s why you run this one though because you don’t understand French. After you run this you’ll understand every command afterwards.

ryannathans ,

You’ll certainly understand french after running it

jetsetdorito ,

blindly copy and pastes top stack overflow answer

lord_ryvan ,

Yeah, seriously don’t do that!

state_electrician ,

What about downloading a shell script and piping it directly into a shell?

Rinox ,

Well, I understand it removes the french language, right? /s

UhBell , in web development
@UhBell@lemmy.world avatar
PriorityMotif , in Malware As A Service
@PriorityMotif@lemmy.world avatar

Can’t get hacked if your machine isn’t running.

jaybone ,

You’re hired!

nexussapphire ,

Idk boss, people weren’t too happy the last time we tried that.

ByteJunk , in Implementing RFC 3339 shouldn't really be that hard...
@ByteJunk@lemmy.world avatar

It should be implemented in people’s brains.

How this goes, usually, is:

Them:…before 6PM.

Me: 6PM… Ours? The server’s? The user’s?

Them: GMT, of course.

Me: So that’s 7PM London right now, and changes to 6PM in November?

Them: What no are you stupid. Always 6PM GMT.

Me:* jumps off a cliff*

Klear ,

Reminds me of a LARP I was on one time. A group of people I was doing stuff with ended up always meeting at 10 because we redefined “10” to mean “whenever we all meet”.

jaybone ,

Don’t get it. Is this implying GMT has daylight savings?

Ephera ,

GMT doesn’t have daylight savings, but most people won’t be as precise in language. Here in Germany, we might also tell people “GMT+2”, even though it changes to GMT+1 in winter. Like, I don’t even know what the correct shorthand would be for our timezone…

jaybone ,

CET?

abcd ,

It’s CET/CEST (MEZ/MESZ in German)

en.m.wikipedia.org/wiki/Central_European_Time

ByteJunk ,
@ByteJunk@lemmy.world avatar

I use TZ identifiers, and confirm the expected behaviour (“Berlin time, correct?”), as then I know how I should handle DST changes.

schnurrito ,

That is why lots of time zone selectors allow you to select “Europe/Berlin”: then it is clear that depending on the time of year this is UTC+1 or UTC+2.

firelizzard ,
@firelizzard@programming.dev avatar

GMT doesn’t have daylight savings but London does

mox ,

Them: GMT, of course.

Me: So that’s 7PM London right now, and changes to 6PM in November?

Them: What no are you stupid. Always 6PM GMT.

Me:* jumps off a cliff*

Sorry, but are you under the impression that GMT means London time, or that it observes British Summer Time?

caden ,

I too was similarly confused by the original comment at first, but I think they’re referring to the fact that 6pm GMT is 7pm in London during the summer (BST), and 6pm in London the rest of the year. It seems OP and “them” are both correct in that hypothetical exchange.

my_hat_stinks ,

UK is under BST (UTC+1) for half the year but people are usually just taught that the UK is GMT (UTC+0) which is based in the time in Greenwich, withought mentioning DST. I suppose it’s also possible everyone is taught BST and just forgets about it because daylight savings sucks, but either way most people seem to think GMT and UK time are the same thing.

This means you’ll get people asking for GMT times when they want BST or UK local time.

nyctre ,

Can confirm. Thought UK was always gmt+0, Paris/Amsterdam/whatever GMT+1, etc. (thought it was the clock that changed, not the timezone, if you know what I mean)

ruk_n_rul ,

The term UT is specifically created to divorce universal timekeeping from whatever UK’s timezone is doing, whether DST is on or not, etc. and the derived term UTC for when started adding leap seconds.

GMT hasn’t been a thing since UTC. It should be scrubbed from the vocabulary and old farts still using it should be shunned and reeducated.

golden_calf , in Explaining software development methods by flying to Mars

The art style is nice but the content makes no sense. Kanban and scrum are parts of agile. They are not their own systems.

Lean also doesn’t mean you have no money. It’s a system of manufacturing where you cross train people to do the jobs on either side of them so they can pick up slack if needed and keep things moving without hiring more people.

woodenskewer ,
@woodenskewer@lemmy.world avatar

Lean is also short for putting your inventory in an open top dumpster.

EnderMB , in Old timers know

I remember joining the industry and switching our company over to full Continuous Integration and Deployment. Instead of uploading DLL’s directly to prod via FTP, we could verify each build, deploy to each environment, run some service tests to see if pages were loading, all the way up to prod - with rollback. I showed my manager, and he shrugged. He didn’t see the benefit of this happening when, in his eyes, all he needed to do was drag and drop, and load the page to make sure all is fine.

Unsurprisingly, I found out that this is how he builds websites to this day…

hakunawazo , in What the heck is a god dang cloud?

📎 It seems you want to save your file locally. Too bad…

Irelephant ,
@Irelephant@lemm.ee avatar

I can’t be the only one who liked clippy in the XP days.

Fargeol , in Wait... it's all backdoors ? Always has been bro...

other relevent XKCD: https://xkcd.com/2166/

0x0 , in My C is a little rusty

Ah yes, the rust zealots shitting on one of the most important languages of all time… again.

Kinda weird how the number one way to promote Rust has been to downplay C and others.

agressivelyPassive ,

How exactly do you promote anything without saying “it’s better than the competition” in some way?

What else can you say about a programming language? There’s literally not a single point where a feature is not a comparison to the rest of the languages. There’s exactly one actual barrier: turing completeness. And that bar is so low, even Excel gets over it.

Schmeckinger ,

Also rust interacts through C Abi with most stuff. So C is still important for it.

Lmaydev ,

Okay grandpa, back to bed.

onlinepersona ,

Boomers out past their bed time are hilarious.

Ephera ,

I believe, this post is primarily shitting on C and only mentioning Rust at the side.

poplargrove OP , (edited )

I really didnt put all that thought into it when I posted this (certainly wasn’t looking to evangelize Rust). It was mildly amusing (memory safety came to mind) and I needed a title somewhat related to the meme was really all there was to it.

savvywolf ,
@savvywolf@pawb.social avatar

Honestly, as a Rust Zealot, I’m much more excited about Zig as a C killer than Rust.

porgamrer ,

The specifics of C’s design could barely be less important. In the 70s it was one of countless ALGOL derivatives churned out on-demand to support R&D projects like Unix.

Unix succeeded, but it could have been written in any of these languages. The C design process was governed by the difficulty of compiler implementation; everyone was copying ALGOL 68 but some of the features took too long to implement. If Dennis Ritchie had an extra free weekend in 1972, C might have a module system. But he didn’t, so it doesn’t.

witx ,

That’s because Rust solves lots of issues caused by C, of course they are going to twist that knife and use it as a selling points. Humour is not bad, I’ve done lots of C and C++ and am not bothered a bit by it.

It doesn’t reduce the importance of the language at all, just sheds some light on safer languages, Rust or not.

crispy_kilt ,

Found the Cnile

Turbo ,

Lol if this is a joke on C and senile… Haha well done.

nintendiator ,

Word, Rust shills are the most annoying and shitting of the programming language zealots I’ve seen since the Java Enterprise shilling of the early 200xs. WHat’s worse, their memes aren’t even good, unlike the JS memes.

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