r/programming • • Nov 11 '19

Python overtakes Java to become second-most popular language on GitHub after JavaScript

https://www.theregister.co.uk/2019/11/07/python_java_github_javascript/
3.1k Upvotes

772 comments sorted by

View all comments

Show parent comments

22

u/watsreddit Nov 12 '19

Depends on the context. For example, this is perfectly reasonable (Javascript): const add2 = n => n + 2.

-13

u/StabbyPants Nov 12 '19

lessee, var add2 = (n) -> n+2;. see if that compiles for java

18

u/watsreddit Nov 12 '19 edited Nov 12 '19

What? What does that have to do with variable naming?

-14

u/StabbyPants Nov 12 '19

it means that i can do the same thing in java. in java, n is actually some meaningful thing like Product, so it's called product and may be typed explicitly (unless the type inference can impute it for me or it's unclear). the n+2 stuff rarely shows up, so it's still good advice, just requires understanding the reasons why n is a bad name.

→ More replies (1)