46

I'm always one of these two

Comments
  • 0
    Hold on. Wtf does 'quotify' mean?
  • 0
    @orhun probably a pattern thing. They always turn out classes and methods that nobody knows how to name then.
  • 5
    @orhun This masterpiece
  • 0
    @gathurian Pretty neat!
  • 1
    how useless is that actually...
  • 0
    Why do you need a separate function for just that?
  • 0
    `stringify(x)` = 12 characters.
    `'"' +x+'"' ` = 9 characters.

    Hell, assuming it's Javascript:
    `"${x}"` = 8 characters.
    ❓🤷‍♂️❓
  • 0
    @kwilliams It's a quick hack missing a todo, the proper impl also doubles every \ and etc
  • 0
    Why not
    return f'"{x}"'
    ? Its even shorter and on average faster and easier to read than +'s imho
  • 0
    Holy shit people, ever heard of code reusability? Damn son.
  • 0
    @stonestorm It was mostly because I couldnt be assed to put triple quotes around random strings all the time.

    @kwilliams PyCharm (and VI as well for that matter) has autocomplete, so it's basically just 'qu<TAB>'
Add Comment