« first day (1325 days earlier)      last day (3845 days later) » 

00:01
In perl single quotes are literal, so '$hello' is what it says, but double quotes are "interpolated" or processed, for variable substitutions, so that "$hello" is whatever is in the variable $hello
Solution: use CSS. And drop the PHP. — bjb568 19 secs ago
The main purpose of single/double quotes in Javascript or Python seems to be so that you can write strings that contain the other quote character without escaping.
But this question says Java is different: stackoverflow.com/questions/439485/…
yeah java is different... and the javascript ability to mix to avoid escaping comes in handy sometimes - but you gotta love regexp right
no string interpolation in js so doesn't matter
double or single usually convention
just stick w/ w/e your team / project recommends
yo coffescript is the f*kn bomb
j.s done right
j ashkenas is my boy
I tried coffeescript and it upset my stomach, much like too much coffee.
00:08
Not a fan of coffeescript.
i hate it
woah
okay the shit I always hear is "omg you write and debug in 2 diff languages"
There was a huge list of issues on the project site back them, over what coffee was supposed to produce what in js, and so I bailed on using it. Maybe it is better now?
I don't trust any language that doesn't use curly brackets
@Meredith Same.
00:10
@Paul yeah maybe
hahahaha
Pyhon is ok
Don't really see the purpose of coffeescript. Seems like its just more difficult to read.
Isn't that the purpose?
I never actually bothered learning it though, so I have no clue.
@twize no way
fn = (a) -> a * a
that vs var fn = function blAH BLAH BLAH
+ curly brackets
plus it cleans up the semantics (no implicit globals)
00:12
I think the point of coffeescript is to trade readability for lines of code per hour
@Meredith so coffeescript isn't readable?
@Meredith readability--; testtime*=12
damn coffeescript h8ters in here
tbh I don't use it
LOL
@linstantnoodles because it's pointless? haha
00:14
Coffeescript is readable
But less readable than plain javascript
Coffeescript is a nice experiment.
@Meredith yeah maybe the javascript it outputs is less readable
but cmon you gotta love the syntax ...
(imo) learning a compile to js is just more work. I still have to know js. I still have to (in the end) be able to debug in js. it just means learning another syntax.
No the syntax is terrible
Where are the curly brackets
sure some people can be productive in it. but for me it is pointless
00:17
Where are the semicolons
3
relying on ASI is stupid
Let's learn JS! Yay, after forever I know JS. I can debug it too! Now lets learn another thing that complies down to JS! Never mind that it's a waste of time, pointless, has terrible syntax, isn't debuggable, and will probably ruin your life, it'll make you write faster!
@rlemon that's what I thought ... but if you actually try it there's actually not much of a learning curve.
lol
relying on an error correction mechanism is stupid. period.
damn imagine if the browser wars never happened
screw js
00:19
Has anyone made a language called coffee thats completely unrelated to coffeescript yet
screw scripting languages in the browser
lets go back to old school static html
Anything dynamic must be done with php
if you subscribe to progressive enhancement then you already go back to the old school
no nothing should be done with php
its far better than coffeescript
00:21
php is old school
@rlemon I honestly don't feel like there's anything to enhance
!!youtube progressive enhancement 2
^^^
anyone near detroit, michigan? theres a MITECH php conference tmrw if interested btw
00:21
@Meredith CoffeeScript is decent
yeah php is old school but php is also broken
I don't like it
A lot of things that got into JavaScript originate in CoffeeScript
PHP stinks.
@BenjaminGruenbaum Whatever. It sucks.
Jeremy, the guy coding it is a TC39 member, he also coded underscore.
00:22
If I see another dollar sign I'm going to die
PHP does a job.
$var $var $var
holy shit
Php is basically what you'd get if c++ hit its head with a hammer for fun whenever it got bored
but it is horrible at the same time
In this room: people who never used language complaining about languages.
00:23
@BenjaminGruenbaum Underscore sucks too. Well, all libraries do.
Also, the worst argument you can have against a language is its syntax, seriously.
how do people outside of america deal with php
@BenjaminGruenbaum $var $var $var $var $var $var $var $var $var $var $var $var $var $var $var $var $var $var
@bjb568 What exactly do you think drives vanilla forward?
do you even have a $ on your keyboard
00:23
coffeescript is pretty good. i'm excited for es6 and beyond
but why learn a new syntax on top of the one I already have to study?
@BenjaminGruenbaum orly
@BenjaminGruenbaum People developing it? They can get ideas from people using it?
@bjb568 right, and how do you think they get those ideas?
From libraries... jQuery changed the DOM a ton. CoffeeScript helped evolve JavaScript
@BenjaminGruenbaum From using it and finding things to improve?
Why do you think there are TC39 (that's the people who move JavaScript forward) members from the jQuery foundation?
00:24
@BenjaminGruenbaum jQuery dom? Seriously? $$$$$$$$$
Yes. The DOM has a lot of features that were added to it because of libraries like jQuery.
I'm not a real big fan of libraries and frameworks
@BenjaminGruenbaum Some people are idiots, how is that relevant to this discussion?
But yeah they do help drive the language forward
Like being able to do element.remove() instead of element.parentNode.removeChild(element)
@Meredith why?
00:25
@BenjaminGruenbaum yeah right the only thing to dislike about PHP is its syntax. Otherwise it's gr8.
Why I'm not a fan of libraries?
@linstantnoodles seriously? Syntax is your problem with PHP?
@BenjaminGruenbaum jQuery syntax sucks. It doesn't even name it's function---s--- (how you do strikethru).
@Meredith yes, frameworks are understandable.
I'm not sure jQuery and coffeescript can really be compared... ha
00:25
I was joking bro
@bjb568 what?
It's just annoying when people go around using jquery to do shit they otherwise wouldn't know how to do
@BenjaminGruenbaum $
@bjb568 what about $?
@Meredith Why? I think it's great.
dont tell that to C# devs
00:26
@BenjaminGruenbaum Hideous function name that doesn't describe what it does?
The fact you can get productive fast is good.
@bjb568 you can also use jQuery(), so....
Jquery is nice if you already know what you're doing
@twiz Equally undescriptive.
It's a shortcut, not an excuse to not learn how to do something
00:27
So call it select , $ is good because it's short
@Meredith so you're telling me you know native?
No one remembers everything, seriously.
well... querySelectorAll() may be descriptive, but....
@BenjaminGruenbaum select('some css thing')? How about querySelector v querySelectorAll?
I'm in favor of Magic(selector).plugin()
querySelector is horrible imo, querySelectorAll returning a NodeList is equally bad, they were stuck trying to salvage an old API.
Sets are the correct mathematical abstraction over CSS selections.
QSA isn't that bad
00:28
The problem is not using jQuery, the problem is people writing shitty code.
@rlemon try to .map it :D
@BenjaminGruenbaum Horrible why? I play with nodelists every day. It's fine.
how often do you need a live node list?
@BenjaminGruenbaum touche
How often do you need to map a node list?
@bjb568 really? Why? Name one thing a nodelist does better than an array?
@BenjaminGruenbaum I agree with that
00:29
@bjb568 all the time since it's a list and not a set so it's the wrong abstraction to begin with. What if I want to select elements and attach event listeners to all of them?
@BenjaminGruenbaum I agree an array would work better, but in most cases it doesn't make a difference.
i've just accepted [].whatever.call
;)
Yes, it does. A NodeList is a host object, it does unspeakable things.
What's the problem with nodelists?
@BenjaminGruenbaum while loop?
00:29
@rlemon fun fact, petka is writing a patch for that right now
@bjb568 oh so much uglier than jQuery.
Not that I use jQuery very much, but ranting on it just got a little too popular imo.
Oh nevermind you said already I just wasn't paying attention
People should stop blaming libraries for shitty code :D
@BenjaminGruenbaum You can play with loopy things. It's fun :)
Seriously, the problems of writing a good piece of software are universal to all languages and technologies.
I suggest everyone use abstractions after they learn the language.
00:30
@BenjaminGruenbaum But it's both is shitty and encourages shitty.
The fact we're writing UI with or without jQuery is irrelevant.
The only thing that stops bad devs is education, bad code existed before jQuery and will exist after it
Wait, why ain't I quoting?
Feb 19 '13 at 16:12, by John Resig
bad uses of JavaScript existed long before jQuery ever came out - jQuery being popular doesn't stop bad devs from existing, the only thing that stops bad devs is good education, which is why I've written two books and am working at Khan Academy
@rlemon THIS! If you want to use a library, at least know that it's building upon JS. But then you can build something better than jQuery…
But the jquery API has some actual problems. Like not throwing errors. Or the weird notion of overloaded getters/setters
The thing is, though, that you don't have to learn how to write good code with javascript if you use jquery
At least in a lot of cases
@Meredith Don't learn? Just don't. No learning, no good code, nothing of value comes from jQ.
00:32
well you don't have to write good code with javascript either
@copy of course, I don't like the jQuery api very much (I just like sets for selections, since in JS no one knows about those for some off reason). I think it gets a lot of things wrong. The only point I was making is that people shouldn't blame it for bad code.
write less, do more is true. but you can't abuse it
$(this).prop('id') is an abuse. it isn't writing less, or doing more.
@bjb568 so you know exactly what your code builds upon all the time?
@linstantnoodles But it's easier.
@BenjaminGruenbaum Yup.
@rlemon also likely a reference error.
@bjb568 I doubt that.
00:33
sure it's easier to get something working but I'd say that's a good thing
@BenjaminGruenbaum Agreed
i much rather read a bullshit jquery program than a bullshit j.s program in the dom
@linstantnoodles wait what?
Knowing how every part of your code works is bad.
of course I'd much rather not read crappy code
@BenjaminGruenbaum The relevant things. I don't care about every transistor inside my CPU, it's irrelevant. But I can and should and do fiddle on the browser and JS level, so I understand it.
00:34
If everyonw knows exactly how every piece ticks there is no abstraction.
@bjb568 What is this JS level?
Do you know how substring is implemented? How fast is it? What consequences does it have?
Can a addEventListener cause a memory leak in an iframe?
@BenjaminGruenbaum The JS abstraction. Writing JS + using interpreter instead of writing C++.
There's only about a gazillion Jquery selector trivia questions on SO, because people can't be bothered to read the docs or grok the essence of a previous answer. I'm not talking about combining multiple selectors, either....
What about a onload? Which is faster? Why?
@BenjaminGruenbaum What browser?
@bjb568 chrome version 26.
00:35
@BenjaminGruenbaum Faster than what?
@BenjaminGruenbaum yes (I can look it up), no, and spoiler it does shit with strings ;)
@BenjaminGruenbaum Test it.
Faster than addEventListener?
@bjb568 right, so the answer is no. We all right code all the time that we don't completely understand.
Does it matter? Just never use onload, it's bad practice.
Why is .bind slower than a closure?
00:36
@BenjaminGruenbaum But we don't care about that and can safely assume no.
Does allocating lots of native promises cause a memory leak?
@BenjaminGruenbaum because the v8/other engine teams, haven't got their shit together.
:P
The only difference between you and people using jQuery for the DOM is one more level of abstraction over the API, which - there are hundreds of anyway.
@BenjaminGruenbaum Why would you use bind?
@BenjaminGruenbaum haha why would you need to know that?
00:37
.bind is crazy powerful.
@rlemon I actually kind of know that one
@bjb568 for partial function application.
starred, will read when not drunk
@BenjaminGruenbaum And why do that when you can make quality code?
Drunk, eh?
Two days too late...
00:37
@twiz you don't that's my point, just like you don't need to know about different ajax transports to have jquery make an XHR request on IE6 without knowing how it works internally.
@BenjaminGruenbaum You don't? That's my point to.
@bjb568 wait what? .bind, and the concept of partial function application is insanely useful. The fact you can do that is one of the reasons JavaScript is good.
@bjb568 why use a RAD?
seriously?
Oh ok, I didn't read the whole conversation. Thought you were making the opposite argument.
ummm
so
abstractions are good.
00:39
@bjb568 no, your point was is that you should know layer n-1 (DOM) in order to use layer n (jQuery) which is a popular opinion in this room I disagree with.
@BenjaminGruenbaum Why can I get by with making my closures and proto structure work?
@linstantnoodles but not free. Sometimes you need to use the DOM, or read v8 code.
@BenjaminGruenbaum No, you should know some of layer n-1. You should know what you need to know. And to debug jQuery, you need JS. You're not saving anything.
you guys are saying the same thing
@bjb568 you're asking if you can get by without knowing how higher order function application works? You can, in Java for example stuff like .bind is uncommon. I just think it's worth knowing since it's insanely useful.
@Paul yeah, so I actually know that one, but seriously - it only matters in very few cases. For example, petka would kill me if I used .bind in Bluebird code, but I use it in personal projects and work all the time.
but outside of super performance critical cases. it is perfectly fine
@BenjaminGruenbaum I do know. And I do use it in hacky situations. But it isn't day-to-day-use kind of useful.
I have to add that.
00:42
@bjb568 it's perfectly fine not to know something, lying about it makes you look silly.
@Paul no clue
I don't know lots of shit in JS.
@BenjaminGruenbaum What? I do know it. Why wouldn't I?
omg the amount of API's in JS are tremendous
and JS is very skimpy on APIs
Right, I'm not going to answer to that and just let you climb off that tree.
00:43
@bjb568 Because you're a kitten! Shouldn't you be pooping a box somewhere?
I'm disappointed that I didn't make it to the 2048 doge....
Or maybe I did... not really sure how to know.
oh shit @bjb568 just took a selfie
Professor Schrodinger would like to borrow you for an experiment....
yay my meta post is trending
00:44
@linstantnoodles Nah, that's my friend.
That cat has a very square tail...
@BenjaminGruenbaum why are you so baller
teach me how to js
lmfao
I can totally name like 20 people who are 10 times better than me at JS out of my head.
@rlemon That font…
00:46
Wait, your head runs js?
@BenjaminGruenbaum damn what's their secret
no IMPACT
yo @rlemon that shit makes no sense
Oh gawd I hate IMPACT
@linstantnoodles beta.lemonmeme.com
00:49
0
Q: Testing for specific properties of rejected promises, with Mocha and Chai-as-Promised

toddgeistI am trying to test the specifics of a rejected Promise, using Chai-as-Promised, Mocha, and the "should" dialect. Promises are implemented by bluebird. This works fine: it('it should be rejected when given bad credentials', function () { var promiseOfUsers = db.auth("bad", "credentials").ge...

@BenjaminGruenbaum so I propose that we go back to using static html pages
no css
no scripting
what do you think
inb4 horrible idea
@bjb568 yeah
00:50
seriously
I rather have this conversation on AOL chat rooms
dynamic websites are overrated
down with javascript.
So could "Not a question a professional or enthusiast programmer would ask" replace "off topic" as a category or is it just wordier?
@linstantnoodles I don't think that is the popular vote
but hey, thanks for trying!
@rlemon prefix that last one with "givemethe"
nah I got mad love for javascript
00:53
But I am just a silly Canadian. I may be wrong...
make it into an explanation that can be linked for the gimme-the-codez people
room.thejavascript.ninja
A pie chart tool should be built atop Lorem Pizza
@Paul legit question
there's an opportunity cost to spending all this time sexifying an HTML page
I could be making aerospace software bro
but yeah for sure I'm prob in the wrong room.
idr who linked that nicholas zakas video but i like it so far
i did the same trick to get my mom to stop using ie too
01:04
@Meredith which?
Change the ie icon to point to firefox
I actually pointed it to chrome but he did ff
@Brad 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.
01:21
lol, I just ran into a question
And it was the last one @bjb568 answered
And it was about how shitty NodeLists are
haha
I don't like infinite scrolling
It's becoming so popular these days
I came to ask - are Java Apps on browsers 'stand-alone' applications? Is it possible to send data from them to the browser?
Java on the browser is dead
E.g. If I have a simple java app with a radio button group is there a way I can record the response of what radio button the session user pressed and store it in the cache of the browser or a database (e.g. sql)?
01:35
Has been for about 5 years now, most browsers won't run Java applets.
I would not invest any time in developing Java browser apps.
@BenjaminGruenbaum runescape.com
If you must use Java (and you really don't have to), at least use GWT
@Meredith that's still a thing? I remember playing this like 12 years ago
It sucks now
@be
Was just making a joke
@BenjaminGruenbaum is GWT 'standalone'
01:37
@BDillan just use JavaScript
or is it 'ingrained' in the browser
GWT just compiles Java to JavaScript
You can send http requests with java
Also with JS
My whole web service is written in PHP
(the dynamic part)
01:37
Just learn JavaScript, seriously.
Java and JavaScript are completely different
As car is to carpet
If php is the dynamic part of your application
You messed up
But it's not hard to sit in one if you know how to sit on the other
except of course only the sitting part is the same.
@Meredith like Wikipedia and Facebook messed up.
How do you sit in a carpet but on top of a car?
Exactly
also cars have carpet in them
01:39
This chat is called javascript
so java has javascript in it
For data manipulation you use PHP.
For visual and behavioral effects you use JavaScript and be a kiddie
okay maybe that was not the best metaphor.
lol "and be a kiddie"?
01:40
So I guess its javascript IN PHP
i use nodejs to parse php and execute it
idk ive learned what to say to make you uncomfortable and i cant stop
HAMMERTIME!
Now why does Google need to use document.write in their friggin loader script?
01:44
Guys - when I log out how can I look at 'these' messages in the future?
@Qantas94Heavy probably to save a byte
@BDillian there is a load older messages and load to my last message buttons on top of the chat
@Qantas94Heavy did not check the code but if they are writing a script tag it could probably be because of delay loading stuff based on location/browser capabilities(what is turned on and what is not)
02:00
0
Q: Bluebird promises - how to explode an array, then map it?

AlastairIf I have an array: ['one.html','two.html','three.html'] how could I explode that array, apply a chain of promises to it, then combine it back together again? At the moment my code is like this: Promise.map(['one','two','three'], function(i) { dbQuery('SELECT ' + i); }).then(function(resu...

@BenjaminGruenbaum It's not perfect. But at least it isn't jQuery.
02:32
@fmquaglia 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.
thanks for the welcome @CapricaSix that is
02:57
Does anyone know why one might set all of their click events as 'touchend click'? I'm getting double triggers all over the place and I can't for the life of me figure out why someone would do that... everywhere!
0
Q: Can I assign a Javascript variable to any number?

user3583667Good day! Is assigning a Javascript variable to any number possible? I know iterations and incrementing values are a solution. But with this kind of structure, I can't figure out how. @(user: String, first: List[Tag]) <link rel="stylesheet" media="screen" href='@routes.Assets.at("dist/themes/de...

This is why I don't like people using libraries/frameworks without understanding javascript
He's trying to use a jquery plugin but he doesn't know how variables work
@monners One or the other, not both. Mobile detection req'd.
What templating framework is that?
I have no idea
03:38
@jihchuan 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.
hi, quick question, i wanna pass in dynamic value to my .js but i want my .js cache-able as well..

initially i use php
<script type="text/javascript" src="file.js.php?myval=<?=$myval?>" />

but this is not cache friendly..

is there any alt way to make it cache-friendly?

does it helps if i put
header("content-type: application/javascript");
inside my file.js.php ?
i know there another alt way is using global var, but still searching for better alt way..

<script type="text/javascript">
var myval = "<?=$myval?>";
</script>
<script type="text/javascript" src="file.js"></script>
03:54
header("content-type: application/javascript");
That just tells the browser that they're dealing with javascript, not html
And you can't cache a file that might change
That's the whole point of caching. You know it won't change, so you save it to your harddrive and access it there instead of downloading it every time.
ohh... okay i got wat u mean, stupid me haha..

"And you can't cache a file that might change
That's the whole point of caching."

thanks for the lightbulb bro
@user1574779 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.
@Bartek Dude, Haskell ruined my dream
I was of course saving the world (or destroying it? I dunno) via some video game with robots and shit, and had to solve some equation. But there was this weird operator, and I couldn't figure it out
Alarm clock rang, snoozed, went back to sleep, brain kicked to fake overdrive trying to figure out what the fuck it meant. Did bizarre unit conversions, integrals, nothing.
Woke up disappointed, got some juice, and as it started pouring into the glass, it dawned upon me what <*> is
04:11
I have had the same dream!(xkcd), it's awesome!
@BenjaminGruenbaum Hit him.
Not Spundun. Bartek.
Nice
Last night I had a dream that I stole a knife from subway
04:28
@ketan 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.
@MQuy 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.

« first day (1325 days earlier)      last day (3845 days later) »