lysdexic

joined 1 year ago
MODERATOR OF
[–] lysdexic 1 points 2 months ago* (last edited 2 months ago) (2 children)

Yeah, the quality on Lemmy is nowhere (...)

Go ahead and contribute things that you find interesting instead of wasting your time whining about what others might like.

So far, all you're contributing is whiny shitposting. You can find plenty of that in Reddit too.

[–] lysdexic 2 points 2 months ago* (last edited 2 months ago)

It’s from 2015, so its probably what you are doing anyway

No, you are probably not using this at all. The problem with JSON is that this details are all handled in an implementation-defined way, and most implementation just fail/round silently.

Just give it a try and send down the wire a JSON with, say, a huge integer, and see if that triggers a parsing error. For starters, in .NET both Newtonsoft and System.Text.Json set a limit of 64 bits.

https://learn.microsoft.com/en-us/dotnet/api/system.text.json.jsonserializeroptions.maxdepth

[–] lysdexic 4 points 2 months ago* (last edited 2 months ago)

Why restrict to 54-bit signed integers?

Because number is a double, and IEEE754 specifies the mantissa of double-precision numbers as 53bits+sign.

Meaning, it's the highest integer precision that a double-precision object can express.

I suppose that makes sense for maximum compatibility, but feels gross if we’re already identifying value types.

It's not about compatibility. It's because JSON only has a number type which covers both floating point and integers, and number is implemented as a double-precision value. If you have to express integers with a double-precision type, when you go beyond 53bits you will start to experience loss of precision, which goes completely against the notion of an integer.

[–] lysdexic 1 points 2 months ago* (last edited 2 months ago) (3 children)

The only think that TCP_NODELAY does is disabling packet batching/merging through Naggle's algorithm. Supposedly that increases throughput by reducing the volume of redundant information required to send small data payloads in individual packets, with the tradeoff of higher latency. It's a tradeoff between latency and throughput. I don't see any reason for transfer rates to lower; quite the opposite. In fact the very few benchmarks I saw showed exactly that: TCP_NODELAY causing a drop in the transfer rate.

There are also articles on the cargo cult behind TCP_NODELAY.

But feel free to show your data.

[–] lysdexic 3 points 2 months ago (5 children)

A reminder that TCP_NODELAY should be set by default,

Why do you believe that?

[–] lysdexic 17 points 2 months ago (1 children)
[–] lysdexic 0 points 2 months ago

It’s very hard for “Safe C++” to exist when integer overflow is UB.

You could simply state you did not read the article and decided to comment out of ignorance.

If you spent one minute skimming through the article, you would have stumbled upon the section on undefined behavior. Instead, you opted to post ignorant drivel.

[–] lysdexic 4 points 2 months ago

I wouldn’t call bad readability a loaded gun really.

Bad readability is a problem cause by the developer, not the language. Anyone can crank out unreadable symbol soup in any language, if that's what they want/can deliver.

Blaming the programming language for the programmer's incompetence is very telling, so telling there's even a saying: A bad workman always blames his tools.

[–] lysdexic 8 points 2 months ago* (last edited 2 months ago)

Well, auto looks just like var in that regard.

It really isn't. Neither in C# nor in Java. They are just syntactic sugar to avoid redundant type specifications. I mean things like Foo foo = new Foo();. Who gets confused with that?

Why do you think IDEs are able to tell which type a variable is?

Even C# takes a step further and allows developer to omit the constructor with their target-typed new expressions. No one is whining about dynamic types just because the language let's you instantiate an object with Foo foo = new();.

[–] lysdexic 1 points 2 months ago (1 children)

I think I could have states my opinion better. I think LLMs total value remains to be seen. They allow totally incompetent developers to occasionally pass as below average developers.

This is a baseless assertion from your end, and a purely personal one.

My anecdotal evidence is that the best software engineers I know use these tools extensively to get rid of churn and drudge work, and they apply it anywhere and everywhere they can.

[–] lysdexic 1 points 2 months ago

the first thing I saw is 150 lines of C# reimplementing functions available in the .NET standard lib.

Once again: https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

[–] lysdexic 2 points 2 months ago (3 children)

They existed before LLMs were spitting code like today, and this will undoubtedly lower the bar for bad developers to enter.

If LLMs allow bad programmers to deliver work with good enough quality to pass themselves off as good programmers, this means LLMs are fantastic value for money.

Also worth noting: programmers do learn by analysing the output of LLMs, just as the programmers of old learned by reading someone else's code.

55
Code Smells Catalog (luzkan.github.io)
submitted 2 months ago by lysdexic to c/programming
11
submitted 2 months ago by lysdexic to c/git
13
submitted 2 months ago by lysdexic to c/cpp
29
submitted 2 months ago by lysdexic to c/git
5
Kuth’s Merge Sort in C (www.yodaiken.com)
submitted 2 months ago by lysdexic to c/data_structures
11
submitted 2 months ago by lysdexic to c/ddd
17
submitted 2 months ago by lysdexic to c/webdev
view more: ‹ prev next ›