1537: "Types"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

User avatar
Echo244
Posts: 511
Joined: Wed May 20, 2015 9:49 am UTC
Location: Ping! Ping! Ping! Ping!

Re: 1537: "Types"

Postby Echo244 » Sat Jun 13, 2015 9:43 am UTC

<Applauds that last one, wildly>
Unstoppable force of nature. That means she/her/hers.
Has committed an act of treason.

AngryTribble
Posts: 1
Joined: Sat Jun 13, 2015 10:12 am UTC

Re: 1537: "Types"

Postby AngryTribble » Sat Jun 13, 2015 10:33 am UTC

NOOOOOOOO!!!

I remember all to well a "Professional Developer" using the string "Null" all through his Visual Basic database application.
He finally got the damned thing working, Kinda, and expected me to deploy it on 400 machines.

I asked him to show me how to deploy it on 3, consistently. That got him out of my hair for another couple of months. Finally after a huge amount of exasperation I showed him where the dependancies were stuffing up. Job done, he moved on. Bastard was on better money and less stress. Found out a few years later he'd move onto a plum defense contracting job, supplying software. The only thing I knew about the submarine project was that the combat software blue screened so often it was preventing them from firing torpedos for the first trial runs, and was eventally abandoned.

User avatar
chridd
Has a vermicelli title
Posts: 843
Joined: Tue Aug 19, 2008 10:07 am UTC
Location: ...Earth, I guess?
Contact:

Re: 1537: "Types"

Postby chridd » Sun Jun 14, 2015 7:13 am UTC

[4] is sort of like Perl's magical auto-increment operator:

Code: Select all

> $x = NaN;
NaN
> ++$x;
NaO
> ++$x;
NaP
(NaN is actually a string here (unlike Ruby, Perl supports barewords). If you get a real NaN—which you can't get with 0/0 because that's an error, but you can with 1e310-1e310—then it won't increment like that.)
~ chri d. d. /tʃɹɪ.di.di/ (Phonotactics, schmphonotactics) · she · Forum game scores
mittfh wrote:I wish this post was very quotable...

User avatar
staticsan
Posts: 6
Joined: Fri Dec 12, 2008 1:56 am UTC

Re: 1537: "Types"

Postby staticsan » Sun Jun 14, 2015 10:41 am UTC

Some creative ideas in that list, I have to say. I particularly like colors.sort() returning "rainbow". So long as "rainbow" is usable elsewhere where a colour set is required, I'd use it.

Lock-of-fear
Posts: 2
Joined: Sun Jun 14, 2015 4:00 pm UTC

Re: 1537: "Types"

Postby Lock-of-fear » Sun Jun 14, 2015 4:14 pm UTC

First this is hilarious to me. If you don't know what week typing is and the kind of moronic behavior it can result in It's probably not funny. I still remember a number of years ago before I understood javascript trying to add the results of two number I got from a form. I ended up with code that looked like value1*1+value2*1 . A very good example of why week typing is NOT helpful to beginners.

rmsgrey
Posts: 3633
Joined: Wed Nov 16, 2011 6:35 pm UTC

Re: 1537: "Types"

Postby rmsgrey » Sun Jun 14, 2015 6:10 pm UTC

AngryTribble wrote:I asked him to show me how to deploy it on 3, consistently. That got him out of my hair for another couple of months. Finally after a huge amount of exasperation I showed him where the dependancies were stuffing up. Job done, he moved on. Bastard was on better money and less stress. Found out a few years later he'd move onto a plum defense contracting job, supplying software. The only thing I knew about the submarine project was that the combat software blue screened so often it was preventing them from firing torpedos for the first trial runs, and was eventally abandoned.


Any chance of getting him employed by {insert traditional enemy here}' s armed forces?

User avatar
orthogon
Posts: 3078
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1537: "Types"

Postby orthogon » Sun Jun 14, 2015 9:53 pm UTC

rmsgrey wrote:
AngryTribble wrote:I asked him to show me how to deploy it on 3, consistently. That got him out of my hair for another couple of months. Finally after a huge amount of exasperation I showed him where the dependancies were stuffing up. Job done, he moved on. Bastard was on better money and less stress. Found out a few years later he'd move onto a plum defense contracting job, supplying software. The only thing I knew about the submarine project was that the combat software blue screened so often it was preventing them from firing torpedos for the first trial runs, and was eventally abandoned.


Any chance of getting him employed by {insert traditional enemy here}' s armed forces?

Maybe he already was... ( du du derrrrrrr...)
xtifr wrote:... and orthogon merely sounds undecided.

gcgcgcgc
Posts: 48
Joined: Sun Nov 10, 2013 1:18 pm UTC

Re: 1537: "Types"

Postby gcgcgcgc » Mon Jun 15, 2015 8:21 am UTC

Surprised no-one's mentioned http://wtfjs.com/ yet... this comic won't seem so far-fetched afterwards...

Lock-of-fear
Posts: 2
Joined: Sun Jun 14, 2015 4:00 pm UTC

Re: 1537: "Types"

Postby Lock-of-fear » Wed Jun 17, 2015 12:39 am UTC

gcgcgcgc wrote:Surprised no-one's mentioned [link removed because it was tripping the spam filter] yet... this comic won't seem so far-fetched afterwards...

I think your link is pretty poor, that first code piece there isn't a javascript quirk that's a regex quirk, or possibly even an ascii quirk.

Code: Select all

[A-z] includes [a-zA-Z]
and

Code: Select all

\ [ ] ^ `
The uppercase and lower case alphabets aren't contiguous there's a few characters between them (including backslash). That poster wants

Code: Select all

/[a-zA-Z]/.test
or

Code: Select all

/[a-z]/i.test
(case insensitive flag).

Gargravarr
Posts: 74
Joined: Mon Dec 21, 2009 8:34 am UTC

Re: 1537: "Types"

Postby Gargravarr » Tue Jun 23, 2015 8:44 am UTC

Inspired by PHP?

PsiSquared
Posts: 126
Joined: Wed May 09, 2012 6:02 pm UTC

Re: 1537: "Types"

Postby PsiSquared » Sun Jun 28, 2015 2:48 pm UTC

igorlugosi wrote:Ha ha, line 11 changes the value of 2 FOREVER!


I remember a language from the 1970's which did something similar. You couldn't change the value of '2', but you could change the value of factorials:

> 2+2
4
> 5!
120
> 5!+10
130

So far so good, but look at this:
> 5!=42
42
> 5!+10
52

And you were 'stuck' with the new value (42 in this case) until the end of the session (or until you manually changed it again).

rmsgrey
Posts: 3633
Joined: Wed Nov 16, 2011 6:35 pm UTC

Re: 1537: "Types"

Postby rmsgrey » Sun Jun 28, 2015 4:06 pm UTC

PsiSquared wrote:
igorlugosi wrote:Ha ha, line 11 changes the value of 2 FOREVER!


I remember a language from the 1970's which did something similar. You couldn't change the value of '2', but you could change the value of factorials:

> 2+2
4
> 5!
120
> 5!+10
130

So far so good, but look at this:
> 5!=42
42
> 5!+10
52

And you were 'stuck' with the new value (42 in this case) until the end of the session (or until you manually changed it again).


But did the change affect the value of any other factorials? What happened to 6! when you changed 5! ? And if it didn't change for small factorials, are there larger values where it does? Or do they just use a look-up table up until you can start approximating?

PsiSquared
Posts: 126
Joined: Wed May 09, 2012 6:02 pm UTC

Re: 1537: "Types"

Postby PsiSquared » Mon Jun 29, 2015 3:56 am UTC

rmsgrey wrote:But did the change affect the value of any other factorials? What happened to 6! when you changed 5! ? And if it didn't change for small factorials, are there larger values where it does? Or do they just use a look-up table up until you can start approximating?


As far as I remember, the values were independent. Changing 5! did not affect the result for 6!.

So I suspect it was a look-up table all the way. My guess is that (x)! was simply treated as an ordinary variable with a preset default value.

At any rate, the look-up table would be quite small. As far I remember, the numbers where all single precision. So anything above 33! or 34! would overflow anyway.

Keybounce
Posts: 103
Joined: Fri May 29, 2009 1:41 am UTC

Re: 1537: "Types"

Postby Keybounce » Fri Jul 17, 2015 6:56 am UTC

What happened to line 12? And why are 13 and 14 reversed order?
<this space on hold>

User avatar
Pfhorrest
Posts: 5447
Joined: Fri Oct 30, 2009 6:11 am UTC
Contact:

Re: 1537: "Types"

Postby Pfhorrest » Fri Jul 17, 2015 7:34 am UTC

Keybounce wrote:What happened to line 12? And why are 13 and 14 reversed order?

On line 11, the value of 2 was permanently increased by 2, so every 2 is now a 4. So line 12 is now line 14 (because the 2 in "12" became a 4). Line 13 after it is unaffected. If there were a line after 13, I assume it would be 14 again, which could be a problem.
Forrest Cameranesi, Geek of All Trades
"I am Sam. Sam I am. I do not like trolls, flames, or spam."
The Codex Quaerendae (my philosophy) - The Chronicles of Quelouva (my fiction)

Keybounce
Posts: 103
Joined: Fri May 29, 2009 1:41 am UTC

Re: 1537: "Types"

Postby Keybounce » Fri Jul 17, 2015 4:19 pm UTC

Ahh; then that also explains the range() function.

Still, I suppose we could just sort the list if there's four 14's, right?

(Just saw the comic on sorting ...)
<this space on hold>


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: moody7277, ZoomanSP and 44 guests