News for hackers. Stuff that matters.

fryan

Re:Overview of JavaScript ES6 features on Monday October 24, 2016 @05:54PM (#12783233)
I had to debug code like that the other day. Before you debug it you have to mentally grok wtf is going on. What a mess.
Re:Overview of JavaScript ES6 features on Monday October 24, 2016 @02:49PM (#12781642)

    const foo = {bar: 1}
The only thing const about it is the reference `foo` cannot be reassigned:

    foo = something_else; // error
Unlike `const` in C++, `const` in javascript in not very useful in my opinion. `let` is shorter and more readable.
Re:Webcams used to attack Reddit and Twitter recalled on Monday October 24, 2016 @02:15PM (#12781297)
Is the denial of service attack on DNS servers still going on? Major sites are still much slower than last week.
Re:Overview of JavaScript ES6 features on Monday October 24, 2016 @01:44PM (#12781026)

    const Header = ({ children, iconName, iconSize, title }) => { ... };
Once you get used to the destructuring parameter idiom, sure. It also conveys more information.

But that statement is overloaded in that it makes use of implicit object shortcuts which has a bit of a learning curve for longtime ES5 users.

    const Header = ({
        children: children, 
        iconName: iconName, 
        iconSize: iconSize, 
        title: title }) => { ... };
When object destructuring is nested it can be confusing and more verbose.
Re:Overview of JavaScript ES6 features on Monday October 24, 2016 @12:06PM (#12780049)
I agree that object destructuring makes the code far less readable. Array destructuring however is easy for anyone to grok.
Re:Overview of JavaScript ES6 features on Monday October 24, 2016 @12:03PM (#12780009)
buble is a good alternative - small and fast. Doesn't support all of ES2015, but it does support the examples in the article.

https://buble.surge.sh/guide/