4 ms·
Node's intrinsic ability to "speak" JSON makes for some very clean code when dealing with that sort of data. If you're doing a simple API back-end in Express wi
by astrodust 10y ago
Node's intrinsic ability to "speak" JSON makes for some very clean code when dealing with that sort of data. If you're doing a simple API back-end in Express with JSON in, JSON out, it's extremely light-weight.
PHP, Ruby and Python here are at a disadvantage. JSON is JavaScript's home turf.
- krapp 10y agoPHP isn't at much of a disadvantage - it has its own native JSON encode and decode functions. Granted, actually using javascript is better but it's not as if you have to import a library or write your own JSON parser.
- astrodust 10y agoIt's not the decoding and encoding stuff, every language has that, but the difference in accessing the data. $data['key']['value'][0] is a lot messier than data.key.value[0]. Ruby has ways of mitigating this, but you pay a performance penalty.
- krapp 10y agothat's fair - your only options in PHP are array notation or arrows for objects, dots are much easier.
- astrodust 10y agoThanks to Perl that's used for string concatenation.
- qaq 10y agowell nicer syntax vs not dealing with event loop for me it's nicer to use more verbose syntax. (I guess I am getting tired of Node too :) all thanx to getting spoiled by Elixir.
- TazeTSchnitzel 10y agoThere's also $data->key->value[0], which is the default. But yes, dots are shorter.
- flukus 10y agoThere's a special place in hell for language designers that make you use shift that often.
- TazeTSchnitzel 10y agoI actually began working on a language where you would never press Shift on a typical U.S.-style keyboard.