#round engineer is the best engineer smh
Explore tagged Tumblr posts
Text
round bb in progress 😩
i love him sm smh
18 notes
·
View notes
Text
Supernatural family plays “Among Us”
Everyone sits in the library to play- Sam has triple checked the strength of their wifi (with Charlie’s help) to make sure that none of them will be losing connection any time soon, and since there’s enough of them- they play in a private server. They also stick to the Skeldmap.
Dean is Blue, Sam is Cyan, Castiel is Yellow, Mary is Pink, Charlie is Orange, Crowley (who plays begrudgingly but is 100% into it and won’t admit it) is Black, Jack is White, Rowena is Purple, Claire is Green, and Chuck (who wasn’t invited but insists on playing so they let him anyway since they need 10) is Red. (Also why aren’t there more colors on tumblr mobile smh)
They don’t use the chat box in voting because they’re all in the same room so there’s kinda no need.
Jack, Claire, and Dean call literally everyone “sus” whether they are or not, they’re just way to suspicious of everyone else.
Sam is always the first to finish his tasks. He’s also okay with being the first one everyone kills because being a ghost is more efficient since you can go through the walls. Dean never finishes his tasks because he’s too busy trying to figure out who the impostor is stating “you’ll thank me later when we win” and never ends up figuring it out first.
Rowena has the bests arguments and could convince anyone she’s not the impostor, even if she was, and makes convincing cases that someone else is. She’s never caught ever.
Charlie and Mary are the worst imposters because they’ll either accidentally vent in front of someone else and can’t catch up to kill the witness or end up being seen killing someone else. Dean often teases Mary because she’s “a badass hunter but can’t make decent kills in a video game”. Mary argues that they’re two very different things. Charlie usually gets carried away trying to be really sneaky, but has won a few games by sabotaging the o2.
Castiel has accidentally thrown a few games because, next to Sam, he’s one of the first to be killed and will get offended that he was killed so he’ll verbally accuse whoever did it- giving away the whole game. He’s also definitely said “how do I vent like dean just did”.
Dean is actually a pretty good impostor, he makes kills in drive by fashion and lets someone else report it.
Crowley self reports 80% of the time, he’s also a pretty good impostor. He mostly lies in wait in the vents by electrical.
Jack and Claire team up even though no one is supposed to talk to communicate outside of voting. Jack also caught Claire as the imposter but instead of ratting her out he helped her kill everyone else. They had been sitting next to each other at the time and Sam had to split them up after figuring out that’s what they were doing.
Chuck has only been impostor once, and is usually voted off quick since he can’t ever come up with a good alibi even if he’s innocent. He almost won the round where he was impostor but accidentally vented in front of Castiel and Mary, he was able to kill Cas but Mary called the emergency meeting.
They literally all say “where” one after the other, except the actual adults (ie Rowena, Crowley, and Mary) despite being in the same room.
The most epic chase was when Sam was impostor. He accidentally vented in the lower engine but everyone came from the hall above so he ran and of course everyone followed. Knowing he was caught, he stopped in storage and turned around and murdered someone at random, which ended up being Dean, as a final act of chaos before being voted off.
Charlie likes to hide in comms in the upper left hand corner and then kill whoever comes in.
They tried to play a different map once but got horribly lost, except dean who took advantage when he was the impostor and killed everyone.
Dean, Crowley, and Chuck favor the light sabotage. Sam, Mary, Jack, and Castiel favor the o2 sabotage. Charlie and Rowena favor the reactor sabotage. Claire hardly ever uses the sabotages and usually ends up just relying on killing everyone.
Longest impostor streak was three rounds in a row and it’s held by Castiel. No one suspected him a single one of those rounds.
Also Castiel is that one that gets away with it by not talking and just keeping to himself. He’s lowkey proud of that.
Crowley picks on Dean and convinces everyone else that Dean is the impostor, even though he hardly ever actually is. Everyone votes Crowley next but he’s hardly ever the impostor either- he just does it to mess with Dean.
Sam gets a guilty pleasure out of haunting whoever killed him. He usually starts the “ghost cult”. Provided he’s done with his tasks of course.
Claire started a “f in the chat” for Castiel the first time he was a victim.
They arrange weekly “Among Us” game nights on Fridays.
Dean has said “that guy is sus” on more than one occasion when working a case.
Jack decided everyone should were tee-shirts that matches with their preferred colors. Dean and Sam and Castiel made sure that happened.
Update!! I forgot hats!!
Dean wears the cowboy hat until he finds the sheriff hat- he says it helps him figure out who the impostor is (it doesn’t)
Sam has the angel halo - he likes to say it proves his innocence so he can just finish his damn tasks before he gets killed
Castiel doesn’t use hats but one time dean got on his phone and changed it to the party hat. Cas hasn’t changed it back
Mary has the mini crew mate and the matching pet bc most people associate those as “children” and she has two kids :”) hush she thinks it’s cute so leave it alone
Jack used the cowboy hat until the Halloween update and now he uses the pirate hat
Charlie loves the plant one and the knight one oh and the fedora one
Rowena didn’t use a hat (except the flower one) until the Halloween update and now she uses the witch hat.
Crowley likes the fedora- plus it matches the black color well- fancy too. He’s also prone to uses the horns.
Claire goes for the knight hat. That one and the plague doctor ones are her favorites. Also the cherry is a classic too.
Chuck often uses the flamingo bc he finds it freaking hilarious for some unknown reason.
#dean winchester#sam winchester#supernatural#among us#castiel#spn#Jack Kline#Crowley#Rowena#Mary Winchester#Charlie Bradbury#Claire Novak#chuck shurley#incorrect supernatural#family bonding#spn family
213 notes
·
View notes
Text
Your best boy is shit
Ki: This is just a little something I’ve been feeling like doing for a while.
Disclaimer: This is all for comedy’s purpose.
Ayato
The legend, the meme, the man himself, Suck-a-dick Ayahoe
He’s the main/poster boy for the series but everyone likes Shu more anyway
His ego is so big you can probably use it to measure Yuma’s dick
This bitch thinks he’s some Lebron James ass shit, bitch can’t even lay-up without twisting his ankle smh
He likes tits like the fuckboi he is this nasty ass bitch
Also he’s like, at least a few centuries old, and he still can’t dress himself
Still the best now, Ayabitch?
Shu
Everyone’s OG let’s be honest, it’s Suck-a-dick Shoe
He might as well be a shoe he doesn’t do fucking anything goddamn
This bitch has got a fear of fire due to past trauma just like, light a match in front of him, that’ll get him moving (I’m horrible)
He’s kind of a dick to all his other brother and tbh I don't blame him
He supposedly plays violin and speaks some French or Latin or somewhat idk man he’s just some stuck up rich kid with family problems
Subaru
You’d think Reiji’d be the angriest with rage phonetically in his name but nope it’s Suck-a-dick Toyot-I mean Hyunda- I mean Land Rov- I mean Nisa- wait no that’s the furry from the other family my bad
He’s always angry
He’s also a car
Is having an affair with about 30 walls in the Suck-a-dick mansion
He doesn’t like people in his room because he’s hiding a large MCR and Fallout Boy collection
He wrote that one tumblr post about said bands performing together before Dan and Phil walk onstage and kiss, he had that dream
All you gotta do to make his engine go is mention his dad
Laito
Hey it’s HentaiM@ster69 AKA Suck-a-dick Laihoe
This guy is into some nasty shit
Tbh if you try to douse him in holy water the water actually won’t leave container
He was abused by his mum so now he’s really fucked
Tbh Yui knows what’s up wearing a swimsuit in the bath with this pervert around
Also he’s the biggest asshole out of the brothers
Probably has every STI known to mankind and then some with how much he sleeps around
Reiji
Ki’s best boy, and the shittiest, Suck-a-dick Ragé
This shit is like, ‘be all women-like’ and then proceeds to fucking poison you
I hate him
Reiji’s a dickhead
He gets off on tableware this goddamn otaku
He probably can’t actually make a proper cup of tea so has taken to poisons instead
Extreme mummy issues, it’s like senpai notice me but it’s mummy give me attention and affection like a gOOD FUCKING MOTHER
Once memorised an entire book haha what a nerd
Probably tried to dab once but had to immediately exorcise himself out of disappointment and embarrassment
Kanato
Now I ain’t gonna kink shame if Kanahoe is your best boy, but what the ever-loving fuck
Dude it’s like canon he stabs people with forks
Also his entire diet consists of sugar which I’m pretty sure is a symptom of batshit crazy
Ki’s golden rule: don’t stick ur dick in crazy and stick ur pussy on crazy, this break that rule on every level and then some more
He also carries around a stuffed bear that contains his mother’s remains I mean really
I don't really have to do much to roast him he kinda does it himself tbh
Bonus round
Kino
No one really knows much about him but he low-key stole my handle so I’m gonna call him Fuckface from now on
Tbh he looks like a Reiji Azusa lovechild which actually isn't a half bad ship now that I think about it
Fuckface thinks he’s Ketchup Daddy’s son bc he was made with his magic residue
Jokes on you that’s not how it works
Bitch just sits on his ass drinking juice and playing video games and tbh yea same
Ki: Next time, Mukami and Tsukinami (I still don’t write for them seriously)
#meme#Diabolik Lovers#admin ki#sakamaki#suck a dick#sakamaki ayato#sakamaki subaru#sakamaki reiji#sakamaki kanato#sakamaki shu#sakamaki laito#kino#sakamaki kino#not serious#your best boy is shit#headcanons
179 notes
·
View notes
Text
crow rates all of yohanes cards
below the cut bc this is gonna be insanely long
cute pose, but school uniforms are boring. 2/5
reeaally cute pose, legs, dorky hat, has a lot of blues and pinks which just so happens to be my fav color combo. 4/5
thigh highs digging into skin is a+, pose is even dorkier than the ones before, but the school uniform kinda brings it down. 2/5
wtf is that outfit. 1/5
relatively nice outfit but nothing special. 2/5
super pretty outfit with really nice colors, adorable pose, i love the lil tongue sticking out. 5/5
cute outfit with cute pose but its a bit too gray for me. 3/5
i love the blown kiss but what the fuck are those clothes. 2/5
legs. 3/5
outfit doesnt mash well with background. 2/5
i love the bird and the food, the outfit is super cute, the expression and pose are adorable!!!!! 5/5 im kin w the birb
really cute but slightly overdecorated. 3/5
chocolate banana!!!!!! yukatas are lovely, she looks like shes having the time of her life. 5/5
outfit is overdecorated but the pose is pretty cute. 3/5
extremely adorable, but the background is lackluster and kinda burns my eyes. 3/5
incredibly pretty outfit with pretty colors!!!! 5/5
not a fan of the outfit but its nothing horrible. 2/5
reaaally gorgeous dress. 4/5
cute but nothing special. 2/5
the outfit burns. 1/5
the outfit is really boring but the thigh highs bring it up a bit. extremely boring background though. 2/5
ugliest thing ive ever seen. 0/5
i love the pose!!! unique hairstyle with simple but really nice clothes. 4/5
extremely pretty outfit but the pose is pretty boring. 4/5
i fucking love the lobster but the outfit is really meh. 2/5
really nice colors, shoulder birb!!! a bit too overdecorated though. 4/5
super cute expression and nice simplistic outfit. 3/5
my eyes. why. 1/5
super cute!!!! simplistic outfit with food!!!!!!! 5/5
outfit is ugly af but the background and colors are incredibly nice and that pose is the cutest shit ever. 4/5
top hat!!! super cute outfit, i love it. 4/5
that purple pink color burns a bit but its relatively cute. 3/5
shes so fucking smug i love her. the outfit is a disaster but its dorky enough to pass. 3/5
!!!! incredibly pretty colors and background with beautiful and creative outfit!! 5/5
i hate those sandals but the dress is pleasant to look at. 2/5
i fucking love the pose and expression and!!! it has blue and purple!!!!!! with whites!!!!!!! 5/5
kinda weird lookin but nothing too bad. 2/5
die. 0/5
really cute outfit!! lovely hair!!! 4/5
I FUCKING LOVE IT AND ITS BLUE AND PINK!!!!!!! 5/5
cute concept but fucking boring. 1/5
really ugly outfit. 1/5
she looks like human thomas the tank engine. 0/5
cute outfit with knives. 3/5
it would be really pretty if the composition wasnt so fucking weird. 4/5
best card!!!! pretty sunset colors!! adorable hair with nice outfit!!!!! the face chub!!!!!!! the corn!!!!!!!!!!!! the drink!!!!!!!!!!!!!!!!!! 10000000/5
im going blind. the background is insanely pretty tho. 3/5
booo. boring. 1/5
is she farming. wtf are those clothes. 1/5
the outfit is cuter this time and i really like the fan. 3/5
i love the outfit!!! this one is one of my fav sets in general the card is super lovely. 5/5
a tiny bit overdecorated but ill forgive it since its so pretty. 5/5
reaaaally meh. 1/5
cute outfit with cute pose but eeehh. 2/5
lazy recycled art smh klab. at least its sorta pretty. 3/5
my eyes burn. the outfit would be cute without that painful background. 2/5
reeaaally overdesigned but that bunny is 10/10. 3/5
cute outfit with cute pose. i like the leaf elements. 4/5
the hair!!! the cat ears!!! extremely cute 5/5
kind of cute but still really meh. 3/5
i hate that pink. 1/5
okay-ish bg but those stickers really bug me. 2/5
incredibly cute!! i love the giant plush and her pose, shes trying to be so scary. the angle is kind of boring but the outfit is still very nice. 4/5
i fucking love that outfit. 4/5
too much. my eyes. why. 1/5
i mean its not hurting my eyes. 3/5
weird ass outfit but still passes. love the pose. 3/5
i really love the cookies!!! and that outfit is super super adorable. 4/5
the outfit would be okay but why those colors. she looks naked. 3/5
i love it a lot but?? the angle is mega boring and it really needs a filter. 4/5
reeaaally cute pose with pretty colors and nice enough outfit. 5/5
fuck man normally all the shine would bug me but it looks insanely nice. also fuck i love that outfit. 5/5
cute pose but otherwise... eh. 2/5
shes so cute!!!!! those round cheeks!!! the hair!!!!!! 10000/5
super cute but the uniform again... 3/5
really cute but so fucking bright. 4/5
its cute enough, u pass. 3/5
that outfit is an abomination. 1/5
super simple but the cat pockets are adorable. 3/5
ugly af outfit, pewish. 1/5
super cute, i absolutely love this whole set. 5/5
adore the hair and the plush. please step on me. 5/5
again that hideous outfit but this time with an even more boring bg and pose. 0/5
#aJKFDHSKJ#llsif#love live#tsushima yoshiko#yoshiko tsushima#long post#i spent too much time on this
4 notes
·
View notes
Text
Ep. 3 - “hopefully failure does not turn into fracture” - John
Dylan C
oh nvm, it was Jack lol
Timmy
I was half a second from muting Ellie on my own during the tribal. Also JACK LEFT 🎉🎉🎉🎉🎉🎉🎉
John
first vote, check. first blindside, check. feels good knowing i helped spearhead the vote flip from stephen onto jack, but if jack comes back he might be out for blood. luckily enough for us worms, the vote morphed into a 7/1 landslide, so he might come after maynor or stephen or keith before me and my peeps. but only time will tell.
Timmy
ELLIE DRINK WATER CHALLENGE, DO THAT CHALLENGE
Keith John
Last night was a tough vote. Jack made people paranoid. Even though i wanted him to stay. No one in my alliance felt easy with him. Even though i wanted jack around as he was good in chllenge and wanted to work with me. But it is what it is.
Raffy
I finally managed to get into an alliance with Ellie and Timmy. Though it is not the biggest, I feel confident that these two will serve me well, at least in the premerge. It's called the Just Go For It Alliance, courtesy of Timmy. And we almost got caught forming it because of Cormac which is iconic. Speaking of him, I don't really know what to make of him. He's very... weird. Like it's hard talking to him, but I feel the same way about Keith so whatever. Plus, I don't really trust Cormac considering he basically made a day 1 alliance with two people on my tribe and Sierra. I need to keep an attentive eye on him.
Ellie
I am so immensely thankful for the tribe call last night. It was filled with things I needed to hear, of course we joked around with the fact that I can’t turn on a stove but I was also so thankful for the amazing people in the call making sure that I take care of myself which I haven’t been doing lately. Life has been really hard on me and it feels like a never get a break, sometimes I neglect taking care of myself because I feel that I physically and mentally can’t. I function on caffeine and I get 2-5 hours of sleep on a good night. Last night was kind of a wake up call because I learned that I am putting myself in danger by neglecting myself and my needs. It was really hard for me to accept that but I feel like I have bonded with these people BEYOND the game, they feel like my family now. Life sucks and I get really unmotivated sometimes and can’t bring myself to get out of bed or even eat, but I’ve gotten a lot better and I hope to continue getting better and the people in that call have already played a huge part in that by motivating me to care about my wellbeing and take care of myself, I will always be thankful for that.
Raffy
I feel like I am bonding well with people? It's hard to get a read on some of them, but I think it's fine for now. Other than that, John came up to me asking for a game bond that I thought we already have. Either way, that seems to be my way into an alliance with him. Hopefully we can grow our numbers and build a trustworthy yet powerful group. We're suspecting a swap pretty soon so I hope that I've bonded with the right people in order to be successful.
Dylan C
I haven’t been socializing enough lately with anyone, and wasn’t going to today but then today was Yikes so. I did miss the tribe call for the challenge because I was on the phone with my friend. Maybe I could’ve made it but eh. Hopefully that one point isn’t going to make or break us. And if it did, well I’ve also done a lot for this challenge already soooo
Ellie
I’m going to be picking flour out of my eyebrows for days
Raffy
I hope we win the challenge. I'm kind of scared that so many things were left blank, but this has got to be enough
Dylan C
BITCH
several of us on this tribe were just on a call saying we didn't wanna vote anyone out smh
I keep agreeing when people say they can't come up with a name for tribal but I do actually have one in mind. I'd say Justin since he seems to be around somewhat less, but it's still not great. I mean, I'd rather not vote anyone
So I've talked with Raffy and Joseph and they agree w/Justin. Haven't specifically mentioned names with anyone else. Ellie says she's just going to listen, and not throw out any names. Also didn't ask my thoughts lol. I'll expand on this more when I record my next video confessional
Timmy
Ughhh we lost, I say we but like I did nothing for the challenge so I was a big contributor to the loss. But now people want justin out and like Justin wants to work with me so I’m not here for that. Honestly I have an alliance that will half the tribe after tomorrow so i would like to have a majority group with him, but I’m still in a good spot without him here. I would rather get Joseph or Dylan R out this round though.
John
okay so apparently cormac wants sierra out after stephen now which is news to me. i just agreed and nodded and was like “okay cool” bc i don’t want to draw negative attention towards myself by acting like i’m trying to protect them, but like i don’t think blindsiding them would be the best move? this game is going to get crazy quick. plus if he’s thinking of taking them out, what if all of a sudden they wanna flip on me? in engineering terms, cracks are propagating on the surface of the material, and it’s not long until failure occurs. hopefully failure does not turn into fracture.
Timmy
Joseph and I haven’t spoken in a few days yet he messages just saying “so, tribal” in bold and I’m like wtf like I’m not gonna talk to you about tribal yet, I need to see if I can trust you first.
Dylan C
What is the big risk I'm taking for the idol and risking my vote at tribal? A fucking puzzle with a shit ton of blue sky and snow, and the piece are weird and r o t a t e. I'm not getting this shit done by 11pm tomorrow! Not when I'm in classes all day, and then have DnD not long after. And I made an account to save my progress, putting my name in it so if I do finish and end up on the leaderboard for someone else to see. You know what I've got tonight? BDE. That's right: big dummy energy. At least the vote seems almost unanimous at this point, so that could easily change, but if it goes like it seems like it will then my vote won't matter too much.
Dylan C
41 minutes and 40 second in, 32%, brain is fried JustinAlright so I am a bit nervous for this tribal considering I have not been too active for this round, but I am still confident I can move the target onto someone else. I was thinking I can possibly get people to vote out Dylan R considering he has been more inactive than I have. Although, the other tribe blindsiding Jack makes me weary because it might have caused people on my tribe to make a move against a more active player. So, I need to be on my toes to make sure that is not me. Also, remember how I said I want to work with Timmy? Well I messaged that bitch asking if he wants to work with me officially, but he hasn't answered even though he has been online since I have sent the message. So, honestly I might try to target him considering he has not been super active either.
Keith John
I have been a bit busy these past few days, havnt spoken to everyone much. Good thing we won immunity. So scrambling is at its minimum. i got a feeling a swap is coming up. Makes me nervous. I dont have many connections on the other side.
Except Justin, spoke to him a few times. Raffy and Ellie I spoke to but they feel like people who talk to everyone. so I dont know if they have my back. Whilst Timmy even didnt reply to my hi. As guess he is clear about not working with me
Stephen
Hi. My name is Mr Immune, which I almost misspelt as Mt Immune, wouldn’t that be entertaining? Anyway the tribes feeling good, John and Sierra are cool, Zoes nice, Maynors nice but oddly distant. Everythings middle of the road atm, nothing great but nothing sucky. I’ll probably try and cruise for a bit on social connections until swap or something equally spicy pops up.
Maynor
I have continued doing the puzzles and I have 3 of them left. Hopefully the idol isnt found yet. We’ll see. Im so happy we were able to win immunity cuz i was slowly freaking out that Jack said my name. Atleast i just screamed inside my head and didnt become as paranois as Jack. He literally made himself the target. Everyone agreed on Stephen then his paranoia happened and it switched onto him.
P.S. ❤️ Jay
Sierra
After Jack got voted out, I was worried that we were going to lose the next challenge. I was so relieved when we actually pulled through and won! We all really worked so hard to win that one... and even though I’m in an alliance, I’d rather not have to test things again just yet.
Raffy
God I hate tribal. It’s ugly. Though I instantly have a name in mind: Justin. He’s the person I trust the least and have talked to the least. I talked to Ellie and Dylan C about it. They seemed to be on board with the whole thing. We just need one more vote which should be easy to get. After all, I am in an alliance with Timmy, so it should be easy for me to get four votes. I’m just hoping that he doesn’t have an idol.
Last night, I was talking to Dylan a little bit. Apparently, they are are scared that they haven’t been added to any alliances and they feel like alliances are being made. So I suggested making an alliance with them and I. They’re in a vulnerable position which is great for me since it means they’ll be more willing to work with me. After tribal, I’m hoping that we can create an alliance together with some other people. I’m excited!!!
Ellie
So it’s between Justin and Dylan R and I have the deciding vote?? More drama coming soon
Justin
Ok these bitches are making me mad. I approached Ellie and Dylan C for alliances. Luckily, they both said yes to individual alliances, but as soon as I brought up the idea for all of us to join together plus Raffy they go mute. That is definitely concerning, but I brought up Dylan R’s name to all three as a target this vote and I can only hope they stick to their word to vote them out. I also made an official alliance with Keith, and he spilled the beans that he has been talking to Raffy a bit which makes me nervous. However, I have changed my stance on Raffy because he actually talks to me quite a lot. But, I am aware he is definitely playing this game hard and is talking to almost everyone. That is why I want to keep him close for the time being and then perhaps blindside him in a swap or early merge. Back to Keith tho, he is ITCHING to make a move. He told me it is his first time playing an ORG and he definitely wants to blindside people which as long as it ain’t me I’m good.
Joseph Collins
Me and Elle have been working so good together. I hope she doesn’t stab me in the back lol. The tribe consensus was Justin but I flipped them all to Dylan r. Blindsideeeeee coming. Hahahahaha. *evil laugh* *winky face
Joseph Collins
Lemme break down how I flipped the vote. I just told Dylan c that “look. I respect you. And I’d want someone to do this for me. The tide’s changing and I think the vote is gonna be Dylan R tonight. I don’t want you to be left out of a vote because I wanted to work with you so I feel like you should know” that establishes trust and kinda gets Dylan to switch her vote
John
i’m ready to make a legitimate move in this game. but it’s all about timing. our best move, if we lose again, is sending stephen outta here. WITH THAT BEING SAID, it’s on after that. bring on the bloodbath. not everything will be happy go lucky for long.
Joseph Collins
I orchestrated this blindside and took no credit in my voting message. Like a true mastermind. *maniacal laugh*
Justin
Biiiiiiiitch. I just found out bitches have been conspiring against me cuz of the time zone difference. So, I was right for being paranoid omg. The person who initially told me was Joseph of all people which was shocking since I probably talk to him the least besides Dylan R. But, I’m glad he did and then Timmy further confirmed it which I’m like hello again Timmy it’s been a bit bud. From what they have told me is that the majority is still on Dylan R. and I talked to Dylan C. about the vote and I straight up talked about the time zone difference not being an issue. They said they have a friend in Scotland so it doesn’t bother them so if at least those three and myself vote Dylan R. then I should be good.
Raffy
The tribe has switched their mentality and have decided to go with Dylan R. with this vote which I am fine with considering he does not talk to me at all either. Plus, Justin came up to me asking if we could align together in this game which is always a good sign. So, I was more inclined to keep him throughout the day. Either way, I think I should be safe at this tribal council.
Zoe
I’m a wild bitch.
For the scavenger hunt challenge, I definitely got a tattoo (of the water tribe symbol from avatar, don’t @ me) for a whopping 20 points, and we definitely won the challenge. While riding on that high I accidentally talked about the idol hunt and got a strike from the god-host, which made me feel like the ultimate failure. Other than that, I have several strong alliances which I am confident in going into the swap.
Dylan C
https://youtu.be/gpUevTrixLo
https://youtu.be/_Qpn_dE6fxs
Not feeling like typing this up in detail but the vote has now changed to Dylan R and I’m down with/that. I talked to some people about it and they agree. Joseph messaged me and was like “I feel I have to tell you since you said you wanted to vote Justin.” I was like “that’s sweet but I already knew.” And kinda tried to play it off after that like I’m a little worse at socializing than I actually am but idk how well that worked. I really should’ve made this confession 5 hours ago but oh well. (Those videos were filmed almost 12 hours ago).
Dylan C
I actually finished the fucking puzzle and I can’t believe it. Also if I hadn’t, it would’ve counted against me next tribal, not tonight’s. Either way, I’m not losing that vote via that puzzle babey.
0 notes
Text
I Don’t Hate Arrow Functions
TL;DR
Arrow functions are fine for certain usages, but they have so many variations that they need to be carefully controlled to not break down the readability of the code.
While arrow functions clearly have a ubiquitous community consensus (though not unanimous support!), it turns out there’s a wide variety of opinions on what makes “good” usage of => and not.
Configurable linter rules are the best solution to wrangling the variety and disagreement of arrow functions.
I released proper-arrows ESLint plugin with several configurable rules to control => arrow functions in your code base.
Opinions are like noses…
Anyone who’s followed me (tweets, books, courses, etc) for very long knows that I have lots of opinions. In fact, that’s the only thing I’m an expert on — my own opinions — and I’m never at a loss for them!
I don’t subscribe to the “strong opinions, loosely held” mantra. I don’t “loosely hold” my opinions because I don’t see any point in having an opinion if there isn’t sufficient reason for that opinion. I spend a lot of time researching and tinkering and writing and trying out ideas before I form an opinion that I would share publicly. By that point, my opinion is pretty strongly held, by necessity.
What’s more, I teach based on these opinions — thousands of developers in different companies all over the world — which affords me the opportunity to deeply vet my opinions through myriad discussion and debate. I’m tremendously privleged to be in such a position.
That doesn’t mean I can’t or won’t change my opinions. As a matter of fact, one of my most strongly held opinions — that JS types and coercion are useful in JS — has been shifting lately, to a fairly significant degree. I have a much more rounded and deepened perspective on JS types and why type-aware tooling can be useful. And even my opinion on => arrow functions, the punchline of this article, has evolved and deepened.
But one of the things many people tell me they appreciate about me is, I don’t just state opinions, I back those opinions up with careful, thought-out reasoning. Even when people vehemently disagree with my opinions, they often compliment me on at least owning those opinions with backing.
And I try to inspire the same in others through my speaking, teaching, and writing. I don’t care if you agree with me, I only care that you know why you have an technical opinion and can earnestly defend it with your own line of reasoning. To me, that’s a healthy relationship with technology.
Arrow Functions != functions
It is my sincere belief that the => arrow function is not suitable as a general purpose replacement for all (or even most) function functions in your JS code. I genuinely don’t find them more readable in most cases. And I’m not alone. Any time I share an opinion like that on social media, I often get dozens of “me too!” responses peppered in with the scores of “you’re totally wrong!” responses.
But I’m not here to rehash the entire debate over => arrow functions. I’ve written extensively about my opinions on them, including these sections in my books:
“You Don’t Know JS: ES6 & Beyond”, Ch2, “Arrow Functions”
“Functional-Light JavaScript”, Ch2, “Functions Without function“ (and the preceding section on function names).
Whatever your preferences around =>, to suggest that it’s only a better function is to be plainly reductive. It’s a far more nuanced topic than just a one-to-one correspondence.
There are things to like about =>. You might find that surprising for me to say, since most people seem to assume I hate arrow functions.
I don’t (hate them). I think there are definitely some important benefits.
It’s just that I don’t unreservedly endorse them as the new function. And these days, most people aren’t interested in nuanced opinions in the middle. So since I’m not entirely in the pro-=> camp, I must be entirely in the opposition camp. Not true.
What I hate is suggesting they’re universally more readable, or that they’re objectively better in basically all cases.
The reason I reject this stance is because I REALLY DO STRUGGLE TO READ THEM in many cases. So that perspective just makes me feel dumb/inferior as a developer. “There must be something wrong with me, since I don’t think it’s more readable. Why do I suck so much at this?” And I’m not the only one whose impostor syndrome is seriously stoked by such absolutes.
And the cherry on top is when people tell you that the only reason you don’t understand or like => is because you haven’t learned them or used them enough. Oh, right, thanks for the (condescending) reminder it’s due to my ignorance and inexperience. SMH. I’ve written and read literally thousands of =>functions. I’m quite certain I know enough about them to hold the opinions I have.
I’m not in the pro-=> camp, but I recognize that some really do prefer them, legitimately. I recognize that some people come to JS from languages that have used => and so they feel and read quite natural. I recognize that some prefer their resemblance to mathematical notation.
What’s problematic IMO is when some in those camps simply cannot understand or empathize with dissenting opinions, as if there must just be something wrong with them.
Readability != Writability
I also don’t think you know what you’re talking about when you talk about code readability. By and large, the vast majority of opinions on code readability, when you break them down, are based on a personal stance about preferences in writingconcise code.
When I push back in debates about code readability, some just dig in their heels and refuse to support their opinion. Others will waive off the concerns with, “readability is all just subjective anyway”.
The flimsiness of that response is stunning: two seconds ago they were vehemently claiming => arrow is absolutely and objectively more readable, and then when pressed, they admit, “well, I think it’s more readable, even if ignorants like you don’t.”
Guess what? Readability is subjective, but not entirely so. It’s a really complex topic. And there are some who are undertaking to formally study the topic of code readability, to try to find what parts of it are objective and what parts are subjective.
I have read a fair amount of such research, and I’m convinced that it’s a complicated enough topic that it can’t be reduced to a slogan on a t-shirt. If you want to read them, I would encourage you doing some google searching and reading of your own.
While I don’t have all the answers myself, one thing I’m certain about is, code is more often read than written, so perspectives on the topic which ultimately come from “it’s easier/quicker to write” don’t hold much standing. What needs to be considered is, not how much time do you save writing, but how clearly will the reader (future you or someone else on the team) be able to understand? And ideally, can they mostly understand it without pouring over the code with a fine-toothed comb?
Any attempt to justify writability affordances with unsubstantiated claims about readability benefits is a weak argument at best, and in general, nothing but a distraction.
So I roundly reject that => is always and objectively “more readable”.
But I still don’t hate arrow functions. I just think to use them effectively, we need to be more disciplined.
Linters == Discipline
You might be of the (incorrect) belief that linters tell you objective facts about your code. They can do that, but that’s not their primary purpose.
The tool that’s best suited to tell you if your code is valid is a compiler (ie, the JS engine). The tool that’s best suited to tell you whether your code is “correct” (does what you want it to do) is your test suite.
But the tool that’s best suited to tell you if your code is appropriate is a linter. Linters are opinionated collections of rules about how you should style and structure your code, so as to avoid likely problems — according to the authors of those opinion-based rules.
That’s what they’re for: to apply opinions to your code.
That means it’s almost certain that these opinions will, at one time or another, “offend” you. If you’re like most of us, you fancy yourself pretty good at what you do, and you know that this thing you’re doing on this line of code is right. And then the linter pops up and says, “Nope, don’t do it that way.”
If your first instinct is sometimes to disagree, then you’re like the rest of us! We get emotionally attached to our own perspectives and abilities, and when a tool tells us we’re wrong, we chuff a little bit.
I don’t get mad at the test suite or the JS engine. Those things are all reporting facts about my code. But I can definitely get irritated when the linter’s opinion disagrees with mine.
I have this one linter rule that I enabled a few weeks ago, because I had an inconsistency in my coding that was annoying me on code re-reads. But now this lint rule is popping up two or three times an hour, nagging me like a stereotypical grandma on a 90’s sitcom. Every single time, I ponder (for just a moment) if I should just go disable that rule. I leave it on, but to my chagrin.
So why subject ourselves to this torment!? Because linter tools and their opinions are what give us discipline. They help us collaborate with others.
They ultimately help us communicate more clearly in code.
Why shouldn’t we let every developer make their own decisions? Because of our tendency toward emotional attachment. While we’re in the trenches working on our own code, against unreasonable pressure and deadlines, we’re in the least trustable mindset to be making those judgement calls.
We should be submitting to tools to help us maintain our discipline.
It’s similar to how TDD advocates submit to the discipline of writing tests first, in a formal set of steps. The discipline and the bigger picture outcome of the process are what we value most, when we’re level headed enough to make that analysis. We don’t institute that kind of process when our code is hopelessly broken and we have no idea why and we’re just resorting to trying random code changes to see if they fix it!
No. If we’re being reasonable, we admit that the overall good is best served when we set up reasonable guidelines and then follow the discipline of adhering to them.
Configurability Is King
If you’re going to knowingly subject yourself to this finger wagging, you (and your team, if applicable) are certainly going to want some say-so in what rules you’re required to play by. Arbitrary and unassailable opinions are the worst kind.
Remember the JSLint days when 98% of the rules were just Crockford’s opinions, and you either used the tool or you didn’t? He straight up warned you in the README that you were going to be offended, and that you should just get over it. That was fun, right? (Some of you may still be using JSLint, but I think you should consider moving on to a more modern tool!)
That’s why ESLint is king of the linters these days. The philosophy is, basically, let everything be configurable. Let developers and teams democratically decide which opinions they all want to submit to, for their own discipline and good.
That doesn’t mean every developer picks their own rules. The purpose of rules is to conform code to a reasonable compromise, a “centralized standard”, that has the best chance of communicating most clearly to the most developers on the team.
But no rule is ever 100% perfect. There’s always exception cases. Which is why having the option to disable or re-configure a rule with an inline comment, for example, is not just a tiny detail but a critical feature.
You don’t want a developer to just have their own local ESLint config that overrides rules while they commit code. What you want is for a developer to either follow the established rules (preferred!) OR to make an exception to the rules that is clear and obvious right at the point where the exception is being made.
Ideally, during a code review, that exception can be discussed and debated and vetted. Maybe it was justified, maybe it wasn’t. But at least it was obvious, and at least it was possible to be discussed in the first place.
Configurability of tools is how we make tools work for us instead of us working for the tools.
Some prefer convention-based approaches to tooling, where the rules are pre-determined so there’s no discussion or debate. I’m know that works for some developers and for some teams, but I don’t think it is a sustainable approach for generalized, broad application. Ultimately, a tool that is inflexible to the changing project needs and DNA of the developer(s) using it, will end up falling into obscurity and eventually replaced.
Proper Arrows
I fully recognize my usage of the the word “proper” here is going to ruffle some feathers. “Who is getify to say what is proper and not?”
Remember, I’m not trying to tell you what is proper. I’m trying to get you to embrace the idea that opinions about => arrow functions are as varied as all the nuances of their syntax and usage, and that ultimately what is most appropriate is that some set of opinions, no matter what they are, should be applicable.
While I’m a big fan of ESLint, I’ve been disappointed by the lack of support from built-in ESLint rules for controlling various aspects of => arrow functions. There are a few built-in rules, but I’m frustrated that they seem to focus mostly on superficial stylistic details like whitespace.
I think there are a number of aspects that can hamper => arrow function readability, issues that go way beyond what the current ESLint ruleset can control. I asked around on twitter, and it seems from the many replies that a lot of people have opinions on this.
The ultimate linter would not only let you configure rules to your liking, but build your own rules if something were lacking. Luckily, ESLint supports exactly that!
So I decided to build an ESLint plugin to define an additional set of rules around => arrow functions: proper-arrows.
Before I explain anything about it, let me just point out: it’s a set of rules that can be turned on or off, and configured, at your discretion. If you find even one detail of one rule helpful, it would be better to use the rule/plugin than not.
I’m fine with you having your own opinions on what makes => arrow functions proper. In fact, that’s the whole point. If we all have different opinions on => arrow functions, we should have tooling support to let us pick and configure those different opinions.
The philosophy of this plugin is that, for each rule, when you turn the rule on, you get all of its reporting modes on by default. But you can of course either not turn the rule on, or turn the rule on and then configure its modes as you see fit. But I don’t want you to have to go hunting for rules/modes to turn on, where their obscurity prevents them from even being considered. So everything comes on per rule.
The only exception here is that by default, all rules ignore trivial => arrow functions, like () => {}, x => x, etc. If you want those to be checked, on a per-rule basis you have to turn on that checking with the { "trivial": true } option.
Proper Arrows Rules
So what rules are provided? Here’s an excerpt from the project overview:
"params": controls definitions of => arrow function parameters, such as forbidding unused parameters, forbidding short/unsemantic parameter names, etc.
"name": requires => arrow functions to only be used in positions where they receive an inferred name (i.e., assigned to a variable or property, etc), to avoid the poor readbility/debuggability of anonymous function expressions.
"location": restricts where in program structure => arrow functions can be used: forbidding them in the top-level/global scope, object properties, export statements, etc.
"return": restricts the concise return value kind for => arrow functions, such as forbidding object literal concise returns (x => ({ x })), forbidding concise returns of conditional/ternary expressions (x => x ? y : z), etc.
"this": requires/disallows => arrow functions using a this reference, in the => arrow function itself or in a nested => arrow function. This rule can optionally forbid this-containing => arrow functions from the global scope.
Remember, each rule has various modes to configure, so none of this is all-or-nothing. Pick what works for you.
As an illustration of what the proper-arrows rules can check for, let’s look at the "return" rule, specifically its "sequence" mode. This mode refers to the concise return expression of => arrow functions being a comma-separated sequence, like this:
var myfunc = (x,y) => ( x = 3, y = foo(x + 1), [x,y] );
Sequences are typically used in => arrow function concise returns to string together multiple (expression) statements, without needing to use a full { .. } delimited function body and an explicit return statement.
Some may love this style — that’s OK! — but a lot of folks think it favors clever terse style coding over readability, and would prefer instead:
var fn2 = (x,y) => { x = 3; y = foo(x + 1); return [x,y]; };
Notice that it’s still an => arrow function and it’s not even that many more characters. But it’s clearer that there are three separate statements in this function body.
Even better:
var fn2 = (x,y) => { x = 3; y = foo(x + 1); return [x,y]; };
To be clear, the proper-arrows rules don’t enforce trivial styling differences like whitespace/indentation. There are other (built-in) rules if you want to enforce those requirements. proper-arrows focuses on what I consider to be more substantive aspects of => function definition.
Concise Summary
You and I almost certainly disagree on what makes good, proper => arrow function style. That’s a good and healthy thing.
My goal here is two-fold:
Convince you that opinions on this stuff vary and that’s OK.
Enable you to make and enforce your own opinions (or team consensus) with configurable tooling.
There’s really nothing to be gained from arguing over opinion-based rules. Take the ones you like, forget the ones you don’t.
I hope you take a look at proper-arrows and see if there’s anything in there which you could use to ensure your => arrow functions are the best form they can be in your code base.
And if the plugin is missing some rules that would help define more proper arrows, please file an issue and we can discuss! It’s entirely plausible we may add that rule/mode, even if I personally plan to keep it turned off!
I don’t hate => arrow functions, and you shouldn’t either. I just hate uninformed and undisciplined debate. Let’s embrace smarter and more configurable tooling and move on to more important topics!
The post I Don’t Hate Arrow Functions appeared first on David Walsh Blog.
I Don’t Hate Arrow Functions published first on https://appspypage.tumblr.com/
0 notes
Text
I Don’t Hate Arrow Functions
TL;DR
Arrow functions are fine for certain usages, but they have so many variations that they need to be carefully controlled to not break down the readability of the code.
While arrow functions clearly have a ubiquitous community consensus (though not unanimous support!), it turns out there’s a wide variety of opinions on what makes “good” usage of => and not.
Configurable linter rules are the best solution to wrangling the variety and disagreement of arrow functions.
I released proper-arrows ESLint plugin with several configurable rules to control => arrow functions in your code base.
Opinions are like noses…
Anyone who’s followed me (tweets, books, courses, etc) for very long knows that I have lots of opinions. In fact, that’s the only thing I’m an expert on — my own opinions — and I’m never at a loss for them!
I don’t subscribe to the “strong opinions, loosely held” mantra. I don’t “loosely hold” my opinions because I don’t see any point in having an opinion if there isn’t sufficient reason for that opinion. I spend a lot of time researching and tinkering and writing and trying out ideas before I form an opinion that I would share publicly. By that point, my opinion is pretty strongly held, by necessity.
What’s more, I teach based on these opinions — thousands of developers in different companies all over the world — which affords me the opportunity to deeply vet my opinions through myriad discussion and debate. I’m tremendously privleged to be in such a position.
That doesn’t mean I can’t or won’t change my opinions. As a matter of fact, one of my most strongly held opinions — that JS types and coercion are useful in JS — has been shifting lately, to a fairly significant degree. I have a much more rounded and deepened perspective on JS types and why type-aware tooling can be useful. And even my opinion on => arrow functions, the punchline of this article, has evolved and deepened.
But one of the things many people tell me they appreciate about me is, I don’t just state opinions, I back those opinions up with careful, thought-out reasoning. Even when people vehemently disagree with my opinions, they often compliment me on at least owning those opinions with backing.
And I try to inspire the same in others through my speaking, teaching, and writing. I don’t care if you agree with me, I only care that you know why you have an technical opinion and can earnestly defend it with your own line of reasoning. To me, that’s a healthy relationship with technology.
Arrow Functions != functions
It is my sincere belief that the => arrow function is not suitable as a general purpose replacement for all (or even most) function functions in your JS code. I genuinely don’t find them more readable in most cases. And I’m not alone. Any time I share an opinion like that on social media, I often get dozens of “me too!” responses peppered in with the scores of “you’re totally wrong!” responses.
But I’m not here to rehash the entire debate over => arrow functions. I’ve written extensively about my opinions on them, including these sections in my books:
“You Don’t Know JS: ES6 & Beyond”, Ch2, “Arrow Functions”
“Functional-Light JavaScript”, Ch2, “Functions Without function“ (and the preceding section on function names).
Whatever your preferences around =>, to suggest that it’s only a better function is to be plainly reductive. It’s a far more nuanced topic than just a one-to-one correspondence.
There are things to like about =>. You might find that surprising for me to say, since most people seem to assume I hate arrow functions.
I don’t (hate them). I think there are definitely some important benefits.
It’s just that I don’t unreservedly endorse them as the new function. And these days, most people aren’t interested in nuanced opinions in the middle. So since I’m not entirely in the pro-=> camp, I must be entirely in the opposition camp. Not true.
What I hate is suggesting they’re universally more readable, or that they’re objectively better in basically all cases.
The reason I reject this stance is because I REALLY DO STRUGGLE TO READ THEM in many cases. So that perspective just makes me feel dumb/inferior as a developer. “There must be something wrong with me, since I don’t think it’s more readable. Why do I suck so much at this?” And I’m not the only one whose impostor syndrome is seriously stoked by such absolutes.
And the cherry on top is when people tell you that the only reason you don’t understand or like => is because you haven’t learned them or used them enough. Oh, right, thanks for the (condescending) reminder it’s due to my ignorance and inexperience. SMH. I’ve written and read literally thousands of =>functions. I’m quite certain I know enough about them to hold the opinions I have.
I’m not in the pro-=> camp, but I recognize that some really do prefer them, legitimately. I recognize that some people come to JS from languages that have used => and so they feel and read quite natural. I recognize that some prefer their resemblance to mathematical notation.
What’s problematic IMO is when some in those camps simply cannot understand or empathize with dissenting opinions, as if there must just be something wrong with them.
Readability != Writability
I also don’t think you know what you’re talking about when you talk about code readability. By and large, the vast majority of opinions on code readability, when you break them down, are based on a personal stance about preferences in writingconcise code.
When I push back in debates about code readability, some just dig in their heels and refuse to support their opinion. Others will waive off the concerns with, “readability is all just subjective anyway”.
The flimsiness of that response is stunning: two seconds ago they were vehemently claiming => arrow is absolutely and objectively more readable, and then when pressed, they admit, “well, I think it’s more readable, even if ignorants like you don’t.”
Guess what? Readability is subjective, but not entirely so. It’s a really complex topic. And there are some who are undertaking to formally study the topic of code readability, to try to find what parts of it are objective and what parts are subjective.
I have read a fair amount of such research, and I’m convinced that it’s a complicated enough topic that it can’t be reduced to a slogan on a t-shirt. If you want to read them, I would encourage you doing some google searching and reading of your own.
While I don’t have all the answers myself, one thing I’m certain about is, code is more often read than written, so perspectives on the topic which ultimately come from “it’s easier/quicker to write” don’t hold much standing. What needs to be considered is, not how much time do you save writing, but how clearly will the reader (future you or someone else on the team) be able to understand? And ideally, can they mostly understand it without pouring over the code with a fine-toothed comb?
Any attempt to justify writability affordances with unsubstantiated claims about readability benefits is a weak argument at best, and in general, nothing but a distraction.
So I roundly reject that => is always and objectively “more readable”.
But I still don’t hate arrow functions. I just think to use them effectively, we need to be more disciplined.
Linters == Discipline
You might be of the (incorrect) belief that linters tell you objective facts about your code. They can do that, but that’s not their primary purpose.
The tool that’s best suited to tell you if your code is valid is a compiler (ie, the JS engine). The tool that’s best suited to tell you whether your code is “correct” (does what you want it to do) is your test suite.
But the tool that’s best suited to tell you if your code is appropriate is a linter. Linters are opinionated collections of rules about how you should style and structure your code, so as to avoid likely problems — according to the authors of those opinion-based rules.
That’s what they’re for: to apply opinions to your code.
That means it’s almost certain that these opinions will, at one time or another, “offend” you. If you’re like most of us, you fancy yourself pretty good at what you do, and you know that this thing you’re doing on this line of code is right. And then the linter pops up and says, “Nope, don’t do it that way.”
If your first instinct is sometimes to disagree, then you’re like the rest of us! We get emotionally attached to our own perspectives and abilities, and when a tool tells us we’re wrong, we chuff a little bit.
I don’t get mad at the test suite or the JS engine. Those things are all reporting facts about my code. But I can definitely get irritated when the linter’s opinion disagrees with mine.
I have this one linter rule that I enabled a few weeks ago, because I had an inconsistency in my coding that was annoying me on code re-reads. But now this lint rule is popping up two or three times an hour, nagging me like a stereotypical grandma on a 90’s sitcom. Every single time, I ponder (for just a moment) if I should just go disable that rule. I leave it on, but to my chagrin.
So why subject ourselves to this torment!? Because linter tools and their opinions are what give us discipline. They help us collaborate with others.
They ultimately help us communicate more clearly in code.
Why shouldn’t we let every developer make their own decisions? Because of our tendency toward emotional attachment. While we’re in the trenches working on our own code, against unreasonable pressure and deadlines, we’re in the least trustable mindset to be making those judgement calls.
We should be submitting to tools to help us maintain our discipline.
It’s similar to how TDD advocates submit to the discipline of writing tests first, in a formal set of steps. The discipline and the bigger picture outcome of the process are what we value most, when we’re level headed enough to make that analysis. We don’t institute that kind of process when our code is hopelessly broken and we have no idea why and we’re just resorting to trying random code changes to see if they fix it!
No. If we’re being reasonable, we admit that the overall good is best served when we set up reasonable guidelines and then follow the discipline of adhering to them.
Configurability Is King
If you’re going to knowingly subject yourself to this finger wagging, you (and your team, if applicable) are certainly going to want some say-so in what rules you’re required to play by. Arbitrary and unassailable opinions are the worst kind.
Remember the JSLint days when 98% of the rules were just Crockford’s opinions, and you either used the tool or you didn’t? He straight up warned you in the README that you were going to be offended, and that you should just get over it. That was fun, right? (Some of you may still be using JSLint, but I think you should consider moving on to a more modern tool!)
That’s why ESLint is king of the linters these days. The philosophy is, basically, let everything be configurable. Let developers and teams democratically decide which opinions they all want to submit to, for their own discipline and good.
That doesn’t mean every developer picks their own rules. The purpose of rules is to conform code to a reasonable compromise, a “centralized standard”, that has the best chance of communicating most clearly to the most developers on the team.
But no rule is ever 100% perfect. There’s always exception cases. Which is why having the option to disable or re-configure a rule with an inline comment, for example, is not just a tiny detail but a critical feature.
You don’t want a developer to just have their own local ESLint config that overrides rules while they commit code. What you want is for a developer to either follow the established rules (preferred!) OR to make an exception to the rules that is clear and obvious right at the point where the exception is being made.
Ideally, during a code review, that exception can be discussed and debated and vetted. Maybe it was justified, maybe it wasn’t. But at least it was obvious, and at least it was possible to be discussed in the first place.
Configurability of tools is how we make tools work for us instead us working for the tools.
Some prefer convention-based approaches to tooling, where the rules are pre-determined so there’s no discussion or debate. I’m know that works for some developers and for some teams, but I don’t think it is a sustainable approach for generalized, broad application. Ultimately, a tool that is inflexible to the changing project needs and DNA of the developer(s) using it, will end up falling into obscurity and eventually replaced.
Proper Arrows
I fully recognize my usage of the the word “proper” here is going to ruffle some feathers. “Who is getify to say what is proper and not?”
Remember, I’m not trying to tell you what is proper. I’m trying to get you to embrace the idea that opinions about => arrow functions are as varied as all the nuances of their syntax and usage, and that ultimately what is most appropriate is that some set of opinions, no matter what they are, should be applicable.
While I’m a big fan of ESLint, I’ve been disappointed by the lack of support from built-in ESLint rules for controlling various aspects of => arrow functions. There are a few built-in rules, but I’m frustrated that they seem to focus mostly on superficial stylistic details like whitespace.
I think there are a number of aspects that can hamper => arrow function readability, issues that go way beyond what the current ESLint ruleset can control. I asked around on twitter, and it seems from the many replies that a lot of people have opinions on this.
The ultimate linter would not only let you configure rules to your liking, but build your own rules if something were lacking. Luckily, ESLint supports exactly that!
So I decided to build an ESLint plugin to define an additional set of rules around => arrow functions: proper-arrows.
Before I explain anything about it, let me just point out: it’s a set of rules that can be turned on or off, and configured, at your discretion. If you find even one detail of one rule helpful, it would be better to use the rule/plugin than not.
I’m fine with you having your own opinions on what makes => arrow functions proper. In fact, that’s the whole point. If we all have different opinions on => arrow functions, we should have tooling support to let us pick and configure those different opinions.
The philosophy of this plugin is that, for each rule, when you turn the rule on, you get all of its reporting modes on by default. But you can of course either not turn the rule on, or turn the rule on and then configure its modes as you see fit. But I don’t want you to have to go hunting for rules/modes to turn on, where their obscurity prevents them from even being considered. So everything comes on per rule.
The only exception here is that by default, all rules ignore trivial => arrow functions, like () => {}, x => x, etc. If you want those to be checked, on a per-rule basis you have to turn on that checking with the { "trivial": true } option.
Proper Arrows Rules
So what rules are provided? Here’s an excerpt from the project overview:
"params": controls definitions of => arrow function parameters, such as forbidding unused parameters, forbidding short/unsemantic parameter names, etc.
"name": requires => arrow functions to only be used in positions where they receive an inferred name (i.e., assigned to a variable or property, etc), to avoid the poor readbility/debuggability of anonymous function expressions.
"location": restricts where in program structure => arrow functions can be used: forbidding them in the top-level/global scope, object properties, export statements, etc.
"return": restricts the concise return value kind for => arrow functions, such as forbidding object literal concise returns (x => ({ x })), forbidding concise returns of conditional/ternary expressions (x => x ? y : z), etc.
"this": requires/disallows => arrow functions using a this reference, in the => arrow function itself or in a nested => arrow function. This rule can optionally forbid this-containing => arrow functions from the global scope.
Remember, each rule has various modes to configure, so none of this is all-or-nothing. Pick what works for you.
As an illustration of what the proper-arrows rules can check for, let’s look at the "return" rule, specifically its "sequence" mode. This mode refers to the concise return expression of => arrow functions being a comma-separated sequence, like this:
var myfunc = (x,y) => ( x = 3, y = foo(x + 1), [x,y] );
Sequences are typically used in => arrow function concise returns to string together multiple (expression) statements, without needing to use a full { .. } delimited function body and an explicit return statement.
Some may love this style — that’s OK! — but a lot of folks think it favors clever terse style coding over readability, and would prefer instead:
var fn2 = (x,y) => { x = 3; y = foo(x + 1); return [x,y]; };
Notice that it’s still an => arrow function and it’s not even that many more characters. But it’s clearer that there are three separate statements in this function body.
Even better:
var fn2 = (x,y) => { x = 3; y = foo(x + 1); return [x,y]; };
To be clear, the proper-arrows rules don’t enforce trivial styling differences like whitespace/indentation. There are other (built-in) rules if you want to enforce those requirements. proper-arrows focuses on what I consider to be more substantive aspects of => function definition.
Concise Summary
You and I almost certainly disagree on what makes good, proper => arrow function style. That’s a good and healthy thing.
My goal here is two-fold:
Convince you that opinions on this stuff vary and that’s OK.
Enable you to make and enforce your own opinions (or team consensus) with configurable tooling.
There’s really nothing to be gained from arguing over opinion-based rules. Take the ones you like, forget the ones you don’t.
I hope you take a look at proper-arrows and see if there’s anything in there which you could use to ensure your => arrow functions are the best form they can be in your code base.
And if the plugin is missing some rules that would help define more proper arrows, please file an issue and we can discuss! It’s entirely plausible we may add that rule/mode, even if I personally plan to keep it turned off!
I don’t hate => arrow functions, and you shouldn’t either. I just hate uninformed and undisciplined debate. Let’s embrace smarter and more configurable tooling and move on to more important topics!
The post I Don’t Hate Arrow Functions appeared first on David Walsh Blog.
I Don’t Hate Arrow Functions published first on https://deskbysnafu.tumblr.com/
0 notes
Text
Which is the best homeowners insurance?
"Which is the best homeowners insurance?
is it better in person or online to get it
BEST ANSWER: Try this site where you can compare quotes: : http://saleinsurancequotes.xyz/index.html?src=tumblr
RELATED QUESTIONS:
Who is California Insurance Comany?
MY BOSS WAS IN AN ACCIDENT RECENTLY, WHEN THE INFORMATION WAS EXCHANGED, THE OTHER PARTY WROTE DOWN CALIFORNIA AUTO INSURANCE COMPANY AND A POLICY #, NO PHONE NUMBER, HER NAME, MAKE OF VEHICLE, MODEL AND VIN#. HOW CAN I FIND OUT THE PHONE NUMBER WITH THIS INFO. ONLY?""
How much would it cost me to get a motorbike include CBT and insurance?
I am 18 years old. I am wondering how much would it cost me to have a yamaha R1+CBT+cheap insurance. please help
How much should car insurance cost me?
im 16 and ive been saving some money for a while and i bought a 1998 honda civic, im currently paying $265/month for insurance is that too much, because im not sure im going to make the insurance this month because my hours were cut""
How to get cheap car insurance?
i want to know that how to get cheap first car insurance in u.k?
Insurance Quote for teenage driver?
Can you give me an estimated insurance rate based on the following - 18years old college student with 2 years foreign driving experience, one week old US drivers license - Never involved in any accidents - Toyota RAV 4 2009 4WD""
If I have proof of insurance but driving a friend's car who doesn't have insurance...?
Can I get a ticket for not having insurance? I was pulled over while driving a friend's car and received a ticket for not having proof of insurance. I had proof of insurance for my car in my wallet, and I showed it to the officer. He told me there needed to be proof of insurance for the car I was driving as well. Anybody know if this is true? I'm in Washington State for the record.""
Motorcycle and car insurance?
I want to get a motorbike but cant afford to run my car also. Put a question on here the other day about running a bike only all year round and been sort of put off by responses re winter riding. Is it possible to road tax and insure a car for half a year only and then for other half of year not road tax/insure it. During that period to insure and tax bike instead if put car on private driveway and not use it for that period? So basically run car half year in crap weather and bike other half in good? Whats the reprocussions insurance wise if thats possible? UK answers would be more usefull as thats where I live! thanks!
What's an affordable life insurance with no health exam?
My father needs life insurance and has health problems. He needs something with low monthly payments, but will provide enough if he has a natural death.""
Where can I get a great health insurance for a student?
Where can I get a great health insurance for a student?
Which icar insurance is cheap and best?
where can i find find cheap and good car insurance
Peugeot 206 gti insurance cost?
Does anyone know roughly how much it would cost for first time insurance? I'm 18 by the way.
Person A driving person B's car and hits my car. Who's insurance pays?
Person A driving Person B's car. Person A backed up into my car. Who's insurance pays? Person A because he was driving? Person B because it's her car? Or my insurance because I have full coverage? What are the consequences if I file through my insurance company? Will my insurance go up even if it's not my fault? I think not but if you know for sure that would be helpful. Any and all information is helpful!! Thanks!
How much can car insurance be cheaper if someone hold off driving 2 years after they can their license?
or is it any cheaper?
How Much Homeower Insurance Do I need?
How Much Homeower Insurance Do I need?
What is the cheapest auto insurance for undr 25's in Texas?
Please provide me with the web address if possible.
How much Do you pay for Car insurance every month?
and what car insurance you have?
What is the estimate car insurance cost for me?
Hello~ I'm a 16 year old female who is looking into cars and insurance. I've made a deal with my parents, so I believe that I am getting a 2013 Kia Rio. My question is...What is a rough estimate for the insurance cost that my parents will have to pay? 16 years old Female 2013 Kia Rio I have a 3.5 - 3.8 ish GPA (Can't remember exactly) If I have to, I'll probably take a drivers ed class (Although I'd love to avoid that) I believe my family is with State Farm We live in Gilbert AZ Thank you in advance! <3""
What size engine should i get for cheap insurance?
It will be my first car, and i don't really want to be paying allot on insurance, but want a nice nippy little motor. So what size is cheap for insurance but not too small to be really really slow lol.""
Canadians-What's a good insurance company for motorcycles?
I live in Halifax, NS and looking for good insurance rates. Also, what type of insurance should I get? Full coverage? I would like to insure my soon-to-be 2000 Kawi Ninja 250. I've already put this up before, but I got a lot of answers for AMERICAN companies, I'm looking for Canadian. Thanks.""
Marital status for car insurance?
trying to fill out an insurance quote and wondering what i come under for the maritial status, been living with my gf for around 6 ish months and we are engaged. these are the options i was given. married single common law partner(separate) civil partnership""
RAC CAR INSURANCE HELP!?
I purchased car insurance from RAC last year, they then annulled it as said I could not use my no claims bonus on two cars and sent me a new quote. I rang them up and they then said I haven't sent the no claims bonus documents in so I faxed them through once again, I advised I received this letter but they said just send in the documents which I did. I also never received any documents for my cover so had to request these myself which were sent by email for 25.00 :S. After hearing nothing back I rang rac for an update who said my new insurance quote was double the original quote!! I haven't signed any paperwork or received any paperwork advising they automatically gave me new insurance. I asked them to cancel but they said I have to pay 1000 as well as them keeping my deposit and paying for the first months insurance..1000?? I told them no. Paid what i owed for the first month. Now they are sending me letter telling me to pay..do I really have to do this?? I haven't signed anything even for the original insurance as they never sent the paperwork out, and as the insurance was annulled can they really automatically start a new insurance without my permission?? Thanks in advance""
""Car parked on drive, do I need insurance?""
I am buying a car in aprivate sale very soon, although will not be able to drive it until April 1st. Will I be able to just leave the car on my drive without insurance or is that illegal?""
Will my car insurance rates go up?
A year ago, I got into an accident that was my fault. My insurance rates went up. Recently they dropped but at school, I was pulling out of a parking space and I ran into another girl's car. Will my insurance rates go up if she put in a claim? If so, how much. Any thoughts? What should I do?""
Does the Motorcycle Safety Course lower your insurance?
If so by how much? If you've been riding for years would your insurance still be lowered?
I don't have insurance ?
I don't have any insurance. Any cheap one? Please any suggestion ?
Which is the best homeowners insurance?
is it better in person or online to get it
Car Insurance Gangsters :(?
Car insurance for me is $7500 for 6 months? That's buying my car twice !! Idk why I didn't wait and be patient. Now I feel like I'm stuck with this car that I just purchased because there's no way I can afford that kind of car insurance. That's just unbelievable. I've been researching and researching and I finally felt like I was ready to start driving. I see people my age on forums saying they only pay $200 a month so I figured I would be paying around there maybe even a bit more but $1000 a month? Smh,, I can't do that. I don't know what to do. Should I try to sell the car I just purchased? I signed the papers and all smh. That's just ridiculous. Almost $1500 a month smh. Idk what to do man, please give me some advice. Maybe there's a not so good insurance company that can insure me for cheap? I don't plan on getting into any accidents. I don't even think I want to drive anymore, that quote has me going nuts right now.""
What is the cheapest insurance for an 18 year old driver to get?
i dont have alot of money and need the cheapest insurance possible, that covers things somewhat. thankyou!!!""
Is health insurance worth getting if you are 23?
I just started working my first real adult job and have become eligible for a health insurance package. If I decided to get the benefits, about $88 dollars will be taken from my paycheck--that will be $176 a month ($2,112 over a year) that I will be loosing. That's a lot! I'm 23 (female) and I never get sick and I haven't had the need to go to the the doctor for anything serious in over 4 years. It may seem like a stupid question since Health Coverage right now is a current hot topic that many people are fighting about, but....SHOULD I GET MY BENEFITS? I just don't see the point of having all that money taken out of my paycheck and then STILL having to pay a co-pay. I might go see a Obgyn but that costs less than $250 out off pocket which is still less than $2112. I also just left college so I'm current on all my physicals, and I don't need any eye prescriptions. So is it worth the gamble?""
Car insurance for a Nissan 350Z?
Would it the car insurance be expensive for the Nissan 350Z if my parents bought it? But its for me. Yes, they're older than 25 :p and they own a car of their own. But this would be my first car, of my own. Not me driving theirs everywhere. lol. Cause i heard something about being a first time driver or whatever, being a teen and under the age of 25 with a two seater car that insurance can be hectic? But im not paying for it. And i can't make up my mind between the Audi TT or the 350Z. But i will start paying for it when i get a job, 16th birthday isn't to far. Which would you choose and why?""
Best and Cheapest Car On Insurance For a 17 Year Old?
Best and Cheapest Car On Insurance For a 17 Year Old?
Should people who do not own cars be forced to buy car insurance?
so that the insurance would be cheaper for those who can't really afford the premiums? That's what Hillary wants to do with Health insurance. She wants to force young people who very rarely need it to buy it so that it would be more affordable for others.
""What are my options for car insurance, being a US resident who is taking classes in British Columbia?""
I am a student at Trinity Western University in BC, Canada. My current car insurance company will only cover me through March since I am in Canada and I am finding it hard to find an insurance company that will cover me. I am trying to avoid at all cost having to get the government-issued BC car insurance because I probably wouldn't be able to afford school (it is ridiculously expensive). Anyone have any ideas?""
Can you purchase auto insurance over the phone or online??
can you purchase auto insurance over the phone or online??
How much is third party car insurance for a 2 litre car?
my dad might be giving me his car after i pass my test when i'm 17 so i was wondering how much roughly a 2 litre engine 5door mazda 626 would be to insure for a 17 year old boy on third party car insurance in the uk?
Do judges call in to verify your car insurance?
I was just curious if you are sent to court for driving without proof of insurance if the judge in court calls into the insurance to verify it. If it helps I live in Illinois. Just curious I'm trying to prove something to a friend.
Looking for insurance?
I'm self employed and I drive for a living, I own a freightliner and it has 90k miles on it. My warranty is going to run out and I'm looking to get a extended warranty but no success. I was thinking I could get insurance to cover it. Does anybody know of anything else! I'm just trying to protect my business.""
Is it legal for some1 with an International driver license to drive an insured car in California?
The car is mine and the car is insured under my name only. Will my cousin get in trouble if she drives my insured car even though her name is not included in the auto insurance policy? Or will it be okay?
Will my dad's car insurance go up if I get my license?
I'm 19 and want to get my license without getting my dad's car insurance going up.
Does anyone know the approximate cost of insurance for an 06 Golf GTI for a 16 year old driver in illinois?
Does anyone know the approximate cost of insurance for an 06 Golf GTI for a 16 year old driver in illinois?
How much insurance will I need to lease a car?
I want to lease a 2010 car. I want my insurance prices to be low, but who determines what kind and how much insurance I will need. Will my insurance be higher or lower than financing the car? What are some insurance things I SHOULD get once I lease? Any other info you can provide that I will NEED to know will be greatly appreciated! Thanks!""
How much would car insurance cost me?
IM 17, have a 3.67 gpa, the car will be a 98 van, and w/ that driver education training thing how much would it be.""
Cancelling car insurance?
I am a New York state resident, In order to cancel my car insurance, must I first surrender my license plates to the DMV ??""
Insurance for a motor bike or scooter?
Hey there, Im 19 years old and currently a student. I am looking to purchase a motorbike, but will probably buy a scooter instead since its cheaper and easier to get used to and ride. But the problem is, im not sure how insurance works on scooters as well as the legalities of actually riding them. So where could I get my scooter insured, on average how much would it cost, do I need any licences or lessons, etc...? Help!""
On medical insurance?
I want to get medical insurance but have no idea where to start or what to even look for. My employer offers medical insurance, which I don't qualify for yet, but want to look into other plans before making a decision. Can I get some links so I can educate myself on this, or can I get some suggestions or information from you guys? Thanks""
Which is more expensive: Car or Motorcycle?
And let's say they are both cheap ones. Similar price; not a fancy engine.
Who offers affordable home owners insurance in south florida?
trying to buy a house in south florida and I need a good and affordable company for my home owners ins.
What if my parents don't have insurance?
Well my i just found out since my dad got fired, we don't have insurance anymore and i can't go to the orthodontist any more either. I'm wondering why couldn't we just buy permanent insurance so we don't have to deal with this in case one of them looses a job. Shouldn't the whole affordable act thing make health insurance cost less? Or has it not I'm only 16 so i have no clue.""
""21 Year old, Need Car, Low Insurance Please Help! :(?""
Ive now had 3 years driving experience initially on my car, under my mothers no claims, then my (then) girlfriends 2 cars. However, during that time I have accrued no no claims and it has been a year since I've been insured on any. I know how to drive, I need a car. Since then it is not possible for me to get a quote on any car I try which have included family cars, small cars and even extended to classic cars in order for classic car insurance. My grandfather said I could use his no claims, however my quote goes up?! No one else has any NCB years for me to use. I have had no prior crashes, I also live in a good area for insurance. At this stage I will gladly accept a car that would get be under 1.8k on the insurance, So I'm looking for any suggestions! PLEASE HELP :(""
Life Insurance?
I had a child in 2007.. is it necessary for me to get life insurance? Why.. and what is the best carrier (in your opinion) to use? Also, what rules do I need to know before I opt to get it? Thanks.""
Will my Car Rental include insurance?
I'm hiring a car in Texas from Avis, it says it Includes Unlimited mileage, CUSTOMER FAC FEE, TRANSPORTATION FEE, VEH LICENSE FEE, Additional Liability Insurance (ALI), Collision Damage Waiver (CDW) - does this mean I won't have to arrange my own car insurance (I live in the UK) to cover driving the hire car abroad?""
Which is the best homeowners insurance?
is it better in person or online to get it
Health Insurance Confusion?
I'm a college student as of right now and I'm insured under my mother's plan. She's an OR nurse so pretty much anywhere I go in this town I don't have to pay much to get an appointment because all of them are with people who work for the hospital she works for. In the fall I will be attending a college two states away where I can waive my option to get campus health insurance or enroll to get it. Considering my health insurance only really works for this specific area do I enroll for the campus insurance? or waive? Because I know I will be getting checkups and such on campus anyway.
Does insurance cost more if you have a sporty car versus a truck?
Guess im just wondering cause some of my friends with sporty cars talk about there insurance being high cause of that, or if it didn't matter what kind of car they have. Insurance is just based on the person not the vehicle...if that makes sense lol""
What is the average auto insurance increase with one DWI?
What is the average auto insurance increase with one DWI?
""What is the best way to find cheap car insurance if Ur 21. Ive tried all the comparison sites, help??? ?
I've tried all the comparison sites but I'm getting a really high quote.
How do you get insurance?
Before I get my license, I have to get insurance. But I wanna know what do I need to get insurance? What do I have to bring?""
Under the new Cash Allowance Rebate program is my vehicle eligible if the registration and insurance ran out?
I owned my jeep cherokee for four years continuously registered and insured but just recently moved to California from New Jersey and out of necessity just let the truck sit for a few months during which the reg and insur. just expired about three months ago. So now can I still use this as a redeemable option on a new car.
Need Advise On Car Insurance?
On Friday Fed. 12th I bought Me a good Used car. I had to park on the side of the street cause my neighbors from downstairs had company and were in my spot. when I woke up on Saturday morning my car was wrecked in the front and the other vehicle no where in site well except for the trail of car fluids that led to his car three blocks away. the police came got his info and mine, towed his vehicle, advised me what I needed to do and left. I found out on my own that the insurance that the police had was false info. I was pissed. Well low and behold the owner of the car came to my house that same evening and was like my car was stolen and all this other bs. He gave me his correct insurance papers and said he would report it to claims. He never did I had to on Tuesday. His insurance knew nothing of the matter. I filed my claim with them and they said it would be 24 to 48 hours and they would get in contact with me. Nothing yet.. Im still waiting for them to call me. What should I do now???????????""
If my license is suspended and I want to trade my old car in for a new one; will my insurance company drop me?
I received a letter that my driver's license is being suspended for 6 months because I received more than 12 pts on my license (Maryland). I already have insurance and so far the rates haven't changed. I want to buy a new vehicle and I want to know that if I can actually go ahead and trade my old vehicle in for a new vehicle with the same insurance policy if the insurance company will drop me because of that suspended license. My license has been turned in to the DMV but i won't be getting it back for another 4 months.
Perth; Can I ride a motorcycle without insurance?
And if I am buying motorcycle insurance, how come they ask me how much I want to pay? Please see the link at http://rac.com.au/Insurance/Motor-insurance/Motorcycle-insurance/Motorcycle-insurance-quote.aspx So how much must I pay? I bought my second hand scooter for A$1,000 on bikesales.coml.au""
Should my baby have insurance coverage?
I am 34 weeks pregnant. I am on my dad insurance and they are paying 100% for the delivery. They said they will not paying anything for the baby once he is born though. I have been ...show more
UK - Insurance for Teenagers?
Hello, Does anyone know where newly qualified drivers can take advantage of low insurance prices. I have tried a few of the price comparison sites, but find that the price of the insurance cover is more than the car. If I purchased a car for about 800, how much should the insurance be. What is the cheapest way of buying it. Is it better to Telephone a local Broker ? Or online.""
PLEASE HELP ! Where can I get the best/cheapest car insurance deal ?
I have tried various price comparison sites without success . I need to get a low / cheap fully comprehensive car insurance policy for my son to be able to insure his car . We are an extremely low income family In order to drive his car on British roads my son needs to have an MOT certificate , Road Tax and Insurance . That is the Law of this land ! The Car only cost him 200 , I am not going to suggest that we break any laws but he should not have to pay out 15 times the cars value to get insurance to drive the car on British Roads , that is absolutely ridicules ! PLEASE CAN SOMEONE SOMEWHERE HELP There is NO PUBLIC transportation to get him to his place of employment , he needs his own transport , riding a bicycle is out of the question , he would be exhausted by the time he got there as his work place is 8 miles away , in windy weather he would be blown of it and in wet weather he would be soaked to the skin before he got there , he has to use his car . If I took him to work , I would have to make the 8 mile journey 4 times , if he does it , the journey would be twice . His Mother has her own car but works the opposite direction . her insurance is less than 500 but that is more than twice my insurance because I have held a driving license for longer , my insurance is very much lower . Our Son is too young to legally drive my vehicle . PLEASE HELP""
If someone hits me do I file a claim with his insurance company or mine?
on new years eve a man backed into my car, I'm kind of behind and starting to finally get on it, when we called state farm (my company) they said it would make our rates go up because we were filing with them, do I have to call his insurance company or mine? and is there a certain amount of time i have to file a claim?""
Companies that provide cheap car insurance for a 17 year old male?
I have recently passed my driving test and whenever I get a quote from a car insurance company it it always over 3000. I have tried putting myself under my mother's name as an additional driver but I still get the same outcome. I know people who are the same age with same car and have been able to get their insurance for a little over 1000. Are there any companies that will help me to get a lower quote (don't suggest compare websites because they are more expensive). Any help would be appreciated. Thanks
If i cash in my insurance(life) after 34 years ? 2500 policy?
i was born in 1962 in 1976 my family purchased a $2500 life insurance policy on me .what is its value now?
Is the car insurance free for me?
Ok, my family has State Farm and my mom and dad are on the insurance. If they list me as part-time, will they have to pay extra for me (I have a clear driving record.)? I tried to ask the agent this question,but I guess he didn't understand what I was trying to say. He said anyone that my parents give permission to can drive the car and they'll cover if there's an accident. So, does that mean the name has to APPEAR on the insurance if I'm part time?""
What is the best and the cheapest car insurance in ontario?
What is the best and the cheapest car insurance in ontario?
How much is car insurance?
My mom said she would buy me a car, as long as i payed for the insurance. Im thinking about getting an SUV if that matters. Also I'm Terrell Owens so money is not an issue.""
Does the official DMV website offer a free point insurance reduction program?
my friend recently complete an online 6 hour class to reduce his insurance rates by 10%. he told me the class was free and that he found it from the dmv official website. but when i go on the website, it only directs me to classes from private companies that aren't free. does the dmv website offer a Point Insurance Reduction Program (PIRP)??? http://www.dmv.ny.gov/broch/c32a.htm thanks!!!""
How much are car insurance for a first time driver?
hi i am getting a car soon and i am a first time driver.I would like to know how much insurance will be for a first time driver living in Canada ontario ?.
Will my insurance cover it?
My dad is taking me off the insurance and my coverage will end at the end of February. Anything I get done through February, as long as it is before the 1st of March should be covered, correct? I know insurance companies don't reimburse immediately. It usually takes a couple of weeks. But anything should be covered within that month right? Thanks for the help.""
Does anyone know any cheap insurance companies for me.?
i got my boyfriend a street bike and its under my name so the insurance has to be under my name to.
Can I get car insurance for one month?
I need tags for my car and I have to have insurance. I can't afford more than 150 so does anyone know a good place I can go that would let me do one month or just somewhere that is cheap online that i can pay a little amount then cancel the rest?
Is the global warming scare (scam) just what the government needs to mandate disaster insurance as well?
With they make those without if look bad and neglectful? After all, children would be homeless just because their neglectful parents didn't buy disaster insurance for their ...show more""
Free health insurance for full time student?
My friend told that me since I am a full time student, I have 15 units, I would be able to qualify for free health insurance until i'm 26 or done with school. Is this true? Thanks""
Which is the best homeowners insurance?
is it better in person or online to get it
Cheapest auto insurance in PA??
for a non-standard driver.
Rental car insurance?
Do I have to get rental car insurance in va from hertZ
What insurances do I need as a home-owner?
And any advices on insurance providers? Good service and price?
Which is the cheapest car insurance in Louisiana?
Which is the cheapest car insurance in Louisiana?
Driving without car insurance.?
Im 17, I have had my license for 2 months and my uncle gave me his car and i was wondering if i could drive it because he is still paying for the insurance on it, but I dont have any insurance of my own.""
Does your Drivers Ed grade effect insurance?
I know that taking Drivers Education can give you a discount on insurance. However, in the class, we take tests and are assigned homework. We need a 65 to pass. If I get a 70 does this effect the discount I could recieve on insurance compared to say a 90 average? State: New York""
What Are Low Cost Term Life Insurance?
What Are Low Cost Term Life Insurance?
""About car insurance, pls help?""
okay so heres my story, my dads the only one with auto insurance, mom doesnt drive, and im buying a car soon so if i sign the car under my dads name, does he become primary driver for both cars? or do i become 1 primary driver when im added onto his insurance, or can i be secondary driver with him being signed under both cars? pls help. and how much do you think it would add onto his insurance, im 18 and have my g2, never been insured, and im getting a 2004 acura rsx type s coupe thank you all""
What is the likely penalty for a new driver caught without insurance?
i know you get 6-8 points but what im really interested in knowing is what happens with the license ie if it is revoked, how long on average is the ban before you can sit the test again?""
Do you need insurance if your car has insurance?
I'm about to get my license but my family doesn't want to pay for my insurance. My brother says that the car he's giving me has insurance on it under his name and that if i get into an accident all the blame goes to him. He said its okay, is this true?""
How much would insurance be on a corvette?
I'm looking at corvettes in the 1998-2003 range, about 100,000 miles on it. I will be 18 when I buy it and I'm hoping I keep my perfect driving record. If it's affordable ...show more""
CAR INSURANCE <how much>?
how much is the car insurance for eg. opel corsa <cheapest car> because it would be my first car if you're a woman under 25 im actually 18
How much would this car cost?
Hello, I was wondering hypothetically speaking, if I bought the new 2012 Ford Mustang GT. Im under 18 (I would use my moms credit). And how much is insurance on a sports car when you under 18? Im looking for a range for the insurance. I know people say I can't give you an answer because of blah blah blah get a quote. Like I was told like 150 a month? I live in a town in Northern Ohio low crime rate. You people think it would be like 100-300 a month?""
Single input multiple quote car insurance?
looking for multiple quotes on car insurance with single information input
Cheap car insurance companies?
What car insurance companies are cheap... and do they have a web site/phone number so I can get a quote
Would you let someone ride in your car who didn't have health insurance?
Would you let someone (maybe your friend or someone you know) ride in your car who didn't have health insurance?
Is credit used in determining health insurance rates?
I am licensed in GA for property & casualty insurance, so I know credit is used to help determine rates for auto & homeowners insurance, but it is considered in health insurance?""
Does a parking ticket effect my insurance?
I received a ticket today for not cramping my wheels to the curb while parking uphill. Will that effect my insurance? And will my parking violation appear anywhere on my insurance statement or any car paperwork? Thank you :)
What is the best health insurance for a newly married couple to get?
My husband and I just got married and are looking to get health insurance. we both can not get insurance through work. we live in arizona, my husband attends ASU. We are both involved in masters programs. We are looking to start a family poss. with in the year! what is the best coverage we can get, with our student incomes? thanks in advance for any advice / guidence you can provide!""
Can you get seperate car insurance in the UK?
When I pass my driving test, I will be sharing my mums car and then going away for a year to work on a cruise ship. Is it possible to not be put on her insurance, and get a complete different insurance for me so I can build up some no claims years?""
How much is an occasional drivers insurance in ontario?
I am 16 i have a g2 i drive and 2003 dodge caravan sxt its my dads how much would it cost to list me as an occasional driver with TD insurance
Insurance california?
hi I'm an international student who goes to college in Iowa. I have a college insurance and I guess it convers most of meetings with doctors. Now, I'm taking 3 months-summer session at University of California. I think I 've heard some stuff that I need to have Californian insurance to stay here. What is this? Is it wrong? Plus, my wisdom teeth is coming out recently. It starts to hurt. Does insurance in America covers dental work?""
Anybody self employed got medical insurance successfully in usa?
Hi I am self employed. Have anybody got single employee insurance successfully? if yes I will like to know who is your insurance carrier. I have precondition so I am declined individual coverage or premium is $1000/month. Thank you
Do I need additional Insurance when renting a car in the USA?
I have full car insurance in the UK. Does this cover me when I rent a car in the USA or do I legally have to take out further insurance?
Car Insurance rate increased when I moved????
I recently moved WITHIN the same county and my car insurance rates increased because of the move. Should it increase even though I am in the same county???? It's seriously like 5 miles from my old house....
Which is the best homeowners insurance?
is it better in person or online to get it
https://www.linkedin.com/pulse/find-auto-insurance-quotes-lawrence-arnold/"
0 notes
Text
I Don’t Hate Arrow Functions
TL;DR
Arrow functions are fine for certain usages, but they have so many variations that they need to be carefully controlled to not break down the readability of the code.
While arrow functions clearly have a ubiquitous community consensus (though not unanimous support!), it turns out there’s a wide variety of opinions on what makes “good” usage of => and not.
Configurable linter rules are the best solution to wrangling the variety and disagreement of arrow functions.
I released proper-arrows ESLint plugin with a variety of configurable rules to control => arrow functions in your code base.
Opinions are like noses…
Anyone who’s followed me (tweets, books, courses, etc) for very long knows that I have lots of opinions. In fact, that’s the only thing I’m an expert on — my own opinions — and I’m never at a loss for them!
I don’t subscribe to the “strong opinions, loosely held” mantra. I don’t “loosely hold” my opinions because I don’t see any point in having an opinion if there isn’t sufficient reason for that opinion. I spend a lot of time researching and tinkering and writing and trying out ideas before I form an opinion that I would share publicly. By that point, my opinion is pretty strongly held, by necessity.
What’s more, I teach based on these opinions — thousands of developers in different companies all over the world — which affords me the opportunity to deeply vet my opinions through myriad discussion and debate. I’m tremendously privleged to be in such a position.
That doesn’t mean I can’t or won’t change my opinions. As a matter of fact, one of my most strongly held opinions — that JS types and coercion are useful in JS — has been shifting lately, to a fairly significant degree. I have a much more rounded and deepened perspective on JS types and why type-aware tooling can be useful. And even my opinion on => arrow functions, the punchline of this article, has evolved and deepened.
But one of the things many people tell me they appreciate about it me is, I don’t just state opinions, I back those opinions up with careful, thought-out reasoning. Even when people vehemently disagree with my opinions, they often compliment me on at least owning those opinions with backing.
And I try to inspire the same in others through my speaking, teaching, and writing. I don’t care if you agree with me, I only care that you know why you have an technical opinion and can earnestly defend it with your own line of reasoning. To me, that’s a healthy relationship with technology.
Arrow Functions != functions
It is my sincere belief that the => arrow function is not suitable as a general purpose replacement for all (or even most) function functions in your JS code. I genuinely don’t find them more readable in most cases. And I’m not alone. Any time I share an opinion like that on social media, I often get dozens of “me too!” responses peppered in with the scores of “you’re totally wrong!” responses.
But I’m not here to rehash the entire debate over => arrow functions. I’ve written extensively about my opinions on them, including these sections in my books:
“You Don’t Know JS: ES6 & Beyond”, Ch2, “Arrow Functions”
“Functional-Light JavaScript”, Ch2, “Functions Without function“ (and the preceding section on function names).
Whatever your preferences around =>, to suggest that it’s only a better function is to be plainly reductive. It’s a far more nuanced topic than just a one-to-one correspondence.
There are things to like about =>. You might find that surprising for me to say, since most people seem to assume I hate arrow functions.
I don’t (hate them). I think there are definitely some important benefits.
It’s just that I don’t unreservedly endorse them as the new function. And these days, most people aren’t interested in nuanced opinions in the middle. So since I’m not entirely in the pro-=> camp, I must be entirely in the opposition camp. Not true.
What I hate is suggesting they’re universally more readable, or that they’re objectively better in basically all cases.
The reason I reject this stance is because I REALLY DO STRUGGLE TO READ THEM in many cases. So that perspective just makes me feel dumb/inferior as a developer. “There must be something wrong with me, since I don’t think it’s more readable. Why do I suck so much at this?” And I’m not the only one who’s impostor syndrome is seriously stoked by such absolutes.
And the cherry on top is when people tell you that the only reason you don’t understand or like => is because you haven’t learned them or used them enough. Oh, right, it’s my ignorance. SMH. I’ve written and read literally thousands of =>functions. I’m quite certain I know enough about them to hold the opinions I have.
I’m not in the pro-=> camp, but I recognize that some really do prefer them, legitimately. I recognize that some people come to JS from languages that have used => and so they feel and read quite natural. I recognize that some prefer their resemblance to mathematical notation.
What’s problematic IMO is when some in those camps simply cannot understand or empathize with dissenting opinions, as if there must just be something wrong with them.
Readability != Writability
I also don’t think you know what you’re talking about when you talk about code readability. By and large, the vast majority of opinions on code readability, when you break them down, are based on a personal stance about preferences in writingconcise code.
When I push back in debates about code readability, some just dig in their heels and refuse to support their opinion. Others will waive off the concerns with, “readability is all just subjective anyway”.
The flimsiness of that response is stunning: two seconds ago they were vehemently claiming => arrow is absolutely and objectively more readable, and then when pressed, they admit, “well, I think it’s more readable, even if ignorants like you don’t.”
Guess what? Readability is subjective, but not entirely so. It’s a really complex topic. And there are some who are undertaking to formally study the topic of code readability, to try to find what parts of it are objective and what parts are subjective.
I have read a fair amount of such research, and I’m convinced that it’s a complicated enough topic that it can’t be reduced to a slogan on a t-shirt. If you want to read them, I would encourage you doing some google searching and reading of your own.
While I don’t have all the answers myself, one thing I’m certain about is, code is more often read than written, so perspectives on the topic which ultimately come from “it’s easier/quicker to write” don’t hold much standing. What needs to be considered is, not how much time do you save writing, but how clearly will the reader (future you or someone else on the team) be able to understand? And ideally, can they mostly understand it without pouring over the code with a fine-toothed comb?
Any attempt to justify writability affordances with unsubstantiated claims about readability benefits is a weak argument at best, and in general, nothing but a distraction.
So I roundly reject that => is always and objectively “more readable”.
But I still don’t hate arrow functions. I just think to use them effectively, we need to be more disciplined.
Linters == Discipline
You might be of the (incorrect) belief that linters tell you objective facts about your code. They can do that, but that’s not their primary purpose.
The tool that’s best suited to tell you if your code is valid is a compiler (ie, the JS engine). The tool that’s best suited to tell you whether your code is “correct” (does what you want it to do) is your test suite.
But the tool that’s best suited to tell you if your code is appropriate is a linter. Linters are opinionated collections of rules about how you should style and structure your code, so as to avoid likely problems — according to the authors of those opinion-based rules.
That’s what they’re for: to apply opinions to your code.
That means it’s almost certain that these opinions will, at one time or another, “offend” you. If you’re like most of us, you fancy yourself pretty good at what you do, and you know that this thing you’re doing on this line of code is right. And then the linter pops up and says, “Nope, don’t do it that way.”
If your first instinct is sometimes to disagree, then you’re like the rest of us! We get emotionally attached to our own perspectives and abilities, and when a tool tells us we’re wrong, we chuff a little bit.
I don’t get mad at the test suite or the JS engine. Those things are all reporting facts about my code. But I can definitely get irritated when the linter’s opinion disagrees with mine.
I have this one linter rule that I enabled a few weeks ago, because I had an inconsistency in my coding that was annoying me on code re-reads. But now this lint rule is popping up two or three times an hour, nagging me like a stereotypical grandma on a 90’s sitcom. Every single time, I ponder (for just a moment) if I should just go disable that rule. I leave it on, but to my chagrin.
So why subject ourselves to this torment!? Because linter tools and their opinions are what give us discipline. They help us collaborate with others.
They ultimately help us communicate more clearly in code.
Why shouldn’t we let every developer make their own decisions? Because of our tendency toward emotional attachment. While we’re in the trenches working on our own code, against unreasonable pressure and deadlines, we’re in the least trustable mindset to be making those judgement calls.
We should be submitting to tools to help us maintain our discipline.
It’s similar to how TDD advocates submit to the discipline of writing tests first, in a formal set of steps. The discipline and the bigger picture outcome of the process are what we value most, when we’re level headed enough to make that analysis. We don’t institute that kind of process when our code is hopelessly broken and we have no idea why and we’re just resorting to trying random code changes to see if they fix it!
No. If we’re being reasonable, we admit that the overall good is best served when we set up reasonable guidelines and then follow the discipline of adhering to them.
Configurability Is King
If you’re going to knowingly subject yourself to this finger wagging, you (and your team, if applicable) are certainly going to want some say-so in what rules you’re required to play by. Arbitrary and unassailable opinions are the worst kind.
Remember the JSLint days when 98% of the rules were just Crockford’s opinions, and you either used the tool or you didn’t? He straight up warned you in the README that you were going to be offended, and that you should just get over it. That was fun, right? (Some of you may still be using JSLint, but I think you should consider moving on to a more modern tool!)
That’s why ESLint is king of the linters these days. The philosophy is, basically, let everything be configurable. Let developers and teams democratically decide which opinions they all want to submit to, for their own discipline and good.
That doesn’t mean every developer picks their own rules. The purpose of rules is to conform code to a reasonable compromise, a “centralized standard”, that has the best chance of communicating most clearly to the most developers on the team.
But no rule is ever 100% perfect. There’s always exception cases. Which is why having the option to disable or re-configure a rule with an inline comment, for example, is not just a tiny detail but a critical feature.
You don’t want a developer to just have their own local ESLint config that overrides rules while they commit code. What you want is for a developer to either follow the established rules (preferred!) OR to make an exception to the rules that is clear and obvious right at the point where the exception is being made.
Ideally, during a code review, that exception can be discussed and debated and vetted. Maybe it was justified, maybe it wasn’t. But at least it was obvious, and at least it was possible to be discussed in the first place.
Configurability of tools is how we make tools work for us instead us working for the tools.
Some prefer convention-based approaches to tooling, where the rules are pre-determined so there’s no discussion or debate. I’m know that works for some developers and for some teams, but I don’t think it is a sustainable approach for generalized, broad application. Ultimately, a tool that is inflexible to the changing project needs and DNA of the developer(s) using it, will end up falling into obscurity and eventually replaced.
Proper Arrows
I fully recognize my usage of the the word “proper” here is going to ruffle some feathers. “Who is getify to say what is proper and not?”
Remember, I’m not trying to tell you what is proper. I’m trying to get you to embrace the idea that opinions about => arrow functions are as varied as all the nuances of their syntax and usage, and that ultimately what is most appropriate is that some set of opinions, no matter what they are, should be applicable.
While I’m a big fan of ESLint, I’ve been disappointed by the lack of support from built-in ESLint rules for controlling various aspects of => arrow functions. There are a few built-in rules, but I’m frustrated that they seem to focus mostly on superficial stylistic details like whitespace.
I think there are a number of aspects that can hamper => arrow function readability, issues that go way beyond what the current ESLint ruleset can control. I asked around on twitter, and it seems from the many replies that a lot of people have opinions on this.
The ultimate linter would not only let you configure rules to your liking, but build your own rules if something were lacking. Luckily, ESLint supports exactly that!
So I decided to build an ESLint plugin to define an additional set of rules around => arrow functions: proper-arrows.
Before I explain anything about it, let me just point out: it’s a set of rules that can be turned on or off, and configured, at your discretion. If you find even one detail of one rule helpful, it would be better to use the rule/plugin than not.
I’m fine with you having your own opinions on what makes => arrow functions proper. In fact, that’s the whole point. If we all have different opinions on => arrow functions, we should have tooling support to let us pick and configure those different opinions.
The philosophy of this plugin is that, for each rule, when you turn the rule on, you get all of its reporting modes on by default. But you can of course either not turn the rule on, or turn the rule on and then configure its modes as you see fit. But I don’t want you to have to go hunting for rules/modes to turn on, where their obscurity prevents them from even being considered. So everything comes on per rule.
The only exception here is that by default, all rules ignore trivial => arrow functions, like () => {}, x => x, etc. If you want those to be checked, on a per-rule basis you have to turn on that checking with the { "trivial": true } option.
Proper Arrows Rules
So what rules are provided? Here’s an excerpt from the project overview:
"params": controls definitions of => arrow function parameters, such as forbidding unused parameters, forbidding short/unsemantic parameter names, etc.
"name": requires => arrow functions to only be used in positions where they receive an inferred name (i.e., assigned to a variable or property, etc), to avoid the poor readbility/debuggability of anonymous function expressions.
"location": restricts where in program structure => arrow functions can be used: forbidding them in the top-level/global scope, object properties, export statements, etc.
"return": restricts the concise return value kind for => arrow functions, such as forbidding object literal concise returns (x => ({ x })), forbidding concise returns of conditional/ternary expressions (x => x ? y : z), etc.
"this": requires/disallows => arrow functions using a this reference, in the => arrow function itself or in a nested => arrow function. This rule can optionally forbid this-containing => arrow functions from the global scope.
Remember, each rule has various modes to configure, so none of this is all-or-nothing. Pick what works for you.
As an illustration of what the proper-arrows rules can check for, let’s look at the "return" rule, specifically its "sequence" mode. This mode refers to the concise return expression of => arrow functions being a comma-separated sequence, like this:
var myfunc = (x,y) => ( x = 3, y = foo(x + 1), [x,y] );
Sequences are typically used in => arrow function concise returns to string together multiple (expression) statements, without needing to use a full { .. } delimited function body and an explicit return statement.
Some may love this style — that’s OK! — but a lot of folks think it favors clever terse style coding over readability, and would prefer instead:
var fn2 = (x,y) => { x = 3; y = foo(x + 1); return [x,y]; };
Notice that it’s still an => arrow function and it’s not even that many more characters. But it’s clearer that there are three separate statements in this function body.
Even better:
var fn2 = (x,y) => { x = 3; y = foo(x + 1); return [x,y]; };
To be clear, the proper-arrows rules don’t enforce trivial styling differences like whitespace/indentation. There are other (built-in) rules if you want to enforce those requirements. proper-arrows focuses on what I consider to be more substantive aspects of => function definition.
Concise Summary
You and I almost certainly disagree on what makes good, proper => arrow function style. That’s a good and healthy thing.
My goal here is two-fold:
Convince you that opinions on this stuff vary and that’s OK.
Enable you to make and enforce your own opinions (or team consensus) with configurable tooling.
There’s really nothing to be gained from arguing over opinion-based rules. Take the ones you like, forget the ones you don’t.
I hope you take a look at proper-arrows and see if there’s anything in there which you could use to ensure your => arrow functions are the best form they can be in your code base.
And if the plugin is missing some rules that would help define more proper arrows, please file an issue and we can discuss! It’s entirely plausible we may add that rule/mode, even if I personally plan to keep it turned off!
I don’t hate => arrow functions, and you shouldn’t either. I just hate uninformed and unenforced debate. Let’s embrace smarter and more configurable tooling and move on to more important topics!
The post I Don’t Hate Arrow Functions appeared first on David Walsh Blog.
I Don’t Hate Arrow Functions published first on https://appspypage.tumblr.com/
0 notes
Text
I Don’t Hate Arrow Functions
TL;DR
Arrow functions are fine for certain usages, but they have so many variations that they need to be carefully controlled to not break down the readability of the code.
While arrow functions clearly have a ubiquitous community consensus (though not unanimous support!), it turns out there’s a wide variety of opinions on what makes “good” usage of => and not.
Configurable linter rules are the best solution to wrangling the variety and disagreement of arrow functions.
I released proper-arrows ESLint plugin with a variety of configurable rules to control => arrow functions in your code base.
Opinions are like noses…
Anyone who’s followed me (tweets, books, courses, etc) for very long knows that I have lots of opinions. In fact, that’s the only thing I’m an expert on — my own opinions — and I’m never at a loss for them!
I don’t subscribe to the “strong opinions, loosely held” mantra. I don’t “loosely hold” my opinions because I don’t see any point in having an opinion if there isn’t sufficient reason for that opinion. I spend a lot of time researching and tinkering and writing and trying out ideas before I form an opinion that I would share publicly. By that point, my opinion is pretty strongly held, by necessity.
What’s more, I teach based on these opinions — thousands of developers in different companies all over the world — which affords me the opportunity to deeply vet my opinions through myriad discussion and debate. I’m tremendously privleged to be in such a position.
That doesn’t mean I can’t or won’t change my opinions. As a matter of fact, one of my most strongly held opinions — that JS types and coercion are useful in JS — has been shifting lately, to a fairly significant degree. I have a much more rounded and deepened perspective on JS types and why type-aware tooling can be useful. And even my opinion on => arrow functions, the punchline of this article, has evolved and deepened.
But one of the things many people tell me they appreciate about it me is, I don’t just state opinions, I back those opinions up with careful, thought-out reasoning. Even when people vehemently disagree with my opinions, they often compliment me on at least owning those opinions with backing.
And I try to inspire the same in others through my speaking, teaching, and writing. I don’t care if you agree with me, I only care that you know why you have an technical opinion and can earnestly defend it with your own line of reasoning. To me, that’s a healthy relationship with technology.
Arrow Functions != functions
It is my sincere belief that the => arrow function is not suitable as a general purpose replacement for all (or even most) function functions in your JS code. I genuinely don’t find them more readable in most cases. And I’m not alone. Any time I share an opinion like that on social media, I often get dozens of “me too!” responses peppered in with the scores of “you’re totally wrong!” responses.
But I’m not here to rehash the entire debate over => arrow functions. I’ve written extensively about my opinions on them, including these sections in my books:
“You Don’t Know JS: ES6 & Beyond”, Ch2, “Arrow Functions”
“Functional-Light JavaScript”, Ch2, “Functions Without function“ (and the preceding section on function names).
Whatever your preferences around =>, to suggest that it’s only a better function is to be plainly reductive. It’s a far more nuanced topic than just a one-to-one correspondence.
There are things to like about =>. You might find that surprising for me to say, since most people seem to assume I hate arrow functions.
I don’t (hate them). I think there are definitely some important benefits.
It’s just that I don’t unreservedly endorse them as the new function. And these days, most people aren’t interested in nuanced opinions in the middle. So since I’m not entirely in the pro-=> camp, I must be entirely in the opposition camp. Not true.
What I hate is suggesting they’re universally more readable, or that they’re objectively better in basically all cases.
The reason I reject this stance is because I REALLY DO STRUGGLE TO READ THEM in many cases. So that perspective just makes me feel dumb/inferior as a developer. “There must be something wrong with me, since I don’t think it’s more readable. Why do I suck so much at this?” And I’m not the only one who’s impostor syndrome is seriously stoked by such absolutes.
And the cherry on top is when people tell you that the only reason you don’t understand or like => is because you haven’t learned them or used them enough. Oh, right, it’s my ignorance. SMH. I’ve written and read literally thousands of =>functions. I’m quite certain I know enough about them to hold the opinions I have.
I’m not in the pro-=> camp, but I recognize that some really do prefer them, legitimately. I recognize that some people come to JS from languages that have used => and so they feel and read quite natural. I recognize that some prefer their resemblance to mathematical notation.
What’s problematic IMO is when some in those camps simply cannot understand or empathize with dissenting opinions, as if there must just be something wrong with them.
Readability != Writability
I also don’t think you know what you’re talking about when you talk about code readability. By and large, the vast majority of opinions on code readability, when you break them down, are based on a personal stance about preferences in writingconcise code.
When I push back in debates about code readability, some just dig in their heels and refuse to support their opinion. Others will waive off the concerns with, “readability is all just subjective anyway”.
The flimsiness of that response is stunning: two seconds ago they were vehemently claiming => arrow is absolutely and objectively more readable, and then when pressed, they admit, “well, I think it’s more readable, even if ignorants like you don’t.”
Guess what? Readability is subjective, but not entirely so. It’s a really complex topic. And there are some who are undertaking to formally study the topic of code readability, to try to find what parts of it are objective and what parts are subjective.
I have read a fair amount of such research, and I’m convinced that it’s a complicated enough topic that it can’t be reduced to a slogan on a t-shirt. If you want to read them, I would encourage you doing some google searching and reading of your own.
While I don’t have all the answers myself, one thing I’m certain about is, code is more often read than written, so perspectives on the topic which ultimately come from “it’s easier/quicker to write” don’t hold much standing. What needs to be considered is, not how much time do you save writing, but how clearly will the reader (future you or someone else on the team) be able to understand? And ideally, can they mostly understand it without pouring over the code with a fine-toothed comb?
Any attempt to justify writability affordances with unsubstantiated claims about readability benefits is a weak argument at best, and in general, nothing but a distraction.
So I roundly reject that => is always and objectively “more readable”.
But I still don’t hate arrow functions. I just think to use them effectively, we need to be more disciplined.
Linters == Discipline
You might be of the (incorrect) belief that linters tell you objective facts about your code. They can do that, but that’s not their primary purpose.
The tool that’s best suited to tell you if your code is valid is a compiler (ie, the JS engine). The tool that’s best suited to tell you whether your code is “correct” (does what you want it to do) is your test suite.
But the tool that’s best suited to tell you if your code is appropriate is a linter. Linters are opinionated collections of rules about how you should style and structure your code, so as to avoid likely problems — according to the authors of those opinion-based rules.
That’s what they’re for: to apply opinions to your code.
That means it’s almost certain that these opinions will, at one time or another, “offend” you. If you’re like most of us, you fancy yourself pretty good at what you do, and you know that this thing you’re doing on this line of code is right. And then the linter pops up and says, “Nope, don’t do it that way.”
If your first instinct is sometimes to disagree, then you’re like the rest of us! We get emotionally attached to our own perspectives and abilities, and when a tool tells us we’re wrong, we chuff a little bit.
I don’t get mad at the test suite or the JS engine. Those things are all reporting facts about my code. But I can definitely get irritated when the linter’s opinion disagrees with mine.
I have this one linter rule that I enabled a few weeks ago, because I had an inconsistency in my coding that was annoying me on code re-reads. But now this lint rule is popping up two or three times an hour, nagging me like a stereotypical grandma on a 90’s sitcom. Every single time, I ponder (for just a moment) if I should just go disable that rule. I leave it on, but to my chagrin.
So why subject ourselves to this torment!? Because linter tools and their opinions are what give us discipline. They help us collaborate with others.
They ultimately help us communicate more clearly in code.
Why shouldn’t we let every developer make their own decisions? Because of our tendency toward emotional attachment. While we’re in the trenches working on our own code, against unreasonable pressure and deadlines, we’re in the least trustable mindset to be making those judgement calls.
We should be submitting to tools to help us maintain our discipline.
It’s similar to how TDD advocates submit to the discipline of writing tests first, in a formal set of steps. The discipline and the bigger picture outcome of the process are what we value most, when we’re level headed enough to make that analysis. We don’t institute that kind of process when our code is hopelessly broken and we have no idea why and we’re just resorting to trying random code changes to see if they fix it!
No. If we’re being reasonable, we admit that the overall good is best served when we set up reasonable guidelines and then follow the discipline of adhering to them.
Configurability Is King
If you’re going to knowingly subject yourself to this finger wagging, you (and your team, if applicable) are certainly going to want some say-so in what rules you’re required to play by. Arbitrary and unassailable opinions are the worst kind.
Remember the JSLint days when 98% of the rules were just Crockford’s opinions, and you either used the tool or you didn’t? He straight up warned you in the README that you were going to be offended, and that you should just get over it. That was fun, right? (Some of you may still be using JSLint, but I think you should consider moving on to a more modern tool!)
That’s why ESLint is king of the linters these days. The philosophy is, basically, let everything be configurable. Let developers and teams democratically decide which opinions they all want to submit to, for their own discipline and good.
That doesn’t mean every developer picks their own rules. The purpose of rules is to conform code to a reasonable compromise, a “centralized standard”, that has the best chance of communicating most clearly to the most developers on the team.
But no rule is ever 100% perfect. There’s always exception cases. Which is why having the option to disable or re-configure a rule with an inline comment, for example, is not just a tiny detail but a critical feature.
You don’t want a developer to just have their own local ESLint config that overrides rules while they commit code. What you want is for a developer to either follow the established rules (preferred!) OR to make an exception to the rules that is clear and obvious right at the point where the exception is being made.
Ideally, during a code review, that exception can be discussed and debated and vetted. Maybe it was justified, maybe it wasn’t. But at least it was obvious, and at least it was possible to be discussed in the first place.
Configurability of tools is how we make tools work for us instead us working for the tools.
Some prefer convention-based approaches to tooling, where the rules are pre-determined so there’s no discussion or debate. I’m know that works for some developers and for some teams, but I don’t think it is a sustainable approach for generalized, broad application. Ultimately, a tool that is inflexible to the changing project needs and DNA of the developer(s) using it, will end up falling into obscurity and eventually replaced.
Proper Arrows
I fully recognize my usage of the the word “proper” here is going to ruffle some feathers. “Who is getify to say what is proper and not?”
Remember, I’m not trying to tell you what is proper. I’m trying to get you to embrace the idea that opinions about => arrow functions are as varied as all the nuances of their syntax and usage, and that ultimately what is most appropriate is that some set of opinions, no matter what they are, should be applicable.
While I’m a big fan of ESLint, I’ve been disappointed by the lack of support from built-in ESLint rules for controlling various aspects of => arrow functions. There are a few built-in rules, but I’m frustrated that they seem to focus mostly on superficial stylistic details like whitespace.
I think there are a number of aspects that can hamper => arrow function readability, issues that go way beyond what the current ESLint ruleset can control. I asked around on twitter, and it seems from the many replies that a lot of people have opinions on this.
The ultimate linter would not only let you configure rules to your liking, but build your own rules if something were lacking. Luckily, ESLint supports exactly that!
So I decided to build an ESLint plugin to define an additional set of rules around => arrow functions: proper-arrows.
Before I explain anything about it, let me just point out: it’s a set of rules that can be turned on or off, and configured, at your discretion. If you find even one detail of one rule helpful, it would be better to use the rule/plugin than not.
I’m fine with you having your own opinions on what makes => arrow functions proper. In fact, that’s the whole point. If we all have different opinions on => arrow functions, we should have tooling support to let us pick and configure those different opinions.
The philosophy of this plugin is that, for each rule, when you turn the rule on, you get all of its reporting modes on by default. But you can of course either not turn the rule on, or turn the rule on and then configure its modes as you see fit. But I don’t want you to have to go hunting for rules/modes to turn on, where their obscurity prevents them from even being considered. So everything comes on per rule.
The only exception here is that by default, all rules ignore trivial => arrow functions, like () => {}, x => x, etc. If you want those to be checked, on a per-rule basis you have to turn on that checking with the { "trivial": true } option.
Proper Arrows Rules
So what rules are provided? Here’s an excerpt from the project overview:
"params": controls definitions of => arrow function parameters, such as forbidding unused parameters, forbidding short/unsemantic parameter names, etc.
"name": requires => arrow functions to only be used in positions where they receive an inferred name (i.e., assigned to a variable or property, etc), to avoid the poor readbility/debuggability of anonymous function expressions.
"location": restricts where in program structure => arrow functions can be used: forbidding them in the top-level/global scope, object properties, export statements, etc.
"return": restricts the concise return value kind for => arrow functions, such as forbidding object literal concise returns (x => ({ x })), forbidding concise returns of conditional/ternary expressions (x => x ? y : z), etc.
"this": requires/disallows => arrow functions using a this reference, in the => arrow function itself or in a nested => arrow function. This rule can optionally forbid this-containing => arrow functions from the global scope.
Remember, each rule has various modes to configure, so none of this is all-or-nothing. Pick what works for you.
As an illustration of what the proper-arrows rules can check for, let’s look at the "return" rule, specifically its "sequence" mode. This mode refers to the concise return expression of => arrow functions being a comma-separated sequence, like this:
var myfunc = (x,y) => ( x = 3, y = foo(x + 1), [x,y] );
Sequences are typically used in => arrow function concise returns to string together multiple (expression) statements, without needing to use a full { .. } delimited function body and an explicit return statement.
Some may love this style — that’s OK! — but a lot of folks think it favors clever terse style coding over readability, and would prefer instead:
var fn2 = (x,y) => { x = 3; y = foo(x + 1); return [x,y]; };
Notice that it’s still an => arrow function and it’s not even that many more characters. But it’s clearer that there are three separate statements in this function body.
Even better:
var fn2 = (x,y) => { x = 3; y = foo(x + 1); return [x,y]; };
To be clear, the proper-arrows rules don’t enforce trivial styling differences like whitespace/indentation. There are other (built-in) rules if you want to enforce those requirements. proper-arrows focuses on what I consider to be more substantive aspects of => function definition.
Concise Summary
You and I almost certainly disagree on what makes good, proper => arrow function style. That’s a good and healthy thing.
My goal here is two-fold:
Convince you that opinions on this stuff vary and that’s OK.
Enable you to make and enforce your own opinions (or team consensus) with configurable tooling.
There’s really nothing to be gained from arguing over opinion-based rules. Take the ones you like, forget the ones you don’t.
I hope you take a look at proper-arrows and see if there’s anything in there which you could use to ensure your => arrow functions are the best form they can be in your code base.
And if the plugin is missing some rules that would help define more proper arrows, please file an issue and we can discuss! It’s entirely plausible we may add that rule/mode, even if I personally plan to keep it turned off!
I don’t hate => arrow functions, and you shouldn’t either. I just hate uninformed and unenforced debate. Let’s embrace smarter and more configurable tooling and move on to more important topics!
The post I Don’t Hate Arrow Functions appeared first on David Walsh Blog.
I Don’t Hate Arrow Functions published first on https://deskbysnafu.tumblr.com/
0 notes