Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
operator not self-explanatory 9 // 2 #1039
Hey, can you say a bit more about how you came across this operator? Is there something that could be added that would make it easier? Perhaps in the documentation or elsewhere.
Please let me know more about your situation so we can try to think of ways to make it less confusing!
As another user whose comment has been removed said. The // operator is in the docs. But you have a point. Unlike the / operator which every kid learns in school // is not taught in school because its not general. But if we follow that logic we would have to remove ^ as exponent as in school we learn that superscript is the way to annotate exponents. The // operator has its roots in python as far as I know and most people know it from python. Integer dividing is important in the Web for styling things, so making the operator longer wouldn't be great as it would add unnecessary complexity. In Morse for example the e is a single dit (.), because it is used often. If the e were let's say dit dit dah dit (..-.) it would be slow to Morse. Same applies to programming language. Verbose features tend to be used less/only if needed. Elm language design respects that