Official Post Your Random Thoughts (201 Viewers)

Joined
20 November 2018
Messages
65,862
Reactions Received
77,040
Location
Heaven
Cards
View Profile
KS Coins
53,448
Studying two programming languages is confusing. The number zero evaluates to false on a Javascript boolean expression, but it's true on Ruby. An empty string is false on Javascript, true on Ruby. I clearly remember an empty string to be true on C language, and it had to be null to be false. In Pascal, things were clearer. You only could use boolean variables in the place where a boolean was expected. Otherwise, the compiler brought an error. At least it's only two languages. I can imagine them being three or four: boolean soup.
 

bulletproof

✧ @karina is the eva to my noora ✧
.
.
Joined
2 September 2018
Messages
12,423
Reactions Received
54,952
Location
ARMY base 💕
Cards
View Profile
KS Coins
55
Gender
Female
Ship
@bulletproof i keep thinking that your posts are mine if i see your badges bc i see chungha and bts

but then i see v and i'm like oh :haylul:
I didn't see this coming :lisalaugh: but oh, now I won't be able to unsee it
 
  • Haha
Reactions: Yili
Joined
20 November 2018
Messages
65,862
Reactions Received
77,040
Location
Heaven
Cards
View Profile
KS Coins
53,448
When we use the expression 10 * '5' in Ruby, the interpreter brings an error; but in Javascript it brings a result (50). However if we invert the order of the operands ('5' * 10), it brings the same result in Javascript (50), but the result is "5555555555" in Ruby. Fascinating.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Viewing thread