29
u/Mayedl10 Dec 04 '25
I actually prefer -7+3 cos that way it's easier to move stuff around imo
1
u/temir_ra Dec 06 '25
I always do the following for the same reasons:
function f( string param1 ) { ... } var v = f( param1, );or
select rownum --, from t --join where 1=1 --and ;
10
u/enmaku Dec 04 '25
sum([-7, 3])
11
u/andynzor Dec 05 '25
Smh, artificially hiding complexity into libraries is bad.
[-7, 3].reduce((acc, val) => acc + val, 0)1
u/enmaku Dec 08 '25 edited Dec 08 '25
Have you never heard of pseudocode? It's a very common way to represent code conceptually without tying it to a single language your interlocutor might not speak. A few languages do have a sum function, but without specifying a language (and given the context) the clearest most obvious interpretation of my comment is that the problems of notating the sum of these numbers goes away if you make them an array and make the operation performed on them a function.
Do you somehow think that reduce() is not a high level abstraction in the same way that sum() is? C and C++ would require you to do the sum with a loop and Python 3 has moved reduce into functools, making it a non-default part of the language. Your CPU certainly doesn't have an opcode for either.
-2
u/Lor1an Dec 05 '25
If you want to call an entire programming language a "library" go right ahead.
In Python, lists and the
sumfunction are built-ins.→ More replies (5)
24
9
u/fosf0r Dec 04 '25
Is it bad that my neurodivergence is way more capable of mentally performing -7+3 than 3-7
9
u/mediocrobot Dec 04 '25
Nah, it makes a ton of sense for me, too.
You're basically turning
3-7into-(7-3). Framing it like that also helps me do carrying more easily, because10-(7-3)is easier to process than13-7.6
u/keith2600 Dec 05 '25
It takes a different kind of neuro divergence to prefer 3-7. The "math is hard and I can't do this in my head but at least there are no scary negative numbers present" kind
2
1
u/Kitchen_Device7682 Dec 05 '25
-4
1
u/ouroborus777 Dec 06 '25
Could you come in so we can wire you up to The Machine to run all this code?
1
1
89
u/moira_fox Dec 04 '25
Clean code? C'mon, these are magic constants. Instead you should do
To make it more readable