Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Gounads
Mar 13, 2013

Where am I?
How did I get here?

Vulture Culture posted:

8 hours isn't fine for one step (if the interview is based entirely on technical prowess and 0% on team fit, run the gently caress far away). It's fine if you're already between jobs because you can afford to be, or because you're an unencumbered twenty-something or early thirty-something with no other demands on that time. It's not okay for people with multiple jobs, people with children, people with elder care responsibilities, etc. This will be reflected in the demographics of the workplace.

8 hours was meant as an absolute upper bounds for the entire process.

Adbot
ADBOT LOVES YOU

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

pugnax posted:

How do you guys treat documentation in your ~agile flow~? An extra story per feature? Treat it like a feature in itself?
We document features after the fact because most of our features are experiments and don't live long enough to be worth documenting.

Gounads posted:

8 hours was meant as an absolute upper bounds for the entire process.
Reasonable. I must have missed some intervening posts in the thread.

revmoo
May 25, 2006

#basta

Gounads posted:

8 hours was meant as an absolute upper bounds for the entire process.

Yes and I agree with this also.

I really just need to solidify my stance against doing these tests. I've done two so far, the results; one mysterious company that was recruiting with "hacker" challenges--I made it to the last step and they told me to set up a web app. I went a little overboard and even implemented a system that popped my resume up in a PDF viewer when visiting the site. They wanted me but it turned out that they literally had no money and were looking for people to work for free. gently caress idea guys. The other one, I had to implement a fully-fledged app to order pizzas online. They hired me and I instantly hated the job and despised my boss. I should have listened to my gut on that one.

No more, I'm putting my foot down against interview "homework." It's loving bullshit.

It's annoying because I really would like to find a new job but solid non-bs jobs are scarce as gently caress right now. I'm about to just put in my notice at my current job and live off savings because I can't stand my current boss, even in spite of the current hiring climate. Company got bought out and this idiot that doesn't even know what a hosts file is, is now in charge of every move I make. I literally built the CI system at this company from the ground up, but this idiot is the only one who is allowed to sign off on deployments now. He's trying to fire me at the moment because he ordered, ORDERED me to have a complex project done by midnight on wednesday and I told him that was unlikely. This dude is so completely delusional he has this idea in his head that whatever he says goes, regardless of whether his expectations are realistic or not. He's had me working 60 hour weeks for over a month now and just ordered me to go to loving Detroit on basically no notice to do a bunch of poo poo I could easily do from here.

After he ordered me to complete that project by midnight, I told him I'd likely have it done but I felt it needed more testing than our usual UAT. His response was basically "Are you refusing to comply with my order?" I told him that we needed to discuss this between myself, him and the CTO. His response? "No."

I basically wrote a letter to the CTO telling him this is bullshit and I'm taking the day off for a mental health day, fire me if you want. Idiot boss then sends me this text (verbatim):

"Just in case you're not monitoring your email I want to make sure you understand that you are not authorized to take tomorrow off"

Who the gently caress says that?

Now, I currently am almost completely maxxed on PTO right now, I've haven't had two days off in a row since August, and while I understand how disruptive just taking a sick day out of the blue can be, I basically just had to take a time out so I wouldn't do or say something I'd regret. The CTO was cool with it and fully understood but my boss is just raging at the moment. He's very clearly and obviously trying to build a paper trail so he'll have some ammo to try and get me canned, but he also doesn't have the clout and the whole thing is just kind of hilarious to me. I really wish they'd just fire me to be honest. I wonder if they remember agreeing to a $15k severance or striking out the binding arbitration clause from my employment contract....

hobbesmaster
Jan 28, 2008

Do you work for Chris Roberts?

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
I hope you forwarded that message to the CTO with the message "and this is why"

revmoo
May 25, 2006

#basta

hobbesmaster posted:

Do you work for Chris Roberts?

I think I'd rather work for crobbits tbh. Highlights of some of the stuff this dude has pulled recently:

- Instituted a whole new workflow for everything and didn't tell anyone. I found out when I notified him about a deploy I had pushed out to fix a customer issue and he made me revert the deploy, hotpatch the DB to fix the customers issue, and then re-deploy the same code the next day with his blessing. This caused a time-sensitive overshoot with our customer.

- Did not know we do UAT with the prod data. Why is this? Because we're stretched too thin at the moment to create a proper dev environment and our "prod data" is a 290TB read-only hadoop cluster.

- Constantly puts me onto random tickets with other deadlines looming and then is abusive when those deadlines are not met.

- Messages me constantly on Slack. To the point where it intrudes on my work. The other day I checked the chat logs and he had occupied three hours of my time by noon. Usually he will asks questions about information that's already in tickets, or he'll ask for updates and constant re-estimates of work I'm in the middle of.

- Didn't know what a CNAME was, and was apparently also too lazy to google it and educate himself. Also does not understand what an A record is. This is a software development / network engineering company.

- Doesn't know how to create a user account on our flagship product. You literally login and go to 'Users' and click 'Add user'

- I built a SSO system using Oauth2. I fully documented the process for customers to integrate with us. It provides verbatim step-by-step instructions that can easily be replicated in Postman by even a non-developer. He wanted me to walk him through the entire process to prove that it's functional but got stuck on every single step including step 1, 'create a user.' His .NET folks have ALREADY figured out this integration and they're already using it. The dev had a couple clarification questions towards the end, but I only had to give him maybe five minutes of guidance to implement.

- Literally thinks deadlines are magical incantations

- Tried to get me to schedule a thousand miles of driving with 3 days notice.

- Told me to go get dinner with my wife twice as a "thank you" for working overtime. He never expensed the meals.

- Literally had to spell out for him that a ticket waiting on other tickets for implementation, couldn't be done first. He was the one who documented the dependancies in our ticketing system.

- I start early. He'll message me "Good morning!" and then bother me four 20 minutes with insane drivel. Then an hour later he'll message me "Good morning!" again as if we'd never even spoke.

This is just the recent stuff that pops into my head. There's more that I'm forgetting. The guy's absolutely insane.

Hughlander
May 11, 2005

Vulture Culture posted:

8 hours isn't fine for one step (if the interview is based entirely on technical prowess and 0% on team fit, run the gently caress far away). It's fine if you're already between jobs because you can afford to be, or because you're an unencumbered twenty-something or early thirty-something with no other demands on that time. It's not okay for people with multiple jobs, people with children, people with elder care responsibilities, etc. This will be reflected in the demographics of the workplace.

Exactly, the problem is that it's a self-selection issue. Only people who have no problem with giving up multiple days will apply to that company, so it will be stocked with people who think that's ok and normal. You're completely limited in the number of places you can apply for at a time. I remember a few jobs ago I had two weeks of flying around the country to WA (twice), MD, and MA from CA. If one of those wanted the day or two of travel for a f2f and another day or two of a test, I'd drop them off the list. This line of thought makes me really glad i'm not an artist or designer where their take home tests run 20-40 hours routinely.

kedo
Nov 27, 2007


Reading this post stresses me out.

spiritual bypass
Feb 19, 2008

Grimey Drawer

You...uhhhh...work remotely for a web hosting company around Detroit that just hired a new guy that starts on Monday?

revmoo
May 25, 2006

#basta

rt4 posted:

You...uhhhh...work remotely for a web hosting company around Detroit that just hired a new guy that starts on Monday?

Haha wow. Uhh pm me.

FlapYoJacks
Feb 12, 2009
I have a coworker
Who is a good guy
But messages
Me on slack like
This constantly and doesn't
Think to just write a single
Sentence.

hailthefish
Oct 24, 2010

That's a terrible poem.

Dirty Frank
Jul 8, 2004

ratbert90 posted:

I have a coworker
Who is a good guy
But messages
Me on slack like
This constantly and doesn't
Think to just write a single
Sentence.

Hey
*10mins pas*
I work with
That guy
Too

spiritual bypass
Feb 19, 2008

Grimey Drawer
/giphy haha cool

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



Vulture Culture posted:

8 hours isn't fine for one step (if the interview is based entirely on technical prowess and 0% on team fit, run the gently caress far away). It's fine if you're already between jobs because you can afford to be, or because you're an unencumbered twenty-something or early thirty-something with no other demands on that time. It's not okay for people with multiple jobs, people with children, people with elder care responsibilities, etc. This will be reflected in the demographics of the workplace.

What do people mean when they say they test for team fit? It's been a while since I went for interviews and I don't remember much about seeing if I fit in to a team. What would that even be? Making sure the person isn't an rear end in a top hat, or expecting everyone to be wearing suits at the company?

Iverron
May 13, 2012

return0 posted:

If you need to go to the toilet or make a coffee or spend two minutes wrapping up then that's obviously fine, the point is you cannot defer peer review and must do it immediately. It works pretty well, and is quite well aligned to a one-piece-flow / kanban philosophy.


That is too much. At my place we have an exercise that is as small as possible while still being a somewhat interesting problem that we can derive some useful insight on how people code, how they research, etc. It's an optimisation problem with a trivial polynomial solution and a slightly more complex (but still straightforward) linearithmic solution with an appropriate data structure. It should take an hour tops and a succinct python solution fits on a single page of code.

Would you mind sharing the exercise? If not that's cool.

We haven't had the best experiences hiring lately and the exercises / questions our leads are asking aren't getting the job done. I'd rather transition to something like what you're describing.

csammis
Aug 26, 2003

Mental Institution

piratepilates posted:

What do people mean when they say they test for team fit? It's been a while since I went for interviews and I don't remember much about seeing if I fit in to a team. What would that even be? Making sure the person isn't an rear end in a top hat, or expecting everyone to be wearing suits at the company?

When people say "testing for team fit" they usually mean a part of the interview which is attempting to make the candidate fits their ~ company culture ~. The concept is given a lot of crap but I have interviewed many people who passed our programming tests but then turned out to be absolute shits of human beings. A couple of standouts: person who couldn't stop leering at one of the female interviewers, person doing a remote interview where we screenshared and they had a wallpaper saying "What do you call the extermination of six million Jews? A good start!"

Vulture Culture's point, and I agree with it, is that If a company believes you should only interview 100% on technical skills and don't even consider the part where the candidate may ever have to interact with some other person then that company will probably end up hiring people who normal individuals cannot stand to be around.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

piratepilates posted:

What do people mean when they say they test for team fit? It's been a while since I went for interviews and I don't remember much about seeing if I fit in to a team. What would that even be? Making sure the person isn't an rear end in a top hat, or expecting everyone to be wearing suits at the company?

How white, male, and young are you, or can you pass for?

It's supposed to be how well you'll get along with and work with your new prospective team, but ultimately seems to be a way to make a monoculture more than anything else.

Slash
Apr 7, 2011

csammis posted:

... person doing a remote interview where we screenshared and they had a wallpaper saying "What do you call the extermination of six million Jews? A good start!"

Wow, that's quite something... How can he have thought that was ok?

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

csammis posted:

When people say "testing for team fit" they usually mean a part of the interview which is attempting to make the candidate fits their ~ company culture ~. The concept is given a lot of crap but I have interviewed many people who passed our programming tests but then turned out to be absolute shits of human beings. A couple of standouts: person who couldn't stop leering at one of the female interviewers, person doing a remote interview where we screenshared and they had a wallpaper saying "What do you call the extermination of six million Jews? A good start!"

Vulture Culture's point, and I agree with it, is that If a company believes you should only interview 100% on technical skills and don't even consider the part where the candidate may ever have to interact with some other person then that company will probably end up hiring people who normal individuals cannot stand to be around.
"Team fit" and "culture fit" should mean that the person's approach to work meshes well with the standards and practices of the team and aligns with the broader vision for how the company would like improve as they scale up operations. This is especially important in teams that have somewhat informal, self-directed approaches to management, but where people need to collaborate closely in order to avoid being constantly blocked waiting on each other.

Startup culture, which often has no formal HR, has sort of ruined the term by taking it to mean whatever handwavey bullshit they use to justify hiring people with their own specific biases (white, male, young, programs in their spare time, shows up to the interview in a t-shirt, likes to go out after work and socialize with coworkers). So it's important to have an idea of what you want beforehand and restrict your impressions to those things instead of doing gut post-facto rationalization.

But to give an example of where I've passed on people for culture fit in the past: when I was the manager of a wide swath of IT roles at my last job, we had a guy interview for a storage engineer position who was really good technically, but was really high-strung, and this was in an environment that culturally had been really casual because it didn't pay well at all and had very little budget. It was clear to basically everyone that the guy was going to go crazy trying to get anything done the way that he wanted to work and that the entire team's dynamic and morale was going to suffer for it.

Vulture Culture fucked around with this message at 13:38 on Oct 10, 2016

Pollyanna
Mar 5, 2005

Milk's on them.


I did end up getting feedback from one of my co-workers on my performance, and the response boiled down to this:

  • PRs should go through the red-green-refactor cycle as much as possible before I submit it. There should be as little involvement from or work done by the reviewers as possible, to minimize the time spent reviewing PRs and preventing them from lagging behind. Their feedback was that my PRs were often in a working but not optimal stare and reviews would be spent getting it as close to acceptable as possible (we never established what acceptable means, probably the minimal-review-necessary metric mentioned before). I explained my general approach to PRs re: get feedback as soon as possible, but said I understood the need for tighter review cycles and will polish PRs more before asking for review. tl;dr: Make sure PRs are as polished as possible before submitting.
  • PRs need to cover all possible code paths and application states, including running different paths and states against each other (e.g. permutations of feature A * permutations of feature B * permutations of feature C) in order to reduce the likelihood of a reviewer pointing out a path combo I missed or a bug making it into staging. Basically, work by the adage that if it can break, it will break, and make sure it doesn't break. Devs are responsible for covering all possible happy and sad paths for the code they write. tl;dr: Test and handle every single possible situation.
  • Refactoring is a team effort, not a PR-level thing. Refractors need buy-in from the team at large in order to tackle, which means going through the "add to list of improvements -> accept into backlog -> make ticket -> add to backlog -> estimate at backlog pruning -> drag into sprint" workflow. This is the feedback that my co-worker was least sure about, and we talked about the difficult in balancing it with "leave things better than you found it". We settled on PR-level refactoring being limited to the immediately relevant code touched by the PR, and even then to as minimal as possible. tl;dr: Refactoring is something we leave to tickets in the Tech Debt epic.
  • Code should be written as simply and as straightforward as possible, for the benefit of the members of our team who are new to coding and have difficulty understanding relatively advanced techniques. I disagreed this one the most since the examples and scenarios we covered felt like they compromised code quality more than I liked, but I'm guilty of writing clever BS like delegate/helper methods for classes too, so whatever. tl;dr: Code to the lowest common denominator on the team.

It helps to mention that this is all against the background of another co-worker being the driving force behind "don't let a single bug into staging, test literally everything, don't rock the boat too much", which both I and the one giving me feedback are a little skeptical about.

I fully admit to being too ambitious in refactoring and abusing the PR review process, but I'm not entirely sure I'm happy with the direction the team is going in. But hey, if this is the way we work, I'll do whatever's best for the team. In the meantime, I'm gonna see if I can get these "how we work" guidelines written down somewhere.

Pollyanna fucked around with this message at 15:05 on Oct 10, 2016

MrMoo
Sep 14, 2000

quote:

Refactoring is a team effort, not a PR-level thing. Refractors need buy-in from the team at large in order to tackle, which means going through the "add to list of improvements -> accept into backlog -> make ticket -> add to backlog -> estimate at backlog pruning -> drag into sprint" workflow. This is the feedback that my co-worker was least sure about, and we talked about the difficult in balancing it with "leave things better than you found it". We settled on PR-level refactoring being limited to the immediately relevant code touched by the PR, and even then to as minimal as possible.

The Chromium Project has an odd take on refactoring, they prefer completely fixing the larger picture than smaller PR's that improve what is there today. This can mean ugly code lives in the tree for a long time.

CPColin
Sep 9, 2003

Big ol' smile.

Pollyanna posted:

tl;dr: Make sure PRs are as polished as possible before submitting.

I agree with this one, for the most part. We had issues where, near the end of a sprint, people started opening pull requests early so reviewers could get a head start. They'd then repeatedly commit single-file changes in responses to comments that came up, forcing everybody else to reload the pull request and potentially start over. I suggested that projects that were so close to their deadlines that this had to happen maybe should be bumped out of the sprint and my boss got mad at me.

On the other hand…

Pollyanna posted:

tl;dr: Code to the lowest common denominator on the team.

:rip:

Messyass
Dec 23, 2003

Pollyanna posted:

I did end up getting feedback from one of my co-workers on my performance, and the response boiled down to this:

  • tl;dr: Make sure PRs are as polished as possible before submitting.
  • tl;dr: Test and handle every single possible situation.
  • tl;dr: Refactoring is something we leave to tickets in the Tech Debt epic.
  • tl;dr: Code to the lowest common denominator on the team.


That sounds pretty reasonable. Your PR's should be polished. If you want earlier feedback, just ask someone to pair program or be your rubber duck.

Whether you should test everything really depends on how critical the thing you're making is. The "permutations of feature A * permutations of feature B * permutations of feature C" does worry me a bit. That smells of too much coupling between features.

The last point I definitely agree with. Boring code > clever code. That doesn't mean you should be avoiding useful language features just because someone isn't willing to learn them, but in general it's a good rule.

Pollyanna
Mar 5, 2005

Milk's on them.


CPColin posted:

I agree with this one, for the most part. We had issues where, near the end of a sprint, people started opening pull requests early so reviewers could get a head start. They'd then repeatedly commit single-file changes in responses to comments that came up, forcing everybody else to reload the pull request and potentially start over. I suggested that projects that were so close to their deadlines that this had to happen maybe should be bumped out of the sprint and my boss got mad at me.

On the other hand…


:rip:

The PR one is the most reasonable and a legit fuckup on my part. I'm used to the "gently caress it get it out as soon as possible and let others comment on it" mentality that I got from...somewhere?...and it's probably just making things worse. I guess I just don't fully understand how to go from "it works" to "it's acceptable" outside of "make the code look good and more robust". I'll have to experiment with that a bit, it's high time I held myself to a better standard.

The common denominator thing is mmmmmeh? A minor example of that is string interpolation vs. constructing a string from an array of substrings that was procedurally updated. Personal preference, but they still accomplished the same thing...that's the kind of thing that often comes up in PR reviews, which makes me a little nervous. We'll see how it goes.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Pollyanna posted:

I did end up getting feedback from one of my co-workers on my performance, and the response boiled down to this:

  • PRs should go through the red-green-refactor cycle as much as possible before I submit it. There should be as little involvement from or work done by the reviewers as possible, to minimize the time spent reviewing PRs and preventing them from lagging behind. Their feedback was that my PRs were often in a working but not optimal stare and reviews would be spent getting it as close to acceptable as possible (we never established what acceptable means, probably the minimal-review-necessary metric mentioned before). I explained my general approach to PRs re: get feedback as soon as possible, but said I understood the need for tighter review cycles and will polish PRs more before asking for review. tl;dr: Make sure PRs are as polished as possible before submitting.
  • PRs need to cover all possible code paths and application states, including running different paths and states against each other (e.g. permutations of feature A * permutations of feature B * permutations of feature C) in order to reduce the likelihood of a reviewer pointing out a path combo I missed or a bug making it into staging. Basically, work by the adage that if it can break, it will break, and make sure it doesn't break. Devs are responsible for covering all possible happy and sad paths for the code they write. tl;dr: Test and handle every single possible situation.
  • Refactoring is a team effort, not a PR-level thing. Refractors need buy-in from the team at large in order to tackle, which means going through the "add to list of improvements -> accept into backlog -> make ticket -> add to backlog -> estimate at backlog pruning -> drag into sprint" workflow. This is the feedback that my co-worker was least sure about, and we talked about the difficult in balancing it with "leave things better than you found it". We settled on PR-level refactoring being limited to the immediately relevant code touched by the PR, and even then to as minimal as possible. tl;dr: Refactoring is something we leave to tickets in the Tech Debt epic.
  • Code should be written as simply and as straightforward as possible, for the benefit of the members of our team who are new to coding and have difficulty understanding relatively advanced techniques. I disagreed this one the most since the examples and scenarios we covered felt like they compromised code quality more than I liked, but I'm guilty of writing clever BS like delegate/helper methods for classes too, so whatever. tl;dr: Code to the lowest common denominator on the team.

It helps to mention that this is all against the background of another co-worker being the driving force behind "don't let a single bug into staging, test literally everything, don't rock the boat too much", which both I and the one giving me feedback are a little skeptical about.

I fully admit to being too ambitious in refactoring and abusing the PR review process, but I'm not entirely sure I'm happy with the direction the team is going in. But hey, if this is the way we work, I'll do whatever's best for the team. In the meantime, I'm gonna see if I can get these "how we work" guidelines written down somewhere.

Most of that doesn't seem entirely unreasonable, but there's a reading of it that's extremely process over people. The last point is pretty bad depending on where the line is drawn.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

MrMoo posted:

The Chromium Project has an odd take on refactoring, they prefer completely fixing the larger picture than smaller PR's that improve what is there today. This can mean ugly code lives in the tree for a long time.
It seems rather in tune with the Google mothership way of approaching work, where all their code for all projects (besides Chromium, Android, and a small handful of others) lives in a single monolithic (Piper) repository and up to 50% of the code can be changed in any given month.

CPColin
Sep 9, 2003

Big ol' smile.

leper khan posted:

Most of that doesn't seem entirely unreasonable, but there's a reading of it that's extremely process over people. The last point is pretty bad depending on where the line is drawn.

Yeah, it makes me think, "An ebbing tide lowers all boats." in that, if the new-to-programming developers never encounter anything advanced, the average skill will drop and drag the code down with it.

Space Kablooey
May 6, 2009


Pollyanna posted:

The PR one is the most reasonable and a legit fuckup on my part. I'm used to the "gently caress it get it out as soon as possible and let others comment on it" mentality that I got from...somewhere?...and it's probably just making things worse. I guess I just don't fully understand how to go from "it works" to "it's acceptable" outside of "make the code look good and more robust". I'll have to experiment with that a bit, it's high time I held myself to a better standard.

Maybe contributing to projects on GitHub? In the times I had PRs open there, it was normal to have a substantial PR and then lots of smaller commits while it's open to fix things the repo owner asked.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

Pollyanna posted:

PRs should go through the red-green-refactor cycle as much as possible before I submit it. There should be as little involvement from or work done by the reviewers as possible, to minimize the time spent reviewing PRs and preventing them from lagging behind. Their feedback was that my PRs were often in a working but not optimal stare and reviews would be spent getting it as close to acceptable as possible (we never established what acceptable means, probably the minimal-review-necessary metric mentioned before). I explained my general approach to PRs re: get feedback as soon as possible, but said I understood the need for tighter review cycles and will polish PRs more before asking for review. tl;dr: Make sure PRs are as polished as possible before submitting.
Further breaking out this issue: if you're a more junior developer on the team, it's good to have mentorship and get (reasonable) feedback about the things you're doing. But code reviews are a process tool for ensuring the quality of code entering HEAD; it's not a particularly good communication flow and it's not a particularly good way to discuss the best way to solve a problem. A generally better approach is to build relationships with team members that you can ask to bounce things off of, or to look over your shoulder and pair while you work on something complicated that you're not sure about.

As a caveat, this is different when you're working on huge projects with really disconnected, asynchronous flows like the Linux kernel, for instance. And reviewers should be making a concerted effort to not be anal about the One True Way to do things until a few people have tried different ways of solving the same problem and hit walls and refactored. The best approach has a habit of shaking itself out of all the alternatives in a project with a high enough development velocity.

Slash
Apr 7, 2011

Pollyanna posted:

I did end up getting feedback from one of my co-workers on my performance, and the response boiled down to this:

  • Code should be written as simply and as straightforward as possible, for the benefit of the members of our team who are new to coding and have difficulty understanding relatively advanced techniques. I disagreed this one the most since the examples and scenarios we covered felt like they compromised code quality more than I liked, but I'm guilty of writing clever BS like delegate/helper methods for classes too, so whatever. tl;dr: Code to the lowest common denominator on the team.

I think your tl;dr is wrong for this one. Simple, easy to read code is almost always better than clever, hard to read code. You need to think about the long-term maintainability of the code, particularly if people who aren't familiar with the code base are going to be working on it in the future.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

Slash posted:

I think your tl;dr is wrong for this one. Simple, easy to read code is almost always better than clever, hard to read code. You need to think about the long-term maintainability of the code, particularly if people who aren't familiar with the code base are going to be working on it in the future.
IMO, this is the entire reason Golang is taking off. It's a language that makes it remarkably hard to write clever code.

Pollyanna
Mar 5, 2005

Milk's on them.


Well, the LCD thing was straight from the discussion, but that's a better way of looking at it anyway.

AskYourself
May 23, 2005
Donut is for Homer as Asking yourself is to ...
I'm not super good with testing, and there is a couple of thing I don't understand about that test every single possible scenario statement.

With one integer variable there is 4 biliions possible scenario. 2 integer ? that's 4 billion square... How can you really test all possible scenario of any function that has 18446744073709551616 possible scenarios ? Even if you can test a billion time per second it would take over 200 thousand years to test them all.

It seem to me like testing is more about testing edge case, that's what make more sense to me. In that case, you can't say you are testing every possible scenario, just the one you think might mess up the code.

It seem more reasonable to test edge case and catch exceptions and handle exception gracefully.

Testing every possible scenario just seem subjective and arbitrary to me.

But yeah as I said I don't have a lot of experience with testing. I usually prefer to write solid code, log extensively, monitor logs, and fix important bug, this method as served me well over the years.

Anyone care to enlighten me ?

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

AskYourself posted:

With one integer variable there is 4 biliions possible scenario. 2 integer ? that's 4 billion square... How can you really test all possible scenario of any function that has 18446744073709551616 possible scenarios ? Even if you can test a billion time per second it would take over 200 thousand years to test them all.
...woah woah woah.

Your tests just have to verify you can correctly go through the different code paths as much as possible. You'll find plenty of bugs just dealing with that. You're not worried about a cosmic ray flipping a bit in RAM and wrecking your program.

Okay, you're not normally worrying about a cosmic ray flipping a bit in RAM and wrecking your program.

Generally, if you have something that does X, you first just verify it can do X in its most controlled way possible. You can then handle more evil scenarios as necessary. You generally shouldn't have to worry about people violating the contract of what that thing does. So if you take in floating point numbers, you normally don't have to worry if they pass in a bunch of NaN or whatever. There may be a context where you do, but it should be very apparent. Or in dynamic languages, you may be testing a method that takes an int and suddenly it's passed in an instance of SomeDumbClass(). That is generally not your problem unless you have some specific knowledge that it is.

Even with those training wheels and handholding, the project will eventually be extended and those tests will fall on their rear end. They will have done their job.

Destroyenator
Dec 27, 2004

Don't ask me lady, I live in beer
The idea is more like "cover all branches" not "all inputs". If you're testing something that takes two integers you should be thinking about things like the a < b, a > b, a == b, one zero or negative, both zero or negative, both high enough to overflow if you add them. Obviously it always depends on what you're doing, but you should aim to exercise all the different paths in your code. Sometimes it's also worth putting tests in that you think are obvious if makes it easier for others to check their assumptions about your code too.

Disclaimer: You always need to consider the effort vs provided value when you're writing tests.

Polio Vax Scene
Apr 5, 2009



Rocko Bonaparte posted:

Okay, you're not normally worrying about a cosmic ray flipping a bit in RAM and wrecking your program.

Is this a thing that actually happens or am I better off not knowing and being able to sleep peacefully?

Space Kablooey
May 6, 2009


Polio Vax Scene posted:

Is this a thing that actually happens or am I better off not knowing and being able to sleep peacefully?

Yes, but it's more likely that you have a bad RAM chip or something.

Space Kablooey fucked around with this message at 17:36 on Oct 10, 2016

Pollyanna
Mar 5, 2005

Milk's on them.


With regards to testing paths and scenario combinations, here's an example of something I'm working on right now. We encode 2D data as a Datum that coordinates between a Row and a Column. We recently had a production issue where there somehow ended up being two Datums per Row+Column pair where it is assumed that there is only ever one, and we need to enforce a one-Datum-per-pair rule to prevent that from happening again and causing bugs and unexpected behavior.

The important thing to keep in mind is the different dimensions to each interacting system and the assumptions placed upon them. For example:

  • Rows are assumed to be valid.
  • Columns are assumed to be valid.
  • Columns have about 8 or so different types.
  • Datums can optionally have Targets associated with them or not.
  • A Datum already exists for an RC pairs, or does not already exist.

Additionally, there are a couple different places where the number of Datums associated with RC pairs is important (i.e. where poo poo broke in the first place):

  • The Table view (view of Datums X Rows X Columns)
  • The Graph view (donut graph summary of Datums's values and statuses)

Our actual goal is "make sure each Row-Column pair hs only one Datum associated with it". But in order to be comprehensive and cover all possible paths, we need to test this validation given each permutation of model validity, Column type, existence of a Target, and pre-existing Datum given each context of "Table view" and "Graph view". So, the list of test cases, in RSpec, looks like this (without expectations written out): Pastebinned for length.

Now, this is close to the worst case scenario, where we try to test each possible outcome regardless of relevance. But, we've run into many bugs where a part of the application that appeared to be totally unrelated to the feature or bug at hand ended up relevant somehow (e.g. the user that's logged in, the type of data we're working with, the user's permissions, the Board's relation to other Boards, the JavaScript in the view, etc.) and so the current sentiment to testing is to play it safe and try all sorts of possible states.

That's the idea behind our approach, at least from talking with my other co-worker. I personally disagree with testing the Target portion of that since it was orthogonal to the "only one Datum per pair" issue, but it seems like we're leaning towards testing that anyway.

Adbot
ADBOT LOVES YOU

Storysmith
Dec 31, 2006

Polio Vax Scene posted:

Is this a thing that actually happens or am I better off not knowing and being able to sleep peacefully?

It's a thing that happens. Even without rowhammer / FFS, there's a surprising amount of traffic to sites one bit flip away from windows update's url, for instance.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply