News for hackers. Stuff that matters.

cbrogrammer

TDD helps close to 0 % with fragility and only exists to help development
Re:Anti-Pattern of the Day: Type Keys on Monday January 02, 2023 @10:23AM (#34218845)
> const createUser = (

> attributes: UserAttributes,

> onCreate: (user: User) => void

> ): User => {

> user = User.create(attributes);

> onCreate(user);

This stood out to me, in an otherwise tame article, as probably the most terrible overthought interface possible. A literal callback function passed as a function reference to something that does three lines of code? Good luck with that, I much prefer even a slightly procedual implementation.

Re:Digital Books wear out faster than Physical Books on Wednesday November 16, 2022 @08:28AM (#33622562)
Well that is just objectively false. The man was never "sentenced to 13 federal crimes, 50 years of imprisonment and one million dollars in fines". It is blatantly false.
Re:Digital Books wear out faster than Physical Books on Wednesday November 16, 2022 @02:49AM (#33620194)
Saying anyone is "responsible" for a suicide is disingenuous
Re:Too much efficiency makes everything worse on Friday November 11, 2022 @02:14AM (#33558080)
> Goal: Distribution of labor and resources based upon the needs of society > Proxy: Capitalism > Strong version of Goodhart's law leads to: Massive wealth disparities (with incomes ranging from hundreds of dollars per year to hundreds of dollars per second), with more than a billion people living in poverty

Nothing as annoying as online communists inserting their horrible political opinions everywhere. Try moving to a communist country. See how capitalism has raied billions out of poverty in only 30 years

Re:Sudo: Heap-based overflow with small passwords on Friday November 04, 2022 @09:34AM (#33466408)
We could start by considering not writing stuff like

> /*

> * Truncate to 8 chars if standard DES since not all crypt()'s do this.

> * If this turns out not to be safe we will have to use OS #ifdef's (sigh).

> */

> sav = pass[8];

Re:ValueObject (2016) on Monday August 29, 2022 @06:14AM (#32636454)
there is no copy-on-write in the C language
Re:Win32 Is the Only Stable ABI on Linux? on Tuesday August 16, 2022 @03:26AM (#32480141)
Gnome and making bad choices, name a better combo
Re:C23 is finished: Here is what is on the menu on Friday August 05, 2022 @08:36AM (#32355201)
if C throws away portability it is no longer C
Re:Twenty years of Valgrind on Wednesday July 27, 2022 @09:01AM (#32249893)
That is what many people fail to understand as to why us C programmers dislike C++
Re:How CUDA Programming Works on Tuesday July 05, 2022 @09:38AM (#31988061)
CUDA is absolutely fine just like x86 assembly is absolutely fine. They are well thought out. What I am saying is that from my perspective they are as granular and difficult, and programming directly in them for even small projects is not a good idea. GPU programming is, at the moment, stuck in 1960's way of thinking, as there are multiple people writing CUDA code by hand.
Re:How CUDA Programming Works on Tuesday July 05, 2022 @09:29AM (#31987980)
> is **like** writing x86 assembly by hand

yes absolutely, way too granular and low level

Re:How CUDA Programming Works on Tuesday July 05, 2022 @05:44AM (#31986236)
Writing CUDA by hand is like writing x86 assembly by hand, why would anyone ever do that willingly and not for fun?
Re:Framework Laptop Mainboard on Wednesday April 20, 2022 @02:51AM (#31093615)
will this laptop ever ship with a non-US keyboard layout? The enter key is so bad on them, I hate that it is long and not high. Dealbreaker unfortunately, wish I could buy one of these.
Re:Old C code – how to upgrade it? on Friday April 08, 2022 @12:28PM (#30959184)
What do you mean? A cast to a char pointer is absolutely valid C. For most intents and purposes, a pointer "type" in C is merely the step size, and only void pointers cannot be decremented.

The line of code is basically two lines:

  (char*)hash_ptr.parm.v.p = (char*)hash_ptr.parm.v.p - 1; // move the pointer back by one byte
  *((char*)hash_ptr.parm.v.p) = fpop(sst); //At the memory location, write the output of fpop(sst)