6

So, apparently I have start some heated discussions about idiomatic javascript or something.

While it's nice to have standard (and probably a linter), I guess creating an idiomatic javascript is not as easy as creating pythonic code.

IMO the reasons are:

1. Python has Guido van Rossum. The one and only dictator telling us what's right and what's wrong

2. Javasript has airbnb standard, mozilla standard, and some open source standards. Strictly take one of them, and your code will be non idiomatic. Cherry pick some styles and combines the ones that makes more senses for you, and your code become non idiomatic.

3. The language is changing. Very fast. Put your idiomatic code in github, leave it for a while, and it's become non idiomatic. So I don't know, but this kind of code, is idiomatic, but takes some times to understand what's going on

anObject = {someFunction, someOther, someKey: someValue};

At the end, I guess the point of those standards are providing one correct way to do something. The consistencies.

I understand it is an important aspect. But this started to be religion...

Like someone really get offended if you doesn't end your code with semicolon.

In that sense, why the javascript foundation (or something) allow a statement to not being end up with semicolon at all?

Also, this is a never ending debate: tabs or spaces? two spaces or four spaces?

This is going to be ' ruby' vs 'python' thing again. I don't know about nowadays ruby, but back then they said the biggest advantage of ruby is you can approach something by using different ways and they are all corrects. Not sounds so idiomatic for me.

Ah yes, I heard almost everyone love javascript and hate php despite the fact that devRant was built on top of php stack. Just FYI, that much hated inconsistent language has something named PSR. And how about javascript? I never heard JSR or ESR. Just ES5, ES6 and in near future ES7... Which are simply provide new ways to do things, add more enthrophy to this already-chaotic-universe.

Also. In vim, how the hell do you define basic indentation based on file type? I really think 4 spaces is just beautiful. But apparently, only python coders think the same. Rest of mortal out there use 2 spaces. Somehow it hurts my eyes, yet it is the standard right?

goddammit... looks like I'll spend more time learning about what idiomatic javascript really is, debating with some zealot thinking they worship the one and only true standard, rather than solving the actual problem...

Comments
  • 1
    Extra ++ for mentioning the irony of everybody hating PHP here 😂😂😂

    Please comment to claim @gofrendi
Add Comment