5
Maybe because I have a much greater experience with PHP I’ve never been a fan of Javascript.
I always found the syntax of language confusing and complicated and often resorted to jQuery to do simple things that many would do with their feet on their back.
However, in the last few days I was looking for a simple and elegant way to at least simulate the basics of OOP that one has with PHP in Javascript, main, but not exclusively, heritage.
It was when I accidentally tripped on ES2015 and the syntax proposed by him pleased me a lot because it was well what I wanted, something simple and direct and with a greater power of Object Orientation.
But, as always with my Javascript adventures, there was one problem: ES2015 is not well supported by browsers. Even Chrome seems to need a certain experimental option to be enabled for these features to work.
Then again, I stumbled upon something called Babel, that even has a nice online editor that transcomplates automatically.
The problem is that I have no idea how to even begin to use it because I never used the Nodejs thing, which I heard about but I never really cared about because I didn’t like Javascript, and which, apparently, is one of the requirements.
I swear I tried to research something more tangible for someone who is completely alienated from language, but every article I read was more technical than the other, mentioning even more things I never used as such a Grunt, Gulp, Karma or worse, always focused on Linux environment what is and always was very difficult for me and, in the end, no article was able to make clear exactly what to do.
I know this is a lot out of community standards, but I decided to take a risk because back there, when SOPT started, it was quite common for silly questions like this to receive complete and well written answers (often answered by the authors themselves in order to leverage score - which I find wrong) as content aggregation.
I kind of foresee a rain of negative votes, mostly by people who don’t like to read and even the closure of the issue as being too broad (though not)but if direction is possible it would be extremely useful to me and perhaps to others who are afraid to take this first step publicly.
Cool! But what exactly is your question? About the use of Babel? Where to start? Advantages? Disadvantages? Use of Node.js?
– BrTkCa
Especially where to start, from the installation of the product and what it needs. If it is worth an addendum on advantages and disadvantages, great, would be welcome. If it is necessary to learn something about the nodejs in order to use Babel, it would also be interesting to have as information.
– user5613506
Interesting doubt, also I would like to know more
– Bruno Augusto
Just one thing: ES2015’s class syntax no longer gives you "OO power". It’s basically syntactic sugar. It is not a good way to try to replicate in JS what you do in PHP. Each language has its own style.
– bfavaretto
When I said more OO power was more in the sense of getting closer to what I have with PHP, since syntax and some features are very similar.
– user5613506