Extra script operators
Posted: 19 Feb 2017 06:29
Will be handy to use some syntactic sugar on smartphones, as:
1. ++
2. +=
3. [lat, lon] = split('{location,locationformat,decimal}', ','); //[a,b,c] = line.split() - as in Python language
4. "All variables is an object" concept
5. Define own function
6. Ternary operator r = a ? b : c
7. "?=" or "||=" operator, same as getValue()
8. arr = [1,2,3]
So, less symbols => more time to think about functionality, and clear, compact code.
Using JavaScript possibilities, we can write more clean code, by the way.
And v8 JS engine pretty fast: simple loop with some math operations works faster then C++ code with -O3 optimization.
// I used CoffeeScript on frontend and backend, it's so clear, but spaces instead of using brackets may be so annoying at smartphones. Who knows.
Or, Martin, is there some tricks to use Java functionality in action script?
Best regards.
1. ++
2. +=
3. [lat, lon] = split('{location,locationformat,decimal}', ','); //[a,b,c] = line.split() - as in Python language
4. "All variables is an object" concept
5. Define own function
6. Ternary operator r = a ? b : c
7. "?=" or "||=" operator, same as getValue()
8. arr = [1,2,3]
So, less symbols => more time to think about functionality, and clear, compact code.
Using JavaScript possibilities, we can write more clean code, by the way.
And v8 JS engine pretty fast: simple loop with some math operations works faster then C++ code with -O3 optimization.
// I used CoffeeScript on frontend and backend, it's so clear, but spaces instead of using brackets may be so annoying at smartphones. Who knows.
Or, Martin, is there some tricks to use Java functionality in action script?
Best regards.