20

Hey guys how do you deal with juniors who code like this?

As a Senior this give me OCD and anxiety.

Comments
  • 8
    If you were a real senior this would open the knife in your pocket and loaded the rifle you (probably) don't have.
  • 3
    @rutee07 We do, is just they code INSIDE OF GITHUB instead of IDE for many times.
  • 3
  • 1
    @rutee07 Yeap. I know... I tried my best to speak to my junior about this.... But it don't work. Probably I realise that I need to work on my leadership skill.
  • 1
    @ostream oh this one. I use this previously , but they code DIRECTLY into GitHub of the MASTER branch , which I am so tired of tracing weird mistakes...
  • 5
    That must be someone who sucks the python and don't want to see brackets
  • 2
    @ScriptCoded Yet, they waste precious time indenting them. Be I Tab-evangelist, I'd kill them on place πŸ˜‚
  • 0
    @rutee07 Good Idea, I am going to do this....and see what happens.

    They are "Dato's"(Dato means someone who have high position in the government, in my country) son. I try to negotiate with them or I consider elsewhere to work.
  • 7
    If you ask your junior to not write directly in GitHub and they don't, it's not your leadership at fault, it's lack of repercussions. We aren't children - listen to your team mates and lead.

    In your case I would say yes automated linter, disable changes without pull requests, block the PRs, disable ability to edit via GitHub if possible. Maybe automate block if limiting fails.

    In my experience making it impossible or too hard to do things the wrong way can be the only solution.
  • 1
    can't you disable that feature in github somehow?
  • 2
    @craig939393 This is eye opening. Keep everything difficult to go wrong.
  • 0
    @coffeeholic yea, but my superior will give them the privilege for editing.
  • 5
    @johnmelodyme ok, your superior is plain wrong if they give write access left and right
  • 4
    Physical violence.
  • 1
    @vintprox Yea... At least I tried to tell them the consequences tho. The pipeline is going to be *ehem ehem* interesting
  • 2
    Introduce a standard and make sure everyone keeps true to it. That's everything that should be needed to prevent this shit tbh...
  • 3
    Are code reviews a thing?
  • 0
  • 1
    @NEMESISprj I strongly agree, but I lack of confidence to let them listen to me. Maybe I am doing something wrong...
  • 2
    Enforce a style formatter, if needed even automate it through git

    Edit: don't allow them to code inside github directly onto the master. Make everything go through a PR
  • 2
    Fire the second one. He is beyond repair.

    First one is still potentially salvageable
  • 4
    @johnmelodyme create a code sanity pipeline which will fail the merge request and make those monkeys obey the rules by force.

    And block committing to master all together.
  • 3
    Integrate the deep scan app into your repo, and have it run every time your junior makes a PR. It’s one thing to call them a retard they expect that, but an even better thing is to have a code quality app tell them they’re a retard.
  • 5
    Ugh I hate the whole "just use a formatter" excuse.

    If you are a programmer, WRITE CLEAN FUCKING CODE. IT'S NOT HARD. It's a sign of your ability to write code in the first place.

    Formatters are a crutch and are only useful in cases where subtle formatting consistencies are needed. If you're writing code like the above, someone has fucking LIED to you about how to write code, or you're trying to innovate in a place where no innovation should happen (you're not being edgy with this sort of formatting).
  • 4
    Fire them hire some poor guy who's been sitting without work for a year or two because dispite being a decent dev, got a raw deal at previous company
  • 0
    @junon I find formatters overrated, but when you're the next dev on a project that last dev allowed to become shit, it's a a saving grace.

    Yes, I've gotten assigned projects with the simple sticky note that says "Good Luck".
  • 5
    Do formatters even work?
    Every time I press "format code" nothing happens😏

    Clean code doesn't write its self, clean code is like art. Be a bloody artist or gtfo!

    As for this abomination, some people like to have their eyes burn, that's their problem, but fuck me dead, brackets only go in 1 of 2 places

    Here {

    }

    Or

    Here
    {

    }

    And that's as far as we need to argue over that, enforcing a code formatter won't teach this dev how or why to write clean code, only to start relying on something else doing it for them.

    Proof: see comments above πŸ˜…

    As for GitHub, lock it down. Protect branches, force pull requests with approvals. also I'm keen to understand how you's test this code since the junior would be doing a hell of a lot of pulls or... not testing a all πŸ€”
  • 1
    .... the actual fuck? If they are that retarted, they should reconsider living - or ar least their career choice. How to deal with them? Well, I don’t know if you have the right people on your speed dial, but I tend to just give the name to Igor and those people are never seen again, by anyone anywhere. Capisce?
  • 2
    Damn these comment limits.

    ---

    Also, style one leads to a billion ternary checks later in life, and we all know how that goes when there's nested operations.

    "But I saved a few lines of code"
    Whoop de fucking doo, you just added 10+ minutes of reading time to work out what the fuck is happening in 6-12 months time, rather then being able to skim across the code.

    x = 1;
    If ( y == z)
    x = 2;

    Tell me how that is going to kill the compiler and take 0.00000001 ms longer to run.

    Style 2, needs to get off their high horse and read the style guide for the given language and start using it.

    Everyone hates php, but even it has a style guide 🀦‍♂️

    Also: does the dev even test this shit???? Or does it just get loaded into a pipeline without local execution?
  • 1
    Also, if you're worrying about performance in a language that doesn't convert trivial if statements to phi nodes and optimizes them accordingly, you simply do not understand performance at all. Sorry.
  • 1
    i've already fired 2 "semi senior's" who code like that. Too bad.
  • 4
    @junon Jesus Christ, YES! Developers are ridiculously immature and unprofessional when it comes to certain things. My wife is a trained chef and one of the things that was drilled into her was work clean, keep your station clean at all times, don't just make a huge mess intending to clean it up at the end. A professional works clean, and I 100% agree and it applies to coding too. If a developer can't adhere to a stated standard, then it calls into question their attention to detail (hint: their actual code is ALWAYS worse) and their professionalism. I mean, look, you want to argue what the style should be? Great, bring it on! As a lead, I'll listen, we can debate, and if the team all agrees, and I'm the lone voice of dissent, guess what? The style changes! But, if you can't follow the standard WITHOUT A TOOL TO CLEAN YOUR SHIT UP AFTERWARD, then you done fucked up. Period, end of story. Tools that help you perform better are great. Tools that cover your mistakes? CRUTCH!
  • 3
    @fzammetti

    > Tools that help you perform better are great. Tools that cover your mistakes? CRUTCH!

    This is the way.
  • 2
    =style 1=
    the language i'm designing enforces precise spaces, tabs and newlines :-P.
    ignores how you write it, converts to the standard-prescribed style

    =style 2=
    1. find a python department in your company
    2. show this to them
    3. they will realize guy secretly wants to be a python coder
    4. pick one of theirs who is ...more versatile, and willing to actually code in the language he's coding in
    5. win-win
  • 1
    The prettier extension works great in VS code. Have the junior type whatever he wants but when he saves the code it automatically formats.

    https://prettier.io/
  • 2
    @DeepHotel I did propose, they refused. They write code Directly into GitHub instead .
  • 2
    @johnmelodyme it’s the effort that counts I guess lol

    Writing code directly onto GitHub seems terrible hahahahahahah
  • 2
    @johnmelodyme That is a HUGGEEEE no-no. No respectible dev writes code directly in Github save for a few exceptional times.
  • 1
    @DeepHotel now finally I refractor and clean the master, locked for PR . My superior seems not like this.
  • 1
    You pointed him at your corporate coding style guide when he started? And again when he produced code like that?
  • 0
    @fizzyade Hahahahahaha

    corporate style guide

    that's funny, what's that?
  • 1
    @fizzyade I did have a coding guideline for them , but they do it anyway like this.
  • 1
    @johnmelodyme either you do have issues in your company or they have serious attitude issues (likely both) if you can’t keep them in check...
  • 1
    @100110111 yea... I notice this too. My proposal for the flow of PR to my employer they still tell me "it's pending" "would you do something productive besides complaining?"
  • 3
    @johnmelodyme that’s just sad... and it’s not even the worst problem. The last thing you want are juniors with such attitude where they refuse to listen to their senior/lead (whatever your position is)... I don’t know about you, but I’d be giving my manager an ultimatum: either we fix this shit or I leave.
  • 0
  • 3
    @johnmelodyme fuck management - I say that as the guy who is used to dealing with shitty git implementations and having been forced to rebase to new branches on 1 repo before because it was a incomprehensible mess.

    Lock down master, no one should have direct access to push to master - 99.99999999999999998% of the time, and even then it's debatable.

    Lock down your dev / staging branch as again, no one should be directly pushing to it. Introduce feature branches - or go full blown and use git-flow.

    Document the way of doing things going forward and then, they'll either get on the right path or reduce productivity so much that they'll change anyway.

    This sounds like a chance to stand your ground and bring some "small" but productive changes into the chaos.

    While your at it, jot down how much time is losed cleaning the repo every week and then use that as a cost / benefit for changing the process as you'll gain $x per week by not fixing the mess - management loves hearing how a change will save them money 😜
  • 2
    @C0D4 oh.... Money works...
  • 1
    @C0D4

    > Lock down master, no one should have direct access to push to master

    I agree in scenarios where you cannot trust 100% of the team to do good work. It's rare that this isn't the case, but there are situations where pushing to master is OK. I've only ever been on one team where I'd feel comfortable doing that again, though.

    In most cases, I agree, especially the case OP has illustrated.
  • 2
    About 20 years ago in my company, there was a guy who used to align the code in the middle of the screen... Literally... I mean, his code was “centered”.

    We still call this “the Christmas tree indentation”...
  • 1
    Format on save ... Probleme solve
  • 1
    @jak645 unless the author already enlightened us about the incomprehensible workflow they have. You cannot force GitHub to format code for monkey workers that refuse to use IDE. But you could say Codespaces to do that, if thay are SO resilient to install editor on the computer. Anyways, their demeanor is punishable and Git hooks alone won't save the sinking ship.
  • 2
    @fuckyouall it's not a matter of trust. No one should be able to push to master without a merge request. And I mean literally no one.

    Pushing directly to master without a peer review is never a good idea.
  • 2
    @vintprox at commit you code pipeline a linter and refuse the commit or the merge ... Now you can code what shit you like you will never touch master with stink code
Add Comment