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.

genfood OP , in Chewing gum as a promotional gift for a RTOS

Although the best-before date had already passed, the chewing gum was still good.

https://feddit.de/pictrs/image/a2b802de-757c-499c-8ddd-4a0024457cb7.jpeg

MNByChoice , in Chewing gum as a promotional gift for a RTOS

Package nicely mirrors this image from the pikeos site. sysgo.com/…/csm_SYSGO_graphic_pikeos_rtos_hypervi…

genfood OP ,

There is one / to much, well it isn’t but the URL formatting isn’t working for me. 🥲

MNByChoice ,

Interesting. URL is as copied from my browser. In any case, here is the website, and it might work better.

www.sysgo.com/pikeos

genfood OP ,

Ok may bad, it’s the client I am using, it works on other Apps.

scorpionix ,
@scorpionix@feddit.de avatar

Jerboa? The link is malformed for me as well

colorado ,

Voyager on Android as well

GeniusIsme , in What could go wrong trying to solve AoC in Rust?

Show the alternative, I’ll have a good laugh.

janAkali , (edited )

It’s Nim, but I have no idea why you can’t do this in Rust:


<span style="color:#323232;">var seeds = lines[0].split(": ")[1].splitWhitespace().mapIt(it.parseInt)
</span>

Full solution: codeberg.org/Archargelod/…/solution.nim

GeniusIsme ,

Ahh, it is the same thing. Rust example surely has some cruft, but mostly for the better. I’m sure not all of it is needed.

exocrinous , in Whitespace

Int *p is unreadable, unreasonable, and bad programming.

Ferk ,
@Ferk@kbin.social avatar

But C syntax clearly hints to int *p being the expected format.

Otherwise you would only need to do int* p, q to declare two pointers... however doing that only declares p as pointer. You are actually required to type * in front of each variable name intended to hold a pointer in the declaration: int *p, *q;

exocrinous ,

That’s because C was designed by a fool.

Aatube ,
@Aatube@kbin.social avatar

The fools who created Unix

Tja ,

And C!

CanadaPlus ,

What, could you have done better in 70-whatever?

Aatube ,
@Aatube@kbin.social avatar

Why so? It’s what it actually is

dbilitated , in Whitespace
@dbilitated@aussie.zone avatar

I’m just a c# dev wishing to fuck we had something visual to indicate reference types so my coworkers could stop misusing them

jjagaimo ,
dbilitated ,
@dbilitated@aussie.zone avatar

oh thank you! I use jetbrains but I wonder if I can implement the same thing

vithigar ,

It’s such a short list of value types though. How can they have that much trouble? All of the various ints and floats, bool, char, structs, and enums. Everything else is reference.

GissaMittJobb , in Whitespace

Having an asterisk both be the type indicator and the dereference operator is one of the great programming language design blunders of our time, along with allowing nulls for any type in so many languages.

darkpanda ,

I also sometimes wish that the syntax in if statements was inverted, where () was optional and {} was required.

victorz ,

Based

CodexArcanum ,

Rust makes this choice and it is way better.

clay_pidgin , (edited )

Can you give me an example? I’m not sure I follow. Might be language specific?

noli ,

if(condition) statement; Is valid in typical C-style syntax.

if condition { … }

Is invalid in typical C-style syntax

clay_pidgin ,

Gotcha, thanks.

darkpanda , (edited )

The code in the image is C or C++ or similar. In those languages and languages derived from them, curly braces are optional but the parentheses are required. It should be the other way around to avoid logic errors like this:


<span style="color:#323232;">if (some expression)
</span><span style="color:#323232;">  doSomething()
</span><span style="color:#323232;">else if (some other expression)
</span><span style="color:#323232;">  printf(“some debugging code that’s only here temporarily”);
</span><span style="color:#323232;">  doSomethingElse();
</span>

Based on the indentation you’d think that doSomethingElse was only meant to run if the else if condition was true, but because of the lack of braces and the printf it actually happens regardless of either of the if conditions. This can sometimes lead to logic errors and it doesn’t hold up to a principle of durability under edit — that is, inserting some code into the if statement changes the outcome entirely because it changes the code path entirely, so the code is in a sense fragile to edits. If the curly braces were required instead of optional, this wouldn’t happen.

I have all of my linters set up to flag a lack of curly braces in these languages as an error because of this. It’s a topic that sometimes causes some debate, ‘cause some people will vociferously defend their right to not have the braces there for one liners and more compact code, but I have found that in general having them be required consistently has led to fewer issues than having arguments about their absence, but to each their own. I know many big projects that have the opposite stance or have other guidelines, but I just make ‘em required on my own projects or projects that I’m in charge of and be done with it.

clay_pidgin ,

That makes perfect sense, thank you.

Blackmist ,

Having assignments return a value is right up there as well.

GissaMittJobb ,

Because of the possibility of accidentally performing an assignment in a conditional expression?

If yes, I agree that it’s not great.

Blackmist ,

Yeah, exactly that.

fl42v , in Whitespace

std::shared_ptr<int> p;

RandomCookie420 , in Whitespace
@RandomCookie420@eviltoast.org avatar

Ever written a entire php in one line? I did, and that without separation whenever possible.

Man my coworker even ended the trolling contest over that.

catconnoisseur , in Whitespace

no int * ptr fans here?

db2 , in Whitespace

There is an other.

int * p;

kambusha ,
otter ,

:)

far_university1990 ,

i am in this picture and i do like it

Deceptichum ,
@Deceptichum@kbin.social avatar

Male otters kidnap children otters and hold them for ransom until the mum gives them food.

thomasloven ,

I’ve seen that in style guides ”because it should piss of everyone equally”.

TORFdot0 , in What I want to become Vs What I do

You mean I copy 2 line python scripts from StackOverflow

KuroeNekoDemon , in I like seeing the numbers go up

This is the best part when you finish setting up your server. I was so happy when I can access my backup files and my media server I want to setup Home Assistant one day for a local, private smart home

danc4498 , in I like seeing the numbers go up

How else will you know it’s working while you’re away?

drcabbage , in What I want to become Vs What I do

Hey, that’s not fair! Sometimes I write 3 lines.

dmalteseknight ,
@dmalteseknight@programming.dev avatar

Comments don’t count

xyguy , in Scott reviews the perfect browser extension

Wow this music player app is simple and does everything it should.

Random Commenter: why won’t it play video?

MBA: Why isn’t this a subscription service?

UsernameIsTooLon ,

Parents: why don’t you get a real job?

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