r/ProgrammerHumor • • Aug 01 '22

>>>print(“Hello, World!”)

Post image
60.8k Upvotes

5.7k comments sorted by

View all comments

7.3k

u/TastesLikeOwlbear Aug 01 '22

$m = ( ( 1 << $b ) - 1 ) << ( 32 - $b );

14.5k

u/a-slice-of-toast Aug 01 '22

tax deductions

2.7k

u/AndrewNonymous Aug 01 '22

In one of the best posts I've ever seen on this sub, this comment was top.

0

u/[deleted] Aug 01 '22

[deleted]

0

u/[deleted] Aug 02 '22

[deleted]

21

u/Grashopha Aug 02 '22

I’m even more confused now…

→ More replies (2)
→ More replies (1)

43

u/Small_Wall_7538 Aug 01 '22

This kind of post is done so often

69

u/CopEatingDonut Aug 01 '22

I like steak now and I like steak later.

→ More replies (12)
→ More replies (6)

53

u/DentalFlossTycooon Aug 01 '22

When you do your taxes in the H&R Block app, this is that source code. It's like the tax deduction Rosetta Stone.

37

u/TheAgreeableGuy Aug 01 '22

the "b" means in Billions?

8

u/I_LIKE_DIRT123 Aug 01 '22

So then I guess it means 1million= ((1smthbillion) -1) smth (32-billion)

(I don’t know anything about programming too… unless you count scratch but that’s way too simplified)

11

u/torb Aug 01 '22

TurboTax hate him.

→ More replies (9)

471

u/666pool Aug 01 '22

Fills in the upper $b bits with 1s and the rest are 0s.

238

u/tehlemmings Aug 01 '22

I was looking at this thinking "this is probably some bit manipulation bullshit"

I'm glad I at least understood that much. But now I get what its doing.

21

u/PrincessRTFM Aug 02 '22

If you see << or >> then it's definitely bitmanip bs

9

u/[deleted] Aug 02 '22

~ & ^ are also pretty sure giveaways

→ More replies (1)

120

u/TastesLikeOwlbear Aug 01 '22

Yes, specifically for 0 <= $b <= 32.

Because, after validation:

$b = (int)explode( '/', $s )[1];

→ More replies (5)
→ More replies (10)

15

u/[deleted] Aug 01 '22

Don't give me imposter syndrome

8

u/TastesLikeOwlbear Aug 01 '22

Sorry! :-(

If it helps, I intentionally changed the very descriptive variable names down to one letter to post this here otherwise it would have been supremely clear what this is for, defeating the OP's purpose.

24

u/[deleted] Aug 01 '22

[removed] — view removed comment

31

u/AceJohnny Aug 01 '22 edited Aug 01 '22

Because of the $: Perl, or PHP? (Shell also has $ to prefix variables but you can't do arithmetic like this without some extra bells)

15

u/elenchusis Aug 01 '22

<< is bit-shift left. Essentially multiplies by a power of 2 without hitting the math processor

8

u/derpbynature Aug 01 '22

without hitting the math processor

Great, this'll run on my 486SX.

→ More replies (1)
→ More replies (9)

12

u/TastesLikeOwlbear Aug 01 '22

PHP. Because I had to write that yesterday, and why should I suffer alone?

→ More replies (7)
→ More replies (2)
→ More replies (40)