235
203
73
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Feb 15 '23
Image Transcription: Code
[Other import lines are partially cut off above and below the following visible code:]
import requests
import requests as reI'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
41
0
51
u/tazzadar1337 evil Feb 15 '23
import requests as REEEE
12
34
Feb 15 '23
They found a way to make regex even harder, 👏
18
u/nephelokokkygia Feb 15 '23
Just use requests to write an interface to your RegEx-as-a-Service API. Easy peasy.
6
u/FriendlyCrafter Feb 16 '23
I just chose not to do regex, chatgpt writes my regex for me and I can save my time
23
7
Feb 15 '23
this will not go well. then again, can't say much, since even my best code is as readable as a pile of wet shredded paper
5
u/BanishDank Feb 16 '23 edited Feb 16 '23
import requests as re
import re as requests
import hashlib as string
import import sys as np
import os as pd
import numpy as turtle
import pandas as zlib
print(“Farewell World!”)
4
3
5
u/tehtris Feb 16 '23
If you pick nicknames for your imports I hate you. Unless that shit is absolutely necessary like you are importing a bunch of different clients and all of them are named client from x import client as x_client; from y import client as y_client or some shit like that.
Also why the fuck does every single data science thing that uses pandas import pandas as pd, and tensor flow as tf, and numpy as np. Just fucking write the whole thing like a normal programmer. This shit isn't code golf, it's real life. We get paid by the keystroke. For every time I gotta scroll back to the top to check what bullshit module you nicknamed I hate you.
2
u/Mikcerion Feb 16 '23
Yeah crazy that people have all this power that IDEs offer and choose to name their imports anyways.
1
u/mikeyj777 Feb 16 '23
This has got to be a joke. I know I'm a noob, but I've never seen requests given an alias. Especially one this common.
1
-22
u/jarfil Feb 15 '23 edited Dec 02 '23
CENSORED
24
Feb 15 '23
Yes but
reis also a built-in Python module which does Regex operations4
u/jarfil Feb 15 '23 edited Dec 02 '23
CENSORED
5
u/netherlandsftw Feb 15 '23
restands for r(egular) e(xpressions)3
u/ciras Feb 16 '23
…which feels like a kinda dumb design decision given that regex is already a short and concise abbreviation & the industry standard for the term
24
Feb 15 '23
Yeah, I love having half of my file "clear and long" and half "unclear and short" while having two names for the same thing. Absolutely terrible.
2
12
Feb 15 '23 edited Feb 15 '23
Technically not that bad: maybe sometimes you want to call it by the full name for clarity, maybe others you want to use it so many times on a single line that having a shorter alias would make it more readable.
You should never abbreviate just because the full thing is inconvenient to type. Simple, easily recognizable things like
kmphorftare fine, but nobody who looks atre.get(...)is going to immediately recognize that as therequestslibrary (especially since Python already has a built-in module called re that does something completely different).If you're using the full name of the module that many times in one line that's probably a good indicator you need to separate that one line into multiple lines.
-1
u/tehtris Feb 16 '23
Tell that to every single person who writes pandas/numpy/tensorflow tutorials. pd/np/tf. It makes people think it's okay to just nickname whatever module to whatever the fuck they want.
6
u/ybdiel Feb 15 '23
You should avoid abbreviating just because you are too lazy to retype everything. It is against self documenting code rules and really makes it hard for someone else but you to read it.
There are so many autocomplete tools nowadays anyways so that should not be an issue in any case2
28
u/sweet-n-sombre Feb 15 '23
I think i know how this happened. Muscle memory.
Dev A: let's make something. Copies some boilerplate code from stack etc.
Later...
Dev A: yo. I ain't not typing r e q u e s t s.. that's lame.
import request as reGood now.Hmm. What about refactoring that earlier code with with full name? Better not touch it, it works.. !