Better HN
topnewbestaskshowjobs
Log inSign up

fryan

5 karma · joined Oct 24, 2016 (10y ago) · 6 submissions

Submissions

comment 10y ago · link · parent

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.

comment 10y ago · link · parent

    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.

comment 10y ago · link · parent

Is the denial of service attack on DNS servers still going on? Major sites are still much slower than last week.

comment 10y ago · link · parent

    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.

comment 10y ago · link · parent

I agree that object destructuring makes the code far less readable. Array destructuring however is easy for anyone to grok.

comment 10y ago · link · parent

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/