Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I hate javascript

Name: Anonymous 2011-09-28 13:24

Currently I am learning how to program windows 8 metro apps using Javascript.

I have some prior experience with javascript, but only with the stuff js was actually designed for: small snippets embedded in HTML code. This is the first time I am developing a complete application in js. And I got to say: the more I learn about it the more I hate it.

-no type safety
-all errors except for the most trivial syntax errors can only be found at runtime when the code in question is executed
-a mistyped member variable of an object, is even silent at runtime, because you needn't declare public member variables of classes, even when using 'use strict'.
-OOP is a joke. Most features which should be standard repertoire of an OOP language are only available through nasty hacks. Most annoying flaw so far: event handlers can't call instance methods*. wtf? how am I supposed to create a proper MVC pattern, when my controllers can't be instanced?

Why do people keep promoting this shit? Sure, you do everything nowadays in a webbrowser, and in a web application, javascript is the only standardized, platform-independent way to have any logic in the client. So you don't get around using JS when you have a web application. But why do people promote this abomination of a language for areas where much more viable alternatives exist? Like stand-alone client applications (windows 8 metro apps) and even server applications (NodeJS).


*They can call them, but they are executed in a static context, not the context of the object, which means that you can't access any member variables.

Name: Anonymous 2011-09-28 13:44

Agreed OP. I sometimes have to use Javascript at work to make in-browser applications, and it's quite painful as a language. Lack of type safety is the most awkward thing, creates a lot of needless code.

It's a relief when I go back to Java at work, and that's saying a lot.

Name: Anonymous 2011-09-28 13:44

Why do people keep promoting this shit?
Because the other reasonably fast dynamic languages, such as Lisp and Lua, have very bad marketing reputation.

But why do people promote this abomination of a language for areas where much more viable alternatives exist? Like stand-alone client applications (windows 8 metro apps) and even server applications (NodeJS).
Because ``Web developpers'' are too dumb to learn multiple languages for multiple purposes.

Name: !L33tUKZj5I 2011-09-28 13:47

I once made a roulette program out of javascript, because I was trying to find a way to beat the system. Figured that all the online ones were closed source, so I couldn't trust them to be fair.
Surprise surprise, I couldn't beat the system.

Name: Anonymous 2011-09-28 13:50

What is your application OP?

Presumably the IE/Windows Javascript interpreter in Windows 8 is faster than previously, or else you're fucked as a developer.

Name: Anonymous 2011-09-28 13:50

key to writing JS: never use this or new. Never mutate objects. Always use closures.

Tada.

Name: Anonymous 2011-09-28 13:54

Currently I am learning how to program windows 8 metro apps using Javascript.
Javascript is the least of your problems.

Name: Anonymous 2011-09-28 13:55

>>1
OOP is a joke

What you fail to realize, young Padawan, is that this is true in the general sense.

Name: Anonymous 2011-09-28 13:57

>>8
It's time to reveal more truth. GC is shit.

Name: Anonymous 2011-09-28 13:58

>windows 8
>laughing_girls.txt

Name: Anonymous 2011-09-28 14:02

Just remember: Microsoft also "bet the entire company" before in .NET and Silverlight.

Windows 9 will relegate all the Metro crap to secondary, deprecated status.

Name: Anonymous 2011-09-28 14:05

>>11

But .NET is actually good... Metro looks like shit.

Name: Anonymous 2011-09-28 14:08

>>12
That's not the point, but yeah, Metro being shit for anything else than toys (phones/tablets) won't help either.

Name: Anonymous 2011-09-28 14:14

>>6

FORCED USE OF CLOSURES, THREAD OVER

Name: Anonymous 2011-09-28 14:43

I love JS

function fibs(words){
    var my=[];
    my.push('[b][i]');
    for(i in words){
        if (i%2==0){
        my.push('[o]');
        my.push(words[i]);
        my.push('[/o]');
        }
   
    else {
        my.push('[u]');
        my.push(words[i]);
        my.push('[/u]');
        }
   
}
    my.push('[/i][/b]');
    return my.join('');
}

Name: Anonymous 2011-09-28 14:47

So lets see, your complaints are:

* It's a dynamic language! But I'm used to static types!
* It's a prototypal object model! But I'm used to classical inheritance!

Listen bro, there are problems with Javascript, but all I see here is user error. Clearly you are versed in paradigms that aren't exploited by Javascript. You have to open yourself up to Javascript's mutability to see how its a strengths. All of the problems you cited aren't actually problems if you program Javascript like its Javascript, and not Java, or Python, or Scheme for that matter (the language from which Javascript takes most of its inspiration).

Good books with stupid names you should look at:
Javascript: The Good Parts, Crockford
Secrets of the Javascript Ninja, Resig

>>6
I have a feeling OP is not really using closures, but I disagree that just because the bound object model can be tricky it means you straight up shouldn't use it.

Name: Anonymous 2011-09-28 14:52

>>15
You are a faggot.

Name: Anonymous 2011-09-28 15:06

>>17
Don't I know you? Oh yeah you're that douche who let 4 fat juicy elephant cocks penetrate your hot virgin arse. How are the piles? Still full of puss and blood, or did your father manage to lick them clean this time?

Name: Anonymous 2011-09-28 16:02

>>18
fuck you faggot

Name: Anonymous 2011-09-28 16:06

>>16
Pig disgusting javascript apologist seeks humiliation and whipping by SICP super men.

Name: Anonymous 2011-09-28 16:05

>>18
fuck you faggot

Name: Anonymous 2011-09-28 16:23

>>16

I might be the only one who read those books and still thinks JavaScript is complete shit.

Name: Anonymous 2011-09-28 16:47

>>22-1,1000-24
huge faggots

Name: Anonymous 2011-09-28 17:32

>>1
metro apps
Faggot

- The Javascript type system sucks.
- In a dynamic language, errors happen in runtime. But logic errors always happen in runtime, dynamic or not, so you better get used to debug your code, faggot.
- A mistyped member or variable is set to undefined. It's retarded, live with it.
- OOP is not what you think it is. You are actually clueless. I bet you're wondering how do you define interfaces, abstract methods or where do you put the "throws Exception" bullshite. gb2/javafaggotry.

Name: Anonymous 2011-09-28 18:08

>>24
stop getting trolled fucktard.

Name: Anonymous 2011-09-28 18:53

Every time I use JS I wish I was using Io instead.

Name: Anonymous 2011-09-28 19:06

>>26
ONE WORD: THE FORCED PARENTING OF OBJECTS, THREAD OVER

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-09-28 19:38

>>24
- OOP is not what you think it is. You are actually clueless. I bet you're wondering how do you define interfaces, abstract methods or where do you put the "throws Exception" bullshite. gb2/javafaggotry.

That is something you learn and master by your second year of college.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-09-28 19:43

>>24
>- In a dynamic language, errors happen in runtime. But logic errors always happen in runtime, dynamic or not, so you better get used to debug your code, faggot.

Okay, after looking at this statement again, I've come to the conclusion that you're also a dumbass. Psst... you're confusing semenatic errors with... never mind. You suck. Go reread your shit OOP book again.

Name: Xarn 2011-09-28 23:23

SLACKWARESUPREMACYSLACKWARESUPREMACYSLACKWARESUPREMACY

Name: Anonymous 2011-09-28 23:24

I think Javascript is my favorite dynamic language. If you are having trouble with the type safety and such, then just program carefullerer. Run your stuff through tons of tests. Consider writing the testing files before you even write the moduleythingymabob. Thoroughly test each moduleithing you make before it is used in anything. Use a lot of discipline when doing OO stuff so your design doesn't get too out there, like modifying classes at run time. If you feel that Javascript is inadequate, you may be able to program a small extension to the language and make appropriate use of it, although this should probably be avoided if the javascript is going to get compiled for something in a phone. Sticking to the core javascript and pretending that it is a more staticy language would probably allow for better optimization.

Name: Anonymous 2011-09-29 0:07

Welcome to the "wonderful" world of JavaScript!


$ js --version
JavaScript-C 1.7.0 2007-10-03
usage: js [-PswWxCi] [-b branchlimit] [-c stackchunksize] [-v version] [-f scriptfile] [-e script] [-S maxstacksize] [scriptfile] [scriptarg...]
$ js
js> 0 == ''
true
js> false == 'false'
false
js> false == '0'
true
js> false == undefined
false
js> " \t\r\n" == 0
true
js> Math.min() < Math.max()
false
js> ",,," == Array((null,'cool',false,NaN,4))
true
js> var foo = [0]
js> foo == foo
true
js> foo == !foo
true
js> function toInt(number) {return number && + number | 0 || 0;}
js> toInt("1")
1
js> toInt("1.2")
1
js> toInt("-1.2")
-1
js> toInt(1/0)
0
js>

Name: Anonymous 2011-09-29 0:18

dynamic typing considered pig disgusting.

Name: Anonymous 2011-09-29 0:49

>>33
Dynamic Typing

( )


Static Typing:

! <+> <> +++ <-> <|> // <$> </> >< ## $$ << <?> ==> !! # $+$ /=? <&>
|+ |- &&? .* .|. <$$> <.> <||> ==? ? \\/ ||? !> $ && &&& &&@ *. -<-
-=- ->- . .&. .&.? .= /=@ /\\ <*> <+ <. <//> <:> <== <=> <=? <=@ <?
<@ <|*|> =<< ==@ >-> >. >:> >=> >=? >=@ >>> >? >@ \\\\ ^ ^^ |* |> ||
||* ||+ ||@ ||| ~: ~? ~~ !!! !-> !.! !>>= $! $$= $=! $> $~ $~! % %:
%= & &&. &> * *& *&&&* *&* ** *** ***** *<<<* *=* *=>* *> *>>>* *|*
+ ++ ++>> +/+ +: += +> +>> - -!- --> -->> -/\\- -::- -< -<=- -=> -?-
-?> -?>> -\\/- -| -|- -~> .$. .+ .++. .--. .-. .->. ... .... ./. ./=
.: .< .<= .== .=> .> .@. .\\. / /+/ /- /=&& /=. /==> /=> /=|| />/ /|
/~ /~? :+ :-> <$ <$?> <* <**> <++ <++> <-$ <-- </=? <<! <<< <<^ <<|
<<~ <=. <==? <@> <|?> =$$= =$= =*= =/= =< =<<! =<= =<>= ==&& ==. ===
===> ==|| =>> =~ =~~ >*> >++> >-- >=. >== >===> >=>=> >> >>= >>=#
>>@ >>^ >|< >||< ?&&? ?+ ?? ?||? @=? @? @?= @@ \\== ^# ^% ^. ^<< ^>>
^^. ^^^ |*| |-| |. |..| |.| |/ |// |: |<- |= |=| |? |\\ |\\\\ ||.
|||| ~=? ~> ~?= ~|||~ ~||~ ~|~ ~~> ~~? ~~~>

Name: Anonymous 2011-09-29 1:01

>>32

stop it..yurgunna scare them away...

But, never fear, the === operator is here!



js> 0 === ''
false
js> false === 'false'
false
js> false === '0'
false
js> false === undefined
false
js> " \t\r\n" === 0
false
js> Math.min() < Math.max()
false
js> ",,," === Array((null,'cool',false,NaN,4))
false
js> var foo = [0]
js> foo === foo
true
js> foo === !foo
false
js> function toInt(number) {return number && + number | 0 || 0;}
js> toInt("1")
1
js> toInt("1.2")
1
js> toInt("-1.2")
-1
js> toInt(1/0)
0
js>

Name: Anonymous 2011-09-29 1:04

>>34
I don't understand.  Static typing has better operators?  Your post looks like bonerlang.

Name: Anonymous 2011-09-29 1:07

>>36

% ghci
Prelude> let (\^.^/) a b = a + b
Prelude> :i \^.^/
(\^.^/) :: (Num a) => a -> a -> a
Prelude> 3 \^.^/ 4
7
Prelude> let (\*^^*/) a b = a - b
Prelude> 7 \*^^*/ 3
4

Name: Anonymous 2011-09-29 1:25

>>32

lesson: =='s coercing rules in javascript is awful. use === always

Name: Anonymous 2011-09-29 1:49

>>37
% ghci
*** Exception: stack overflow

Name: Anonymous 2011-09-29 2:51

3 \^.^/ 4 kawaii desu ne

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List