« first day (1847 days earlier)      last day (3103 days later) » 

3:00 PM
!!afk debugging hell
 
@MadaraUchiha Yeah, but syntactically, what's supposed to happen? Modify the prototype of the class? Eg:
// main file
class MyClass { }
// then in another file
MyClass.prototype.doTheThing = function () {
}
 
@corvid classA extends classB {
 
@AwalGarg probably the last problem
formatting
 
if classB is in the scope of this statement, then it would work
 
3:04 PM
so far i was generating unformatted code
 
Dare i send this to multiple women?
I dared.
 
Functionally it's pretty much the same as
 
@SterlingArcher I wont
 
function MyClass {}
MyClass.prototype = Object.create(ParentClass.prototype);
MyClass.constructor = MyClass;
 
3:05 PM
oh god, hangout ping. @Abhishrek don't make me cry :(
 
@SterlingArcher :P lol, you didn't cry
 
No I laughed and now I feel bad lol
:D
 
@MadaraUchiha when are you coming back?
 
@BenjaminGruenbaum 22nd
 
@MadaraUchiha boo, class MyClass {} :D
@MadaraUchiha damn, I'm flying on the 24th to Amsterdam, we can do a week after that - I want to hear about your trip
 
3:08 PM
@BenjaminGruenbaum Was demonstrating what happens functionally behind the class sugar.
 
more like class MyClass extends ParentClass{ }
 
@Abhishrek Yeah
@BenjaminGruenbaum That's a shame, we're going to have to catch up though :)
 
crl
are there some good persimmons/kaki in Israel? I just love them
 
@MadaraUchiha also defineProperty and stuffs
 
3:10 PM
Also - setPrototypeOf on the parent.
 
Well now I should probably get off reddit before they realize I wasn't working LOL
 
@crl I can testify for the persimmon quality
Depends on where you buy it.
 
crl
:) ok, buying some Italian ones, good too
 
ES6 supports multiple inheritance, correct?
 
@corvid what do the docs say?
 
3:11 PM
wasn't multiple inheritance terrible ?
 
multiple inheritance is teh debil
 
crl
the diamond issue
 
@Abhishrek no
 
@ssube okay so its not terrible now ?
 
How do you reference a global variable when it's hidden by a local variable with the same name? Is it correct to use window.variableName ?
 
3:12 PM
@Abhishrek it's never been terrible
 
@ErroreFatale It is correct to not use global variables ever o noes burninate it exterminate exterminate
 
multiple inheritance of state is problematic in a language with copying, multiple inheritance of behavior has never been a problem
 
multiple inheritance is awesome
 
inheriting multiple interfaces is the best kind and the basis of most functional programming
often known as "mixins"
 
3:14 PM
I know it as multiple inheritance
 
crl
I don't like too much react's mixins.. kinda polluting the state
 
Multiple inheritance doesn't seem too bad ._. though in Node, it seems like most things extend EventEmitter
 
and yes, its superior
 
neither does react team
 
@KendallFrey this is not an answer to my question. However, why shouldn't I use global variables? Sometimes a variable must be accessed by many functions...
 
3:15 PM
@corvid given that node's strongest selling point is evented IO, that makes incredible sense :P
 
crl
@ErroreFatale pass it in function arguments
 
crl
or make some classes
 
yeah, EventEmitter is pretty great, I just feel like that causes problems for multiple inheritance, based on absolutely no evidence
 
@Loktar @rlemon @FlorianMargaine
 
3:16 PM
@corvid it does not
 
@corvid what
 
multiple inheritance of behavior is safe, well-defined, and powerful
 
@KendallFrey :D
unexpected, but lovely.
 
crl
3:17 PM
you actually want that rather youtube.com/watch?v=QFY_CEcaVmQ
 
your only danger is having the names of the event emitter collide with your own. that's managable.
 
crl, if you have a .js file with starts with { and ends with }, the variable declared outside the function are not globals, right? They are shared by all functions in the file, but they are not globals..
 
@ErroreFatale no, they're still global
 
@ErroreFatale only functions limit scope, not any {} block. Unless you are using ES6 and the let keyword
 
@crl twitch, rlemon listens to 10 straight hours of rblack?
 
3:19 PM
linux peeps: I see there is a lot of shit in my /home folder. I only recognize a couple of things (which is my own data, not app data) and I only want to keep that. I changed my distro, so its a clean installing sharing back the /home partition. Is it safe to copy what I need, remove everything from /home and create the home directory tree for the users with usermod and family commands?
 
and even if they weren't, you still shouldn't have variables "shared by all functions"
 
Now we know what Errore Fatate's fatal error is.
 
(ignore all of my canvas code ever)
 
> Note: The language value is case-sensitive. If you set language: C, for example, your project will be considered a Ruby project.
 
lol
 
3:21 PM
		let {foo, bar} = baz;
		this.lorem = {foo, bar}
is there a shorter way to do that ?
 
crl
seems so
 
let {f, b} = baz;
this.lorem = {b, f}
:)
 
-_-
facedesk
 
this.lorem = { foo: baz.foo, bar: baz.bar }
#es3
 
was hoping for some sugar in #es6
 
3:23 PM
we exclusively use sugar here, copy, you know that
 
with(this.lorem) { {foo, bar} = baz; }
 
@AwalGarg what would you like to happen to you?
 
take away from freedomlessness
 
@Abhishrek Be reborn in india
 
Hahahaha
 
3:25 PM
my guess is badger cat is using copy's account
 
@MadaraUchiha She says thanks, she'll try it when she gets home. Also that you explained it really well
 
this.lorem = {b,f} = baz;
 
user1596138
W3 is working with auto makers to develop a spec for connected cars. rawgit.com/w3c/automotive-bg/master/snapshots/… w3.org/auto With access to everything from throttle position to whether the door chime is active.
 
@AwalGarg wouldn't that make a... [/sunglasses] copy cat
 
user1596138
We will soon be able to make webapps for cars
 
3:28 PM
@ssube hahaha
 
@Jhawins turnder, instead of swiping left or right you have to turn the wheel
big $$
 
user1596138
`The browser will be connected to the onboard computer
 
user1596138
@rlemon Yea that sounds like the best application of this tech
 
oh boy
 
@crl what you are saying is that I shouldn't use global variables but using "namespaces"? Does "var foo = {....}" creates a new local scope? Or must you use "var foo = function(){...}?
 
3:31 PM
@Jhawins "we have this new exciting communication platform that allows anyone in the world to seemingly instantaneously share files back and fourth.. so porn yea?"
 
user1596138
@rlemon Heh yea
 
@ErroreFatale must be a function. only functions define a 'scope'.
 
@Luggage false
es6 let block scope
 
look up "IIFE".
yea, we mentioned es6 earlier
 
Ok, then I found a big error in stackoverflow. The best rated answer suggests to create a namespace with an object: stackoverflow.com/questions/881515/…
 
3:33 PM
that isn't wrong
 
they are intentionally making "myNamespace" global
 
Yes, but you might have cross-browser problems
 
which of the two is better?
$('#element').val().length == 0 or $('#element').val() == ""
 
@ErroreFatale how?
 
@Joel define 'better'. What are you really checking for?
 
3:35 PM
@Luggage i want to make sure the field has no input
 
rlemon if you have an old version of a browser
 
crl
make some simple code, with function for each task, then as your code gets bigger start to make 'classes'
 
@ErroreFatale .. it wouldn't make a difference.
 
@Luggage they actually check the same thing.
 
yea, i guess .val() always gives a string for inputs.
 
3:36 PM
Wait, I found a coutnerexample where they evaluate to different results. Wonder if I can find a simpler one.
 
@BenjaminGruenbaum is one better then the other in any way?
 
@BenjaminGruenbaum what if... val returns [] :D
 
@rlemon Why not?
 
</troll>
 
@ErroreFatale why would it?!
 
crl
3:36 PM
@AwalGarg it can't
 
@AwalGarg always returns a string, try harder.
 
crl
"[]" at best
 
@ErroreFatale basic JS structure like that is standard and can be trusted everwhere but the oldest (read IE 5 and earlier) browsers
 
WHAT IF $ isn't jQuery?!?!?!?!
 
var obj = {};  // I work in every version of js *we care about
 
3:38 PM
it only had figuratives
 
you're not helping, the other user is confused.
 
lemme check netscape 7
 
@Cereal Cheers
Let me know if it were correct
 
everytime I see new Array et al, I get when the code(/guide from which code was copied) was written
 
3:39 PM
what if I need to support variables?
 
@ErroreFatale you're good to go with netscape 7, I'm not so sure about netscape 6
 
user1596138
I'm really the only one who thinks it's exciting that the proprietary crap gadgetry in cars today may be replaced by HTML/JavaScript/CSS interfaces and we will have a standard
 
user1596138
There would be Front End dev jobs in the auto industry lol for working on more than just the companies website
 
The first and last of those technologies are freaking horrible, so no.
 
i'll be excited when it's in a car i'm about to buy
 
crl
3:41 PM
ntescape
 
@Jhawins that terrifies me.
 
@Luggage I don't understand... the interpreter is a part of the browser. When they created a version of a browser in year 2003 they didn't know ES6. If what you want to say is that the interpreter of old browsers is updated by the OS I can understand...
 
@BenjaminGruenbaum seriously, when the other users are already confused and two people are trying to explain to them, trolling probably isn't going to help
 
crl
mongoose, bear, .. I sense a joke somewhere
 
3:41 PM
you just undid everything we were working for
 
> how do I make bear a function
 
@rlemon not trolling.
 
@ErroreFatale we ren't talking about es6. es6 i not supported everywhre
 
user1596138
@BenjaminGruenbaum Does it? Everyone uses their own handrolled crap right now, it's buggy it's vulnerable. It doesn't scare you today?
 
ES5, which is still most of what you see, is, though
 
3:42 PM
@KendallFrey awww yeah Friddaaay
 
I think "it might not work with Netscape 6 but it works with Netscape 7" sends a pretty clear message of "It works everywhere - heck, I checked netscape 7 and it works here".
 
crl
lol the dude tagged fantastic
 
@ErroreFatale all your examples, so far, have been es5.
 
new Call of Duty came out today gonna play it so hard.. after work
 
@Luggage es5 is 2008 (or 2009?) lucky for us object literals are ES3.
 
3:43 PM
@Luggage someone told that in ES6 you can create namespaces with blocks { }. I said that using blocks wouldn't be cross-browser because as you say not all browsers support ES6
 
@ErroreFatale it doesn't matter - you have tools that "compile" new JS to old JS so even really old browsers can understand it.
 
es3, then.
 
I still think "hurr durr, this doesn't work in 1999" is irrelevant when the user is clearly already thinking support is an issue
 
user1596138
@Loktar Report back! Last one was a joke so I lost interest
 
@ErroreFatale before you'd just create it with functions, it's a pattern called IIFE (it's on wikipedia). Not that it matters since again - you can transform new JS code to code that runs on IE6.
 
3:44 PM
you wont like my opinion then
 
@rlemon only it does :D
 
I liked the last one as well @Jhawins
ghosts was the last one I thought was shite
 
user1596138
@Loktar Wait was the last one the one with the jet pack crap
 
yea
 
user1596138
Call of Halo
 
3:45 PM
call of titanfall :P
 
user1596138
Good point
 
user1596138
!!afk standup
 
anyone here has experience with node.js ? I'm trying to make a game with node.js and socket.io ... I currently have a room where people get matched and some basic gamelogic. But when 2 players are matched I want to redirect them to a page where the game gets loaded ? how can I do this? tests using a direct link make the sockets disconnect and connect again with new ids etc
 
@Pieter-JanDeBruyne 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.
 
crl
!!> (_=>(_=>({}))())()
 
3:45 PM
@crl {}
 
@BenjaminGruenbaum I have no problem to believe that there are tools which.... but they are not automatic, right?
 
crl
double iife, safer
 
fml angular can get confusing
 
@ErroreFatale you can run them in a completely automatic way (when you save you get es3 output) - but you generally should have a "build".
 
@ErroreFatale Actually we said you can create a 'scope' with a block and let, but not a 'namespace'. A namespace is nothing more than sticking a bunch of variables (e.g. functions) in an object to group them together logically. You can do that anywhere.
How old of a browser do you need to support?
 
3:47 PM
@BenjaminGruenbaum I haven't dug much into the internals of babel, but doesn't it use a lot of ES5 only features which can't be shimmed in ES3? Like getters/setters etc?
 
angular.forEach($scope.selectedSources, function(value, key) {
	$scope.root[value.title] = {
		"description" : value.description,
		"root" : value,
		"selectedFields" : {},
		"weight" : 0
	};
	//to do -- make sure keys aren't duplicated
});

This creates a source to the root object. The $scope.activeSource is always equal to one of these root keys.
I am trying to access the selectedFields object from this object using:

ng-repeat="(key, value) in root[activeSource].selectedFields"
 
@rlemon so I managed to get them using datatype jsonp.Is there a downside to using jsonp or why did you advice against it?
 
crl
window is the outer scope of your browser
 
@AwalGarg they can be shammed, and work in all but very rare cases. In practice it works.
 
This yields nothing, which makes me assume I'm not properly accessing the object. Can I not use a $scope variable in an ng-repeat function?
 
 
@BenjaminGruenbaum what I was saying was: if you give ES6 to an old browser without DOING ANYTHING SPECIAL you might have problems.
 
@Nick sounds like a good time
 
@ErroreFatale true
 
@GotaloveCode there are a few downsides, it is technically a hack, but the api doesn't offer a cors solution so you have to use jsonp or set up a proxy server.
 
@Loktar right? I'm gay I mean.. game.
 
3:49 PM
alright jsonp it is
 
@ErroreFatale right, if you give ES3 to an old browser without DOING ANYTHING SPECIAL you'll probably have problems to. You should have a build step that makes your code more efficient by minifying it (reducing download size), bundling it (concatenating files together to reduce the number of requests), removing dead code, optimizing images and other build'ish things.
 
es3ify
 
8
Q: Just installed Visual Studio 2015, what language is this code?

Thomas SheraI have a userform created using Visual Studio 2015, I have no idea what the language is. In my experience VS uses VB (Visual Basic), but this is clearly another language judging from the bracket and semicolon usage. What language is this? using System; using System.Collections.Generic; using S...

 
@SomeKittens lol
> What is this alien language I'm seeing!? Where is my visual basic!
 
@Luggage I think that what you wrote si wrong, isn't it? "Actually we said you can create a 'scope' with a block" ---> maybe you wanted to say that you can create a namespace with a block, but not a scope. Right?
 
3:51 PM
how is that upvoted so much?
 
idk, thats a terrible question
 
@ErroreFatale block scope is a thing in modern js, function scope was all we had previously.
 
@SomeKittens wtf how does that have 8 upvotes :D
 
Nothing I said is wrong. Let's back up.
 
Why does this have 8 upvotes? — Sterling Archer 8 secs ago
 
3:52 PM
1. Are you using es6?!
 
@SomeKittens Probably upvoted by a network of socks
 
If you don't know, then the answer is no.
 
@Loktar damn your comment. lol
 
hahah
yeah I voted to close as well
 
3:53 PM
12 updoots
 
> put on hold as off-topic by Sterling Archer, Benjamin Gruenbaum, Loktar, m59, rlemon 15 secs ago
The JS room strikes again.
 
@MadaraUchiha will do
 
@Luggage so with older versions of ES a function creates a new scope, but a block doesn't. However you can create a namespace with a block. In ES6, both blocks and functions create a new scope. Right?
 
@BenjaminGruenbaum oh right
it's too early for me
 
3:54 PM
blocks are not namespaces
 
@ErroreFatale I suggest looking at the difference between let and var in es6
 
there is no such thing as a namespace. it's just putting a bunch of variables on one object
// a 'namespace'. Just a plain object. Valid ES3, ES5 and ES6
var myObject = {
    functionA: ...,
    functionB: ...
};
 
Shouldn't there by an = in there somewhere?
 
Could someone maybe take a look at this SQL statement and tell me why my second left join doesn't do anything besides crash, codeshare.io/uqL1H
 
//ES3 and 5: only functions make a 'scope'
var x = 1; //global
function makeVariables() {
    var y = 2; //local
}
 
3:57 PM
@Cereal no
 
@rlemon Yes
 
@Luggage and the variables inside the object are global or not?
 
He edited it
 
@ErroreFatale no
 
the object is global. it's just a variable.
 
3:58 PM
they are properties on the object, and in the function version they are limited to within the function scope
 
though this all gets thrown off once you introduce a tool that altomtically wraps every file in an IIFE..
 

« first day (1847 days earlier)      last day (3103 days later) »