43
Z3a1ot
6y

First time ranter here..

So I started to work in this big company with allegedly many talented devs.

All excited to start and learn a whole bunch of new stuff.

There was this dev, with gazillion years of experience.

We were working on a similar parts of the code base and he told me I should be reusing his module.

I opened the module sources to learn about its internals.

Oh boy...

To illustrate it best, Let’s say there was a function called foo.
It was doing one thing. There was also a function called foo1. Doing almost exactly the same thing. There was also fooA.
And I kid you not, there was a fooA1.
All of them were doing almost the same thing.

Almost all of the functions were documented. The documentation for foo would be:
“This does X. I don’t like how it does it, so there is foo1 which is better.”

Additionally, only 1 of the functions was in use...

It doesn’t end here.
There were functions named like:
cdacictad

You ask what it means?
Well it means “clean directory a copy it’s contents to another directory” of course...

Months later he is no longer with us. I deleted this module.

PS
Glad to be here ;)

Comments
  • 9
    Aliases like that are fine for personal tools and utilities. But not for sharing!
  • 5
    @Ashkin yup, that was the main issue imho, he tried to force such a code on all of the developers. Those aliases weren’t even declared privately to that module :/
  • 4
    @Z3a1ot 😭
    I'm so sorry...
  • 3
    @theScientist agreed.
    That's why clear and concise naming is rule #1
  • 4
    @Ashkin I disagree, not even for private stuff naming like this is okay. It will kick you in the butt and you will regret such a naming.
  • 1
    @plusgut I'm actually a fan of cryptic aliases, and use shortened git commands frequently. They don't bother or confuse me, but I do have a very good memory. Usuallly.
  • 0
    @Ashkin wow, this would confuse the shit out of me. Howdo you manage swapping between projects?
  • 3
    @plusgut it's never been a problem for me. I still remember some from 10 years ago.

    Here are some of my debug chat commands on an MMO I worked for:

    slv -- set local var
    ssv -- set serverside var
    ssvo -- set serverside var (other player)
    gai -- get array[index]
    sai -- set array[index]
    ssaio -- set serverside array[index] (other player)

    Shortcut/var examples:
    $mx/y -- mouse.x / .y
    `there -- "#{mouse.x} #{mouse.y}"

    However, I only made this type of command for things I used regularly. Otherwise it's just confusing and ridiculous.
  • 0
    @Ashkin oh wow. But why don't you just write it out without the shorthand?
  • 0
    @plusgut because that's a lot of typing o.o

    set_serverside_array_index("varname", index, "value", findplayer(last_clicked_player).account)

    vs

    `ssaio varname index value $mt
  • 1
    @Ashkin what about autocompletion? :D
  • 2
    @plusgut They were chat commands, entered in-game and run through a parser I wrote.

    Thats another reason, honestly: writing a parser for full-fledged code is much harder than writing a parser for simple commands, strings, interpolation, and some nesting.
  • 0
    @Ashkin what has this to do with nesting?
    but you have a point there with the chat commands :)
  • 3
    @plusgut nesting commands. Using the output of one command as a param for another (or as the command itself). One of the features i added to my [very simple] parser :p

    Keep in mind I was like 15 when I wrote this! So don't judge too harshly
  • 3
    @Ashkin oh sorry, this wasn't meant to be judgemental. I was just curious.
    And writing a parser at 15 is impressive ;)
  • 1
    @plusgut 😊 thanks!
Add Comment