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
M31
Jun 12, 2012

sarehu posted:

What do you experience then? Non-whiteboard exercises? Conversations about the weather?
I've never encountered exercises at all, except for IQ tests when I just started out. It's just talk about the technical decisions on previous jobs and projects and small talk about current developments. Only once have I had an interviewer ask me to bring some code along which we looked at together during the interview.

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
I've never had an interview in 10 years at a place I ended up working at that didn't involve a coding test of some kind. The rationale is that most "programmers" can't actually code their way out of a wet paper bag, which seems to make sense based on what I've seen conducting those interviews.

Can you remove a node from a linked list in 45 minutes? Congratulations, you're better than 90% of the candidates I've screened.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer
I interviewed a guy recently who spoke really well about concepts. He seemed to know a lot about iOS and casually dropped some decent trivia in conversation. Within five minutes on the white board we realized he couldn't even do basic control flow in a for loop, even with leading comments like "is there some sort of keyword to help you continue execution at the next iteration or break out of the loop entirely?"

People will always find ways to surprise you.

sarehu
Apr 20, 2007

(call/cc call/cc)
Just refactor it into a while loop?

code:
   short i = 0;
   top:
      i++;
      while (i < strlen(s)) {
         if (...) {
            goto top;
         }
      }

Doctor w-rw-rw-
Jun 24, 2008

ultramiraculous posted:

I interviewed a guy recently who spoke really well about concepts. He seemed to know a lot about iOS and casually dropped some decent trivia in conversation. Within five minutes on the white board we realized he couldn't even do basic control flow in a for loop, even with leading comments like "is there some sort of keyword to help you continue execution at the next iteration or break out of the loop entirely?"

People will always find ways to surprise you.

I'm going to be interviewing there in a couple of weeks and now I'm anxious that I'm going to accidentally ruin it with a simple/avoidable fuckup like this. :ohdear:

Which type of interview was this?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Doctor w-rw-rw- posted:


Which type of interview was this?

I'm going to guess a job interview. :downsrim:

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀

sarehu posted:

Just refactor it into a while loop?

code:
   short i = 0;
   top:
      i++;
      while (i < strlen(s)) {
         if (...) {
            goto top;
         }
      }

Where did you get this one?

sarehu
Apr 20, 2007

(call/cc call/cc)
Just a refactoring of a for loop into a while loop...

Soricidus
Oct 21, 2010
freedom-hating statist shill
I'm the strlen

e: and the behavior when strlen(s) >= SHRT_MAX

Soricidus fucked around with this message at 15:21 on Dec 25, 2015

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Soricidus posted:

I'm the strlen

e: and the behavior when strlen(s) >= SHRT_MAX

wait, it got called SHRT_MAX rather than SHORT_MAX? In god's name why? Why do programmers have this mania for adopting unnecessary and unpredictable abbreviations?

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Hammerite posted:

wait, it got called SHRT_MAX rather than SHORT_MAX? In god's name why? Why do programmers have this mania for adopting unnecessary and unpredictable abbreviations?

Vowels are for Communists, FORTRAN and Visual Basic programmers.

:goonsay:

fritz
Jul 26, 2003

Hammerite posted:

wait, it got called SHRT_MAX rather than SHORT_MAX? In god's name why? Why do programmers have this mania for adopting unnecessary and unpredictable abbreviations?

Something something, eight letter identifiers, SHORT_MA, etcetc.

Pixelboy
Sep 13, 2005

Now, I know what you're thinking...

Hammerite posted:

wait, it got called SHRT_MAX rather than SHORT_MAX? In god's name why? Why do programmers have this mania for adopting unnecessary and unpredictable abbreviations?

There was a time, long ago, when our compilers were limited to about 8 chacters for symbols.

Of course, that era was long ago and it is highly unlikely a) they were around to pick up that habit, and b) work on a platform where that's still a thing.

sarehu
Apr 20, 2007

(call/cc call/cc)

Hammerite posted:

wait, it got called SHRT_MAX rather than SHORT_MAX? In god's name why? Why do programmers have this mania for adopting unnecessary and unpredictable abbreviations?

There's a big correlation between people that do this and people that want 80-character column limits.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Pixelboy posted:

Of course, that era was long ago and it is highly unlikely a) they were around to pick up that habit, and b) work on a platform where that's still a thing.

By "them" you mean the people who wrote the original limits.h?

FlapYoJacks
Feb 12, 2009

sarehu posted:

There's a big correlation between people that do this and people that want 80-character column limits.

PEP8, PEP8, PEP8, ONE OF US, ONE OF US. (gently caress the 80 character column limit in PEP8)

pseudorandom name
May 6, 2007

Subjunctive posted:

By "them" you mean the people who wrote the original limits.h?

On the platform where that was a thing, no less.

necrotic
Aug 2, 2005
I owe my brother big time for this!

ratbert90 posted:

PEP8, PEP8, PEP8, ONE OF US, ONE OF US. (gently caress the 80 character column limit in PEP8)

PEP8 has an 80 char max? That's atrocious.

Space Kablooey
May 6, 2009


Pep8 character limit is not that bad. It actually helps when you have multiple files open.

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

necrotic posted:

PEP8 has an 80 char max? That's atrocious.

Everything in pep8 is recommendations, one of the first is to know when to break the rules, but yes, it has a recommendation for 80 characters, or even 79 to leave space for the +- markers in git diffs.

Karate Bastard
Jul 31, 2007

Soiled Meat
I love pep8, and I love breaking that clause of pep8. Breaking that clause so bad, everyday yessir.

I also habitually make multiply nested comprehensions hundreds of chars long with conditionals, ternaries and lambdas out the wazoo just to gently caress with my coworkers, pep8 and my future self hell yes I'm a filthy human being.

b0lt
Apr 29, 2005

ratbert90 posted:

PEP8, PEP8, PEP8, ONE OF US, ONE OF US. (gently caress the 80 character column limit in PEP8)

Isn't PEP8 a 79 column max?

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that
I actually do like 80 character columns because I work on a small screen a lot.

Horse Clocks
Dec 14, 2004


80 char columns means I can comfortably get 3 panes of code side by side, with line numbers and error markers.

Plus it makes things look somewhat consistent. Which is nice. # noqa

Soricidus
Oct 21, 2010
freedom-hating statist shill
I have two big screens and I still like 80 character columns because I can have two of them side by side at a readable size while leaving the other screen free for other stuff

also I have yet to see a very long line of code that was not improved by breaking it up into several short lines of code. or burning it to the ground, salting the earth it stood on, and calling in a priest to drive the lingering spirit of malice back into the depths of hell from whence it came, in the case of one particularly memorable 800+-character java statement that some fuckwit apparently thought was acceptable because we have word wrap now

Nippashish
Nov 2, 2005

Let me see you dance!

I'm not one to get upset about lines longer than 80 chars, but word wrapping your code is just wrong.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
http://chrisseaton.com/rubytruffle/pushing-pixels/

this man is a hero

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Doctor w-rw-rw- posted:

I'm going to be interviewing there in a couple of weeks and now I'm anxious that I'm going to accidentally ruin it with a simple/avoidable fuckup like this. :ohdear:

Which type of interview was this?

At Facebook or Fitbit? This was an architecture-y interview that usually ends with a little coding if it goes well. It's not meant to be difficult but some people turn it into a train wreck.

Doctor w-rw-rw-
Jun 24, 2008

ultramiraculous posted:

At Facebook or Fitbit? This was an architecture-y interview that usually ends with a little coding if it goes well. It's not meant to be difficult but some people turn it into a train wreck.
Facebook. Strangely enough despite my experience with the company I've never gone through the typical interview process there before, so I don't know what exactly to expect.

Was Fitbit before or after Facebook for you?

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

fritz posted:

Something something, eight letter identifiers, SHORT_MA, etcetc.

But there's a USHRT_MAX too

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

That came after C wasn't limited to 8, and was chosen to match SHRT_MAX.

JawnV6
Jul 4, 2004

So hot ...

On every pixel, dynamically construct a string, then throw it at the compiler with the expectation that after it fails the local scope lookup, it searches the entire namespace for whatever garbage you managed to spell out. This is idiomatic ruby?

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

JawnV6 posted:

On every pixel, dynamically construct a string, then throw it at the compiler with the expectation that after it fails the local scope lookup, it searches the entire namespace for whatever garbage you managed to spell out. This is idiomatic ruby?

and somehow graal+truffle made it fast


code written to be as slow as loving possible

Soricidus
Oct 21, 2010
freedom-hating statist shill

JawnV6 posted:

On every pixel, dynamically construct a string, then throw it at the compiler with the expectation that after it fails the local scope lookup, it searches the entire namespace for whatever garbage you managed to spell out. This is idiomatic ruby?

Not only that, but the guy who wrote that post apparently thinks that such code is fine and it's the runtimes fault if it's slow?

Hughlander
May 11, 2005

Soricidus posted:

Not only that, but the guy who wrote that post apparently thinks that such code is fine and it's the runtimes fault if it's slow?

I got out of it more like "this is the poo poo we deal with in the common libraries so we make the optimization so work"

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Soricidus posted:

Not only that, but the guy who wrote that post apparently thinks that such code is fine and it's the runtimes fault if it's slow?

That's the perspective you have to take as a developer of the runtime if you want to build something that's actually useful. If he actually thought it was fine he would not have put in so many disclaimers.

Volte
Oct 4, 2004

woosh woosh

HardDisk posted:

Pep8 character limit is not that bad. It actually helps when you have multiple files open.
It's terrible for a language where whitespace is semantically meaningful and long-line wrapping is discouraged via sheer ugliness. Forcing you to break lines and add whitespace in Python is essentially forcing you to change the structure of your program (rather than just the presentation of it). The PEP8 character limit only superficially affects the physical length of the line, and more accurately promotes a low subexpression depth (since nested subexpressions will rapidly approach 80 characters, and can be easily tamed by extracting them into separate variables). I find this restriction extremely limiting, since I consider a named variable to be a fairly weighty presence within a function (if it has a name, it should be important enough to exist on its own, not just because I need to stick it somewhere while I do some landscaping on the subsequence line of code) and would prefer that temporary values remain anonymous when possible and practical.

I will always ignore any such line-length "recommendation". I usually set the right-hand margin line to be 120 (and try to avoid hitting it).

Pie Colony
Dec 8, 2006
I AM SUCH A FUCKUP THAT I CAN'T EVEN POST IN AN E/N THREAD I STARTED

Volte posted:

It's terrible for a language where whitespace is semantically meaningful and long-line wrapping is discouraged via sheer ugliness. Forcing you to break lines and add whitespace in Python is essentially forcing you to change the structure of your program (rather than just the presentation of it). The PEP8 character limit only superficially affects the physical length of the line, and more accurately promotes a low subexpression depth (since nested subexpressions will rapidly approach 80 characters, and can be easily tamed by extracting them into separate variables). I find this restriction extremely limiting, since I consider a named variable to be a fairly weighty presence within a function (if it has a name, it should be important enough to exist on its own, not just because I need to stick it somewhere while I do some landscaping on the subsequence line of code) and would prefer that temporary values remain anonymous when possible and practical.

I will always ignore any such line-length "recommendation". I usually set the right-hand margin line to be 120 (and try to avoid hitting it).

Having worked at places that strictly enforce PEP8 and at places that don't give a gently caress, I can say the code written to 80 chars max was a lot easier to understand, especially for someone new to the code. The Linux kernel does something similar (8 space tabs to promote low subexpression depth) and it works there too. I don't think Python implementations even have the kind of stack saving optimizations that you'd get with a C compiler, but it's still very much worth doing there. It does take some time to get used to writing though.

Pie Colony fucked around with this message at 21:46 on Dec 26, 2015

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

JawnV6 posted:

On every pixel, dynamically construct a string, then throw it at the compiler with the expectation that after it fails the local scope lookup, it searches the entire namespace for whatever garbage you managed to spell out. This is idiomatic ruby?

I'm the implementation of clamp that allocates an array and sorts it.

Adbot
ADBOT LOVES YOU

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Dessert Rose posted:

I'm the implementation of clamp that allocates an array and sorts it.

Straight outta hakmem.

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