2 ms·
Either way, I find the syntax of both to be extremely ugly. Arguably this may simply be me not getting JavaScript. Starting a line with ; is just plain weird a
by mrweasel 7y ago
Either way, I find the syntax of both to be extremely ugly. Arguably this may simply be me not getting JavaScript.
Starting a line with ; is just plain weird and the last bit })() seems like German, where all the stuff that you technically not need to understand the sentence is at the end.
Maybe someone can explain with JavaScript developers love anonymous functions so much. Why not just name your function and make the whole thing a bit more readable.
- akamaozu 7y agoNot all JavaScript devs. Love the language, hate the popularity of anonymous functions and non-descriptive variable names. My production code as a sample. http://designbymobi.us/wp-content/uploads/2020/02/rabbitmq-customer-rpc-api.jpg http://designbymobi.us/wp-content/uploads/2020/02/rabbitmq-c...
- mrweasel 7y agoYour code sort of have the same issue. Why not define a function: function someName(p1, p2) {} and then when you need it for something, like a handler, just say: handler: someName
- akamaozu 7y agoHoped to show that JavaScript can be easier to read than you described. Obviously wrong. My mistake.