TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Michael Cronqvist
NA
5
570
Good programming practice
Jun 9 2020 11:24 AM
Hey guys
I have a continuous dialog with my developers about Good programmering practice and not all get it.
Please take a look at this piece of code below. I my oppinion this is badly written code because:
Unnessecary negation of the conditional statement can lead to confusions.
The negation makes an ekstra operation.
Obviously dead code since "return" can be avoided.
Obviously you should not negate and instead do the "this.updateTrans(); ok = true;" inside the if statement. This way it's much more readable by human eyes.
What are you guys oppinion and arguments on this?
Thank in advance.
Reply
Answers (
3
)
azure cosmos db implement server-side paging
'Basic Page'-type project problem in VS2019 - revisited