ECMAScript 2016: New Version of JavaScript Language Released (softpedia.com) 165
An anonymous Slashdot reader writes: Ecma International, the organization in charge of managing the ECMAScript standard, has published the most recent version of the JavaScript language. ECMAScript 2016 (ES7 or JavaScript 7th Edition in the old naming scheme) comes with very few new features. The most important is that JavaScript developers will finally get a "raise to the power" operator, which was mysteriously left out of the standard for 20 years. The operator is **...
It will also become much easier to search for data in a JavaScript array with Array.prototype.includes(), but support for async functions (initially announced for ES2016), has been deferred until next year's release. "From now on, expect smaller changelogs from the ECMAScript team," reports Softpedia, "since this was the plan set out last year. Fewer breaking changes means more time to migrate code, instead of having to rewrite entire applications, as developers did when the mammoth ES6 release came out last year."
It will also become much easier to search for data in a JavaScript array with Array.prototype.includes(), but support for async functions (initially announced for ES2016), has been deferred until next year's release. "From now on, expect smaller changelogs from the ECMAScript team," reports Softpedia, "since this was the plan set out last year. Fewer breaking changes means more time to migrate code, instead of having to rewrite entire applications, as developers did when the mammoth ES6 release came out last year."
hated language becomes a success (Score:4, Interesting)
lots of knowledgeable people hate or dislike javascript, and have done so from the start, and give excellent reasons for their hate and dislike.
but it has succeeded in spite of them and these reasons, and is more or less an indispensable part of modern on-line world currently.
why? what did these 'knowledgeable' people missed or still miss when evaluating it?
But JavaScript isn't a success. (Score:4, Insightful)
The only way JavaScript can be considered a "success" is if you define "success" to mean "used because it's the only option available".
But aside from that very limited view of "success", JavaScript is a total disaster.
It's a very broken language. Its type system is a wreck. It didn't have real class OO for ages, and even its prototype approach is shitty compared to Self. Its standard library is rubbish. Its syntax is mediocre. It is full of utterly stupid shit like semicolon insertion. It's a failure when looked at solely as a programming language.
Its surrounding ecosystem is also very broken. Numerous companies and organizations have had to pour huge amounts of money and other resources into it just to get JavaScript implementations that don't limp along at a snail's pace. It has also given us clusterfucks like Node.js and npm. Building anything more than an onclick handler using JavaScript rapidly becomes a huge debacle, and a maintenance headache.
Its community is among the worst there is. Something has to be pretty wrong with a community that thinks a language as awful and broken as JavaScript is worth celebrating! But I will give the JavaScript community credit, it isn't as terrible as the Rust community is. At least the JavaScript community's biggest offense is only ignorance. They aren't hypocrites who attack others with their tyrannical Code of Conduct, like we see some other programming language communities do.
JavaScript just isn't a success in any reasonable sense. It's a failure.
Re: (Score:1)
> It didn't have real class OO for ages, and even its prototype approach is shitty compared to Self.
This is actually a favor JavaScript did us: it showed that classes are unnecessary for OO. I enjoy prototype-based programming, and while I haven't tried Self, I don't see anything wrong with JavaScript's approach.
Re:But JavaScript isn't a success. (Score:5, Insightful)
Prototypes kick ass, if you know how to use them.
That is, if you're not one of the many who confuses the territory (objects) with just one of the maps (classes) you can make of that territory.
The real beauty of JS is that the notation for just about any data structure maps very neatly on to any of the others. If it's easier to work with an object at some point as a hash, you treat it as a hash. A few lines later, it proves handy to treat it as an array. Later, maybe it's best to access it as an object again.
Apparently, most folks can't handle that kind of freedom.
Re: (Score:2)
Re: (Score:2)
...if you know how to use them.
To me, that means the same thing as, "I'll just be careful."
Re: (Score:3)
It's consistent. Try to compare several truthy/falsy things to NaN, undefined, infinity and so on. You will notice, that the operators are not transitive, sometimes equivalence operators are not even symmetric or reflexive.
Re: (Score:1)
the lack of OO is one of the things that makes ECMAscript good.
You are behind the times if you still think javascript is bad. Its far better tham most languages out there.
Re: (Score:2)
I like the elaborate reasoning of your argument and now i am fully convinced.
Re: (Score:2)
Somebody should mod up the parent. Unlike the other comments it actually makes some technical arguments!
You mean technical arguments such as conflating server-side and client-side implementations of javascript?
I don't see any particularly technical arguments there - it's mostly just hand-waving.
Re: (Score:1)
Alternatives to Javascript have been made, Python for one.
Why it doesn't catch on, I will blame Microsoft and Linux browser developers. Microsoft because it doesn't ship with any interpreted languages, and Linux software developers because they ignored the Unix philosophy, the JavaScript interpreter shouldn't be part of the browser, it should be stand alone and the html/css rendering engine should have an API/ABI which can be accessed by a variety of languages, and these languages should be independent from
Re: (Score:2, Insightful)
Alternatives to Javascript have been made, Python for one.
Python (1991) existed before JavaScript (1995) and it does not run in the browser.
Python is not an alternative to JavaScript.
Re: (Score:1)
And Microsoft tried to push vbscript in the browser, but that's even worse than JavaScript.
I'm not sure why anyone would use JavaScript anywhere else but in a browser. And even there it's not really a good language.
Re: (Score:2, Insightful)
Yikes, Python is NOT an alternative to Javascript in any reasonable way. The whitespace issue alone would make it a nightmare as a browser language. The poor record of backwards compatibility doesn't help, either.
The crazy thing is, a reasonable alternative to Javascript that would be trivial for JS programmers to learn already exists: TYPESCRIPT. It's even supported by Node.js and a lot of (smart) developers are using it in that case to get reasonable type safety and decent class/interface/module suppo
Have you ever actually used Python?! (Score:3, Informative)
When somebody makes this "argument", it's a sure sign that they've never actually used Python, and that they're just spewing bullshit.
Anyone who has used Python knows that this is totally a non issue. PEP 8 [python.org] explains very clearly how to avoid and any all problems: "Use 4 spaces per indentation level."
That's all you have to do! Like it says, use 4 spaces per indentation level. It's as simple as that.
Re: (Score:2)
First of all, we're not talking about Python 3 (or 4 or 5), we're talking about Python 1.2 & 2.0 when ECMAScript and VBScript fought it out.
When every byte counts (remember, 56k modems), how do you minify the spaces? Python has a lot more issues than just it's spacing though. Unicode support wasn't there (not sure if it's still defaulting to ASCII strings) while JavaScript defaults to UTF-16. Besides that, the learning curve for Python is a bit higher than JS, type coercion is available in Python 2 but
Re: (Score:2)
That is just the language issues, there are/were political issues as well with Guido, I remember being a bit of a pain to work with when it came to controversial features and 'reworking' the languages caused Python 1-2-3 to be practically different languages. JavaScript from the early era still works just as well in current browsers as modern JavaScript and doesn't need individual interpreters.
Good point. The default browser scripting language is not going to work out well with a language whose creator basks in his designation of "Benevolent Disctoros For Life" (BDFL).
Re: (Score:2)
Bullshit. At this times nobody cared to minify js. This insanity started much later, when people noticed their sites are loading slowly (because of ads, but we cannot remove the ads, so lets save 200 byte in the javascript file, which is cached anyway). At this time you could read html/javascript source code like a book, nothing was obscured.
Re:Have you ever actually used Python?! (Score:5, Insightful)
I think the implication is Javascript doesn't require any repetition of white-space as part of it's syntax.
If you just wanted to do something very simple, you could embed Javascript in an HTML attribute value. You can't do that if you require line endings and white-space as part of the language syntax.
Re: (Score:2)
If you just wanted to do something very simple, you could embed Javascript in an HTML attribute value. You can't do that if you require line endings and white-space as part of the language syntax.
You obviously know first-hand something of what you're talking about. What are you doing in this discussion, anyway? :-D
Re: (Score:2)
Work was boring.
Re: (Score:2)
If you just wanted to do something very simple, you could embed Javascript in an HTML attribute value. You can't do that if you require line endings and white-space as part of the language syntax.
Yes! Please show me a valid Python function in a single line embedded in HTML. Python devs made their choices and adamantly stick to them, but sometimes choices can limit the application of a language in theory or practice...
Re: Have you ever actually used Python?! (Score:1)
The post you took serious to reply is really a troll I think, even my 14.4K modern did excellent compression for trivial things like white spaces and HTML. I was using IBM Global Network while it was SLIP based which didn't have protocol compression, modem handled it damn fine on hardware level.
Re: (Score:1, Flamebait)
When somebody makes this "argument", it's a sure sign that they've never actually used Python, and that they're just spewing bullshit.
I am 100% sure I have done more with Python in the last few years than you will ever in your career, so, bzzt. There is a reason the most popular Linux server distros lag so far behind on Python versions - upgrading to a new version almost always breaks *something* in existing code. Have had it happen SO many times... (and I still use it! It's a decent scripting language for readable, modular projects. Doesn't mean it's that good at backwards compatibility compared to other languages...)
Anyone who has used Python knows that this is totally a non issue. PEP 8 [python.org] explains very clearly how to avoid and any all problems: "Use 4 spaces per indentation level."
THIS clearly pro
Re:Have you ever actually used Python?! (Score:4, Insightful)
Minification is a nasty hack for languages without a binary format. Python compiles to .pyc
Re: Can somebody mod down Dalilama's bullshit? (Score:2)
To be fair, we (web developers) minify and compress everything, or atleast we should. You don't know who is on the other side of the connection, or what kind of bandwidth they have available so always try to cater to the largest target you can.
I also don't depend on huge JS libraries/frameworks, because I avoid JS if I can, but that's just me. Anything outside of basic DOM manipulation (show/hide elements, change this string to that value, etc) it just turns into a pain in the ass. I try to do all of the lo
Re: (Score:2)
remove one ad from your site and you'll saved more than obfuscating the js file does.
despite this, compression is part of http for a long long time.
Re: (Score:2)
Obfuscation != minification or compression. Obfuscation is for making the Javascript harder to read (in an imperfect attempt to provide extra security or protect IP). Minification is for making the text smaller (though it's usually pretty good at obfuscating in the process), and compression is for making the transfer smaller.
Re: (Score:2)
so, then please debug an minimized script. Of course minifying obfuscates the script. And compression makes it unneccessary. That's the point.
Re: Can somebody mod down Dalilama's bullshit? (Score:2)
No. You clearly don't do this stuff, so you really shouldn't be commenting on it if you don't know what you're talking about.
Minification makes the payload smaller. Compression is limited to gzip or deflate. If you compare original source compressed to minified source compressed the minified compressed will be smaller. Anywhere from 5-20% smaller in my own testing.
Some minification techniques will replace local variable names with smaller variable names, decreasing payload size in a way that compression can
Re: (Score:2)
I think you did not really try it. Compressing a long variable name and uneeded whitespace is just as good as minification. A compression algorithm is optimized for making redundant data small and of course everything which can be minified contains redundancy, that's why you are able to shrink it.
And you're elegantly ignoring the other point, that your minified js file is cached for two weeks or something similiar. No need to use something minified.
Re: (Score:2)
A users first impression of a website is how quickly it loads initially. Caching doesn't help here.
I have tested Minification with Compression, and just straight compression. In all of my testing, Minification with Compression always wins. This is for both JS and CSS.
Re: (Score:2)
how big is your gain?
I would rather recommend to use less js, especially as it all adds processing time (which is normally single threaded in a browser ...)
A nice option is to replace a big jquery or similiar with http://vanilla-js.com/ [vanilla-js.com]. Almost all functions you really need are already included, even those which needed jquery in the past.
Re: (Score:2)
I've already posted above that I don't use big libraries... really basic things like DOM manipulation, the odd modal window, and some iframe stuff.
As an example, a site I built recently for a local church has a single JS file called core.js. The original file is 14340 bytes. Compressed it is 3732 bytes. Minified and compressed it is 2792 bytes.
Another example, a project I built last year, is a web based document management system for an appliance manufacturers customers (dealers/retailers/distributors) to a
Re: (Score:2)
You're talking about 300 bytes per file. What data rate do you expect your clients to have on average? How big is your smallest ad (or even the script loading the ad)?
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
That's what we're ta
Re: (Score:2)
You keep bringing up ads... I don't put ads on my sites. I develop web based applications for businesses, with the odd small business and community organization websites sprinkled in.
I've written a script that sits between static files and the web (or a CDN depending on the project) to automatically optimize all of these things for me, so I don't even have to think about it anymore, it just does it automatically.
The script also optimizes images (with optipng [sourceforge.net], jpegoptim [github.com], etc). It even goes as far to do imag
Re: (Score:2)
I am bringing up ads, because most of the "we need to optimize!" people are putting ads on their page, which are way bigger.
I wanted to bring up optipng, as its a lossless way to optimize. But i think the important load time has your assets cached. People coming from a search engine are used to wait 3-5 seconds. People clicking a link on your page, they should get the stuff from cache, so the next page needs less than one second. Server side scaling is useful. If you should use imagemagick (which is slow a
Re: (Score:2)
I'm aware of all of this. I started developing web applications around 1998.
I use ImageMagick because in my testing it was faster at the time for bicubic resizing/scaling. I'm using the Imagick PECL extension [php.net], which mostly eliminates the security and speed issues as it wraps the library into a PHP extension. I've written it to never scale an image up. If you specify a height and width larger than the original file, you'll be served the original file... So someone smart enough can't fiddle and blow up images
Re: (Score:2)
sounds reasonable ;-). I like imagemagick as well, but not for calling by scripts in most cases. php/perl libgd has some disadvantages, though. I like python's pillow.
Re: Can somebody mod down Dalilama's bullshit? (Score:2)
Never built a site that had ads on it, so I'm not sure what the hell you're talking about.
Re: (Score:2)
I bet you visited one in your life ;-).
Now compare: a 500kb banner less or shrinking your js/css from a total of 50kb down to 30kb?
The banner is loaded dynamically, the css and js are cached for two weeks.
You see what i am talking about. And most ad systems need more than 500 kb of traffic nowadays
Re: (Score:2)
The funniest part of this bullshit claim is that whatever you've supposedly done using Python, well, it likely depends on and uses the C and Python code I've contributed to the CPython implementation over the years! Son, you're out of your league.
Who cares? If you run Linux or streamed video you are probably using code I contributed, big fucking deal. In the end you are STILL posting AC, so you are by definition a bullshitter until proven otherwise. And WTF is with the "son"? Get your own voice, don't borrow it from whatever shitty media you borrowed it from. It helps your argument ZERO to sound condescending without any advantage.
You're the one who is out of touch, clearly. We serve compressed content these days
Not sure who "we" is, but web servers serve what browsers, CDNs, etc support. You'd be surprised at how many CDNs
Re: (Score:2)
Python has remarkably good backwards compatibility. A number of Python 3 features were actually backported to Python 2. And Python 2 still sees excellent continued support.
Backporting features and active development on versions "replaced" eight years ago aren't very good signs of backwards compatibility.
And there's the excellent "2to3" tool which can quickly and reliably convert nearly all Python 2 code to Python 3 code
Your definition of "backwards compatibility" seems to be different from the definition used by the rest of the world.
Re: (Score:2)
Java ran in the browser before javascript. It was a little slow at the time but what wasn't?
Re: (Score:2)
Java apps in the browser during that time frame was a pain. You never knew what would or wouldn't work.
Re: (Score:2)
The language, the runtime libraries and the browsers were all changing rapidly at the time. It got us to where we are now. Javascript got a head start by ignoring some of the stuff which made java a pain for new programmers, like strong typing and security.
Re:hated language becomes a success (Score:4, Insightful)
Strong typing and security wasn't the big problems for Java, and the lack thereof in JavaScript is one reason to avoid it if necessary.
The problem with Java as a plug-in was that it had to load the JRE and download a kiloton of libraries before executing. A process that could take minutes and you as a user never knew if it was normal or if something had crashed.
It was Flash that did this a lot better from a user perspective where the response was in seconds instead of minutes. But with security gaps worse than anything else.
Re: (Score:2)
Java competed with Flash, not with Javascript.
Java, like Flash, was something that ran inside a rectangle on a page. Javascript ran as the page itself.
Re: (Score:2)
the JavaScript interpreter shouldn't be part of the browser, it should be stand alone and the html/css rendering engine should have an API/ABI which can be accessed by a variety of languages, and these languages should be independent from everything else as well.
This is already happening. Its called webassembly. You can use whatever language you want.
And in fact even before webassembly it was possible to use third party languages in html/css. You just needed a javascript polyfill that translates the language into javascript. Its a hack but it works.
Re: (Score:1)
It's not already happening. HTML / CSS ignores any rendering that's not JavaScript, or if you suck, vbscript.
I have JavaScript disabled, and there is nothing on the web that in any way does graceful fallback to let me know that I'm missing some esoteric rendering engine. Maybe the foundation is laid,like F#, but it us not happening.
Maybe I would have heard of webassembly, but obviously its not happening anywhere that matters. Because many sites just don't work without JavaScript.
Re:hated language becomes a success (Score:4, Insightful)
Languages are not nearly as important as ecosystem. Else Haskell and co would be ruling the world of software engineering.
We're only starting to see a world where good languages are starting to catch on...but it's slow going. If the ecosystem is there, it picks up, even if the language sucks.
Same reason it is bad - done in 10 days (Score:5, Interesting)
JavaScript is has been the language all browsers support, but why? Also why is it so bad? The answer to both questions is the same:
Because it was created in ten days. While Microsoft was scheduling meetings to discuss a proposal to plan a browser language, Brendan Eich created JavaScript (then called Mocha) and released it to the public. It was used because it was available, while other options were draft proposals, not yet approved for development, much less ready to use.
When you spend all of two days designing a language and seven days implementing it, you end up with a pretty crappy language.
The opposite end of the spectrum is Perl 6, which was designed from 2004 to roughly 2015. It's a rather nice language, for those who like Perl-like languages.
Re: (Score:1)
> what did these 'knowledgeable' people missed or still miss when evaluating it?
Nothing.
JavaScript and PHP are the two most fucked up and popular languages.
Why?
There are more shitty programmers then good programmers .
Seriously, when a language has a fucking hack:
...it only reinforces the shit that it was designed in 10 days. It like we learnt _nothing_ from all the languages of the 80's and 90's.
Re:hated language becomes a success (Score:5, Insightful)
> You don't understand the language
Then why does my day job of writing WebGL apps for Smart TV's run at 60 fps then if "I don't understand the language" -- I guess these shaders just magically wrote themself ! And all those rendering optimizations just "magically" appeared in our code base !! Holy Shit !!! Ghosts are real -- shhh, don't tell the retarded Chinese Cult Politics [globalpost.com] party! (Yes, I know CCP doesn't official stand for that.)
Don't assume. You look like an tool when you do.
> Slashdot is full of incompetent developers like you,
I know I shouldn't feed the Arrogant Cunt trolls, but since you you started with the ad hominem attacks, you're proof is _where_ again??
But then again I wouldn't expect much from a coward too ashamed to hide behind an anonymous name. I guess you don't want the world to know stupid you really are.
> Since when is a pragma a "shitty hack"?
Are you really that fucking stupid? Wait, that was a rhetorical question -- we already know the answer to that.
a) The FACT that this is enabled by default for ECMAScript's 6 modules should tell you that this was a HACK.
b) Do you actually understand _anything_ about type safety and misspelling, at all?? Maybe if you had spent 30 years programming you would understand the importance of compile-time error detection and type safety? Gee, things that make our job of programming easier Go figure!
c) Why do you keep making excuses for a shitty designed language?
> My favorite is NaN != NaN.
Straw man fallacy. Did I complain about isNan(x) ?? No, so quit changing topics because you've simply read What Every Computer Scientist Should Know About Floating-Point Arithmetic [oracle.com]
The bigger problem is the retarded "EVERY number is a double / float64" type [github.io] crap.
Gee, in ECMAScript 2 float and double are reserved word [mathiasbynens.be] but not used. Oh wait, They are no longer in ECMA Script 5+. [mozilla.org] Make up your fucking mind !
Never mind the fact that converting from a string to a var will OVERFLOW and NOT be EXACT.
Oh, look we have Number.isSafeInteger() but, gee thanks, for a mostly useless function as this _still_ doesn't solve the problem of needing an int64_t type.
I need an _exact_ native int64_t and uint64_t type -- WHEN will this be supported? Why do I have to use stupid hacks like "a | 0" to cast to an int??
Javascript broken == operator [github.io] is so fucked up it is laughable. WTF is the point of even having '==' when every smart programmer will use '===' instead???
The four biggest reasons Javascript is a such as piece of shit:
1. Automatic type conversions will get one in trouble:
2. How about the inability to actually _include_ .js files like, you know, a concept that (almost) EVERY-other-programming language has???
3. When Javascript does stupid shit like Automatic Semicolon Insertion (
Re: (Score:2)
Don't mind me, just butting in!
> Then why does my day job of writing WebGL apps for Smart TV's run at 60 fps then if "I don't understand the language" -- I guess these shaders just magically
> wrote themself ! And all those rendering optimizations just "magically" appeared in our code base !! Holy Shit !!! Ghosts are real -- shhh, don't tell the retarded
> Chinese Cult Politics [globalpost.com] party! (Yes, I know CCP doesn't official stand for that.)
> Don't assume. You look like an tool when you
Re: (Score:2)
Never mind the fact that converting from a string to a var will OVERFLOW and NOT be EXACT.
Then don't do it? It's like saying "hey, that gun will kill someone if u pull the trigger while pointing at them!" - duh.
Google any big int lib.
Could you share your experience with the runtime performance (or lack thereof) of available big int libs for JavaScript?
You answered your own complaint... use strict equals.
Do there also exist strict less than and strict greater than?
Didn't they just introduce modules?
What they did "just introduce" is irrelevant as long as the client remains stuck on ECMAScript 5.
any JS developer worth their salary
Perhaps the problem is that the gotchas in the language make most ECMAScript developers not "worth their salary" by that measure.
Re: (Score:1)
It's pretty straight-forward, the same exact reason Microsoft won out over everyone else with Windows: users do not matter, at all, they use what they are given. As much as they believe otherwise, web "developers" aren't programmers, they are power users of web browsers. As a result they got what developers were putting out for them to use and JavaScript, believe it or not, was the least horrible of all of the options.
If web developers knew how to program well enough to create their own browsers (cross-pl
Re:hated language becomes a success (Score:5, Insightful)
I think JavaScript is hated because programmers are taught in school these days to be purists. Object-oriented concepts are taught as THE way to write code, and strict type-safety is a religious commandment. There are very good reasons for good object-oriented and type-safe designs. But in the end, the goal is for the code to work.
JavaScript is successful, I think, because of its simplicity. It is the BASIC of this generation. You can start using without having to install any tools. You can learn enough to do something useful in a few minutes, and you can actually DO something useful in one line of code. This means that lots of novices are writing lots of atrocious code out there, yes. But its low entry threshold allows many ordinary people to accomplish real work without having to study for weeks or years.
Another reason JavaScript is successful is that it isn't "owned" by a single corporation. Remember VBScript? In many ways, in it's day, VBScript was a superior language to JavaScript. But it failed because it was a Microsoft product, and was never adopted by competing browsers. Same goes for SilverLight.
The good news for the haters is this: WebAssembly is coming. This will make it possible for creative people to create their own, "better" languages, that will work in every browser without requiring users to install add-ins.
Re: (Score:2)
The good news for the haters is this: WebAssembly is coming. This will make it possible for creative people to create their own, "better" languages, that will work in every browser without requiring users to install add-ins.
Why is it "good news for haters"? It's good news for everyone, just like SPIR-V.
Re: (Score:2)
Re: (Score:2)
I think we've found our Lisp programmer.
Re: (Score:2)
JS is not and never has been limited to the client. NS-SSJS is long gone, but to this day, you can write ASP/ASP.Net code in JScript and IIS will run it just fine. There are other examples if you care to find them. And I've been hearing lately about something called "Node.JS"...
There are lots of other environments supporting JS as well.
The power operator? Really? (Score:5, Funny)
export function pow(base, exponent) {return base**exponent;}
To use it, enter this command:
npm install js-power
Then, in your code:
const power = require('js-power');
let eight = power.pow(2, 3);
It's just that easy!
Re: (Score:2)
And who's using it on server side?
Re: (Score:2)
Re: (Score:3)
Re: (Score:3)
Thank God for unit tests
Handy when static analysis is all but impossible.
Re: (Score:2)
I don't see how locking between threads can work when their entire namespace is so mutable.
Re: (Score:2)
This is where that pesky win10 upgrade actually helps web developers.
Win10 has "Edge", crap browser, but in terms of compatibility, we can stop worrying about fuckin IE 8, 9, 10, and 11... Bout damn time.
Re: (Score:2)
Re: Why is it not ^? (Score:3)
It's bitwise xor, in pretty much every language.
Re: (Score:2)
Re: (Score:2)
In Pascal, ^ deferences a pointer, as in recptr^.field = value. Some extended Pascal variants used ** as power operator.
Re: (Score:1)
Most of us with programming experience would expect 2^16 to return 18. I take it that you mainly use BASIC, right?
Re: (Score:2)
We all expect 2^16 to return 65,536. Why make it something different?
No, I expect 2 << 15 to return 65536. The ^ is the XOR operator.
Having bitwise operators explained to you by JavaScript programmers must be a soul-crushing experience.
Re: (Score:2)
I just typed "2^16" into bc, and it returned 65536.
BC? Oh yeah, I remember- that was the most popular programming language Before Christ.
Re: Why is it not ^? (Score:1)
JavaScript never does what is expected. This is a feature.
Re: (Score:2)
^ is bitwise OR, just as it is in countless other languages, e.g. C, C++, Perl, Java, to name a few.
ECMA (Score:3)
"ECMA"Script? I would love to adopt it, but I want my web site to be accessible from the UK.
Re: (Score:2)
ECMA International has its headquarters in Geneva, Switzerland. A European but non-EU country, in case you didn't know.
Am I wrong, or is Await/Async still missing? (Score:1)
I was very much looking forward to await/async as a more mature way to natively provide clean synchronous wrappers for async code within synchronous code (and get around the nested hell of when/then). Please correct me if I'm wrong, but it only seems to be a future reserved word.
Right now, it appears I am still awaiting.
Re: (Score:2)
Oh don't get me started on async/await! When I first saw these in C#, I was excited to see a simple, clean way to hand off tasks to background threads. But in practice, it was TOO easy. Worse, the design is viral, once you have async/await one place in the code, you have to start using it in everything that calls that code, and pretty soon it takes over the entire application. Novice programmers started putting async/await statements EVERYWHERE, instead of just in the places where you really need a back
That's ES7 (Score:2)
Yeah, you have to wait, that is ES7.
No competition (yet) (Score:3)
One reason ECMA can be so slow to release new features, is that they have no competition. If you want to write Web-based applications, you're stuck with JavaScript. There are no other viable options. Why should they be in a hurry to change things?
This is about to change. WebAssembly is coming. This is the development that will finally blow open the language barriers for browser-based programming. You'll be able to write client-side code in just about any language you already use and like, and you won't have to require the user to install some add-in to use it. Once this happens, it's quite possible that JavaScript will soon go the way of BASIC and COBOL.
What do we do then? (Score:1)
Re: (Score:2)
Would you have preferred VBScript?
Re: (Score:2)
die JS! Welcome brython! (Score:1)
Re: (Score:3)
In a few more years we'll have this turd polished to a mirror sheen! Maybe some day enough of the horrible design flaws will be undone and make it almost halfway comparable to a serious language.
Damn Straight
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. DAMNSTRAIGHT.
000300
000400*
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
000900
001000 DATA DIVISION.
001100 FILE SECTION.
001200
100000 PROCEDURE DIVISION.
100100
100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS.
100500 DISPLAY "Damn Straight" LINE 15 POSITION 10.
100600 STOP RUN.
100700 MAIN-LOGIC-EXIT.
100800 EXIT.
Re: (Score:3)
Here you go [github.com]
Re: (Score:2)
Re: (Score:2)
Cobol was designed almost 60 years ago. No doubt that if Cobol was created today, it wouldn't stand a chance. Fortunately Javascript is unlikely to resemble that fossil, ever.
Modern Cobol might have a prettier syntax, but the language features itself are still rather unique and, for it's specific niche of batch programming, superior to alternatives. There are still very few language that can consistently beat Cobol on performance for batch programming.
Re: (Score:2)
Yeah, it's nearly as terse.