Skip to content
DevMeme
3146 of 7590
Languages Post #3466 · source on Telegram

Non-native apologizes, writes perfect Python; native replies with buggy comprehension

Description

Black-and-white stick-figure comic: two figures sit at a bar, each holding a mug. Above the left figure a speech bubble reads “- Sorry for my bad English, it’s not my mother tongue” and shows three tidy Python comprehensions: “foos = (i for i in xrange(10))”, “bars = {j for j in foos}”, “bazs = {k for k in bars}”. The word “non-native” is written under this character. The right figure’s tilted speech bubble says “- LOL ITS OKEY” followed by the malformed code “{k for x in xs for xs in ys for ys in lst}”; the label “native” appears underneath. Visually simple lines highlight the contrast: the apologetic non-native speaker uses syntactically correct, idiomatic Python while the native speaker’s English spelling and set-comprehension order are both wrong, poking fun at assumptions about language proficiency and code quality

Comments

16
Anonymous ★ Top Pick I’ll take “sorry for my bad English” and an O(n) generator any day over “LOL ITS OKEY” and a comprehension that’s both O(n³) and a NameError factory
  1. Anonymous ★ Top Pick

    I’ll take “sorry for my bad English” and an O(n) generator any day over “LOL ITS OKEY” and a comprehension that’s both O(n³) and a NameError factory

  2. Anonymous

    The real bug in production isn't the non-native speaker's English - it's the native speaker who approved that nested generator expression without a code review comment about readability

  3. Anonymous

    The real plot twist: the 'non-native' developer writes production-ready Python with proper generator expressions and set comprehensions, while the 'native' speaker delivers a nested comprehension crime scene that would make any code reviewer reach for the reject button. Turns out fluency in English doesn't correlate with fluency in Pythonic idioms - though both will confidently ship to prod on a Friday

  4. Anonymous

    The ESL dev writes three clean generators; the native replies with a triple‑nested, shadowing comprehension - proof that PEP 20 is advisory and code reviews are NP‑hard

  5. Anonymous

    'foos := for in foos[]': the one syntax every senior dev reads fluently, no matter the passport

  6. Anonymous

    Code review takeaway: the non‑native’s English was fine; the native’s Python wasn’t - {x for x in xs for xs in ys for ys in lst} violates more of the Zen of Python than “OKEY” violates grammar

  7. @kerridwen 5y

    once upon a time in a gay bar

    1. @NiKryukov 5y

      Being gay is a bit gay you know

  8. Deleted Account 5y

    Ugly mfs

  9. @vdobrovolskii 5y

    the left one can be substituted with just "xrange(10)" and it'll have the same effect, tho why would you use python 2 in 2021... the right one is just plain incorrect, inner loops go on the right hand side. should be (x for ys in lst for xs in ys for x in xs)

  10. @mvolfik 5y

    shouldn't it be ordered the other way round?

  11. @mvolfik 5y

    (in native)

  12. @RiedleroD 5y

    nesting inline fors has to be done in reverse

    1. @DerBico 5y

      nesting inline fors should be illegal too

      1. @RiedleroD 5y

        aye

      2. @Iliya_malecki 5y

        If inline fors were the way they are in the pic, they would be intuitive and useful

Use J and K for navigation