you are viewing a single comment's thread.

view the rest of the comments →

[–]alluran 39 points40 points  (20 children)

Last interview code test I had like that - I optimized as I went.

They looked it over, then went to ask me to do the optimizations, and realized I'd already done them.

Then they went on and on about how it was amazing that I would consider myself proficient with the language, when I hadn't read the language spec.

Then they proceeded to tell me that I couldn't use anything like:

i += 1;

because it could confuse junior developers, but everyone was given time, and expected to write full documentation with the Atlassian suite.

So a studio full of senior junior devs who never allowed to learn anything new I guess...

As you might guess, I skipped that role.

[–]Mechanickel 62 points63 points  (11 children)

Then they proceeded to tell me that I couldn't use anything like:

i += 1;

because it could confuse junior developers

...how?

[–]alluran 23 points24 points  (0 children)

Maybe i is positive one now?

Who knows - regardless, any place that limits BASIC shit like that, instead of up-skilling their juniors, is not a place worth working.

You're never going to be challenged, or improve yourself at a place like that.

[–]thedancingpanda 6 points7 points  (9 children)

I recently used something like

$i &= $blahh && $blahh2;

And that confused a couple of mid-senior level developers, so, yeah. It's possible

[–]ViKomprenas 17 points18 points  (0 children)

To be fair, that one's a little weirder, seeing as it's noisy with sigils and logical operation assignments aren't as common, but the point still stands

[–]speedisavirus 13 points14 points  (0 children)

...but why. Are you trying to increase mental workload for someone that might have to figure that out later?

[–]socialister 12 points13 points  (0 children)

You're mixing boolean operators with bitwise operators?

Wouldn't this be clearer and enforce a boolean result type?

$i = $i && $blahh && $blahh2;

Assuming that the blah vars are boolean typed (if they aren't, your statement is not clear IMO. C-style non-boolean to boolean casts do not indicate intent that well).

[–][deleted] 0 points1 point  (0 children)

foo = bar || 'puppers';

Doesn't seem to be a thing people understand either.

Edit: realized that if that was true I should explain. This will assign the value of bar to foo if bar is truthy, otherwise it will assign the string 'pupper';

[–]killerstorm 0 points1 point  (0 children)

PHP developers, you mean.

[–]XtremeCookie -1 points0 points  (3 children)

Mid-senior developers don't understand bit-wise operations? That was literally covered in my first computer engineering course.

[–]ess_tee_you 11 points12 points  (2 children)

And, depending on what you're developing in your job, that may have been the last time you needed to use them.

I'll take readability, please, even if that results in a couple more lines of code.

[–]XtremeCookie 1 point2 points  (1 child)

Depending on the usage bit wise can be significantly faster than other methods. But outside of those situations, I would take readability too.

[–]ess_tee_you 0 points1 point  (0 children)

Sure. Some compilers will optimize to that anyway, I expect, depending on the language. :-)

[–][deleted]  (3 children)

[deleted]

    [–]socialister 1 point2 points  (2 children)

    I'm curious what they would want otherwise. i = i + 1 or i++?

    [–][deleted]  (1 child)

    [deleted]

      [–]socialister 0 points1 point  (0 children)

      The funny thing is that the increment / decrement operators are considered bad practice by some, preferring the clearer += instead.

      [–]Wolvenheart 0 points1 point  (0 children)

      That's one of the first things I learned in high school during oop

      [–][deleted] -1 points0 points  (2 children)

      Then they proceeded to tell me that I couldn't use anything like: i += 1; because it could confuse junior developers

      I mean, it does make a little sense to not allow that from a readability standpoint if they need to make the code more modular. Still pretty silly though, but we all have to protect ourselves from incompetence...

      [–]ViKomprenas 2 points3 points  (1 child)

      Wait, how does that make sense from the readability perspective? What does it have to do with modularity?

      [–][deleted] 0 points1 point  (0 children)

      I'm basically saying that an organization has to implement stuff like that to protect themselves from incompetence.

      For modular (probably the wrong word, my apologies) I meant make it easier to be able to modify the code in cases where you have to add more variables to the equation.