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
PIZZA.BAT
Nov 12, 2016


:cheers:


I thought the whole point of becoming a computer toucher and stacking bills was so you could afford the good stuff?

Adbot
ADBOT LOVES YOU

Mniot
May 22, 2003
Not the one you know

Urit posted:

Working from home for a company across the country really screws with your perception of what "job time" is, I will say that. I kind of wish I was in an office 2-3 days out of the week.

Is there a coworking space near you (basically, rent an office room or a desk in an open office)? You ought to be able to get your job to pay for it (or some of it) and it's not an insane expense for you even if they won't.

minato
Jun 7, 2004

cutty cain't hang, say 7-up.
Taco Defender

Doctor w-rw-rw- posted:

Also, no, cocaine is the white collar drug of choice to abuse, and it's big in tech,
If you're talking about performance enhancing drugs as opposed to recreational, then I think you mean Adderall. I know a few people at the Big 5 who take it on the reg, especially on their designated "no meetings" workdays.

minato
Jun 7, 2004

cutty cain't hang, say 7-up.
Taco Defender
Here's a good talk about burnout. It's ostensibly about Ops and burnout, but it applies to programmers too. https://www.usenix.org/conference/lisa14/conference-program/presentation/lehtonen

B-Nasty
May 25, 2005

minato posted:

If you're talking about performance enhancing drugs as opposed to recreational, then I think you mean Adderall. I know a few people at the Big 5 who take it on the reg, especially on their designated "no meetings" workdays.

Modafinil is also big with computer touchers. Even if you aren't tired/sleep-deprived (its primary use), it can increase focus and drive, which is obviously a big win for most coding tasks.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.
I work in adtech and there was a ton of cocaine at our company bbq this week! It was lit!!!! (JK I don't do drugs and felt p uncomfortable)

Analytic Engine
May 18, 2009

not the analytical engine

minato posted:

If you're talking about performance enhancing drugs as opposed to recreational, then I think you mean Adderall. I know a few people at the Big 5 who take it on the reg, especially on their designated "no meetings" workdays.

Yep, some people have ADHD

curufinor
Apr 4, 2016

by Smythe
never mention usenix w/o mentioning james mickens, even though it's a huge conf and everything

https://mickens.seas.harvard.edu/wisdom-james-mickens

mickens is love
mickens is life

curufinor
Apr 4, 2016

by Smythe
different usenix working group poo poo? don't care, mickens mickens mickens

Urit
Oct 22, 2010

minato posted:

Here's a good talk about burnout. It's ostensibly about Ops and burnout, but it applies to programmers too. https://www.usenix.org/conference/lisa14/conference-program/presentation/lehtonen

I am ops (I just write code no one wants to use because they didn't write it and thus don't understand it) and I've watched this talk but I'm gonna watch it again. Thanks!

Honest Thief
Jan 11, 2009

minato posted:

Here's a good talk about burnout. It's ostensibly about Ops and burnout, but it applies to programmers too. https://www.usenix.org/conference/lisa14/conference-program/presentation/lehtonen

His bit about staying in a job you wanna leave will eventually lead you to be fired isn't true in my experience. Some places just wanna squeeze you as much as you can last.

Doctor w-rw-rw-
Jun 24, 2008
Yeah, sometimes the company just thinks it can keep you and thinks it's better off "getting a good deal" on you (read: stealing fair compensation from you), and that's about as much as they think about it.

Honest Thief
Jan 11, 2009
I think I'm coming to the realization that I'm on the wrong field, I keep failing take home assignments for better development roles on the basis of poor documenting and/or confusing code. I admit most of my time working has been with hackey teams and a "get it done" mentality so I guess I'm just not cut out for these roles. I've been actively trying to improve those flaws but it's just never good enough.

vonnegutt
Aug 7, 2006
Hobocamp.

Honest Thief posted:

I think I'm coming to the realization that I'm on the wrong field, I keep failing take home assignments for better development roles on the basis of poor documenting and/or confusing code. I admit most of my time working has been with hackey teams and a "get it done" mentality so I guess I'm just not cut out for these roles. I've been actively trying to improve those flaws but it's just never good enough.

How many have you failed? I recently was involved in evaluating take home assignments for one of our coding positions. I was surprised at the code people handed in, and eventually chose the "best" based on the following criteria:

1. It ran (we eliminated almost a third for this)
2. It did something (no one submitted code that met the full spec of our tic-tac-toe game, but the best ones handled the main game logic)
3. There wasn't a bunch of commented-out code or leftover files from prior attempts at a solution (even most of the "good" solutions included this)

It really seemed like most people started without any kind of plan and then fell headfirst into some complicated edge case and got stuck. I would start by outlining a quick plan and coding up the most straightforward, static version of the problem as possible. Then do whatever you think the interviewer is looking for, and finally save a portion of your allotted time to clean up and try running your program in whatever format the interviewer would.

Did you get any feedback about your assignments?

geeves
Sep 16, 2004

Rex-Goliath posted:

I thought the whole point of becoming a computer toucher and stacking bills was so you could afford the good stuff?

Exactly. And if you can't afford scales, you haven't made it yet.

Honest Thief
Jan 11, 2009

vonnegutt posted:

How many have you failed? I recently was involved in evaluating take home assignments for one of our coding positions. I was surprised at the code people handed in, and eventually chose the "best" based on the following criteria:

1. It ran (we eliminated almost a third for this)
2. It did something (no one submitted code that met the full spec of our tic-tac-toe game, but the best ones handled the main game logic)
3. There wasn't a bunch of commented-out code or leftover files from prior attempts at a solution (even most of the "good" solutions included this)

It really seemed like most people started without any kind of plan and then fell headfirst into some complicated edge case and got stuck. I would start by outlining a quick plan and coding up the most straightforward, static version of the problem as possible. Then do whatever you think the interviewer is looking for, and finally save a portion of your allotted time to clean up and try running your program in whatever format the interviewer would.

Did you get any feedback about your assignments?
In the course of 5 weeks, about four. Only had some constructive feedback on one of them, the rest was always left to "not compliant" or "confusing code"; the former did confused me since the code always did what it was supposed to and I even tested it. There were a couple of instances where apparently the actual test was to do more than what was asked.

I did passed one of the tests to a friend who manages a small team in a consultancy firm and he did give me some tips on what I thought were obvious and plain to understand and that apparently wasn't.

Mniot
May 22, 2003
Not the one you know
Can you post some of your code here? I feel like anything interview quiz is so short that it's hard to make it "too complicated" and it's going to be kind of lovely code anyway.

Honest Thief
Jan 11, 2009

Mniot posted:

Can you post some of your code here? I feel like anything interview quiz is so short that it's hard to make it "too complicated" and it's going to be kind of lovely code anyway.
Well.. sure, I changed the names around a bit, cause I'm paranoid about this sort of stuff but.. This one quiz was to provide the two named exports: one to simply throw the die, the other to return a function that did the same but also could deliver the set notation.
I wasn't happy with how I ended up with one being nothing more than a getter, but due to a lack of time I opted to leave it as it was.
code:
const parseArguments = (...args) => {
    var diceCount = args[0],
        faceCount = args[1] || 6,
        modifier = args[2] || 0,
        matches;

    if (args.length === 1) {
        matches = /^(\d+)?(?=d)?(?=\b)?d?(\d+)?((\+|-)\d+)?/.exec(args);

        diceCount = matches[1] || 1,
            faceCount = matches[2] || 6,
            modifier = matches[3] || 0;
    }
    return {
        diceCount,
        faceCount,
        modifier
    }
}

const diceRoll = (sides, mod) => {
    return Math.max((Math.floor(Math.random() * sides) + 1) + mod,0);
}

const castDice = (...args) => {
    var diceCount = args[0],
        faceCount = args[1] || 6,
        modifier = args[2] || 0,
        ret = 0;
    for (var i = diceCount - 1; i >= 0; i--) {
        ret += diceRoll(faceCount, parseInt(modifier));
    }
    return ret;
}

export const getDie = function(...args) {
    var {
        diceCount,
        faceCount,
        modifier
    } = parseArguments(...args);
    const dices = () => {
        return castDice(diceCount, faceCount, modifier);
    };
    dices.diceNotation = () => {
        var ret = '';
        if (diceCount && diceCount > 1) {
            ret += diceCount;
        }
        if (faceCount && faceCount !== 6) {
            ret += `d${faceCount}`;
        }
        if (modifier && modifier !== 0) {
            ret += `${modifier}`;
        }
        return ret
    }
    return dices;
};

export function roll(...args) {
    var {
        diceCount,
        faceCount,
        modifier
    } = parseArguments(...args);
    return castDice(diceCount, faceCount, modifier);
}

Honest Thief fucked around with this message at 13:47 on Jul 5, 2017

Pollyanna
Mar 5, 2005

Milk's on them.


First thing I noticed: is this ES2016/Babel? I think it has native params destructuring and defaults, so that code could be simplified a bit.

Honest Thief
Jan 11, 2009

Pollyanna posted:

First thing I noticed: is this ES2016/Babel? I think it has native params destructuring and defaults, so that code could be simplified a bit.

Yeah, wanted to play up buzzword bingo a bit

Jose Valasquez
Apr 8, 2005

Dang it, I typed up a better response and accidentally hit F5 and lost it.

I don't know the requirements or the language so caveat my comments with that.

Don't use magic numbers, use constants instead.
Comment the regex, as a reader I don't want to spend the time to figure out what the regex is doing.
Don't repeat yourself with the argument parsing, when you call castDice you already parsed the arguments and handled the default arguments, don't do it again, change the function signature to const castDice = (diceCount, faceCount, modifier) and just use them.
I don't have the requirements but the implementation of diceNotation looks questionable to me.
Here are a few examples that look wrong to me
1 dice, 6 sides, no modifier: ''
2 dice, 7 sides, 1 modifier: '2d71'
2 dice, 7 sides, 1 modifier: '21'
1 dice, 7 sides, no modifier: 'd7'
1 dice, 6 sides, 1 modifier: '1'
Dices is not a word and makes me cringe every time I read it.

The Laplace Demon
Jul 23, 2009

"Oh dear! Oh dear! Heisenberg is a douche!"
Yeah, get this stuff code reviewed by a friend. Another first pass from a non-JS dev:
  • having named parameters is infinitely better than ...args when there's no documentation on the exports,
  • || 6 and || 0 are copy pasted multiple times instead of once when parsing user input,
  • for (var i = diceCount - 1; i >= 0; i--) (backwards, more tokens, easier to gently caress up) instead of for (var i = 0; i < diceCount; i++) (most common) when the loop body doesn't even use i,
  • I think diceNotation would be "43" for getDie(4, 6, 3), I'd expect "4d6+3"
  • that regex seems overly complicated and/or outright wrong (it accepts -1, should that mean 1d6-1 or a constant and no dice roll?). is the problem statement grammar more complicated than /([0-9]+)d([0-9]+)([+-][0-9]+)/? personally I prefer [0-9] to \d in this situation because d is a delimiter.

Honest Thief
Jan 11, 2009
Oh for gently caress's sake, I stuck the 'd' on the wrong member and I tested only edge cases, with negative modifiers so yeah, positive modifiers were moot.
And yeah, I forgot midway die is the plural of dice when refactoring.

The Laplace Demon posted:

[*] that regex seems overly complicated and/or outright wrong (it accepts -1, should that mean 1d6-1 or a constant and no dice roll?). is the problem statement grammar more complicated than /([0-9]+)d([0-9]+)([+-][0-9]+)/? personally I prefer [0-9] to \d in this situation because d is a delimiter.
[/list]
For the missing values I'd assume a default value, 1d and 6. I over-complicated it because you could feed just '2d' meaning two regular die with and I decided to keep it all in one regex because.. I dunno, just felt like it.

Jose Valasquez
Apr 8, 2005

Honest Thief posted:

And yeah, I forgot midway die is the plural of dice when refactoring.
It is the other way around.
Die is singular, dice is plural

Honest Thief
Jan 11, 2009
I'll shut up now.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Jose Valasquez posted:

It is the other way around.
Die is singular, dice is plural

Clearly, you got turned down by a bunch of war-gaming nerds who sperged out over your incorrect dice terminology. Better luck next time.

Jose Valasquez
Apr 8, 2005

Honest Thief posted:

I'll shut up now.

On the bright side, looking at the code I don't think you're irredeemably bad or anything. I've seen much much worse code from people who are paid lots of money to write it.
Just follow a few simple rules like don't use magic numbers, don't repeat yourself, and add comments to functions that you export and any sections of code that are not obvious (like the regex) and your code will look a lot better.

Pollyanna
Mar 5, 2005

Milk's on them.


How are consultancies/contracting companies to work at? I've got a potential lead with one, but consultancy/contracting work isn't very interesting to me, and I don't think it's what I need right now. It'd be the kind of work where you're assigned a client that needs a particular business solution and you'd write an app for them on your own, and I'm looking more for a good team of engineers to gain mentorship from and a position to invest 3+ years into.

(Said company is also the one that lost my take-home assignment and only realized they forgot about it when one of their recruiters tried to scout me again, and I had to remind them about it. Bit of a red flag to me. It then got rejected for not having tests for an entire Rails app written with a time limit of 2 hours...I guess that's my fault, but I wanted to get something working within that time limit :sigh:)

Pollyanna fucked around with this message at 16:47 on Jul 5, 2017

Mao Zedong Thot
Oct 16, 2008


Pollyanna posted:

How are consultancies/contracting companies to work at? I've got a potential lead with one, but consultancy/contracting work isn't very interesting to me, and I don't think it's what I need right now. It'd be the kind of work where you're assigned a client that needs a particular business solution and you'd write an app for them on your own, and I'm looking more for a good team of engineers to gain mentorship from and a position to invest 3+ years into.

(Said company is also the one that lost my take-home assignment and only realized they forgot about it when one of their recruiters tried to scout me again, and I had to remind them about it. Bit of a red flag to me. It then got rejected for not having tests for an entire Rails app written with a time limit of 2 hours...I guess that's my fault, but I wanted to get something working within that time limit :sigh:)

Seems like you just answered your own question?

Pollyanna
Mar 5, 2005

Milk's on them.


...Yeah, I think I did. Thanks, rubber duckies! :v:

PIZZA.BAT
Nov 12, 2016


:cheers:


Consulting is great if you're doing actual consulting. 90% of the time though what they actually mean is you'll be doing implementations for a vendor which sucks. They look kind of the same from the outside but there's a huge difference in both the work you'll be doing and your relationships with the customer. If long term you want to climb the leadership ladder then in a few years consulting will give you more exposure to different styles of management / company internals / client-vendor relations / ground-up chaotic implementations than many people get in their entire careers. Very good for sharpening your teeth in those aspects. If you're more interested in long-term development of products and being more focused on the technical aspects of things while others handle all the 'soft stuff' then you probably want to stick with engineering.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Pollyanna posted:

...Yeah, I think I did. Thanks, rubber duckies! :v:

I wouldn't rule out consulting. Your problem is your current employer. Consulting for a good consulting shop might be exactly what you need. This one you speak of sounds like garbage (RoR, lost your submission, disorganized), but keep your options open.

Also

kedo posted:

Seeking freelance backend devs! I do a lot of frontend and UX work with a few different companies and we're always in need of reliable, skilled backend developers.

Location: Anywhere
Languages/frameworks/tools: Rails, Django, AWS are immediate needs, but if you're using a modern, hot framework or language we're probably bidding on a contract that requires it.
What kind of work: Most of my clients are design/dev shops doing contract work for large corporations, non-profits or political organizations in the northeastern US. Most projects have relatively tight deadlines, but budgets are usually generous and the clients tend to be good.

Contact: PM or something.kedo@gmail.com, send some work samples if you can!

Pollyanna
Mar 5, 2005

Milk's on them.


Skandranon posted:

I wouldn't rule out consulting. Your problem is your current employer. Consulting for a good consulting shop might be exactly what you need. This one you speak of sounds like garbage (RoR, lost your submission, disorganized), but keep your options open.

Oh yeah, it's all the ancillary poo poo that turns me off of it, but I'm also a little wary of consulting shops for...some reason. Then again, it kinda becomes a trade-off between owning my own product and claiming it all on my resume vs. working with cool people and on cool things, which isn't necessarily mutually exclusive.

You have a point, consulting is perfectly fine, it just wouldn't be in this one particular case.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Pollyanna posted:

Oh yeah, it's all the ancillary poo poo that turns me off of it, but I'm also a little wary of consulting shops for...some reason. Then again, it kinda becomes a trade-off between owning my own product and claiming it all on my resume vs. working with cool people and on cool things, which isn't necessarily mutually exclusive.

You have a point, consulting is perfectly fine, it just wouldn't be in this one particular case.

You should be wary of them, I have nothing but bad experiences from working with a RoR shop (ask me how I feel about Ruby!:barf:), but you need to focus on improving your situation now, and that means not being TOO picky.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



I did placement consulting through an agency for a couple years, and there were some good points like never having to worry about having to be on call, but it seemed to me that the sorts of places that needed consultants tended to be the places that have trouble hiring and retaining people because they suck to work at. Not all of them, but probably more than half.

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Pollyanna posted:

...Yeah, I think I did. Thanks, rubber duckies! :v:



A bunch of Quacks, that is what we are.

Honest Thief
Jan 11, 2009
Thanks all for the tips on both proper dice usage and coding style. Much love.

Rex-Goliath posted:

Consulting is great if you're doing actual consulting. 90% of the time though what they actually mean is you'll be doing implementations for a vendor which sucks. They look kind of the same from the outside but there's a huge difference in both the work you'll be doing and your relationships with the customer. If long term you want to climb the leadership ladder then in a few years consulting will give you more exposure to different styles of management / company internals / client-vendor relations / ground-up chaotic implementations than many people get in their entire careers. Very good for sharpening your teeth in those aspects. If you're more interested in long-term development of products and being more focused on the technical aspects of things while others handle all the 'soft stuff' then you probably want to stick with engineering.
Yeah, I got a permanent distaste for consultancy due to how most consultancy firms here do their business. But I have friends who are in good projects and enjoy it, so it's really a matter of luck at times.

Destroyenator
Dec 27, 2004

Don't ask me lady, I live in beer
The logic problems in that code sample could've been caught with some tests. For any code challenge stuff if the problem lends itself to testing then you should definitely write them and include them as part of your submission. A good README file explaining your assumptions and any tradeoffs as well as how to run it is also going to make reviewers much happier.

vonnegutt
Aug 7, 2006
Hobocamp.

Destroyenator posted:

The logic problems in that code sample could've been caught with some tests. For any code challenge stuff if the problem lends itself to testing then you should definitely write them and include them as part of your submission. A good README file explaining your assumptions and any tradeoffs as well as how to run it is also going to make reviewers much happier.

Yeah, keeping in mind that this is code that will be primarily read first and run second is also important with these kinds of take-home problems. A README is always a good idea. You should also be paying more attention to how you're naming args, functions, and variables, and commenting anything that could be misunderstood. Having variables named "ret" is not great.

Definitely get a friend to proof next time you do one of these. Having another set of eyes on your code will show you where your code is confusing even if everything is correct.

Adbot
ADBOT LOVES YOU

Mniot
May 22, 2003
Not the one you know

Honest Thief posted:

Well.. sure, I changed the names around a bit, cause I'm paranoid about this sort of stuff but.. This one quiz was to provide the two named exports: one to simply throw the die, the other to return a function that did the same but also could deliver the set notation.
I wasn't happy with how I ended up with one being nothing more than a getter, but due to a lack of time I opted to leave it as it was.

OK, so all the review comments on better code are good, but trying to think of what would trigger a rejection based on this code... I don't see it. I guess I could imagine a couple of the problems being annoying enough that they'd sum them up and reject. Or if you took a week on this, then that's disappointing but I'm assuming you did it in about an hour. It seems to run correctly and I can follow the code without shaking my head the whole time so I'd call it good.

Did you include any documentation with this? Or was there a clear spec? I'm wondering if this was one of those quizzes where you fail unless you go back and ask questions. Or if there was only a vague description and you didn't include docs, maybe they couldn't figure out the dice format of 2d6+2 (I think your regex is bad and harder to read than needed)?

I don't think I'd reject someone at the screening-level for it, but you have some missing semicolons and some funny spacing. That's not a big deal, but IMO you should be developing it an editor that's linting on the fly for you, and this makes me think you're coding in Notepad or bare-bones Vi. If you feel like you just throw poo poo together until it runs, forcing yourself to follow some style rules may help slow you down and make your code more palatable.

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