Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Splitting on several lines
Message
From
03/06/2013 08:26:16
 
 
To
03/06/2013 03:05:58
General information
Forum:
Javascript
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01575403
Message ID:
01575489
Views:
27
>take advantage of JavaScript automatic coercion !
>
>return loWindow.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
>
Best practive, at least on this side, is to always have the return line to return one value and not execute some logic. Also, this syntax differs too much from other environments and we have structure in place to develop code in the same way. That is why, as you may have seen by now, that having a well understable code on multiple lines is preferred. I also really do not want anyone on the team to try to develop an entire app on one single line, sort of, but you get my point, which is something I have seen at several occasions, making everything so difficult to understand, so difficult to maintain and so difficult to evolve.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform