Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Using Next-generation ES Features

Best Usage of Babel

Going through this video and the code examples, it seems that while Babel is extremely useful for transpiling new to older code, it also seems to be extremely cumbersome size-wise (15 lines of code vs 7500)

My question is, in what instances would this likely be beneficial to a development environment? It doesn't seem like something that would be very beneficial to smaller projects such as static based websites, and really only to larger apps that have a lot going on.

Does anyone have any kind of guidelines they go by, or any instances of what kind of situations this would be practical in? I know it's all the rage right now, but it doesn't seem like a great idea for standard web development and I'm trying to wrap my head around it.

1 Answer

The number of lines of code is irrelevant as long as the application is performant, that it, its operates quickly and efficiently. The reason to use ES6 aka ES2015 is to make development easier with the new features and future proof your code. In order to use Babel is to allow for our future proof code to reach as many people as possible.

If a browser can't read your code, then the user experience is considerably downgraded since no JS is rendered.

Hope this helps.