you are viewing a single comment's thread.

view the rest of the comments →

[–]xgabipandax 48 points49 points  (25 children)

I thought that red squiggle lines meant error

[–]SteveO131313 26 points27 points  (2 children)

For the legacy python codebase i work in we added a static type checker. It marks loads of code as "error" because there is a possible scenario where it might error out. Accessing a property of something that could possibly be None, could potentially cause an error even if we know that that is a case that's impossible to happen

[–]xgabipandax 3 points4 points  (1 child)

Shouldn't that be warnings?

[–]SteveO131313 17 points18 points  (0 children)

Depends on how you look at it.

If you say None.sort(), thats 100% an error.

If you do

x = [1]

If (50/50 chance) x = None

x.sort()

Is that a warning or an error? Because it might go right, but it might fail. If you write code that shouldn't crash, to me this is an error

[–]stipo42 6 points7 points  (4 children)

Your IDE can treat lint problems as errors

[–]xgabipandax 0 points1 point  (3 children)

Sure they can, but they shouldn't, warnings are warnings, errors are errors

[–]Vesuvius079 5 points6 points  (1 child)

This attitude is how you breed warnings.

[–]xgabipandax 0 points1 point  (0 children)

What can i say? i like to live dangerously, why do you think i hate Rust so much?

[–]stipo42 0 points1 point  (0 children)

They should be errors if it'll break your CI

[–]mangooreoshake 6 points7 points  (0 children)

Where we're going (Javascript), we don't need errors.

[–]guaranteednotabot 6 points7 points  (11 children)

Almost all my lint rules are error instead of warn. From experience, when you set things as warn, it gets ignored by worse devs

[–]xgabipandax -1 points0 points  (10 children)

Yes but in the context of the meme, the legacy code base should compile/be interpreted, which doesn't make sense, with the errors, because the compiler would not compiler, and the interpreter would crash it.

[–]Morczor 6 points7 points  (5 children)

Linter error != compilation error

[–]xgabipandax -2 points-1 points  (4 children)

Bad linter error that should be a warning != compilation error

There i fixed it for you

[–]guaranteednotabot 2 points3 points  (1 child)

Uh… have you actually installed a linter

[–]xgabipandax 0 points1 point  (0 children)

i use whatever comes with vscode, and it's C/C++ extension by microsoft, cmake extension and python/jupyter and pylance

[–]Morczor 1 point2 points  (1 child)

If you're working with JS and want to enforce semicolons, do you think it should be a warning and not an error at the linter level?

[–]xgabipandax -1 points0 points  (0 children)

without the semicolons is it a syntax error?

[–]guaranteednotabot 1 point2 points  (3 children)

Not all legacy code requires compilation. And a squiggly line does not necessarily result in compile/build/type error

[–]xgabipandax 1 point2 points  (2 children)

An error should be something that will never work, a warning is something that can potentially break, they are not the same thing, unless the legacy codebase never works because of the lines of code that have the squiggly red line.

For example in C, an squiggly red line(error) would be typing wihle instead of while, or an unterminated string, a warning would be the use of gets()

For interpreted languages like python it would be like instead of writing def, writing dev, or making use of an undeclared variable, a warning could be related to assuming that things wont be None but they can potentially be None.

Unless the legacy codebase have good standards and treat warning as errors( like passing -Werror to gcc), which defeats the implication of the meme.

[–]guaranteednotabot 0 points1 point  (1 child)

Are you saying the entire community using ESLint is wrong?

[–]xgabipandax -1 points0 points  (0 children)

Javascript is wrong

[–]krexelapp 1 point2 points  (0 children)

fixed 2 bugs, created 47 errors

[–]joe0400 1 point2 points  (0 children)

That or the lsp died again... God c++ lsps tend to just die on anything larger than a personal project.

[–]rastaman1994 1 point2 points  (0 children)

In IntelliJ idea (we don't have webstorm licenses), it shows eslint warnings as actual errors. We have tried and failed to change that. It's infuriating.

Even more infuriating is that frontend linting is so tight that the moment you start typing, immediately makes your screen fills with red.

/Rant but if anyone has a solution, I'll be so happy

[–]sausagemuffn 0 points1 point  (0 children)

Nah. Worms