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

Pages: 1-

javascript

Name: Anonymous 2013-03-27 14:17

https://blog.mozilla.org/blog/2013/03/27/mozilla-is-unlocking-the-power-of-the-web-as-a-platform-for-gaming/

see that? that's the end of native, right there.

got your butthurt cream ready, /prog/?

Name: Anonymous 2013-03-27 14:19

javascript? I guess it's better than flash but how are they going to make games with it? I mean after about 100 lines of code no one will know what the fuck is going on and will need the person who wrote those lines of code to interpret this mess because god knows javascripters don't fucking comment also overuse of clojures considered harmful

Name: Anonymous 2013-03-27 14:23

garbage collector stuttering everywhere
``the end of native''

Name: Anonymous 2013-03-27 14:24

JAVASCRIPT IS PORTABLE BUTTEMBLY.

Name: Anonymous 2013-03-27 14:25

>>3
hey faggot how about you read up on how asm.js works

it doesn't do gc allocations

Name: Anonymous 2013-03-27 14:36

butthurt
LEEEEEEEEL E/G/IN MEME /G/ROSKI XDDDDDDDDDDDDDDDDD
>LE MFW WHEN LE RE/G//G/IT IS BUTTHURT
/G/UTTHURT XDDDDDDDDDDDDDD
>2013
>NOT LEEEELIN/G/ WITH HIS RE/G/G/IT/G/ROS
XDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

Name: Rabbi Chaim Goldstein 2013-03-27 14:38

Another common problem that is often visible with large collections is that on update or change, we render a view for every single model in the collection. While this is sometimes necessary, it can lead to severe performance issues and adversely affect UI responsiveness. Especially on old computers and mobile devices.

An example view:


var SomeCollectionView = Backbone.View.extend({
  initialize: function() {
    var self = this;
    this._views = [];
    // create a sub view for every model in the collection
    this.collection.each(function(model) {
      self._views.push(new SomeModelView({
        model: model
      }));
    });
  },

  render: function() {
    var self = this;
    this.$el.empty();
    // render each subview, appending to our root element
    _.each(this._views, function(subview) {
      self.$el.append(subview.render().el);
    });
  }
});

Name: Anonymous 2013-03-27 14:43

      );
    });
  }
}); leeeeel



ן؛ǝǝǝǝǝן ({
 { 
؛   ({
؛          (

Name: Anonymous 2013-03-27 14:46

Poor Design

    Every script is executed in a single global namespace that is accessible in browsers with the window object.

    Camel case sucks:

 XMLHttpRequest
 HTMLHRElement

    Automatic type conversion between strings and numbers, combined with '+' overloaded to mean concatenation and addition. This creates very counterintuitive effects if you accidentally convert a number to a string:

  var i = 1; 
  // some code
  i = i + ""; // oops!
  // some more code
  i + 1;  // evaluates to the String '11'
  i - 1;  // evaluates to the Number 0

    The automatic type conversion of the + function also leads to the intuitive effect that += 1 is different then the ++ operator:

  var j = "1";
  j++; // j becomes 2
 
  var k = "1";
  k += 1; // k becomes "11"

    The var statement uses function scope rather than block scope, which is a completely unintuitive behavior. You may want to use let instead.

Type System

    JavaScript puts the world into a neat prototype hierarchy with Object at the top. In reality values do not fit into a neat hierarchy.

    It is costly to navigate through __proto__, so prototypal inheritance is problematic.

    You can't inherit from Array or other builtin objects very easily. The syntax for prototypal inheritance also tends to be very cryptic and unusual.

    In JavaScript, prototype-based inheritance sucks: functions set in the prototype cannot access arguments and local variables in the constructor, which means that those "public methods" cannot access "private fields". There is little or no reason for a function to be a method if it can't access private fields.

    JavaScript doesn't support hashes or dictionaries. You can treat objects like them, however, Objects inherit properties from __proto__ which causes problems.

    JavaScript doesn't have real arrays. Instead JavaScript just has objects.

  typeof [1, 2, 3, 4, 5] === "object"

    Arguments is not an Array. You can convert it to one with slice:

  var args = Array.prototype.slice.call(arguments);

    The number type has precision problems.

  0.1 + 0.2 === 0.30000000000000004;

(However, the problem is not the result, which is expected, but the choice of using floating point number to represent numbers, and this is a lazy language designer choice. See http://www.math.umd.edu/~jkolesar/mait613/floating_point_math.pdf ).

    NaN stands for not a number, yet it is a number.

  typeof NaN === "number"
 
  // To make matters worse NaN doesn't equal itself
  NaN != NaN
  NaN !== NaN
 
  // This checks if x is NaN
  x !== x

(Which is as it should be, as per IEEE754. Again, the problem is the indiscriminate choice of IEEE754 by the language designer or implementor.)
Bad Features

(You can bypass many of these bad features by using http://www.jslint.com/)

    JavaScript inherits many bad features from C, including switch fallthrough, the use of = for both assignment and equality, and the position sensitive ++ and -- operators. See C sucks below.

    JavaScript inherits a cryptic and problematic regular expression syntax from Perl.

    Semi colon insertion

  // This doesn't work properly
  return
  {
    "a": 5
  };

    Implied globals:

  function bar() {
    // Oops I left off the var keyword, now I have a global variable
    foo = 5;
  }

    The == operator sucks

  0 == ""
  0 == "0"
  0 == " \t\r\n "
  "0" == false
  null == undefined
 
  ""    != "0"
  false != "false"
  false != undefined
  false != null

    The bitwise operators (& | ^ ~ << >> >>>) are inefficient because they convert their operands to floating point and then back.

    Typed wrappers suck:

  new Function("x", "y", "return x + y");
  new Array(1, 2, 3, 4, 5);
  new Object({"a": 5});
  new Boolean(true);

    parseInt has a really weird default behavior so you are generally forced into adding that you want your radix to be 10:

  parseInt("72", 10);

    The with statement sucks because it is error-prone.

  with (obj) {
    foo = 1;
    bar = 2;
  }

    The for in statement loops through members inherited through the prototype chain, so you generally have to wrap it in a long call to object.hasOwnProperty(name).

  for (var name in object) {
    if (object.hasOwnProperty(name)) {
      /* ... */
    }
  }

    There aren't numeric arrays, only objects with properties, and those properties are named with text strings; as a consequence, the for-in loop sucks when done on pseudo-numeric arrays because the iterating variable is actually a string, not a number (this makes integer additions difficult as you have to manually parseInt the iterating variable at each iteration).

  var n = 0;
  for (var i in [3, 'hello world', false, 1.5]) {
    i = parseInt(i); // output is wrong without this cumbersome line
    alert(i + n);
  }

    There are also many deprecated features (see https://developer.mozilla.org/en/JavaScript/Reference/Deprecated_Features) such as getYear and setYear on Date objects.

Missing Features

    There should be some means of enforcing immutability. Your best bet is the const statement which is non-standard, non-cross browser, and specific to Mozilla. This statement, also doesn't work for JavaScript's most important datatype: objects.

  // It works okay for numbers and strings
  const pi = 3.14159265358;
  const msg = "Hello World"; 
 
  // It doesn't work for objects
  const bar = {"a": 5, "b": 6};
  const foo = [1, 2, 3, 4, 5];
 
  // You also can't easily make your parameters constant
  const func = function() {
    const x = arguments[0], y = arguments[1];
 
    return x + y;
  };

    There should be a more convenient means of writing functions that includes implicit return, especially when you are using functional programming features such as map, filter, and reduce.

  // JavaScript 1.8 introduces a somewhat nicer function syntax with implicit return:
  function(x) x * x

    There is still no particularly good means of looping, so you continue to see staments like these:

  for (var i = 0, l = arr.length; i < l; i++) {}

    You still have to manually perform type checking:

  function substr(str, start, end) {
 
    if (arguments.length !== 3) {
      throw new Error();
    }
 
    if (typeof str !== "string" || typeof start !== "number" || typeof end !== "number") {
      throw new TypeError();
    }
 
  }

    Considering the importance of exponentiation in mathematics, Math.pow should really be an infix operator such as ** rather than a function.

  Math.pow(7, 2); // 49

    no Math.sign or Math.signum function.

DOM

    Browser incompatibilities between Firefox, Internet Explorer, Opera, Google Chrome, Safari, Konqueror, etc make dealing with the DOM a pain.

    If you have an event handler that calls alert(), it always cancels the event, regardless of whether you want to cancel the event or not

  // This event handler lets the event propagate
  function doNothingWithEvent(event) {
     return true;
  }
 
  // This event handler cancels propagation
  function doNothingWithEvent(event) {
     alert('screwing everything up');
     return true;
  }

Name: Anonymous 2013-03-27 15:52

>>6
LLLLLLLLLLLLLEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
>EGINGWINGOIN GWIN GRO!!!!!
>LE XDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

Name: Anonymous 2013-03-27 16:02

>>10
LLLLLLLLLLLLLEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
>EGINGWINGOIN GWIN GRO!!!!!
>LE XDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

Name: Anonymous 2013-03-27 21:16

When there is a significant difference between the parent's and child's sense of the amount of attention needed, the child is often described as seeking excessive or inappropriate attention, particularly if the child is whiny, clingy, silly, or provocative. Children generally seek so-called inappropriate attention when they feel unable to manage their emotions or behavior. Needing extra help is usually a sign that a child is not functioning at his or her best level. We call this regression.

Some children engage in so-called "negative attention-seeking behavior," which involves an effort to provoke a response that they know will be negative. Such behavior should always perplex parents, and cause them to examine the behavior more deeply, because negative attention never feels good to a child - after all, the attention comes with quite a price. Disapproving, irritated, reproachful attention does not fill a child with good feeling any more than such attention feels welcomed by an adult! There needs to be quite a "pay-off" to induce a child to actually seek out such negativity. One possibility is that child has been over-indulged and therefore has not developed age appropriate skills, autonomy, and independence.

Name: Anonymous 2013-03-27 23:35

all games in javascript I've played are horribly deficient and try to pass off the shittiness as ``retro''

Name: Anonymous 2013-03-28 8:10

>>13
here. have some retro fractals
http://www.youtube.com/watch?v=aMAoQj23EnQ

Name: Anonymous 2013-03-29 11:36

>>9
In JavaScript […] functions set in the prototype cannot access arguments and local variables in the constructor, which means that those "public methods" cannot access "private fields".
Local variables are not fields.

Name: Anonymous 2013-03-30 6:15

Google's Native Client sounds cooler

Name: angus 2013-03-30 6:19

HARH

Name: angus 2013-03-30 6:21

HARH

Name: angus 2013-03-30 6:21

HARH

Name: angus 2013-03-30 7:04

HARH

Name: Cloudunphee 2013-03-30 7:08

KODAK THE CAMERA IS ON THE MOVE

Name: Cloudunphee 2013-03-30 7:08

KODAK THE CAMERA IS ON THE MOVE

Name: Cloudunphee 2013-03-30 7:08

KODAK THE CAMERA IS ON THE MOVE

Name: Cloudunphee 2013-03-30 7:08

KODAK THE CAMERA IS ON THE MOVE

Name: Cloudunphee 2013-03-30 7:09

KODAK THE CAMERA IS ON THE MOVE

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