Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2 3 ... 6
  ignore  |  Print  
  JavaScript is a scam  (Read 13499 times)
0 Members and 1 Guest are viewing this topic.
Offline longino

Junior Duke


Medals: 1



« Posted 2011-11-03 00:02:35 »

JavaScript is unsuitable for any serious development.

The only people who think this is good for anything are those who never had to use it for anything beyond little "onclick" scripts on a webapp. Just because Google used it it doesn't make it automatically good.

The crappiness comes from the fact that it doesn't support inheritance. This might not seem a problem for a small app, but as it grows you would need to better organize your code. Some methods might be needed by several objects, thus requiring a component hierarchy.

Well, in JavaScript that's impossible.

Some JavaScript developer might say: "You can simulate it with design patterns." Google it and be afraid of the sheer amount of stupidity you need to suffer in order to get something that resembles sanity.

Why even bother with it? Shouldn't you just use a language that allows you to do what you need done?

JavaScript is just for tiny scripts and that's it. And even then there are better options out there.

The hype for this piece of shit is just unbelievable.
Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2011-11-03 00:15:29 »

Shame isn't it. Hopefully something will come along to oust it.

Cas Smiley

Offline sproingie

JGO Kernel


Medals: 202



« Reply #2 - Posted 2011-11-03 00:53:22 »

Yawn.  Now you're not even trolling the right language.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kaffiene
« Reply #3 - Posted 2011-11-03 01:11:29 »

JS is fine for little web scripts, which is all it was intended for.  The problem is that now people want to do real software engineering client-side and JS just isn't up to the task.  Various people want a JS.next, but putting in all the static typing and contract guarantees that would make JS suit people who want to program large systems will just piss off those who like JS the way it is while never satisfying the static/strict crowd.

The root of the problem is the lack of choice.  The only real answer is to allow programmers to use whatever language they like client side, which can only really be achieved by having browsers running a byte code based VM which users compile or interpret to.

Now, I wonder what kind of VM could handle that task???
Offline theagentd
« Reply #4 - Posted 2011-11-03 01:13:33 »

Why are you complaining about your apple not being an orange? xD

Myomyomyo.
Offline JL235

JGO Coder


Medals: 10



« Reply #5 - Posted 2011-11-03 02:24:14 »

JavaScript is unsuitable for any serious development.

The only people who think this is good for anything are those who never had to use it for anything beyond little "onclick" scripts on a webapp. Just because Google used it it doesn't make it automatically good.

The crappiness comes from the fact that it doesn't support inheritance. This might not seem a problem for a small app, but as it grows you would need to better organize your code. Some methods might be needed by several objects, thus requiring a component hierarchy.

Well, in JavaScript that's impossible.
1  
2  
3  
4  
5  
6  
7  
8  
9  
/* Inheritance */
var Parent = function() {
};
Parent.prototype.foo = function() {
};

var SubClass = function() {
};
SubClass.prototype = new Parent();

There are other ways of building inheritance, which also depends on how you build your classes. In some ways I'd say JS as a language is kinda lower level then Java, in that you can build most forms of abstraction in pure JS. Classes, modules, local functions (private to one section of code), static functions, classes, inheritance, multiple inheritance, aspect oriented programming, or something custom. You can build it all!

I've also written a whole programming language and several web applications in JS, and I much prefer it to Java. I also much prefer HTML/CSS to Swing. I get far more control, and it's easier to build a wide variety of components, whilst having far less cruft to deal with. I can just concentrate on getting the job done.

There is a bit of a learning curve, to learn all of these tricks you can perform. But once your over it, it's bliss.

Have you ever built a proper application using JS?

Offline sproingie

JGO Kernel


Medals: 202



« Reply #6 - Posted 2011-11-03 02:39:28 »



Something tells me the author neither knows javascript nor cares.  YHBT.  HAND.

Offline Roquen
« Reply #7 - Posted 2011-11-03 07:17:10 »

The crappiness comes from the fact that it doesn't support inheritance.

Errr...Not having inheritance is, like, the whole point.
Offline JL235

JGO Coder


Medals: 10



« Reply #8 - Posted 2011-11-03 08:16:49 »

JS is fine for little web scripts, which is all it was intended for.
This is not actually true. For example NetScape brought out server side JS just a year after it's release. It was always intended for more then just client-side scripting.

Offline cylab

JGO Ninja


Medals: 52



« Reply #9 - Posted 2011-11-03 09:02:03 »

It still is, see NodeJS for example.

@longino
It seems that you have no clue or whatever about JavaScript. Just consider to really learn a language before complaining about it...

Mathias - I Know What [you] Did Last Summer!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2011-11-03 11:13:07 »

The root of the problem is the lack of choice.  The only real answer is to allow programmers to use whatever language they like client side, which can only really be achieved by having browsers running a byte code based VM which users compile or interpret to.

Now, I wonder what kind of VM could handle that task???
Spot on.

Cas Smiley

Offline JL235

JGO Coder


Medals: 10



« Reply #11 - Posted 2011-11-03 12:31:18 »

The root of the problem is the lack of choice.  The only real answer is to allow programmers to use whatever language they like client side, which can only really be achieved by having browsers running a byte code based VM which users compile or interpret to.

Now, I wonder what kind of VM could handle that task???
The only improvement I know of over the last 5 years to Applets is the ability to use JNLP files. The JVM might be amazingly fast, but a lack of applet development, and terrible start up times makes it practically unusable for the web. It's also far more hassle to put an applet together then to build something JS powered.

But in terms of having a VM to target, rather then JS, I used to think this would be a good idea too. Now I'd rather see a high-level intermediate language, like C--, as it would be much easier to target. If they allow the same, then there is no benefit in having to output bytecodes over ASCII text (the latter is much easier to work out and debug).

Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #12 - Posted 2011-11-03 12:42:46 »

Not as in applets, but as a general purpose execution engine with access to the DOM, just like JS has. Applets are a dead technology - Flash probably going the same way too along with all other plugins. HTML5 ftw.

Also, startup time need not be slow at all. Firstly, if Flash can start up instantly, then brilliant. Secondly, look at JamVM and Dalvik. Perfect. The ability to embed script as base64 encoded jars would be awesome.

Cas Smiley

Offline Son Of Cain

Junior Duke





« Reply #13 - Posted 2011-11-03 12:54:09 »

Could Dart be a first step in the right direction, then?
Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #14 - Posted 2011-11-03 12:55:19 »

Dart sounds like a great big Google NIH and will flop, having no compelling reason to exist other than JavaScript-nerd-envy.

Cas Smiley

Offline Son Of Cain

Junior Duke





« Reply #15 - Posted 2011-11-03 12:57:13 »

It does compile to ECMAScript (to be compatible with other browsers), and does compile to a VM, which will be embedded in Chrome, and the promise goes, available to other browsers as well. At least in theory, it could work... but I share some of your concerns, too.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #16 - Posted 2011-11-03 12:58:09 »

That 'general purpose execution engine with access to DOM' is already here, and it's JS. There's more and more languages and frameworks targeting JS as their eventual output format. Sure it's a big chunky ascii format rather than bytecode, but that's pretty much the only disadvantage IMHO.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #17 - Posted 2011-11-03 13:08:11 »

That, and the fact it's never going to be as fast as straightforward Java bytecode can be due to the design of JS. And of course all of these JS-targeting things are riddled with incompatibilities and bugs. It makes no real sense.

Cas Smiley

Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #18 - Posted 2011-11-03 13:09:42 »

LLVM bytecode would be another decent contender but much of the attraction of Java is the existence of a well-understood and decent platform of APIs. It is indeed the only reason I've bothered looking at Android.

Cas Smiley

Offline longino

Junior Duke


Medals: 1



« Reply #19 - Posted 2011-11-03 13:18:03 »

There are other ways of building inheritance, which also depends on how you build your classes.

Like I said before, Javascript developers will try to convince others that using convoluted Design Patterns for simulating inheritance is actually a good thing.

No, it isn't. It is still crap. Your code (that is supposed to look simpler than Java, right?) will look like diarrhea.

It is easier just to use the right tool for the job. And JavaScript isn't suitable for any job.

In some ways I'd say JS as a language is kinda lower level then Java, in that you can build most forms of abstraction in pure JS. Classes, modules, local functions (private to one section of code), static functions, classes, inheritance, multiple inheritance, aspect oriented programming, or something custom. You can build it all!

No, you can't.

You can stuff functions inside of objects, and that's all. That's not metaprogramming.

You want to see real metaprogramming. Try Lisp. Your jaw will hit he floor and I promise you will never ever want to touch this filthy Javascript again. It is like the difference between a bicycle and the starship Enterprise.

I've also written a whole programming language and several web applications in JS, and I much prefer it to Java. I also much prefer HTML/CSS to Swing. I get far more control, and it's easier to build a wide variety of components, whilst having far less cruft to deal with. I can just concentrate on getting the job done.

The quality of your "programming language" must really low. Javascript doesn't allow simple things that would make good design.

There is a bit of a learning curve, to learn all of these tricks you can perform. But once your over it, it's bliss.

Have you ever built a proper application using JS?

No, it isn't. I tried and the more I learned the more outraged I got for being forced to work in such a primitive way. There are a dozen languages out there, especially on the JVM, that do a much better job.

JavaScript simply lacks many constructs that you get for free in more advanced languages.
Offline Roquen
« Reply #20 - Posted 2011-11-03 13:23:25 »

Now I'd rather see a high-level intermediate language, like C--, as it would be much easier to target. If they allow the same, then there is no benefit in having to output bytecodes over ASCII text (the latter is much easier to work out and debug).

+1 to high level IR.  And esp. a tree structured IR rather than "flat".  Couldn't really care less about how it's transported (bytecode or source).

As much I as like LLVM, it's not the ideal (IHMO) transport method.  But it would be much better than anything we have today.
Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #21 - Posted 2011-11-03 14:20:24 »

From my perspective the ideal transport method is lzma pack200'ed jar files Smiley I suppose only time and motivation is stopping someone hacking on Chrome to implement JamVM like this. Would be exactly what the HotJava browser failed to be*

Cas Smiley

* He had found a Nutri-Matic machine which had provided him with a plastic cup filled with a liquid that was almost, but not quite, entirely unlike tea.

Offline sproingie

JGO Kernel


Medals: 202



« Reply #22 - Posted 2011-11-03 15:56:19 »

There are some advantages to a source-level specification and not a bytecode one -- different architectures can compile it in radically different ways, which is harder when you have assumptions about a machine model encoded into lower level code.  That's the rationale the OpenGL ARB gives for not having a bytecode format for GLSL anyway, and it's a little bit weak but not totally without merit.  Same argument could possibly apply to the scripting runtime for browsers too.  I think we can all agree that Javascript is a pretty terrible compiler target though.
Offline JL235

JGO Coder


Medals: 10



« Reply #23 - Posted 2011-11-03 16:16:21 »

From my perspective the ideal transport method is lzma pack200'ed jar files Smiley I suppose only time and motivation is stopping someone hacking on Chrome to implement JamVM like this. Would be exactly what the HotJava browser failed to be*
Web servers and browsers already support compression whilst sending over data. It would be much better to have better compression there, so HTML, CSS and other items can benefit too. However I heavily disagree about wrapping it all up into one file. It prevents parallel downloads, using multiple CDNs, works against caches and increases startup time longer. Any large web game or application should also have it's content streamed as you are using/playing it, so it appearers like it downloads instantly. More should be done to make this more natural then it currently is. Wrapping all content into one file is like taking a step back from that.

I think we can all agree that Javascript is a pretty terrible compiler target though.
If you use === instead of == in your language, then most of the quirks (like 0 == '') go away. All of the closure and prototype stuff then allows you to build pretty much anything on top, as it's such a flexible language. So I'd disagree with you.

Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #24 - Posted 2011-11-03 17:18:46 »

Funny, I use JavaScript daily and run a single-page-app framework with thousands of lines of code and I'm using classes. Seems to work just fine. And it's not a regular web page app, it's designed for television, meaning all input interaction must be coded and handled in code.

Just because you don't know better doesn't make JavaScript bad, there are tons of libraries out there, frameworks, etc. that can help tremendously.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Cero
« Reply #25 - Posted 2011-11-03 18:01:55 »

being neutral toward JS
I gotta say "scam" ?  It's free and nobody forces you to use it (besides maybe your employer) - so how is it a scam ? =P

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #26 - Posted 2011-11-03 18:36:48 »

You're barking up the wrong tree, this is a Java forum. Other than that, Javascript is an excellent language once you grasp the specification. It's a functional language that looks like an object orientated language, which causes a lot of confusion and results in incredibly crappy example code and tutorials all over the interwebs. Please don't let the incompetence of others influence your perspective on this language. The only thing Javascript desperately needs is a rocksolid IDE.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Son Of Cain

Junior Duke





« Reply #27 - Posted 2011-11-03 18:45:43 »

I kinda like http://jsfiddle.net/..
Offline longino

Junior Duke


Medals: 1



« Reply #28 - Posted 2011-11-03 19:13:19 »

Funny, I use JavaScript daily and run a single-page-app framework with thousands of lines of code and I'm using classes. Seems to work just fine. And it's not a regular web page app, it's designed for television, meaning all input interaction must be coded and handled in code.

Just because you don't know better doesn't make JavaScript bad, there are tons of libraries out there, frameworks, etc. that can help tremendously.

You can't be using classes, because Javascript doesn't have them. You are using a hack you think it is smart because nobody else noticed how much time you waste with this crap yet.
Offline longino

Junior Duke


Medals: 1



« Reply #29 - Posted 2011-11-03 19:15:37 »

You're barking up the wrong tree, this is a Java forum. Other than that, Javascript is an excellent language once you grasp the specification. It's a functional language that looks like an object orientated language, which causes a lot of confusion and results in incredibly crappy example code and tutorials all over the interwebs. Please don't let the incompetence of others influence your perspective on this language. The only thing Javascript desperately needs is a rocksolid IDE.

I know exactly what JavaScript can and cannot do. And it is far from excellent. As a matter of fact it is the exact opposite of it.

Functional and object orientation aren't mutually exclusive, so I don't know what you mean there. JavaScript code looks like crap because the language itself is crap and the developer is fighting all the way through in order to get something sensible running.

Pages: [1] 2 3 ... 6
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (37 views)
2014-10-17 03:59:02

Norakomi (28 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (52 views)
2014-10-14 00:39:48

TehJavaDev (54 views)
2014-10-14 00:35:47

TehJavaDev (42 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (77 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!