Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18653

Re: [ANN] Barman - Small library to define objects using single-inheritance and traits

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="UTF-8"
Message-ID <5545405.CXyfL3cyKS@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <usenet@PointedEars.de>
Organization PointedEars Software (PES)
Date Wed, 27 Feb 2013 19:39:52 +0100
User-Agent KNode/4.8.5
Content-Transfer-Encoding 8Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: [ANN] Barman - Small library to define objects using single-inheritance and traits
Newsgroups comp.lang.javascript
References <f72e2592-8b9f-472e-b092-ccffcb9437f2@googlegroups.com>
MIME-Version 1.0
Lines 52
NNTP-Posting-Date 27 Feb 2013 19:39:53 CET
NNTP-Posting-Host fd46aee1.newsspool3.arcor-online.net
X-Trace DXC=CH<af<YolYFE4ZB2flKORAMcF=Q^Z^V3H4Fo<]lROoRA8kF<OcfhCOK[iUmQ1SdEVMDZm8W4\YJNLb@mF9jNikdE3>YBYU3JEoM173lCGlHmlK
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.javascript:18653

Show key headers only | View raw


Diego Fernandez wrote:

> There are a lot of similar JavaScript libraries, to name a few: composejs,
> dejavu, classy.

If all of them are as bad as yours then I am not surprised that I have not 
heard of any of them ;-)

> Barman has similarities and differences, so its another option to take
> into account for your tool set.
> 
> I hope that you find it useful. Your feedback is welcome!

BTDT (in JSX:object.js [1]), so I doubt your code would be of value to me.

The following issues in your code are indicative of overall bad code to me 
at a glance:

- You are adding a “__super__” property to an object with non-empty
  prototype chain.  Those property names are reserved for
  implementation-specific behavior;

- You are using a lot of unnecessary wrappers (isUndefined, isFunction, …);

- extend() for-in iterates over inherited properties;

- isObject() does type conversion;

- You are using the word “class” inappropriately several times.  These are
  languages using prototype-based inheritance;

- You are augmenting the host object referred to by “window” when you should
  have augmented the ECMAScript global object as referred to by “this” in
  the global execution context (think “parameters”).

Other than that you do have a sense for good code style, though, which is 
rare in this field, and a plus.

Since you are supporting ECMAScript Ed. 5.x as well (“'use strict'”), you 
should leverage the built-in features that are new in that Edition through 
feature-testing and proper emulation as fallback.  Or you might want to 
provide an ES-5.x-only version.  For either of that, you might want to 
bookmark <http://PointedEars.de/es-matrix> or have a look at

[1] 
<http://PointedEars.de/websvn/filedetails.php?repname=JSX&path=%2Ftrunk%2Fobject.js>.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[ANN] Barman - Small library to define objects using single-inheritance and traits Diego Fernandez <diegof79@gmail.com> - 2013-02-27 08:57 -0800
  Re: [ANN] Barman - Small library to define objects using single-inheritance and traits Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-27 19:39 +0100
    Re: [ANN] Barman - Small library to define objects using single-inheritance and traits Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-28 14:14 +0100
      Re: [ANN] Barman - Small library to define objects using single-inheritance and traits Andrew Poulos <ap_prog@hotmail.com> - 2013-03-01 09:53 +1100
        Re: [ANN] Barman - Small library to define objects using single-inheritance and traits Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-01 00:11 +0100

csiph-web