class Application
{
}
module.exports = Application
export default class Application {
}
Website.use(Express.static(Path.resolve(__dirname, '..', '..', 'public')))
ES6 doesn't mean to export default for everything. I'm not wishing to call a new Class.default for this, as it wouldn't function properly this way. Learn what export default does before saying it's the only es6 style way of doing it.Please dont...
needs to beCode:class Application { } module.exports = Application
You're not coding PHP anymore m8.Code:export default class Application { }
Over all looks really good, but wouldn't call this ES6 in any way..
Btw you really need to read this documentationYou must be registered for see links
There's no reason at all to call new Class.default for this, when there's a simple plugin adding the old exports['default'] = ... back to babel, and when the only thing you're really requiring is your "routes", then I don't really see the reason in using es6.ES6 doesn't mean to export default for everything. I'm not wishing to call a new Class.default for this, as it wouldn't function properly this way. Learn what export default does before saying it's the only es6 style way of doing it.
ES6 is only there for code-readability, as it doesn't provide much in enhancements of coding speed nor anything else.There's no reason at all to call new Class.default for this, when there's a simple plugin adding the old exports['default'] = ... back to babel, and when the only thing you're really requiring is your "routes", then I don't really see the reason in using es6.
If it's there for code readability and when it's an open-source project, then why in the hell do you follow PHP coding styles and not the default set by Node themselves?ES6 is only there for code-readability, as it doesn't provide much in enhancements of coding speed nor anything else.
If you're suggesting ES6 is a wasted ideology for this project, you'll be right as it's a wasteful thing in any project when ES5 works and ES6 transpiles into ES5 anyways.
Due to Node being a construct and not an actual language with the NPM package manager being a helpful tool, but not a requirement (A lot of people actually dislike NPM).If it's there for code readability and when it's an open-source project, then why in the hell do you follow PHP coding styles and not the default set by Node themselves?
Classes is default in ES5, which means the only actual ES6 feature you're using is import...Due to Node being a construct and not an actual language with the NPM package manager being a helpful tool, but not a requirement (A lot of people actually dislike NPM).
Node is nothing more than Javascript in the back-end and I follow the same procedures I prefer to use in the front-end, except I can actually take advantage of ES6 readability in Node.
If you knew what ES6 really was, you'd take note of how I use my variables which is (an es6 standard). Classes also are just objects in ES5, but ES6 transpiles it back into the object.Classes is default in ES5, which means the only actual ES6 feature you're using is import...
Because I am so nice, I'm gonna clean up your git repository for you, and then do a pull request.If you knew what ES6 really was, you'd take note of how I use my variables which is (an es6 standard). Classes also are just objects in ES5, but ES6 transpiles it back into the object.
(Classes aren't a ES5 feature, hence why it's converted into an object)
ES6 is for readability, with some new improvements notable with variable handling and declaration. Quit this endless argument based off of opinions, not facts.
I keep code consistency, but in the real world the only thing that matters is code readability as I hold a professional level coding job.Node doesn't fully support ES6 (especially not features like import/export due how incompatible it is to their current module system, and unnecessary it would be to compromise for such a simple feature). What you guys use just trans-compiles your ES6 back into ES5 like CoffeeScript does to JavaScript, which imo is completely redundant for any project without a massive codebase (and other considerable factors).
More on the subject:
You must be registered for see links
My whole point is, if your JavaScript is just going to trans-compile into JavaScript, then just write JavaScript.
Also, the way you write some of your Node like it'd execute synchronously and compensate for your errors by coming up with a more redundant, complicated approach (callback hell? moving code around?) then what is necessary and could've been avoided easily makes me think you should take a break from ES6 and just write ES5 with minimal objects.
You must be registered for see links
p.s. your extensive modularity / file separation in node.js seems a lil redundant, try to be more compact.
p.s.s think less about how aesthetically pleasing your source code is, and focus more on the execution of the program. In the real world nobody cares about how cute your code looks.
p.s.s.s you're writing JavaScript, just come up with a style guide and follow it. Only thing that really matters is consistency.
"Code readability"...I keep code consistency, but in the real world the only thing that matters is code readability as I hold a professional level coding job.
It all compiles back into C in the end regardless, and the only thing I see truly fitting in your comment is the the code being ran in sync. I tend to try keeping away from this however for important operations ie the only time I use sync is for loading controllers which is only done once at start.
Ty mare for the stuff, and for correcting Sentinel on es6 support as I tried earlier
Pretty good thing my code isn't designed to be ran at industrial levels of performance. At that point in development throwing out readability for performance means that the task isn't efficient for Node regardless"Code readability"...
You must be registered for see links
Quote straight out of Node.js source code:
"Be warned: the mechanics here are seriously ugly -- and one must always
keep in mind that clean abstractions often require filthy systems."
Sample JavaScript written by Node.js developers and currently in the Node platform.
You must be registered for see links
You can see how their code isn't as modularized as yours, clean, compact, and functional.
Conclusion:
Readability < Functionality.
Readability < Performance.
Readability < Tangerines