« first day (1287 days earlier)      last day (3662 days later) » 

11:03 AM
What does super_ mean in JavaScript? I don't see any documentation which talks about it
 
@thefourtheye sounds like a private variable pointing to the superclass. Not enforced or provided by the environment.
 
@JanDvorak Thanks I think I figured out. Looks like Node.js's util.inherit adds that it seems
 
@thefourtheye yeah it does that.
 
@BenjaminGruenbaum Thanks for confirming. Where can I find the source of that function?
 
@thefourtheye joyent/node lemme find it real quick for you
 
11:08 AM
Oops, I was checking this project github.com/defunctzombie/node-util
ctor.super_ = superCtor;
@BenjaminGruenbaum Thanks man :)
 
sure.
You rarely want to touch super_ though.
 
@BlueClouds Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
ES6 does this more elegantly with symbols.
 
@BenjaminGruenbaum Like to read more about it, do you blog somewhere?
 
@thefourtheye I don't know any place that explains symbols right except for huge ESDisucss discussions which are not worth reading :P Right now all object properties are strings, and you can't hide anything. A symbol is like a unique string.
A symbol is a unique value you can use as an object key, and you can't access that object value if you don't have a reference to the symbol.
 
11:12 AM
@BenjaminGruenbaum Symbol("A") is different than Symbol("A") ?
 
Yes.
Imagine, if you could use objects for keys you'd do:
var super = {}; // unique object reference
obj[super] = assignSuper(); // doesn't work since objects are strings.
// now other code that doesn't have the reference to super doesn't touch it, unless it uses reflection
 
reflection? in JavaScript? How do I do that?
 
@thefourtheye you do it all the time. A for... in loop is reflective. A Object.keys is reflective, etc.
 
@jAndy vanilla. I rarely like to use frameworks and I prefer to go as light as possible
 
Object.getOwnSymbols or something like that for symbols, iirc.
@jAndy that really depends on the use case. No one can really answer that question.
 
11:15 AM
@BenjaminGruenbaum yea I just realized
but as is, its pretty much the question about personal preference and "why would I choose to use vanilla over Backbone" for instance
 
@jAndy why are you asking?
@jAndy ah, I can answer that. Backbone makes a lot of assumptions without really giving you anything in return at all.
 
@wasatz Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
The event emitter is basic and not very good, the 'router' is poorly implemented and limited to URLs, and the fact you have to wrap objects in Backbone.model is absurd.
 
we're deciding (company wise) what our route will be the next years, pretty much consolidating which architecture we're using
 
oh cool.
 
11:17 AM
so from a company wide point of view, theres different arguments
 
Yeah, that's actually an interesting decision to make. I would not choose any framework.
 
personally I'd always go with vanilla, require, promises
but .. from the company perspective, its probably more efficient to use something even like Ember
 
Ember uses promises extensively fwiw.
 
@BenjaminGruenbaum Office 365 download something ?
 
just for the reason that you have a zillion of pre-made gui elements.. you don't have to waste employees time with
 
11:18 AM
We use a lot of different frameworks at TipRanks, I have Angular and Knockout in production, and a lot of vanilla code. I migrated all our large codebases to promises half a year ago and never looked back.
@jAndy spending time getting assumptions someone made about a component is almost as time consuming as tailoring one for the use case. Architecture and tooling over choosing frameworks imo.
 
@BenjaminGruenbaum But, this is possible, right?
var super1 = {}, obj = {};
obj[super1] = 1;
console.log(obj["[object Object]"])
 
psh i agree with Benjamin about Angular
not so much about knockout
 
@BenjaminGruenbaum I'd agree
 
and even WinJS feels better then vanilla at times. [please add tons of jQueriez when i say vanilla ]
 
@BenjaminGruenbaum what did you use for the promises ?
 
11:20 AM
BlueBird ! // $10 on that
 
$10 what ?
 
@jAndy If I could offer you only one tip for the future, Bluebird would be it. The long term benefits of long stack traces, and debug information have been proved by scientists whereas the rest of my advice has no basis more reliable than my own meandering experience… :D
(sorry for pings)
 
@BenjaminGruenbaum I was expecting a ping :D
 
power editing :P
 
@BenjaminGruenbaum Interesting. Would you say the same about your sexual performance?
JOKES
 
11:22 AM
@jAndy Bluebird, it's the fastest by far, but more importantly for clientside it has AMAZING stack traces and it's very easy to debug and work with. Also, if I really want a feature I just ping Esailija :P
I'd use require over browserify if not using Node since it saves a build step.
 
blubird is open source licenzed ?
 
I'd use a build server, having a CI server really helps, it ensures no code breaks and it encourages writing tests. I'd use Mocha.
@jAndy yes, of course github.com/petkaantonov/bluebird .
I would not insist on Angular/Ember/etc , but I would encourage developers to read on and consider spending more time on architecture. Also, make sure everyone knows how to refactor.
 
we don't plan on refactoring existing code-bases. That would be beyond sick. Its like "start from scratch"
 
@Jamie 420, help, listen, eval, coffee, refresh, forget, info, listcommands, tell, afk, awsm, ban, unban, color, convert, define, doge, domain, findcommand, github, google, hang, inhistory, jquery, learn, aliens, fa, easytools, wherearethegoats, tobacconist, joystick, fools, cake, cool, vengeance, ln, protip, slidepoop, zirak_naked, loktar, artisticpoop, crustypoop, buttstuff, poopkittie, daybreak, rfc, man, ಠ_ಠ..., getit, resources, html5unleashed, jspattern, ajax, xhr, guesswhat, amazon
ihazbukkit, solution, sandbox, gayclubs, kumar, echo, pizza, wherearemypants, yourwrong, martyhuggi
 
!!tell Jamie sandbox
 
11:26 AM
@BenjaminGruenbaum Don't be annoying, drop the @, nobody likes a double-ping.
 
!!echo STAHP
 
STAHP
HAMMAHTIME!
@Jamie You know, there was this funny idea once upon a time that people were supposed to test out commands and "play" in the sandbox
HAMMAHTIME!
 
could I d something like deleting the message by !!/
 
lol ?
oh she also considered my stahp :P
 
glad you tell me about the sandbox I can't find it in the rules.javascriptroom.com I haven't got the link there.
 
11:27 AM
Just personal opinion: You want to be sure everyone knows what an event emitter is, what an observer is, what a router is, what a promise is, etc, all the fundamental design patterns - all the language gotchas (like closure loop). You want one way to define classes (using new and constructors is sadly the way to go for in big apps). As well as defining things on the prototype etc.
 
wait is this room monadic now?
 
we're going with pure object composition, no new at all
 
More importantly, everyone should be aware of the problems the patterns solve , everyone needs to know the importance of separated presentation in code, etc.
@BartekBanachewicz I figured you'd like it.
 
oh I sure do
 
@jAndy the problem with that approach is that engines give you poor stack traces when you don't name your objects. So new Foo will tell you the object is a Foo where return {...} does not.
 
11:28 AM
@KarthickPandiyan Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
That information is invaluable when debugging, especially remotely. Also, even if you do object composition I'd put methods on the prototype etc.
 
ohhh ohhhh :)
 
No code gets committed if it doesn't pass JSHint etc (generally tests, back to the CI server).
 
@jAndy this looks like excessive/premature normalization, especially if you target "the next years". Technics and practices change
 
@BenjaminGruenbaum there are some needs to have a "constructor-like" method on single objects where to compose out of, but thats not really a problem
Object.create will be used extensively
 
11:30 AM
@jAndy the problem is really stack traces and debug logs.
 
I'm still thinking of having some way of parasitic inheritance in there, but then again..
could be pain in the ass
 
what's "parasitic inheritance"?
 
Sorry guys im new in javascript... i dont have questions rite now if so i ll ask later.. I am an android dev
 
!!google "parasitic inheritance"
 
11:31 AM
!!> var obj = {x:4,y:5}; console.log(obj); function Point(x,y){ this.x = x;this.y = y;}; var obj = new Point(4,5); console.log(obj);
I hate the second one, but still use it.
 
@dlampard Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
@BenjaminGruenbaum "undefined" Logged: {"x":4,"y":5},{"x":4,"y":5}
 
> i dont have questions rite now if so i ll ask later.
that's a new one :)
 
In a real browser, it logs Point with the properties, and not just the properties.
 
so it amounts to run-time type information that's filled by the new
 
It also allows for hot swapping of functions later. If you want to change an implementation across all your code from afar, you can't just change obj.someMethod() if it's not on the prototype.
 
11:32 AM
!!schrödingers cat is dead or alive ?
 
@jAndy schrödingers cat is dead
 
haha.. actually the chat coding answers are not looking in proper way its difficult to understnd fr me
 
@BartekBanachewicz it amounts to debug info, but only until engines give better type information for anonymous types.
 
@BenjaminGruenbaum our main reason for using OC is because of multiple inheritance, which is impossible with prototype nowadays
might change in ES6, not sure
but having tons of specialized objects where you can create "mix-ins" is unvalueable to me
 
@jAndy it's possible, isn't it? You just stick a prototype in the middle or something. I totally get mixins though, I use that pattern all the time.
 
11:34 AM
@BenjaminGruenbaum are they supposed to guesswork into "what this could be possibly duck-typed into", or are we back to glorious "type annotation comments"?
 
I write a lot of functions that create a new object if not passed a parameter, or mixin an existing one if they do.
That _is) invaluable.
 
@BenjaminGruenbaum no way if you use this to access mixed-in functions, at some point its over
there is a great article online which I don't recall
 
@BenjaminGruenbaum that's a common pattern in Lua
 
function EventEmitter(x){ // something like this
    if(this !== undefined) x = this; // constructor usage
    // make x event emitter
}
@BartekBanachewicz yeah, it makes sense.
 
@BenjaminGruenbaum isn't it simpler to do x= undefined?
 
11:37 AM
@t1wc oh whoops, that's backwards.
 
@BenjaminGruenbaum :P
 
yeah, should be the other way
 
I should separate my logic from DOM.
 
@BartekBanachewicz definitely.
 
11:38 AM
I've realized on the bus that I won't be able to compile the running demos easily without it
and that was kinda the point of my whole amazing block system
 
@x-yuri Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@BartekBanachewicz also, putting your app logic is in the dom is crazy.
 
@acrmuui Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@BenjaminGruenbaum meh, those are objects like everyone else
I wouldn't mind that if I didn't really need to dump the DOM at some point of processing
 
@BartekBanachewicz no, not really - those are host objects that have no guarantees like normal JS objects - they can be slow or fast at weird times etc. Even if they did - those are your presentation layer.
 
11:42 AM
OIC
well I was suspecting something like that
 
Think of it like some sort of FFI :P
 
In Miaou I started by following the usual logic of having data separated from the DOM and then I found it mainly meant duplicated code and data. It became only clearer and dryer when I stopped storing user and message lists as js objects. So I'd say it dependds.
 
Although, there are efforts to rewrite the dom in JS. Generally, it's faster but no browser has actually taken the step. Such user side efforts are insanely fast though, check out React.
 
@SirBeute Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@dystroy Without checking, I'd guess you weren't doing data binding properly.
 
11:44 AM
@dystroy where did you store the data instead ?
 
@nithi Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@jAndy I stored in message[] and user[] objects. Now they're in datasets and I list elements and it greatly reduced the number of bugs
 
just scored 536870912 (29) on flappy 2048!
 
I mean datasets have a reason, there are usecases
 
11:45 AM
I have far too much time on my hands
 
Yes, storing strictly presentation information configuration and bindings is ok. Just not app business logic or data.
 
@t1wc play maverick bird
 
1
Q: backbone.js events not bind to fire action on text area

SportI have a text area in my template .i want to pass text value from text area to function (view ) change event. I bound the "change" event to textarea but action is not working. template <div id="replyt" class="commentArea"> <textarea id="rep" class="form...

 
When you have dozens of different ways to change the messages you have in different parts of your gui, it's sometimes easier to not have the messages too far from their representation. I say sometimes. That's the only application for now I have like this.
 
BTW, Backbone is the one thing I would definitely avoid.
 
11:46 AM
its sometimes a hard call to differentiate between logic and .. presentation or config
 
@voodoocode Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
thats one big caveat I still see in Angular
 
@jAndy almost always for me, it's a hard call.
 
too much confusion about mixing presentation (HTML) and "logic"
 
@BenjaminGruenbaum interesting
 
11:46 AM
with code
 
Making that sort of call is half of what makes a good developer imo.
 
@KendallFrey shit, it's in flash... can't cheat
 
even if any angular fanboi will shout at me that "thats just templating logic"
 
@BartekBanachewicz while you're at it, check out Om with React, I think you'll love it.
@jAndy the funny thing about Angular is most people don't use it the way Misko intended.
 
I honestly don't know how most people use it
 
11:48 AM
They bind directly to business logic objects, I do it too, it's just an anti pattern :P
 
I'd probably only use it to wipe my ass or something :p
 
@BenjaminGruenbaum too bad I still can't force myself to like lisps
 
The idea in Angular (according to Misko) is: Put all your logic in normal JS objects and run that yourself outside of Angular. Only put presentation related view model objects in scopes, only data bind to those.
What people actually do is: Put all your objects in scopes, bind to those directly
 
@BenjaminGruenbaum that makes sense
altough "complicated"
 
@BenjaminGruenbaum yea but thats exactly what I was saying
a total confusion about MVVC
 
11:49 AM
@BartekBanachewicz lol, really? So you give Misko your ok :P?
 
pretty much putting real logic in form of templating code into your presentation layer, like HTML
 
@BenjaminGruenbaum dunno, I don't dabble in all "your people" angulars and whatnot
 
Angular doesn't use HTML, it uses its own DSL that just looks like HTML :P That's just to trick people.
 
I do many various things in JS that just happen to be in JS :P
 
@BartekBanachewicz Misko Havery is one of the most notable software architects in the world at this point IMO, comparable with people like Martin Fowler. He was the first one for instance to call Singletons as an anti pattern that loudly in articles like "Singletons are Pathological Liars". He has very good ideas about design and has definitely made a contribution in the field.
@BartekBanachewicz he just happens to be in JS at the moment, he worked with other languages most of the time. He basically learned JS at one point and after 6 months was leading the training of JS in Google and built Angular.
 
11:52 AM
sounds legit
@BenjaminGruenbaum proves the point of language being more or less irrelevant :P
 
He also doesn't do lots of Angular development anymore, just comes up with abstractions.
@BartekBanachewicz a point I myself like to argue :) Languages make things easy or hard but the challenges when doing a certain type of program (like UI) are universal.
 
FRP master race
 
A lot of people, less the ones here on SO and more the ones in 'the wild' never bother thinking about the actual challenges in coding UI.
@BartekBanachewicz FRP sucks in so many ways lol. It's like "I have this problem, what's an easy way to think about it? Oh, let's think about it as an actual state machine rather than objects, because that's easier to reason about" :P
I love stealing FRP ideas all over my code, but I would not use FRP for a whole code base.
 
"easy" models aren't always very good when it comes to maintaining and growing stuff
 
It's not about easy, it's about simple. FRP isn't that simple. In my experience it's harder when growing stuff.
Maybe I just don't get FRP very well yet.
 
11:56 AM
@Bitdivision Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@BenjaminGruenbaum I'd argue nobody gets it... yet :)
 
I've written a lot of code that does FRP over the last year, I've attempted it several times and even have a (smallish) Bacon app in staging atm. I do acknowledge I don't understand it nearly as well yet. It's quite possible I just suck at it atm.
 
until it becomes used widely enough to make some patterns appear, it's still an experimental concept
 
What matters at the end of the day is what's easier to reason about. FRP for a whole system is very hard to reason about for me, and I've tried. I got used to it at a point, but it wasn't easy, and maintaining it wasn't easy at that point either. Again, that might be me not being very good at it though.
 
eh, #plzjavascript
.filter(function(event) { return event.keyCode == 32 })
I kinda get why people are skeptical towards those ^
 

« first day (1287 days earlier)      last day (3662 days later) »