« first day (1699 days earlier)      last day (1722 days later) » 

3:00 AM
Seems to work. IE9+, if I'm not mistaken.
 
[ SmokeDetector ] Repeating characters in body: PHP variable image dependent on status value by xorn956 on stackoverflow.com
 
Might work.
 
@bjb568 ...
Dynamic. As in, $(document.body).on('click', 'p', function(e) { ... })
So that if you add another p element with JS, the listener still works on that.
 
3:03 AM
@bjb568 Ok, now make that accept a selector like p.classname:has(span)[width=100].
 
@bjb568 should say something for testing purposes.
 
> If I am a Matrixarian, and I find a red pill on the ground should I take it?
what the...
 
@Doorknob k
 
@Braiam I would only take the blue pill.
 
3:06 AM
@Doorknob is it the computed width, the width attribute, the style attribute width, or any CSS width?
 
@bjb568 Oh yeah, and remember that "cross-browser, terse, and elegant" thing? Yeah.
It's an attribute selector.
 
jQuery isn't elegant.
@Doorknob Why would p have a width attr?
i.e. what are you trying to do?
 
Oh please. How could you make $(document.body).on('click', 'p.classname:has(span)[width=100]', function(e) { ... }) any more elegant?
that's not the point. It's any attribute.
 
@SantaClaus ?
 
@SmokeDetector fp
 
3:08 AM
@Doorknob Registered question as false positive and added title to Bayesian doctype 'good'.
 
@GnomeSlice jk. But why isn't Chrome prompting me to use google translate on that?
 
@bjb568 Oh yeah, and can you make it only trigger for even-numbered paragraphs? And do it elegantly, like, say, by adding :even to the selector? Because that would be great.
 
@Doorknob It's easy. Use jQuery. ;)
 
@Doorknob $ is an awful function name, method chaining is ugly, single-lined call with multiple args is hard to read, not clear what document.body is for, p.classname:has(span)[width=100] is not descriptive, function should probably be outside of call and named
@Doorknob No. You would never need that.
 
@GnomeSlice I guess its partly english
 
3:10 AM
@SantaClaus I dunno, me neither. It does have English on it.
 
> method chaining is ugly
wat
 
> At their first meeting, Veto, Slime Girls, and Space Boyfriend said, "Let's do an anime comp!" Various chiptune artists have come together to cover anime songs. Please enjoy this free compilation!
 
That's one of jQuery's better design choices
 
no
 
@bjb568 If $ is a bad function name, then bjb568 is a bad username.
2
 
3:11 AM
this().that().theotherthing().pls().kill().me().now()
vs
document.something().forEach(functionName)
function functionName () {some; things; here}
 
@bjb568 You can use the jQuery name instead, chaining is wonderful, if you say functions can never have multiple arguments you're missing the point of functions, your own example has document.body in it as well, the selector is the most descriptive you could ever hope to be (it's literally a CSS selector), and you can move the functon out if you want.
All of these arguments make no sense whatsoever.
4
@bjb568 But what happens when you do? Loop through every single child element? How about no.
@bjb568 $('document .something').each(functionName); function functionName() { some things }
 
@bjb568 I likez the topz
 
@bjb568 Did you know you can put chains over multiple lines? I know, it's a pretty neat feature. :)
 
@hichris123 He must be preparing for April Fool's day.
 
@Doorknob jQuery isn't descriptive at all, chaining is horrible, functions on ONE LINE can't have multiple long arguments with functions inline, my own example is clear in what document.body is for, it's a CSS selector that shouldn't be used, I was complaining about your code: of course I can fix it
 
3:13 AM
foo.this()
   .that()
   .theOtherThing()
   .pls()
   .kill()
   .me()
   .now()
 
@Doorknob No, you're doing it wrong if the oddness of the order of an element has anything to do with what clicking on it does.
@AlexisKing foo.this(); foo.that();
 
@bjb568 DRY
 
Can we just ban @bjb568 for having an illogical argument?
5
 
> You find that Microsoft and Sun have released incompatible class libraries both implementing Gun objects. You then find that although there are plenty of Foot objects implemented in the past in many other languages, you cannot get access to one. But, seeing as JavaScript is so cool, you don't care and go around shooting anything else you can find.
 
@Doorknob var myClassElements = document.getElementsByClassName('myclass'); for (var i = 0; i < myClassElements.length; i++) {}
@SantaClaus yer weird
 
3:15 AM
Is @Undo awake?
 
@AlexisKing that doesn't help
 
@bjb568 You can use whatever name you want, about 99% of people disagree with you on the chaining front, there's this wonderful thing called whitespace!, my example is just as clear as yours, and a CSS selector is much more readable than element.this && element.that && element.ohHeyOneMoreThing.
@SantaClaus please do
 
@bjb568 No I'm Santa. You're weird.
 
@AlexisKing how is that any better that repeating foo if that's what you want? And why would you need to do that many things with the same foo?
 
I prefer functions that accept no argument. They are much easier to get along with.
 
3:15 AM
Naughty List: bjb (called Santa "weird" (and used horrible grammar too!)).
 
@bjb568 Hooray, a variable that you're using for absolutely nothing else. How is this better than $('.myclass').each()?
 
@AlexisKing No, explicity is not repetition.
 
@bjb568 What if it's, say, a two-column list, and you're using width: 50%; float: left; elements?
 
@SantaClaus Is Santa a grammar nazi?
 
@bjb568 uhhh... it literally is
That's actually the definition of repetition
O_o
 
3:16 AM
Don't worry, @bjb568, I still love you even when you are completely illogical. I'll just give you unicoins for christmas this year.
 
@bjb568 First of all, you don't have to give it a name. Second of all, the DOM sucks and everyone knows it. jQuery makes the DOM sane. You shouldn't need it 95% of the time anymore, but if you need to do DOM manipulation, it's a good tool to have.
 
@Doorknob Nobody uses "element.this && element.that && element.ohHeyOneMoreThing", if you need a CSS selector, you probably should be using CSS
 
@AlexisKing amen!
@bjb568 wat
 
@tchrist wot
 
mumbles bjb real name is James Kylemumbles
 
3:18 AM
@Doorknob you can use forEach if you want, but I like to see an explicit for loop and it performs better
 
@bjb568 So what happens when you need to select a certain element with a certain class with a certain attribute that contains a certain different element (which can also be a CSS selector) that happens to be the 2nd child of its kind within the parent? What then?
 
I think @bjb should stop writing JavaScript and pick up Enterprise Java.
 
@Doorknob I don't know, then what? Why would the click event be different?
 
@bjb568 Because obviously everyone's going to notice that 0.1ms difference. Totally.
 
@Doorknob Being explicit is not having ambiguity. Repeating doesn't remove ambiguity.
 
3:19 AM
@bjb568 Let's say you only want to add click events to the left column. So you need to select even-numbered elements.
@bjb568 What?! We're not even talking about ambiguity here. I have no idea what you're even trying to say.
 
Also, I heavily distrust anyone who thinks using for(var counter = 0; ... instead of functional looping constructs is more readable.
I write my JavaScript armed with lodash and liberally-applied _.map.
 
@AlexisKing Give what a name? Disagree about DOM. You should try XML. JS is for DOM.
 
@bjb568 wat
 
@Doorknob He is trying to say you are a doorknob and he discriminates against black people.
 
sigh
 
3:20 AM
what are you even saying there
 
@bjb568 You would know whether I wot or whether I wist, and when, right?
 
^^
 
mumbles jsnode mumbles
 
@ɥʇǝS People don't write conditions for an element in the event listener.
 
(Of course, I also write my JavaScript in CoffeeScript.)
 
3:21 AM
@Doorknob You don't need that. Unless you can think of a practical example, you won't convince me.
 
@bjb568 Uhh, no, they write them in the selector. Hey, how about a good old everyone-recognizes-and-understands-it CSS selector!
 
This conversation is making me mad. This is why education in functional programming should be mandatory.
 
For programmers, you mean
 
@Doorknob I do notice it when it's a 3s difference because somebody is displaying a graph of something like CV queue volume over time with 10k points
@Doorknob Why?
 
@bjb568 If it's slow, optimize it. Remember how premature optimization is the root of all evil?
 
3:22 AM
@Doorknob If you say foo.something = something, it's obviously an assignment to something in foo
 
@bjb568 I'd argue that's only because you're excessively used to C-like syntax.
 
@bjb568 Fine. How about a chess app. We want to let the user click any square with a piece of his own color. $('#board .square:has(.piece[data-color="black"])'), done.
 
For me, (set! ...) or anything than ends with ! means mutation.
 
@AlexisKing It's clear there's a loop and we're going for some index thru some array
 
3:23 AM
There are literally millions of examples.
 
(Using Scheme.)
 
@AlexisKing yuk
 
@AlexisKing u wot
 
@bjb568 lrn2functional
 
3:24 AM
@Doorknob They also don't do that. They just select all of a class.
 
@bjb568 "I'm going to cherry-pick only the specific examples that fit my argument, and ignore the majority!"
 
@bjb568 I wot what you want, wot wot!
 
@AlexisKing No. Just no.
 
@ɥʇǝS this (heh) is the great vanilla JS/jQuery debate.
 
@AlexisKing I like C, what's wrong with that? It's readable.
 
3:25 AM
@AstroCB LOL!
 
@bjb568 ... because only the left column can be clicked? You are missing the point. How would you do this in vanilla JS?
 
That is hilarious.
 
@ɥʇǝS At this point, I'm just mad that @bjb seems to think for loops are better than higher-order constructs.
 
@Doorknob document.getElementByClassName('blacksquare')
 
@bjb568 It's readable because you grew up on it. xD
 
3:26 AM
@Doorknob give me a few then
@AlexisKing NUUUUUU
 
@bjb568 How convenient, so do your powers somehow include conjuring up class names that exactly fit your use case?
 
Seriously, though, functional programming is really, seriously important.
 
Explicit loops are easier to read:
loop:
mov r0 @(r1)+
dec r0
bne loop
 
Maybe you should take this discussion to this convenient room I just created:
 
Why am I even continuing this discussion?
 
3:27 AM
@Doorknob The performance thing was a side comment, it's important sometimes, so I like vanilla. And if you use it all the time, even for other reasons, it makes it all merrier when you need to optimize but already have.
 
@SantaClaus Nah, I'm done here. Have to go to sleep soon anyway, and no point in arguing with someone who isn't willing to listen to an argument.
 
@Doorknob duty calls
 
@Doorknob Why would only the left column be clickable? I'm not going to throw together crappy code for a crappy purpose if the purpose doesn't exist in noncrappy form.
 
@Doorknob To make a difference in the corrupted mind of a individual,
 
@Doorknob but... DUTY CALLS!
 
3:28 AM
@AlexisKing I'm growing. Present progressive.
@Doorknob Whoa, like we can write HTML even now!
It's like front end developers use HTML, CSS, and JS appropriately and interrelatedly.
 
I was locked out of chat for a minute or two; I figured @bjb broke it with vanilla JS.
3
 
For some reason this reminds me of the time I was at a robotics competition.. I was trying to help someone with their robot programming and I was like "ok now just commit the code and test it. If it doesn't work backup to the earlier commit on the robot and debug on the development machine". He looked at me kind of blankly and then was like "Ohhh, right." and he proceeds to use Save As.. on the entire project and save it somewhere as backup, in case it doesn't work.
 
whatever that means
 
I notice 4 other of the same project in that folder..
 
@tchrist yeah!
 
3:29 AM
@bjb568 Now is a fine time to learn a non-C-like language! It'll really make you a better programmer, even if you never use it. Being able to think in terms of more abstract concepts than C-like syntactic units is a very, very good thing.
 
@SantaClaus hey
 
@bjb568 hey
 
hay is what horses eat.
 
@AlexisKing What'd you recommend?
 
user259867
Haskell.
 
3:30 AM
@bjb568 Prolog.
 
@AlexisKing Ooh, that sounds like a good idea. I'll second bjb's question there.
 
Note to self: Tavern fights are a great time to test chat scripts.
 
@tchrist looks interesting
 
@bjb568 I'm partial to Racket/Scheme. The tooling is excellent, the community is fantastic, and there's an abundant amount of learning materials.
 
@Woodface doesn't look interesting
 
3:32 AM
hm, I have a friend who was learning Haskell. Perhaps I'll give that a go.
 
If you want to avoid the "Lisp stigma", though, Haskell and Scala are good languages, too.
Though tbh, Haskell and Scala can both sort of hit unfamiliar programmers over the head with their complexity.
 
@AlexisKing interesting that the first example on wabsite was for loop
 
@AlexisKing I'm not going to pretend I know anything here.. but I thought Scala was Java based, which in turn was C based?
 
@bjb568 It's a little different from a JS for loop. ;)
More like forEach.
 
JS has forEach.
JS has for in
JS has for
 
3:33 AM
@ɥʇǝS Everything is ASM based, if you go down far enough!
Scala does run on the JVM, though. So does Clojure.
 
@AlexisKing Touché.
 
I didn't even notice before, but apparently JS has do-while too.
 
Both much, much better languages than Java, though!
 
@AlexisKing So is a boot to the head.
 
@bjb568 All of those are imperative looping constructs.
 
3:34 AM
I'll agree that anything is better than Java.
 
Racket's for loops are functional (mostly).
 
@AlexisKing Can I ask why you hold that opinion? (purely out of interest)
 
Plus, they're also just macros for recursion under the hood.
@ɥʇǝS I've done a lot of work in Java, and it has a lot of problems.
I could probably spend hours explaining why.
But, to keep things simple, I'll just list a few issues.
 
1. It's Java
:P
 
@AlexisKing Care to innumerate a few for me?
I find these discussions teach me lots of new things.
 
3:36 AM
@AlexisKing I haven't, and I agree it has a lot of problems.
 
I find these discussions makes me hungry... for some reason.... maybe is time to get popcorn
 
1. Its type system sucks, and it has basically no inference.
2. Related to the above, it's horrendously verbose.
3. Its first-class function support doesn't exist (and Java 8 "functional interfaces" don't count, though they're much better).
4. The everything-is-an-object model encourages cruft.
5. The lack of syntactic expressiveness leads to **loads** of boilerplate.
 
Get ready for some timely irony: in writing this bjbTrnslatr script, I came across an error ([Error] NotFoundError: DOM Exception 8: An attempt was made to reference a Node in a context where it does not exist.). So, I go to Google and search it. I come across a nice Stack Overflow post with the error, and scroll down to the answer, written by @Braiam.
He wrote this:
> So we just made use of full jQuery instead the DOM method and the error goes away: [code]
 
lol
 
Then, after, this:
 
3:37 AM
haha
 
> Or use ugly JavaScript: [code]
 
@AstroCB actually... is a quote
 
@bjb568 revised it to say this:
> Or use awesomely kewl JavaScript:
 
You're welcome.
 
3:38 AM
With an edit comment:
> fix obvious typo
 
I will rollback war if anybody disturbs that.
:P
 
I've rolled it back. ;)
 
I sometimes prefer plain JS if there's a performance reason
 
YOUR MOVE
 
QA6
 
3:39 AM
> QA6 ???
 
Should I just make it neutral?
 
@AlexisKing cool, thanks. I don't understand all of that so I'll have to go read up on some of it (yay learning), but something piqued my interest there. Why do you consider it horrendously verbose? Did you mean in syntax or the steps it requires you to take to accomplish x vs another language?
 
@bjb568 If you change it, I'll flag. Clearly conflicts with author's intent.
@ɥʇǝS Both. The two are quite related, though.
I'm a total programming language nerd, so I love discussing these things.
 
@AlexisKing gah, fine
 
3:40 AM
I'll try not to flood the tavern, though.
 
@AlexisKing Interesting.. Thanks!
Unfortunately it is time for me to head off to bed.
I should try to find a good book on the more abstract parts of good programming as I don't understand them too well.
 
@ɥʇǝS Can I recommend a link?
 
Good night guys! Enjoy your popcorn @Braiam ;)
@AlexisKing Please!
 
document.createElement('img'); => know exactly what it does even if I've never done javascript before. $("<img>"); => syntactical noise, it could have any implementation since it does not specify the implementation with any (english) name. — FlavorScape Oct 16 '13 at 21:55
 
@ɥʇǝS Check this out. It starts from the bare basics, so feel free to skip through the beginning sections, but I know numerous experienced programmers who have read it and found it helpful (including me!). It's a different approach to programming.
 
3:43 AM
BTW, jQuery('image') does not solve the problem that it sucks.
 
btw, you shouldn't follow that Q @AstroCB as it was a workaround for something Chrome broke (which was working) and worlds apart your problem (through it can shed lights if you are facing the same issue)
 
@bjb568 Tbh, I don't disagree in that particular use-case. But, IMO, doing manual insertion/removal of elements in 2015 is misguided.
Use Angular or some other MVC library.
 
Why?
 
@Braiam That's what I figured; I just thought I'd share the timely disagreement.
 
@AlexisKing Cool! I cannot guarantee I will finish it, I am finding my time pulled in many different directions lately, but I will definitely start it and bookmark it :)
 
3:44 AM
The web isn't MVC.
 
@bjb568 Oh but it is! :D
 
MVC isn't a bad concept, don't get me wrong, but forcing it upon the web is just unnatural.
 
@AlexisKing main(){char m[]={10,46,101,110,105,118,105,100,32,101,115,114,117,99,101,114,32,111,116,32,4‌​4,110,97,109,117,104,32,115,105,32,101,116,97,114,101,116,105,32,111,84,00};f(m);‌​}f(char*s){if(*s){f(s+1);write(1,s,1);}}
 
The web is honestly one of the most natural ways to apply MVC.
It's specifically designed to accomplish things that modern web apps do.
 
@bjb568 Oh there are definitely things you should use Vanillia JS for, but there are also things you should definitely use jQuery for. IMHO.
I wish the EMCA people would adopt most of jQuery's features. At least, I think I hope that..
 
3:46 AM
@tchrist eww, what is that and how can I kill it with fire?
 
There is but one way to learn, grasshopper.
 
@tchrist No compiler of mine is going to be fed those characters. ;)
 
@AlexisKing Mine works just fine. Then type a.out
 
I'm not saying it won't work. I'm saying I don't want to compile it. :P
 
Fear is the mindkiller.
 
3:47 AM
I can't imagine it does anything I care about, tbh.
 
Poor summer child.
 
I am not a C expert by any means.. but a quick try with gcc doesn't work. Could be my idiocy though.
 
@ɥʇǝS they are adopting strong typed features so...
 
(yes, I'm going to steal a page from @Doorknob's book)
 
@tchrist Your paste has unicode characters. Clang spits them out. Happy now?
 
3:49 AM
ok, I am obviously too tired.
Going to bed now.
 
eh, I somehow linked the wrong xkcd to the wrong reply... and lost the original idea laughing at my mistake
 
@AlexisKing this is essence of web jsfiddle.net/xztp55u4
 
@bjb568 Good luck making StackExchange with that.
 
tchrist% cat a.c
main(){char m[]={10,46,101,110,105,118,105,100,32,101,115,114,117,99,101,114,32,111,116,32,44,110,97,109,117,104,32,115,105,32,101,116,97,114,101,116,105,32,111,84,00};f(m);}f(char*s){if(*s){f(s+1);write(1,s,1);}}
tchrist% cc -Wno-all a.c
tchrist% a.out | wc
       1       7      40
 
@AlexisKing what?
 
3:52 AM
It’s your kind of program. Obviously.
 
@bjb568 A web application is very different from what the semantic web used to be. Static content is meaningless. Data is everywhere. Pages are dynamic and require templated interpolation.
 
> a.c:1:93: error: non-ASCII characters are not allowed outside of literals and
identifiers
 
@tchrist That worked. :)
 
@AlexisKing I don't usually see people make that distinction. But anyway, static content is the opposite of meaningless.
 
I have no non-ASCII.
 
3:53 AM
zsh @tchrist?
 
@bjb568 You're right. Meaningless was a terrible word there.
 
@tchrist that doesn't errors out
 
@AlexisKing Thought so.
 
(yes I'm still here.. OS updating)
 
Replace "static content is meaningless" with "purely static content is useless".
 
3:53 AM
I don't get it.
Websites/webapps are for presenting content.
 
0000000 6d 61 69 6e 28 29 7b 63 68 61 72 20 6d 5b 5d 3d
0000010 7b 31 30 2c 34 36 2c 31 30 31 2c 31 31 30 2c 31
0000020 30 35 2c 31 31 38 2c 31 30 35 2c 31 30 30 2c 33
0000030 32 2c 31 30 31 2c 31 31 35 2c 31 31 34 2c 31 31
0000040 37 2c 39 39 2c 31 30 31 2c 31 31 34 2c 33 32 2c
0000050 31 31 31 2c 31 31 36 2c 33 32 2c 34 34 2c 31 31
0000060 30 2c 39 37 2c 31 30 39 2c 31 31 37 2c 31 30 34
0000070 2c 33 32 2c 31 31 35 2c 31 30 35 2c 33 32 2c 31
0000080 30 31 2c 31 31 36 2c 39 37 2c 31 31 34 2c 31 30
Notice that all bytes are below 0x80.
 
➜ ~ ./a.out
To iterate is human, to recurse divine.
 
Therefore, it is ASCII.
 
Templated interpolation sounds like clicking a link and changing pages.
 
How? Look at the web? Look at how it works! Look at the front page of Stack Overflow. It's structured, right? It's generated from some underlying data model. The page is the view. The data is the model.
Ever use gmail's web client?
 
3:54 AM
@AlexisKing ugh no
2
 
Ever used StackExchange chat?
 
@AlexisKing So? There's static content that's easily representable with HTML only.
 
My point is, StackExchange is MVC. You're talking on it right now. And that doesn't represent static content at all.
A server is generating all that content using a templating engine of some sort.
 
@AlexisKing Yes, there's static content, some optional style, and a simple mechanism of adding content.
 
@bjb568 Then it isn't static anymore.
 
3:56 AM
@Braiam Mirabile visu. :)
 
It's static, just some new stuff is added.
@AlexisKing Templating engine?
 
@bjb568 How the hell did you make DevDoodle and somehow continue to not understand the basic concepts of webdev? o.O
2
 
yawns
I feel like I am supposed to genuflect.
 
How does your server generate its pages? What serverside software are you using? Node? Ruby? PHP?
 
@AlexisKing Oh, I guess I wrote the tempting engine myself. It's just the backend.
 
3:57 AM
@ɥʇǝS undo is awake, at least for a few minutes.
 
I'm using node.
Vanilla-y node.
 
@Undo I forgot what my question was :/
 
@bjb568 Are you manually using string concatenation to generate your webpages? o.O
2
 
yes
 
twitch
 
3:58 AM
aha, I had copied it wrong.
 
:P
 
@Undo Trying to remember..
 
bangs head against wall
 
Have people truly forgotten how to write simple programs?
 
HTML client asks vanilla node client for static content, maybe it gets from kewl mongodb data, uses some functions that I wrote to output header/footer, returns data to HTML client, HTML client shows static content.
 
3:59 AM
Programs that don’t give a flip about MVC patterns?
 
And here you are talking about performance of for loops, yet you're manually generating your pages with JS string concatenation.
 
@AlexisKing psst, I figured out how to include files
@tchrist the world isn't all MVC.
 
@bjb568 What’s a “file”? Is that like a row?
 
@tchrist I hate design patterns. That's why I use Lisp. ;)
 
Or is it more like a column?
 

« first day (1699 days earlier)      last day (1722 days later) »