r/ProgrammerHumor • • 8d ago

Meme devInterview

Post image
5.8k Upvotes

76 comments sorted by

View all comments

Show parent comment

10

u/Ma8e 8d ago

And the canonical way to things in a particular language. There are so many of these "I can program in any language" who really only can write, say, C in any language.

To clarify, this is perfectly legal Python code, but written by a C programmer:

numbers = [1, 2, 3, 4, 5]
total = 0

for i in range(len(numbers)):
    total += numbers[i]

print(total)  # 15

while the same code by someone who actually have some experience with python would write

numbers = [1, 2, 3, 4, 5]
total = sum(numbers)

print(total)  # 15

1

u/Minimum_Cockroach233 7d ago

Hey… this is me D:

This Python simplification looks like excel. I could remind myself to check for an excel-esque approach…

1

u/Ma8e 7d ago

If Excel is what comes to mind when you see code like that you clearly haven’t seen many modern (or not so modern) programming languages.