« first day (1541 days earlier)      last day (3426 days later) » 

5:00 PM
@Catgocat control+k please.
 
@Catgocat If your function is that big, you probably need to split it to smaller ones.
 
Why would you iterate a myVariable? Also that code would probably look like range(0, 4).forEach(...)
Which doesn't have a closure-loop problem.
 
I don't see why you guys hate let.
 
It's not that we hate let
 
I don't hate it - I'm just not excited about it.
 
5:01 PM
It's just that functional scope is sufficient for 99.99% of the problems
 
I use it too in 6to5 code, I just don't see it as particularly useful and a big deal. The biggest feature let gives me is that it catches redeclarations (if the linter didn't).
 
So having a whole new keyword for it makes me wonder what's it all about.
 
So it's syntactic sugar. A little but of sugar can help readability, though.
 
function allyIlliterate() {
    //tuce is *not* visible out here

    for( let tuce = 0; tuce < 5; tuce++ ) {
        //tuce is only visible in here (and in the for() parentheses)
    };

    //tuce is *not* visible out here
};
 
@Luggage having more things in the language isn't free.
 
5:02 PM
What about const ? Don't you like it too ?
 
And again
 
@Catgocat what does it solve for me?
 
If they are, internally, just a way to save characters then they are really cheap. The parser gets more cplex, though
 
function allyIlliterate() {
    range(0,5).forEach(function(tuce) {
        // tuce visible here only
    }
}
 
Function scope is ugly.
 
5:03 PM
function allyIlliterate() {
    range(0,5).forEach(tuce => {
        // tuce visible here only
    }
}
@Luggage it's one more thing for every developer to remember.
 
the word let sounds much more advanced than var
var sounds old
 
lol, solid argument :P
 
Though.. I DO like the idea of something like ASM.JS and you just compile other JS0based langauges down to that..
No use for nice syntax in asm.js.
 
I heard they were already making ES7
 
You can track the current proposal.
 
5:12 PM
My counter argument to @BenjaminGruenbaum: If you spend all day in JS and find some (admittedly un-needed) syntactic sugar helpful, do you want your language to be limited to what the average noob is willing to learn? Should the language be limited to that? Compile to JS languages are pretty unpopular around here so there doesn't seem to be any direction you can go. JS will be current-form JS forever.
 
@Luggage Sure, but there is a balance, I'm all for yield sugar (although it's not needed) or =>s - I'm even for maximally minimal classs. I just don't think that let cuts the line.
 
That's not all bad.. I've argued your side before. I've argued that JS's function scope and protoypes let you emulate classes and other constructs.
 
"emulate"?
 
I guess. I can't think of a better word.
 
JS is not limited to what "the average noob" is willing to learn, but adding syntax is not without overhead - it means standardizing it, then implementing it everywhere - shimming it, fixing bugs in it, considering it in every new features and as you said it complicates the lexer and the parser and requires effort that could be put elsewhere.
 
5:15 PM
The fat arrow looks ugly to me..
And what about the old browsers? ES6 will not be used that much..
 
Features cost money, let is a feature that is not worth money.
 
If ES5 is not that used, I imagine ES6.
 
@Catgocat 6to5 :)
 
What is 6to5? A compiler?
 
ES5 is used now, a lot of websites don't target IE8 today - we dropped support about a year ago.
 
5:16 PM
lucky you
 
@Catgocat converts es6 to es5 code so you can develop es6 now and in a few years skip the compile step.
 
Who wrote it?
 
I don't even use ES5 for production..
IE still holds a significant percent.
 
Uhhh. why?
You can shim and polyfill stuff.
 
5:19 PM
Because you can't always choose your users' IT policies :(
ohh, that.
 
I wrote a very cool object method.. I hope they put something like that in ES6 gist.github.com/afonsomatos/c3f1f9807a80bf169a47
var obj = {v: 3}
obj.when('v', 4, function(){ "omg its now 4"; })
 
@Catgocat you might want to check out Object.observe it works in Chrome today.
 
yea. we support browsers that don't eve have .bind() which is why I was so taken aback by people's 'it it works once it'll work everywhere' statement earlier. I'm not starting that argument again, but jsut pointing out that there are some old-ass shit out there. You need to polyfill a LOT sometimes
 
@Luggage Yeah but it's a solved problem - es5-shim
 
I love bind but I use self = this, because you know ES5
 
5:21 PM
Or you can shim bind...
Although a closure is actually faster :P
 
right.
 
Bind is suprisingly slow in tight spots
 
@BenjaminGruenbaum es5-shim can't shim everything
 
yea, i use closures in plain JS code but in this one spot i'm putting an expression in a template and doSomething.bind(...) is juse more readable for a one-off UI click event thingy
 
@FlorianMargaine that's what you have es5-sham for, ES5-shim shims almost everything except getters/setters iirc.
 
5:23 PM
but anyway..
 
I use bind a lot
 
Getter/setters, 2nd argument of Object.create
 
Except in node, since again - it's slower.
@FlorianMargaine I never once used that, also that's getters/setters so there's that.
 
I guess
I have a friend who uses these features extensively in his js code...
 
Yeah, getters/setters are useful
 
5:26 PM
What is the difference between console.dir and console.log ?
I don't see any difference while outputing in node.
 
I think both are browser/engine specific.
 
console.log(input);
console.dir(input);
 
Oh yes, I just checked it out.
 
try it in the console in the chat here
 
@rlemn Yup it shows the properties.
 
5:28 PM
and console.log(input) shows the HTML Element
console.log(input);
VM80:2 <textarea id=​"input">​</textarea>​
undefined
 
Can anyone explain me what Buffers are used for? In the docs it says it represents binary data, but when I output it, it shows hexadecimal values.
Why use them instead of normal strings?
 
because when you output it, it calls .toString iirc
 
@Catgocat hex values are a simple way to represent bytes. It's a lot easier to read FF than 11111111
 
Interesting, and why would you use buffers?
 
@SterlingArcher o/
 
5:32 PM
For manipulating data?
 
For anything that uses raw data
 
Now I feel dumb
 
i.e. I read serial port data as raw data into a buffer
 
Raw data? You mean pulling data from a stream?
 
That's a common one, yes
You would represent data as an array of numbers but it wouldn't be terribly efficient. Or ever that accurate.
 
5:35 PM
How can you interpret buffers in the browser using javascript?
I heard about typed arrays but not sure.
 
You are referring to the node.js Buffer object?
 
Yes.
 
maybe browserify has a browser implementation.. not sure. It's not a normal object in the browser but there are likely equivalents.
 
But what are typed arrays used for?
I mean give me an example, I have never used them.
 
(disclaimer, I don't use them myself and am unfamiliar): I've seen them used for putting data in memory in a specific structure. Like when interacting with native code
I can't think of a reason to use them much in plain everyday browser JS.
webgl.. that's a good reason to use them, it seems.
 
5:44 PM
Maybe.. I think when the time comes I'll know.
 
if you deal with binary data, you'll want things like buffers/streams. IF not they may be useless to you.
 
How long have you been programming javascript?
 
Me? Many years, but for some years i was in the dark. I just did a little JS glue for a web page.
 
Nice nice
 
Only in the last 1-2 years did I write 'real' JS. As in, I think my current code is organized well, uses scope properly. If you asked me to talk about the 'this' scope 3 yeasr ago I'd have given you some wrong answer
Theses days I'm intimately familiar (as one should be)
better than my typing/spelling
 
5:49 PM
Same as me
I only started writing real js a year ago..
 
Always more to learn. techniques, etc.
even for such a 'simple' language/environment
 
Heh, I remember I didn't know about JSON and so for sending and interpreting data client-server, I would join the data using symbols and generating something like name&&&age&&&location
 
yea.. I called JS object literals JSON before and had to eval() results form the server becasue they were just that.
(hangs head)
 
When I didn't know about object literals, I would do eval('var newVariable = 3');
 
I think a lot of people start writing poor JS. It ends itself to that and lets you get away with so much
 
5:52 PM
The language itself is very missunderstood.
 
actually .I guess i wrote JS > 10 year ago when playing with html but..
 
10 years ago..
 
maybe almost 20
 
How old are you?
 
old enough to not tell people on the internet
 
5:53 PM
Hm
 
I started writing js in the late 90's. I started writing decent js last year
 
My first website is VERY VERY bad written.
www.memopad.cc
But it is fully functional.
 
that is my best work
 
Which I've used before in jsfiddles. :)
 
github.com/afonsomatos/memopad.git
 
5:55 PM
I've seen worse JS.
 
But not bad for a 13 years old guy heh?
 
I've written worse JS.
 
It has a mobile version too :p
 
At work.
 
I even used website = "memopad.cc"
instead of location.hostname
e_E
 
6:02 PM
fuck dell, pwm is now on 100% fan is getting controlled by some unknown factor
 
I tried. They turned me down.
 
@darkyen00 cat on keyboard? That'd be my bet
 
No
i am going to get a mac. Seriously mantaining this laptop is totally not worth it.
 
Calm down everybody.
 
6:04 PM
lol
 
I have an ASUS SonicMaster notebook
 
Its like a ghost is controlling my fan
 
It's the perfect Laptop!
 
@Catgocat I tried an Asus ROG G55VW
it became a TANK on Lap
plust crap h/w :-(, didnt survive india much
 
Asus 12gb ram nvidia gtx 840m 2gb i7 4500UCPU @ 2.4ghz
has 1tb of storage
and touchscreen
15,6''
 
6:05 PM
@Catgocat My main desktop... 24" Touchscreen i7 4770k
@ 4.1 Ghz
 
good
I have a 3x SLI GTX 970
 
this laptop game though :-(
 
I mean 2x*
 
I am happy with my Ti ^_^
 
660 ti?
 
6:06 PM
780
 
it's good..
I had a 2x sli gtx 660
 
this laptop is crap :-( thuogh
 
dont use laptop for gaming
for fuck sake
 
Not for gaming
its idleing on 57 - 80
 
You have 2 solutions
 
6:07 PM
because the fan is going mad
 
Buy a mac, or by a windows
 
<- macbook pro 15" (my first apple)
 
mac > 3000$ dollars > 3/4 years
windows > 700$ > 1 year
 
nah. mine was 2k.
 
so cheap
 
6:08 PM
also.. a pc with the same cpu/ram/screen is the same price.
 
:p
 
@darkyen00 silly question, have you opened it and brushed/blown/vacuumed out the dust?
 
@TomW yes even chaned the thermal paste for the processor
and bought a completely new cooler, next ?
 
Did you change the hard-drive fluid?
 
its a new ssd, so no.
// working on updating this laptop.
It has decent potential as a laptop -> i5 max upto 2.9Ghz Quad core and a decent GPU for everyday sublime stuff. (3 year old though)
 
6:10 PM
stop gaming
and go programming
 
you don't need anything too powerful for development, really. Just enough ram for all the utilities/app you generally have open
 
you forgot CSS and android emulator
 
I mean.. general business app type of development.. no idea what you do.
 
you need
many ram
for intese html5 game development
or other game development anyways
and powerful cpu
 
@Catgocat meh
 
6:12 PM
and powerful gfx
 
ram never hurts. If not that, then for VMs
That's the one thing i'd do differently.. more ram.
 
@Luggage more ram can hurt your wallet
 
Ram is cheap
 
relatively speaking at least
 
assuming your mainboard can support it
I am out of luck with mine
 
6:15 PM
bluescreen? server? wtf?
@JanDvorak that's why I went with Sandy-Bridge-E instead of Ivy-Bridge for my desktop (though it was about 2 years ago)
 
i'm screwed becuae upgrading ram on a macbook is not really meant to be.
 
The fan spec says it can max upto 10k
 
That's hot..
 
And its winter :-(
 
Watchout my laptop stopped working when it reached 90ºC on the gpu
 
6:20 PM
ps to achieve those temperatures I am using a deskfan
 
from like 8 years ago..
 
to blow air on my laptop
 
You could always buy those laptop tables that have fans.
 
and now its making me freeze ^_^
 
I bought one of those.
 
6:20 PM
Coolpad
 
Yes, that's right.
 
Won't help much.
I am gonna probably hardwire the fan to run max
and change keyboard
or sell this for around 22k Indian
 
We forgot this is a JavaScript room meanwhile..
 
and get a decent ass chromebook
 
6:22 PM
Make me immortal.
 
Chromebooks + Digital Ocean Servers are the way to in 2015 right ?
@Catgocat wait till google makes a webbios api and bioses are written in JavaScript ^^
 
@rlemon great big caveat at the end
 
if kurzweil is posting about it, it is promising to say the least
 
I take it as a prompt to study what that drug is doing other than its intended effects, rather than the discovery of a wonder drug in itself
 
6:35 PM
Does anyone still programs in PHP?
 
6:49 PM
I am using longpolling for a website I'm writing and don't know wether I should
use PHP or Node.js for the server.
 
happy new year everyone! :D
what have I missed in this week?
 
I'm sure you can do long polling in php but it's request model isn't as well suited for it as node.js's is.
node.js is 'ok' at it out of the box as long as you handle your IO properly and not syncronously.
 
The webserver is in PHP, so an additional server would be very expensive.
 
Ahh. ok, then.
 
But node.js suits better.
 
6:56 PM
well.. expensve in time to setup? you dont' need a physically different server
but yea.. if you are already php, you might as well solve the problem IN php
 
@Catgocat longpolling?
Why not websockets?
 
I want oldbrowsers to work..
I could write an entire fallback to longpolling or use socket.io, but thats not necessary.
I want something simple and easy to maintain.
 
A client/server library that does it's own fallback is the 'simplest'.
 
Socket.io is easy to maintain...
 
But if you want to implement long polling yourself for the lulz, then go for it.
But socket.io, if I recall, is node-only.
 
7:04 PM
It is.
 
hey
 
Any ways to get content from iframe that it's src from another origin?
 
It isn't possible.
Really I've tried 1233x times.
There isn't way of doing it.
 
7:16 PM
@BenBeri no
That's very deliberate.
 
That's ugly
PHP along with socket.io
yuck
It is possible to write an HTML game and deploy it to an android or iOS app?
Without performance damaging?
 
'damaging'? It'll have lower processing power and ram, so you'll ahve to consider the constraints of the device..
And not all devices have equivelent hardware 3d..
 
Not 3d.. just 2d.
 
Ah. Your graphics are just DOM manipulations?
 
No, canvas
 
7:30 PM
ok.. hm. it'll really depend on how you are rendering every frame an if you even need the screen to be constantly updating or just on interaction
.There may be some bnchmarks on how many draw operations of different types each device can handle. Games can vary a LOT in requirements.
In other words. I don't know.
 
true, true
good HTML5 canvas books out there?
 
html5-benchmark.com looks like a decent test
 
@SimonSarris wrote it
 
That covers deep canvas use?
 
7:33 PM
"deep"?
 
@Catgocat Yes, canvas is about a third of the book
 
By volume or weight?
:)
 
@Luggage true
 
@Luggage Weight, canvas pages are heavy.
 
7:54 PM
For tasks that can take anywhere between 0-5 seconds, would you return 200 once complete, or 202 immediately and let it run in the background?
 
@SecondRikudo assuming a normal distribution?
202, assume success, update client if needed
 
@SecondRikudo 202 Immediately and let it run in background.
 
@SomeKittens Update client how?
 
Polling / Websockets / <something else> <SSE>
Darn It I cant sleep :-(
 
@SecondRikudo How we do it at Runnable: Trigger request, client updates as if the request was successful, then updates for realz when request finishes.
We've got a whole custom-built framework for that though
 
8:04 PM
Oh it's a REST API
It won't necessarily be used by a browser
 
ah
What's the process? Can it fail?
 
Inserting an item to the database
After some processing
shouldn't fail unless cosmic radiation.
@PeeHaa ^
 
lulz
 
@SecondRikudo 202 sounds like it'd be ok.
 
8:26 PM
C'mon peeps, half of the entries are mine, and my highest voted suggestion is awful! Don't let me win
 
That's just winning because Pokémon
 
Why does Ruby have negative votes!? I wanted to do a ruby one :(
 
The ruby one is my favourite, too. That's a project I really want done irregardless.
 
The question itself has -9, so there's that.
 
@SecondRikudo blink blink Context?
 
8:33 PM
@Zirak Steins;Gate
 
@SomeGuy uhm...interesting. Not NSFW, Frugal
@SecondRikudo oh yeah. I like the messed up ones, apparently, as Evangelion and Elfen Lied top my list.
Thought you were offering a threesome and wondered who to ask
 
@Zirak Have you watched Mirai Nikki?
 
@Zirak I used this word today. In french, it's not very uncommon
 
@SecondRikudo hah, sounds gory
 
@Zirak Mirai Nikki translates to Future Diary
One of the most awesome psychologicals I've seen
And it's featuring the most apeshit crazy character I've seen in anime.
And I've seen a lot of anime.
In short, I think you'll like it :)
 
8:39 PM
ooohhh. Added it to The List
Thanks
 
just finished bottling my first homebrew
2
got 24x750ml bottles from it
 
nice work
What's the brew?
 
just the lager mix they sent with the kit
 
when will you be able to drink it?
 
in a week
 
8:42 PM
If it's lager it'll benefit from a few weeks to a few months in the cold
and I mean just above freezing cold
 
you think he'll wait that long to drink beer?
 
Nope :P
Excuse to brew another
 
it's a lot of beer
 
I've done a couple of extract brews, they're...ok.
I've been meaning to attempt a grain brew for a while
A lot more complicated though and easy to mess up
 
8:57 PM
function countDocuments() {
    var count = 0;

    for ( var i = 0; i < user.documents.length; i++) {
        count++;
    }

    return count;
}
 

« first day (1541 days earlier)      last day (3426 days later) »