52
rutee07
16d

How one of the developers code in Python. The picture is not clear but this is a photo I took after copying the code to Sublime. Dots are spaces, long dashes are tabs.

The indentation looks so fucked but it works anyway. You don't know which block belongs to which block. This is what I have to deal with on a daily basis. This is what the fucking codebase looks like. It is so time-consuming decoding this that my other colleague raised it already. Not sure what happened but I guess with all the deadlines, that developer has no time to fix hundreds of scripts.

Python is supposed to be easy but some people find a way to complicate this shit. I worked with Java before and while whitespace doesn't mean as much there, people write code that is so fucking ugly, they might as well write it in cursive with their goddamn feet. It would be amazing if I get fired and this bitch stays because she wrote all this shit that no one else can understand. You look like a real damn professional. Congratulations on being indispensable. I don't care anymore.

I'm drinking acid for dinner.
Fuck my life. Fuck it hard.

Comments
  • 13
    What the fuck. Just what the actual fuck
  • 8
    are some kind of linters helping in some way?

    But yes, some people don't have taste
  • 7
    @deviloper No. I think it's a suicide vs murder kind of situation. The amazing thing is sometimes when you add a line somewhere, it wouldn't work unless you follow her "standards" of chaos.
  • 3
    @infernalempress I'm sorry you had to see this. Now I'm not the only one asking these questions.. 😢
  • 9
    scriptContent.replaceAll(" ", "\t"); // 4 spaces
  • 4
    People, if you can suggest a solution to this, I would be so grateful that I'd give you 50% off on my hitman services. I think I tried everything but some of you have more experience with bullshittery. 😭😭😭
  • 2
    @leduyquang753 Doesn't work. I tried converting them all to spaces or all to tabs.
  • 9
    What version of Python do you use? Mixing tabs and spaces is an error in Python 3 and won't compile. Very surprised to see something like this.
  • 3
    VS Code has built-in buttons that you just need to press to uniform all the document to use tabs or spaces, or convert one to other
  • 4
    @VaderNT They still use Python 2.7. 😢

    @crisz Sublime has it too. Tried it already.
  • 5
    maybe autopep can do the trick ? PEP8 specifies that all indentation in python should be 4 spaces, and some lines (such as pylint) will even nag you about it until you fix this.
    Maybe I should check my colleagues codebase for such atrocities, he does seem like the type to do that
  • 1
    @CptFox Will that work using some tool for already existing script files? I will check it out.
  • 2
    Sometimes she would have lines that are a combination of tabs and spaces and the spaces aren't four. They can be six or three or whatever. I don't know what kind of witchcraft she does to make it work.

    If it matters, she's using vi. I use it as well except I never ever ever use tabs.
  • 2
    What the fick??? How can that work at all?
  • 4
    @irene That's what me and my other colleague is so puzzled about. The least painful of all are ultra tabs like:

    if condition:
    <tab><tab><tab>code

    I feel like she's coding somewhere else and copy/pasting it incorrectly or some shit I don't know. Because last time, in my previous rant, I saw a line of code that doesn't work at all but it's checked in on Github.
  • 3
    @rutee07 seems like you don't like CPython 2.7
  • 3
    @-ANGRY-CLIENT- I remember her checking in .pyc files and we all got fucked for it. We keep making code changes but nothing works because of those shit.

    She also checks-in code git adding everything in the directory without a care what's being included.

    I'm starting to believe we are using a cursed version of the language.
  • 6
    Looks like copy/pasta gone wild.
    People don't tend to use multiple styles that close together
  • 4
    I realized the screenshot is not as helpful if you can only see the whitespaces. I will try to replace some details and retain the format tomorrow to give you all more idea and maybe someone can help.

    But thanks for all the sympathy and suggestions. I appreciate it. Maybe I'll drink bleach instead of acid.
  • 2
    @rutee07 lmao bleach instead, I guess that's progress....
  • 3
    @ihatecomputers Actually, it got better and I decided to settle for shampoo.
  • 6
    This is its own special hell, but: traditionally, at least on Unix-alikes, a tab character, when interpreted as spaces or indentation, corresponds to eight spaces.

    It's worth a shot to e.g. in vim:

    :set tabstop=8

    :set expandtab

    :retab

    And then maybe set up a git pre-commit hook that searches for tabs in initial whitespace, refuses to commit if it finds any, and then replaces the contents of their .vimrc with a single line ':set expandtab'.
  • 3
    @halfflat Thanks a lot, man. I will try that myself and then suggest it to them. 🐕
  • 3
    @rutee07 "suicide vs murder kind of situation" ahahah :-D I've been there
  • 2
    PS I had some problems in the past with project from Windows, MacOs, Linux committing to git.
    If they are not configured right sometimes people see different formatting when pulling.
    Also differente IDE and different settings can produce a mess...
  • 2
    @deviloper Dude, that's like a checklist of every possible place where it could go wrong. Some developers use Mac, others Windows. We are also allowed to use whatever editor we want. I just recently decided to settle for vim but we have Sublime users too.

    So I guess I have the same problem as you had in your previous project. 😁
  • 6
    That's one big disadvantage of python2:

    https://docs.python.org/2.0/ref/...

    "Leading whitespace (spaces and tabs) at the beginning of a logical line is used to compute the indentation level of the line, which in turn is used to determine the grouping of statements.

    First, tabs are replaced (from left to right) by one to eight spaces such that the total number of characters up to and including the replacement is a multiple of eight (this is intended to be the same rule as used by Unix). The total number of spaces preceding the first non-blank character then determines the line's indentation. Indentation cannot be split over multiple physical lines using backslashes; the whitespace up to the first backslash determines the indentation."

    As python uses the indentation as syntactic element, it's hard to fix that and keep all indentation levels. And it's even harder to prove that the output is identical.
    I never understood how someone can come up with such a stupid idea.
  • 2
    @ddephor I agree. It's like a maze for no reason. Anyway, thanks for the information, man. It makes more sense now I know I'm not just turning crazy.
  • 2
    You could use Linux' expand and unexpand.

    They can:
    - convert tabs to spaces
    - spaces to tabs
  • 2
    @ddephor I think it's a fault with editors, more than Python. Python is following a particular well-established convention (even if it looks weird from outside.)

    Editors though should never display an actual tab character as e.g. four spaces: this is a lie that will fuck everyone up. If it's a 'dumb' editor, then a user shouldn't be using a tab to mean anything other than 'insert a tab'.

    Code editors should make it hard to screw this up. They should either have 'tab' mean insert a tab, and make it clear that this _is_ a tab; or 'tab' should just be interpreted as 'indent this line by so many spaces'. I really believe the latter should be the default.

    But inserting a tab but making it look like some arbitrary number of spaces — this is just evil.
  • 2
    May the Python 🐍 swallow that person.
  • 1
    I know that pain, though I'm dealing with a hybrid mobile app.
  • 3
    @terminal434 I.. still have some bleach left. Let's toast? 🍻
  • 2
  • 1
    That looks like everyone's Mum formatting her Word document
  • 2
    Definitely a murder scenario. 😖
  • 1
    I thought Python would throw a parse error on mixed indents?
  • 2
    @ojrask Unfortunately only on Python 3.
  • 1
    @sbiewald I see, thanks for clarifying!
  • 3
    @possum looks like 15yo me trying to center non-monospace text in html.
  • 1
    @halfflat it's definitely a python flaw. As python doesn't have a block end and uses indentation level to define block end, there are several cases where mixing indentation will leave you in a state where no technical tool can help you take it back to the right state.
    This is the reason, no editor or linter can do the job right. The user always has to take care of the right indentation.
    That's what's most annoying for me using python.
  • 1
    @ddephor That's why it's fixed in Python 3. Oh, and linters can do it right, Pycharm can fix it. Also the Python 2 docs say a tab equals 8 spaces which means at least this particular issue here could be fixed.
  • 1
    i'm calling bullshit

    python will fucking die if you mix tabs and spaces like this

    edit: i've just noticed that it's Py2.

    Use IDLE's untabify feature.
  • 1
    @rutee07 shit, did you try decoding that hugging mess? Maybe somebody is trying to send out a distress message in morse code?
  • 1
    @theKarlisK Sadly, I did and I will have to again in the future. Simply changing the tabs to spaces doesn't work since it just converts a tab to four spaces but in her code, that's not always the case. 😢

    I clean it up when I touch it though because I want to be the nice guy who gets all (no) booties.
  • 1
    I'm feeling chest pain after seeing this
  • 1
    @gitlog Puberty. Your tits are starting to grow. I remember you said your vagina was leaking so those events could be related.

    Stay strong and show bob pics. 😳
  • 1
    Does she write code in MS word or something?
  • 1
    @rutee07 lol those tits will look strange on my hairy chest
  • 1
    @gitlog You'll have hairy nipples, you can braid them, hottie.
  • 0
    @rutee07 ok this is going too far

    I propose to stop it
  • 0
    You know you can convert tabs to spaces and vice versa?🤔
  • 1
    @c3ypt1c Yes, doesn't work in this case because they aren't always equal, some would have 6 spaces which doesn't make sense since 1 tab = 4 spaces. Also there are double indentations probably due to the editor she was using. Two tabs when it should be just one so simply converting to spaces doesn't work.
  • 1
    Hmmmm. Fuck. But still you're saying that she uses double tab instead of 6 spaces? That's still kinda doable.
  • 3
    @c3ypt1c I don't think she's doing it intentionally, otherwise Python would raise an error. It's just whatever editor she's using is messing up the formatting and her using a combination of tabs and spaces just made it worse. 😦

    Anyway, she is on leave now and I'm working someone else's code that's a lot prettier. 😂
  • 1
    @rutee07 surely there must be some method to this chaos. Idk.
Your Job Suck?
Get a Better Job
Add Comment