[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
ugh why
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 22
Thread images: 3
File: javascripttypesystem.png (5 KB, 131x265) Image search: [Google]
javascripttypesystem.png
5 KB, 131x265
Just why, /g/?
>>
>>54579992
learn how to objects and the difference between string compare and integer compare
>>
>0777
In every decent language prefixing a number with 0 means it's base 8, 0777 is actually 511
>>
Two empty arrays not being equal is completely fine because they are two different objects with different memory location.

0777 being larger than 800 and 600 is also false in real world because 0777 is 511 in octal notation.

I don't even like JS but try harder with your bait next time.
>>
File: 1459305665819.png (417 KB, 500x700) Image search: [Google]
1459305665819.png
417 KB, 500x700
>ugh
kys faggot
>>
>>54580023
>In every decent language prefixing a number with 0 means it's base 8
C was the JavaScript/PHP of its time.
>>
>>54580023
That happens in literally no language ever.
>>>/reddit/

>>54580038
>>54580023
Nice samefag, retard.
>>
>>54580196
No, php is web c but even less rules
>>
>>54580196
No, it was the java of its time.
>slow as balls
>buggy as shit
>impossible to write stable software with it
>high-level and bloated
>worse than pretty much everything else currently available in every possible way
>>
Even better:
{} + []
> 0
[] + {}
> "[object Object]"
>>
>>54580199
>That happens in literally no language ever.
It happens in a lot of languages but a lot of them have also switched to "0o" notation instead to make it less vague.
>>
>>54580267
Oh yeah:
{} + 3
> 3
3 + {}
> "3[object Object]"
>>
>>54580283
>but all of them only ever had
FTFY
>>
>>54580244
This, mesa, CPL and various Algol was better.

>>54579992
At least the first two are actually pretty logical, anon.
>>
>>54580327
I can understand
[] == []
because it's comparing them by identity, but
[] == ![]
being true makes no sense at all. ![] evaluates to false. It also means [] sometimes acts like true and sometimes acts like false.
>>
>>54580430
Silly me, I read !==. You're right of course.
>>
>>54580430
the jit probably just compiles to []!=[]
>>
File: 1452234790855.jpg (8 KB, 250x244) Image search: [Google]
1452234790855.jpg
8 KB, 250x244
>>54580063
this picture just gave me 90's nostalgia. Anyone else? Looks like one of those Disney movies kek
>>
>>54580267
>>54580309
>{} + []
+[] is 0
automatic ; insertion makes that into {}; +[], thus 0.
>[] + {}
+ joins the array with ',' then appends the rest, treats {} as object literal and converts to string
>{} + 3
Also works with {}+"3"(=3) and doesn't with {}+"a"(=NaN)
same auto semicolon bullshit removes the {} part, and then an unary plus tries to convert shit to number
>3 + {}
converts both to string

The "{} + shit" isn't really an issue because it doesn't happen with variables, and the rest kind of makes sense.
>>
Can you guys post all them images you have of the guy holding the degree with the bad code at the side.

Nothing gets me like those.
>>
>>54580327
>This, mesa, CPL and various Algol was better.
The real problem is that schools don't teach these languages. People say C strings are "character arrays" but C strings aren't safe because it doesn't have real arrays.

It wasn't 0 vs 1 based, but 0 vs arbitrary lower bounds with 1 as a default. Fortran, BASIC, Algol 60/68, PL/I, Pascal, Ada, and so on allowed arbitrary lower bounds and had multidimensional arrays too.

Some students today believe that that null-terminated strings were an improvement over other kinds of strings.
>>
>>54581850
Fuck C strings though
I'd rather do them manually instead of their arbitrary rules.
Thread replies: 22
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.