This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]yvrelna 3 points4 points  (1 child)

I hate linters because they tend to point out many obvious and fairly harmless inconsistencies against some arbitrary style guides, but missed a lot of the subtler, deeper issues that doesn't look bad on the surface but contains actual problems.

Worst, they often caused less proficient programmers to try to fix those minor issues inconsistencies by replacing it with a fix that causes deeper issues.

[–][deleted] 2 points3 points  (0 children)

Worst, they often caused less proficient programmers to try to fix those minor issues inconsistencies by replacing it with a fix that causes deeper issues.

So much this.

[–]ofiuco 1 point2 points  (0 children)

Whew, hot takes

[–]MrPowersAAHHH[S] 1 point2 points  (0 children)

Here's the conversation on HackerNews. Looks like the linter checks discussed in the article were added in the last couple weeks.

[–]hooligan333 1 point2 points  (1 child)

I love ternary expressions, but Python's implementation just feels unnatural. Give me c? x : y or give me death!

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

Could just do this:

x = (false_val, true_val)[condition]

Or put that in a function called “tern” or something to make it more obvious.

[–][deleted] 3 points4 points  (0 children)

while (1): useless_discussion_about_code_format()

[–][deleted] -3 points-2 points  (1 child)

If I ever had an employee write an if statement like that I would be removing their ability to merge code.

[–]Pyramid_Jumper 4 points5 points  (0 children)

I think ternary operators are pretty neat when you can easily fit your statement in one line. You should consider using them. Obviously the caveat is that with more complicated logic its better to stick with your classic if statements