Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

At the point that they chose to use all this kit and write "beautiful ES6". Write ES5, use a few polyfill functions, include the already minified mithril/vue/react js IF you actually are going to need dynamic DOM elements. An XHR sweetener is included in mithril at least, but if not, it's only a few lines easily memorized, as you will do them constantly, it's also a good candidate for that library you should have made for all your projects by now, with that "byId()" and "byClass" shorteners etc... just an XHR you can pass a callback, url, and method to...

  var xhr = new XMLHttpRequest();
  xhr.onreadystatechange = function(){
    if(this.readyState == 4 && this.status == 200) {
      //do stuff to your dom, JSON.parse(return stuff) etc.
    }
  }

  xhr.open("POST", "/some route/" + whatever, true);
  xhr.send();
FormData(); would add 2 more lines to the above... I see no point in all this front-end toolchain stuff trying to maintain an illusion that ES6 runs in most browsers. Invariably maintaining false abstractions will not promote deeper understandings of the rather essential and basic "request response" cycle of HTTP.

It's not even pretty. Classes in JS? Gimme a break. Show me the ugly truth and K.I.S.S. because life is short and we have better things to do in life...



> At the point that they chose to use all this kit and write "beautiful ES6"

So are you saying that most projects that use JS should avoid the use of ES6?


Well, either that or polyfill. Transpiling to JS may be a product of other motives (Typescript, Svelte, Elm etc.)

While Ruby is pretty and all, I don't find that I'm enjoying the lie that is ES6, and don't even get me started on classes in JS, etc.

Bottom line, JS isn't my favorite language, but I'm not dying reading/writing ES5, (nor does ES6 look lovely when I know that it's lying to me) and the advantages outweigh the disadvantages...

I'm questioning a lot of the group-think decisions.

State management? What is "a variable"?

Many times the cure is worse than the disease...


> Transpiling to JS may be a product of other motives (Typescript, Svelte, Elm etc.)

I'm not sure what you mean. Are you saying those tools should be avoided too or are you saying they are an exception to the "avoid complexity" rule?

>While Ruby is pretty and all, I don't find that I'm enjoying the lie that is ES6, and don't even get me started on classes in JS, etc.

I don't understand what you mean. What does Ruby have to do with anything? Also, what do you mean by lie?

> Bottom line, JS isn't my favorite language

Ok. That's fine. So what?

> the advantages outweigh the disadvantages

Would you care to elaborate on this? What would you consider to the be the advantages and what makes the complexity disadvantage outweigh them?

> I'm questioning a lot of the group-think decisions.

What is there to question? Don't use tools just because other people are using them, when you encounter a specific problem you want to solve, evaluate the available tools for solving it.

> State management? What is "a variable"?

I'm not sure what you're asking here. Are you asking why people use state managers when building js applications on the web?


Another option is ignoring IE11. Then you don't need webpack, npm, babel, and you can still use modern features.

Something like htm [1] + ES6 modules is the best of both worlds IMO.

State management? Let React/Vue handle it [2]. No need for Redux/Vuex etc

Need to support IE11? Then yeah, I agree, go back to ES5.

[1] https://www.npmjs.com/package/htm#example [2] https://twitter.com/ryanflorence/status/905584958835638272




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: