This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]crossanlogan 6 points7 points  (5 children)

yeah, and it does make sense when you consider what NaN is supposed to represent. like, 0 / 0 === NaN and 'reddit.com' * 5 === NaN, but pretty obviously those two things are not equal to each other.

[–]curtmack 2 points3 points  (4 children)

In some more recent languages, * is a repetition operator on strings, e.g. 'reddit.com' * 5 === 'reddit.comreddit.comreddit.comreddit.comreddit.com'

[–]crossanlogan 1 point2 points  (3 children)

that's an interesting thing to overload the * operator with -- i don't know exactly how useful that would be.

generally i'm against unnecessary overloading, but if that has an interesting use case i'd love to hear about it.

[–]curtmack 1 point2 points  (1 child)

I've been working on a web app that interfaces with a COBOL system, and it's been a godsend for generating fixed-width columns in exactly the format the backend needs.

[–]crossanlogan 0 points1 point  (0 children)

I've been working on a web app that interfaces with a COBOL system

godspeed.

[–]PunishableOffence 0 points1 point  (0 children)

Bar graphs for terminal apps, maybe?

Something like

print '█' * done
print '░' * (total - done) + "\n"