One for BiG D

Zooggy

Junior Administrator
Staff member
Ahey, :)

I actually use that quote all the time.

I don't quite understand the people that think Java "saved the world of computer programming" (of which, there are quite a few, trust me).

I think Java is evil and must be destroyed.

Cheers,
J.
 

thatbloke

Junior Administrator
Ahey, :)

I actually use that quote all the time.

I don't quite understand the people that think Java "saved the world of computer programming" (of which, there are quite a few, trust me).

I think Java is evil and must be destroyed.

Cheers,
J.

Java and Javascript are two very different things...
 

waterproofbob

Junior Administrator
See and there was me trying to be funny. Failed again.

Ahh well back to trawling youtube for Tim Minchin videos, now there is a funny guy.
 

Zooggy

Junior Administrator
Staff member
Ahey, :)

Java and Javascript are two very different things...

ZOMG, my brain is so formatted against the evil that is Java that I didn't even notice that that particular sign was about Javascript... d'oh!

As such, I would like to revise my previous statement:

I actually use that quote all the time, only I use it about Java itself.

I don't quite understand the people that think Java "saved the world of computer programming" (of which, there are quite a few, trust me).

I think Java is evil and must be destroyed.

There, fixed.

Cheers,
J.
 

Ronin Storm

Administrator
Staff member
JavaScript is good because it allows for AJAX.

That said, it's a scripting language and I'm growing tired of guessing where the problem is when it decides that it'll just stop and not tell me where or why. JavaScript just thinks, "hey, I know, this'll be funny, I'll just stop in the middle of doing something but I have no intention of reporting that I've even stopped... I'll just sit here, like a lemon... maybe I'll have a wank, but you'll never know." Yep, it's like that.
 

Wol

In Cryo Sleep
two questions which came up in an interview today:

What does "1" + 2 + 3 evaluate to

What does 1 + 2 + "3" evaluate to

nastyness is nasty.
 

BiG D

Administrator
Staff member
In PHP that's easy. 6, both times.

Javascript I'm not so sure about offhand. First is likely "123", second is either 6 or "33". Yes?

EDIT: Of course, the proper answer is "don't do shit like that."
EDIT2: So I went ahead and tried it. Javascript is indeed "123" and "33", so now you know :p
 

Ronin Storm

Administrator
Staff member
HTML:
<html>
<head>
<title>Test</title>
</head>
<body>
<dl>
<dt>Answer 1:</dt>
<dd>
<script language="JavaScript">
document.write("1" + 2 + 3);
</script>
</dd>
<dt>Answer 2:</dt>
<dd>
<script language="JavaScript">
document.write(1 + 2 + "3");
</script>
</dd>
</dl>
</body>
</html>

... gives results:

Code:
Answer 1:
    123 
Answer 2:
    33
 

Wol

In Cryo Sleep
HTML:
<html>
<head>
<title>Test</title>
</head>
<body>
<dl>
<dt>Answer 1:</dt>
<dd>
<script language="JavaScript">
document.write("1" + 2 + 3);
</script>
</dd>
<dt>Answer 2:</dt>
<dd>
<script language="JavaScript">
document.write(1 + 2 + "3");
</script>
</dd>
</dl>
</body>
</html>

... gives results:

Code:
Answer 1:
    123 
Answer 2:
    33

The easier option is to type "javascript:1+2+'3';" in the address bar of your browser :p.

My answers were "123" and 6, as im more au-fait with keeping the original type of the first var. but it does indeed turn to "33" :cool: Tarded language.

The correct answer *should* be "type mismatch", although I did add " I'm not sure, I dont try and do shit like that"!
 

Ronin Storm

Administrator
Staff member
The correct answer *should* be "type mismatch"

No such thing in a soft-typed language, of course. All JS variables can JIT cast themselves to any other type. Looks like string is preferential on the addition operator. I wonder what would happen with the multiplication operator? Not interesting enough to experiment with, though... ;)
 

DocBot

Administrator
Staff member
hoo boy. I remember a time when I could actually understand this sort of stuff. Now? Give me acid-base homeostasis any day... >_< (I guess there really _is_ only room for that much stuff in the brain..:rolleyes:)
 

thatbloke

Junior Administrator
...And this is PRECISELY why I like strongly typed languages.

Makes stupid things like that that don't make sense not possible.
 

BiG D

Administrator
Staff member
They do make sense. And it's a lot more straightforward than having to cast everything when I want to output a string...
 
Top