-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
You don't need break in default statement #311
Comments
lmao, shitty code.. what do you expect from npm |
troll? |
You also don't need line breaks or most whitespace in code, but people do it for readability and style. |
I'm sorry, but your argument doesn't fit in this case. Break is not necessary and it is not good practice, default is the last statement and you do not need to do any break as there will NEVER be a next statement, so more than helping, it creates confusion and hurts the eyes. |
That sounds like a well-thought out opinion. But it's still just an opinion. Can you provide sources or any evidence to backup your claims that it's not good practice? |
You just have to read a few basic and advanced javascript books and see any example on the internet, you will never see the break in the default because it is not used that way. That it can be put on does not mean that it is the right thing to do. Putting a break in the default does not contribute anything, it is confusing and not understanding that a next statement is not really expected. |
It helps avoid issues during refactoring. Still waiting for actual citations to back up your personal opinion. |
Well, basically it is the case https://www.crockford.com/code.html
Though it still can be treated as an opinion and I personally would not care at all... Anyway, instead of making multiple issues, I'd suggest @prietales create single Pull Request for such updates 😅 |
"Each group of statements (except the default) should end with break, return, or throw." You're not always going to need every statement to end, You always need to put break before default statement, but not inside. You never need break in default statement. The engine does not interpret it, it is useless code. NOT MY PERSONAL OPINION. You cannot defend the indefensible and say that it is better to refactorize, speak without understanding in which cases it is good. |
"You always need to put break before default statement, but not inside." Well, that's just flagrantly wrong. Maybe you should just close this before making yourself look dumber than you already have. |
NO, 'default' is only reserved for the list of conditions that do not meet, in fact, good practices say that you should throw an exception in the default. If you put a return, you don't need break before default. |
@prietales you dont need to force others to do things the way you like them. you need to realize that people can have opinions and style different from yours. |
It is not a question of opinions. There is a thing called good practices and it is a consensus reached by programmers after thousands of hours of work. |
Please always use break in default statement. You are a PRO. |
@prietales if you put in a PR with unit tests, I'll make the changes to the code you've requested. |
This project is dead and you are nobody. |
@prietales is too junior to understand the difference between what he's comfortable with and best practices. @prietales should probably try a code academy or something so he/she/it can learn to understand the discussion. |
Children adore their guru. |
Break inside default and switch inside a for, for likes break statement. |
yeah, while you act like a guru and force others to conform. the irony is real here. |
I am not a guru nor do I want to be. I expose the reality that anyone who is not a junior can see a simple view. If you feel identified by something it will be. |
and yet, when people say that others can have different opinions, you refer to them as gurus, while denying that you yourself are being a guru by forcing your opinions upon others and labeling them as so simple that "anyone who is not a junior" should be able to see them. unless you can give data and evidence, they just remain your opinions, not bona-fide facts. |
i did not come here to argue and have my mind molded into an average person on twitter, so bye everybody, im gonna unsub from this thread. @Ae3NerdGod have a nice day. |
🙄 |
colors.js/lib/custom/zalgo.js
Line 92 in 6bc50e7
The text was updated successfully, but these errors were encountered: