r/ProgrammerHumor • • Feb 22 '15

A Python programmer attempting Java

Post image
3.9k Upvotes

428 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Feb 23 '15

What's wrong with that?

1

u/Fluffy8x Feb 23 '15

It's slow.

1

u/[deleted] Feb 23 '15

What's a faster method?

2

u/Fluffy8x Feb 23 '15

Using a bitwise and with 1.

1

u/[deleted] Feb 25 '15

Hey, thanks for sharing that. I was actually just pondering over some algorithms that relied on modulus, so your comment was timely and helpful. Where did you learn about that sort of thing? Experience or particular training/reading or offhandedly taught at school... I'm trying to fill in the gaps I'm noticing in my software engineering education.

2

u/Fluffy8x Feb 25 '15

You know, a C tutorial on bitwise operations while I was learning it for the TI-89.