« first day (2747 days earlier)      last day (2203 days later) » 

3:00 PM
why was java 6 afraid of java 7?
 
or did you use a lib for working with json?
 
because java 7 java 8 java 9
 
because he jr8 9
 
well, it 8 part of 9
 
@Wietlol My point is, it's perfectly fine to form opinions and hate on things, that's part of a developer's life, but I hate (see what I did there) opinions that are formed based on things you've heard or read as opposed to actual pains you've encountered by using and doing.
 
3:00 PM
is 9 the one that's all modular now?
 
it is yes
 
@ndugger because SevenFactoryEightFactoryNineFactory
 
@MadaraUchiha my pain comes from me having to do it
 
which 7 8 9 java joke will get starred? you be the judge, find out today on dragonball z
 
last time I used js and php was on an internship, the entire website was made in react js
 
3:02 PM
A Java dev forced to do JS hating on JS? That's original
 
the problem was that it was made without any structural design
 
@Wietlol That's definitely the faults of the developers in the company you worked in
And not react's or JS's
 
@Wietlol so you hate the design of the app, not the framework
 
We have had ± the same issues, and we fixed them, slowly but surely.
 
3:03 PM
ohhi
 
@BenFortune o shit
 
Its like saying you hate mcdonalds because you were once served uncooked fries
 
it could be that my hate is partly because of the people who worked there
mostly because they were idiots, but yea
 
user1596138
@BenFortune My god is this a real convo
 
@Jhawins No. They never are
 
3:05 PM
@BenFortune Oh snap
absolutely barbaric.png
 
r/murderedbywords
 
user1596138
> To beat porch thieves, Amazon slips packages in car trunks
 
user1596138
You think I can just leave my trunk unlocked? That's not even how my car works
 
they break in
for your cause
 
you leave it open, they put the package in, they close it
 
user1596138
3:06 PM
WHat a stupid idea lmao
 
@KendallFrey :)
 
!!afk Rofl, they actually want me in on a spec meeting....
 
you hope it doesn't rain before they show up
 
lol amazon
 
@Jhawins Or, and this is revolutionary, coordinate delivery to a time when you're home
Alternatively, deliver to work.
 
3:06 PM
@rlemon the fuck
 
tell them to put it in your garbage can
 
you just send them the spare key to your car
 
they'll never know
 
@MadaraUchiha that is some next level thinking
 
@ssube kid decides it's a nice hiding spot, crawls in, dies, parents sue you, you end up homeless.. but hey, your DVD came on time.
 
user1596138
3:07 PM
@MadaraUchiha Right? Or just let me go pick it up iunno
 
so there's a plus
 
@hilli_micha what if you segregate
 
Or shoot your neighbors
 
user1596138
@rlemon I think that would go to the manufacturer
 
@rlemon just drive the car off a cliff
 
3:07 PM
> UPS offers to meet you in a poorly lit parking to to exchange packages
 
@rlemon don't joke about that, that's a legitimate fear I have for having a pool and being a neighbor to a family with 3 kids.
 
the kennedys solved that problem long ago
 
> Oh yeah timmy jumped your fence, opened your locked screen patio, and then drowned in your pool, we're sueing you.
 
50/50
 
@hilli_micha Welcome to America.
 
3:08 PM
@hilli_micha around here, at least, insurance companies want to make sure you have a locking fence in order to insure your pool
 
@hilli_micha then is it appropriate to ask if they want Timmy back or you can like, stuff him and keep as a trophy
 
@MadaraUchiha the only thing free-r than you is your lawyer
 
yeah what @Luggage said. If the pool is "proper" home insurance will cover it ;)
 
probably a result of built in reflexes
 
3:09 PM
The attractive nuisance doctrine applies to the law of torts, in the United States. It states that a landowner may be held liable for injuries to children trespassing on the land if the injury is caused by an object on the land that is likely to attract children. The doctrine is designed to protect children who are unable to appreciate the risk posed by the object, by imposing a liability on the landowner. The doctrine has been applied to hold landowners liable for injuries caused by abandoned cars, piles of lumber or sand, trampolines, and swimming pools. However, it can be applied to virtually...
 
do you know when you press a button, and it get's like "selected" and when you press the space bar it gets triggered again?
how can I prevent that
 
@Luggage Yeah, that's the case here as well, fence is mandatory, but still, given those two things, its nonsense that it becomes that level of issue.
 
already tried e.preventDefault(), doesn't work
 
@hilli_micha meh, driven my insurnance company's desire to never need to pay
 
may I blur them?
 
3:10 PM
@Neoares deregister the click event
 
heh I was reading some crazy stories about Trampolines, my kids want one but I need to check with house insurance. Someones house burnt down, they had a trampoline, insurance adjuster came out, saw it, said the home insurance was fraudulent that entire time due to having a trampoline so the house didn't get covered.
 
> Insurance adjuster goes missing
 
haha
 
lmao what
 
@FlorianMargaine Assuming the usage of var keyword that leaks the scope, JavaScript encourages to use let keyword that follows lexical scoping or Block-scoping unlike var keyword. But lookup of let variables follows the same rule(LEGB), in this code
 
3:11 PM
handleClick(event) {
  event.target.removeEventListener('click', handleClick);
  event.target.addEventListener('blur', () => event.target.addEventListener('click', handleClick));
}
or something like that
 
@Luggage goes missing, or... gets adjusted?
 
@KamilSolecki you have to check if Trampolines are allowed with your home policy, otherwise you can be royally fucked
 
@overexchange let is block scoped, var is function scoped.
 
seriously what the hell
 
That other guy never showed up, can you send a new adjuster?
 
user1596138
3:11 PM
5 mins ago, by Jhawins
> To beat porch thieves, Amazon slips packages in car trunks
 
if it's covered and a neighbor kid breaks their leg home insurance covers it
 
just flush your trampoline before the cops show up, easy peasy
 
otherwise, you do
 
user1596138
Back to that... AMazon gets consent to open your car and doesn't need your key
 
user1596138
Works with OnStar and shit. I should've read
 
3:12 PM
claim the trampoline was a squatter
 
lol
idk I just don't want to get one tbh
 
if you don't save the receipt, can they really prove it was your trampoline?
 
If I want a trampoline, I can go and buy it. If a kid breaks his leg on it in Poland, you can be like nice and buy a bottle of vodka for his parents or something
 
they do blow around in the wind
 
3:12 PM
@ChandraShekharRam Welcome to the JavaScript chat! Please review the room 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.
 
but you cant get sued
 
they seem like a broken bone waiting to happen
 
> that's a trampoline? fuck I've been using it to separate my dirt and rocks.
 
> Sir, this but a really big sifter.
 
@rlemon They used to be called "jumplines" until your mom went on one.
 
3:13 PM
@Jhawins local narcotics division starts delivering for amazon
 
@apsillers what happened to people keeping an eye on their spawn until they are old enough to have common sense not to do stupid shit that gets them killed / seriously injured ;x
 
@Luggage I'm amazed they don't already
or work as pizza delivery
 
user1596138
We had a trampoline like 10" from the pool and went from one to the other all the time.. Nobody ever got hurt idk
 
user1596138
Shits fun af
 
@ThiefMaster spawn campers appeared.
 
3:13 PM
kids a crossed the street had one. it was fun. no serious injuries
 
@Loktar the riskiest part is the edge where the springs are, but you just need the foam edge and net
 
few sprains. but we'd load like max capacity of kids on there and play popcorn
 
@ThiefMaster Murica
 
> More than 1 million people went to emergency departments for trampoline-related injuries between 2002 and 2011, with nearly 300,000 of those injuries involving broken bones, according to a new study.
 
Yeah but when people play stupid games and then bitch about the prizes, we all have to take home a home-version of the game.
 
3:14 PM
so lots of collisions
 
you don't wanna get your ankle caught in there, but the pad makes it pretty safe
 
@MadaraUchiha Using var keyword is not recommended, for the scoping rule it provides(including redeclaration)
 
user1596138
@Loktar FALE NEWS
 
idk that's magnitudes more than mass shootings
 
wasn't there also some state in the US where parents could get in trouble for letting their kids go to school on their own without accompanying them?
 
user1596138
3:14 PM
Fale lol
 
so ban trampolines.
 
user1596138
Ban assault tarps
 
@overexchange let is a stricter version of var
Therefore, it is more recommended for use.
 
const ftw
 
3:14 PM
@overexchange "block scope" or "function scope" are subsets of "lexical scoping"
 
besides, breaking bones is good for you
 
Here's a nice mini-riddle for ya'll
 
Tell that to my knee
 
it's like natural selection for your bones, remove the ones that aren't good enough
 
sorry that was mean.
 
3:15 PM
@rlemon which click event?
 
every time I break a bone it's like telling my other bones "smarten up or you're next"
 
@SterlingArcher did you get it removed after it broke?
 
clicking on a button doesn't mean it has a click event
 
const a = 5;
(() => {
  console.log(a); // what's printed?
  const a = 6;
})();
 
lol no but there's metal in there
 
3:15 PM
@ssube Same thing I told to that kids parents. They didnt like it
 
@Ikari ^
 
@Neoares you tell me, you're the one with the issue
 
in this case it has, but I want it to be attached
 
if a bone breaks, clearly it is inferior, and you probably didn't need it anyway
 
@MadaraUchiha I'd say undefined?
let me run it
 
3:16 PM
Uncaught ReferenceError: a is not defined
    at <anonymous>:3:15
    at <anonymous>:5:3
 
@MadaraUchiha i'd say undefined without running it
 
I just want to trigger a button by clicking it or by pressing space
 
@Luggage Wrong
@FlorianMargaine Wrong
 
the problem is that if I click and then press space, the space triggers it twice
 
@Ikari Running it is cheating.
 
3:16 PM
:P
 
@MadaraUchiha does JS reorder things?
 
1 for the keypress event handler, and the other one cause.. default HTML behavior
 
@KamilSolecki "reorder"?
 
ah, there isn't block hoisting?
 
@MadaraUchiha 6 because hoisting
 
3:17 PM
my answer was dependent on it being transpiled to es5 loose
yea..
 
@FlorianMargaine Nope.
@SterlingArcher Nope.
 
jesus bad typo
 
5?
 
good to know
 
3:17 PM
@rlemon lol
 
@ssube Nope.
 
two saviors for the price of one
 
it gets hoisted but the prev assignment does something and that's the only option nobody has guessed
 
const is not hoisted.
 
oh, it does the right thing
 
3:18 PM
The correct answer is you get a ReferenceError due to temporal dead zone
 
look at JS being sane and surprising all of us
 
@Neoares did you even try the code I suggested?
 
How about this one?
 
@ssube yeah so weird...
 
var a = 5;
(() => {
  console.log(a); // what's printed?
  var a = 6;
})();
 
3:18 PM
oh, so this is the same as var, sort of-- the declaration is hoisted but not the assignment
 
heh surprised you guys didn't know that...
 
@hilli_micha o shit, I got SO open at home
 
@rlemon didn't see it
 
ah, beat me to it with the actualy var case
 
As part of best practice, using let keyword is better
 
3:19 PM
@overexchange Best practice is to use const as much as possible
 
@overexchange const, ideally
 
If not possible, use let
 
8 mins ago, by rlemon
handleClick(event) {
  event.target.removeEventListener('click', handleClick);
  event.target.addEventListener('blur', () => event.target.addEventListener('click', handleClick));
}
 
ah, blur makes sense
 
@MadaraUchiha easy, undefined
 
3:19 PM
var should not be used in code.
 
<s>it's just slightly more surprising with const because we think const can't be assigned after its declaration, which is hoisted</s>
 
but I have a lot of buttons, I don't want to put that inside of every click handler
 
@rlemon jesus that's not good
 
@apsillers The decleration is not hoisted either.
 
3:20 PM
well, I'll work with the blur thing, thanks
 
it's just surprising because everything was hoisted before let/const were introduced
 
@Neoares I wonder how we solved that problem before?
 
jesus
 
yeah, changing the hoisting behavior was a bit surprising
 
@MadaraUchiha if I'm kicked do I rejoin automatically after the kick duration?
 
3:20 PM
@rlemon No idea
 
ohhh, I see. that's bananas
 
Wanna find out?
 
wait, is there actually a scenario where you couldn't rewrite to use const
 
yes please
 
@KamilSolecki some logic becomes pretty ugly
 
3:21 PM
@MadaraUchiha yes... I will add this as part of my best practice document
 
@rlemon you do
 
@rlemon when you come back, no spamming, please.
 
kick him for 500 minutes xD
 
you can almost always refactor it out into methods with a flat if/else
 
That would have been funny if it was a 30 minute kick and we didn't know lol
 
3:21 PM
@KamilSolecki mutable variables?
 
but at some point it's diminishing returns and the functions become too small
 
eg for loop
 
@ssube I usually avoid else
 
@MadaraUchiha ah, the Go style
 
if (something) { return something }
return somethingElse;
 
3:22 PM
I am undecided on that, but have been skipping the else lately
 
@ssube sure, just wondering
 
the SO bot I was working on is written like that, TS-as-Go :P
 
yeah... i like both approaches.
 
there are people who use else if shudders
 
3:22 PM
@FlorianMargaine you can always just recurse
 
If you can't return, you can generally refactor it so that you have returns.
@KamilSolecki for (let i = 0; i < 10; i++) {
 
@rlemon You should get Teamviewer set-up on your machines so you can access them in times like this.
 
@KamilSolecki Big performance penalty.
 
@FlorianMargaine I've never had strong feelings on the if (!x) { error; } else if (!y) { error; } pattern vs using else
 
1 min ago, by Florian Margaine
eg for loop
 
3:23 PM
does that extra if really make a difference? it is more complex, but by how much?
 
@MadaraUchiha yes, but put aside any performance whatsoever :)
I can't think of one and there probably isn't one
 
simply avoid using imperative constructs altogether; go full functional
 
@ssube I must lookup the else if syntax of whichever language I'm using every time because I almost never use it
 
recursion doesn't have to be slow
 
why not just a blur at the end of the click handler? @rlemon
wait is he banned
 
3:24 PM
@FlorianMargaine you never need to (that I can think of), but is there a real downside?
 
@ssube what if your else if condition doesn't hit?
do you take care of that in the code after?
 
@KamilSolecki you do not
@Neoares because you want to deregister the event
 
@Loktar I assume you have if/elseif/else vs if/if/none
 
@ssube no, but I just came to the conclusion that it's usually a code smell, if I see too many of them
 
@rlemon I think you do on mobile
kick me pls
 
3:24 PM
they're equivalent, the first just uses a block for each branch
 
well my issue wasn't mobile.
 
you can skip the last scope and turn the elseif into an if without changing anything
 
my canned responses were doubling up because I am logged in at home too
 
@rlemon no, I want to blur it, so pressing space bar doesn't count as clicking the button :P
 
@rlemon ah
 
3:25 PM
@Neoares now you've said two different things
 
@FlorianMargaine it's such a subtle difference, reasoning about the chain of elses is slightly harder, but only slightly imo
 
I always said that, I think
 
9 mins ago, by Neoares
I just want to trigger a button by clicking it or by pressing space
9 mins ago, by Neoares
the problem is that if I click and then press space, the space triggers it twice
my code solves that
 
@ssube yeah, I'm not saying else if is bad, I'm just saying that based on my experience, given how so little I use it, using it often is a code smell to me
 
yeah, and blurring after clicking does too
 
3:26 PM
I look at else if similar to adding parens around a condition since it's only going to trigger one and be done, a bunch of ifs you have the potential (if you aren't returning out of them) to hit every condition separately
 
@Neoares but then you're fucking with accessibility because you negated a tab order
it's cleaner (imo) to just remove the event and re-register it when they're done
 
no, because there's something I didn't tell you
 
probably not an issue, but doesn't feel right to me
 
there's more buttons that I want to trigger with different keys
xDDDDDD
 
@Loktar yeah, it's only really relevant in the flat C/Go style
 
3:28 PM
like, left arrow and right arrow
 
if (!x) {
  throw new Error('not x!');
}
if (!y) {
  throw new Error('not y!');
}
await something();
return otherthing;
I guess that's slightly easier to read than if/elseif/else, but it's just so similar
 
Angular 2/4/5 technician, can you please comment on this question? Am about to learn usage of interface & class in TypeScript, for Angular 2
 
a bunch of else ifs though are ugly, hell even one is imo
 
with a really long elseif, it does change
 
early return is definitely better than else if, imho
 
3:29 PM
yeah for sure @FlorianMargaine
 
@FlorianMargaine Especially when the nesting starts shudders
 
yeah
 
@MadaraUchiha why'd you have to go there
 
don't nest, call
 
we were having a proper talk, then you had to go to the gross area ;)
 
3:30 PM
 
it's funny how this mostly maps back to cyclomatic complexity, which can be a so-so metric, but does matter
 
if you purposely avoid else, you kinda force the functions to be smaller and more specific
 
@KevinB single logical units, if you will
 
@ssube cyclomatic complexity is actually one of the few metrics I care about
the other being LoC written during the day
(kidding, kidding.)
 
3:31 PM
Can I have a domain object load it's own child data, or is that a bad idea
 
LoC is good, so long as you end up < 0
 
@rlemon also, my users are not going to use tab to move through videoplayer buttons, and less if they have controls for them
 
if 1 == 7 then 7 == 1
 
> my users don't care about accessibility
that's a huge shit show you're walking into
 
@badboy24 That's not true with ==, it is with ===.
 
3:33 PM
man, I'm giving them controls
 
what about users without mice?
 
that's better than moving through them using the fucking tab order
 
I generally use tabs to nav through buttons when I'm really laid back in my chair, and trying to use another hand to use the mouse is a pain
 
@MadaraUchiha when it is not true with ==?
 
@Neoares Why not both?
 
3:34 PM
using tabs is pretty important
 
so, having tab navs is useful
 
@rlemon ? I'm saying I'm implementing controls for the keyboard
@MadaraUchiha they collide
 
accessibility isn't about what is the convenient option. accessibility is about giving them options because they have no other choice.
 
space bar clloides
why would they be able to press tab but not space or arrow keys?
 
user1596138
@badboy24 but moms aren't gay. Wth
 
3:34 PM
some of them are
 
wat
who?
 
I went to school with a guy who had two moms.
 
=== isn't the "some of them" operator, tho
 
today, someone commented on a 5 years old answer of mine
I have a suggestion. eval([1,2,3,4].join('+'))peter yesterday
 
oh dear
 
3:35 PM
That's a bad suggestion
 
hm.. youtube keeps tab order
 
Oh man, Peter Yesterday, I haven't seen him since high school
 
lul
ok, I'll use another button instead of space for play/pause the video
and everything will be happy
 
What is happy
 
Peter Yesterday is the non-procrastinating Peter Parker
 
3:36 PM
@SterlingArcher a cat
 
what is sadness?
 
@Ikari can second that
 
cats are the devil
 
and soulless
 
Peter? I hardly knew 'er.
 
3:37 PM
key suggestions for play/pause the video?
 
I want a cat but I have no desire to maintain a litterbox
 
@KendallFrey I love that joke
 
@KendallFrey I stand corrected, seems like it is so in JS
 
@Neoares play/pause key
 
It isn't so in PHP
 
3:37 PM
for next/previous frame I'll use arrows
 
@SterlingArcher Get one that shits all over the place. Problem solved
 
@KendallFrey no way
 
why not
 
@SterlingArcher auto scooping boxes work okay
 
cause that triggers many things
like spotify
 
3:38 PM
!!afk garden center
 
@rlemon in a small apartment there's no real good way to hide it
 
@rlemon your spelling is embarrassing
 
@SterlingArcher do you have room in the bathroom?
that's by far my favorite place to put em
 
@SterlingArcher have kids, make them clean it
I haven't cleaned a litter box in years! 😉
 
s/clean/use/
 
3:39 PM
@ssube I mean, maybe under the vanity but I don't want to do that
 
user1596138
HEy anybody know what this is
 
@Loktar litterbox > diapers
 
user1596138
 
user1596138
Safari. It does absolutely nothing and only shows up in 1 input I have seen
 
@Loktar lmao no way brah
 
3:40 PM
some HTML elements
 
user1596138
The little person with the arrow. Safari adds that
 
@Neoares Clicking on the video surface
 
As well as space and enter (even when video itself isn't focused)
 
@MadaraUchiha good one, I'll implement that also
I have it already in my videoplayer, but not in the video editor interface
 
user1596138
3:40 PM
@Loktar Jesus thats stupid
 
user1596138
Idc I'm leaving it
 
@MadaraUchiha have you read the whole thread about using space?
it seems it's not a good idea
 
@Neoares YouTube uses it, it's expected by this point.
 
since it triggers the last pressed button
 
you mean using space to start/stop a video?
 
3:41 PM
Sure, space is used for scrolling down
 
i hate that
 
@MadaraUchiha no, by pressing space you trigger the last button you pressed in youtube's videoplayer
 
youtube, netflix, hulu
 
just checked it
@KevinB yep
I'll go with p, probably
 
@Neoares Or, if you hadn't pressed anything, it pauses the video.
 
3:42 PM
Space should be for pausing starting for sure
 
user1596138
Second safari question. Anybody got sourcempas to work? It jus wont work
 
@MadaraUchiha yeah but I'm in the case in which the user already pressed something
 
0
Q: Use object property values of two JS array of objects

Shehab EltawelI have two arrays let arr1 = [{'id': 'ee', 'seat': '12'}, {'id': 'aa', 'seat': '8'} ] let arr2 = [ {'id': 's22', 'num': ''}, {'id': '2s2', 'num': ''} ] I want to copy seat values from arr1 to num property at arr2, but I only get last arr1 seat value in for loop. for( let i = 0; i <= a...

 
@Loktar but then what do I do with tab order
people are telling me it's the most important thing in the world
 
how are shortcuts and tab order related?
 
3:44 PM
it's related if you want to use space as a shortcut
since it's what triggers buttons in tab order
 
so does enter
 
ok
now there are 2 keys I can't use
 
there are more than that, but I don't see the problem with space
alnum and punctuation are allowed to be app shortcuts
 
let's say you want to trigger a button by pressing space
and you have the focus in another (or the same) button
you press space, both get fired
or twice the same, in the second case
 
3:46 PM
uh, you can prevent that
 
@ssube prevent what, exactly
 
two events from firing
 
it's not about preventing
let's say I have focus on A
 
@Loktar those kids are so cringy
 
I press enter
what should happen?
what's the expected behavior
 
3:47 PM
prevent the message from A, fire B
but using enter as a shortcut is a bad idea
 
fuck, messed it up xD
@ssube that's what I was saying
 
enter submits forms and stuff, space pauses things
 
@ssube same happens with space
space also triggers the focused button
it will trigger A and B
 
if you let it... I'm not sure what the problem you've invented here is
 
if you click on fullscreen in youtube, then press space, it will trigger the fullscreen button again
so basically youtube's not using space for play/pause
@ssube the problem is that I can't use space to trigger a button without messing usability
since tab order seems to be something that needs to be kept
 
3:49 PM
youtube uses k for play/pause
 
the only solution I see is: A) not use space and/or enter. B) blur buttons onclick
@BenCraig yeah that's why I said I'll probably use P
 
but enter still works, so what have you broken?
 
what? xD
I haven't broke anything
I wonder why youtube uses "k"
oh, J and L do things too :D
 
home row is best row
 
if youtube does, it is
I always looked at YT when I wanted inspiration for my videoplayer
 

« first day (2747 days earlier)      last day (2203 days later) »