Comments (6)
Its part of several checks each of which begin with this. It's a code-style-preference thing. I prefer it to be this way, redundant or not.
from libsuperuser.
I don't understand.
Why would you check if something is null, if you know for a fact that it must be null?
from libsuperuser.
Because in cases like these the blocks below that check and set this variable tend to get switched around and cases added over time. Keeping the check there will prevent the logical failure that will occur when the blocks are copy/pasted to change order. There's no technical reason for this, I just prefer it this way as it prevents a possible future logic failure and is clearer to read (imho). Feel free to disagree, I feel free to not care. The compiler/optimizer will take it out anyway if it is redundant.
from libsuperuser.
So you keep a check because you might move the block of code to somewhere else?
But you've already set it to be in a safe place...
For making it safer to move around, you could just put it in a function. It's one of the purposes of functions...
Another alternative is to just comment this code.
In the current situation, it just adds more code to read, so I don't get why it's more readable.
For me, removal of redundant code, as well as commented code (especially old one) makes the code more readable. The less to read, the less time it takes to read.
Plus here you made me wonder why it exists this way, so I thought maybe it's a possible bug in the code that should be taken care of...
Anyway, I will just turn off this warning for this library.
Thanks for helping out.
from libsuperuser.
Stop trying to debate preference. This is exactly why I dislike open source. I have better things to do than discussing this - it's certainly not like we're ever going to agree on it, and worse, it really doesn't matter.
from libsuperuser.
OK OK.
I've already wrote : I will just turn off this warning for this project.
from libsuperuser.
Related Issues (20)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsuperuser.