DEV Community

Discussion on: My Misconception when Learning Web Dev

Collapse
 
ashleyjsheridan profile image
Ashley Sheridan

Did you look at those regular expressions? Nobody, not even a senior, should be expected to rattle that off in an interview.

Besides, a regex like that in any codebase is a sign of something wrong. Code should be human readable. Obviously regular expressions fly in the face of that, but there's surely a limit to how far one goes with them in production-worthy code?

Thread Thread
 
jfsoft profile image
Jonatan R. Fischer • Edited

But you can make it human readable when wrapping it using a function, once the regex is tested in isolation, it can be used in production code without problems. I'm not auditing python regex engine each time I want to use the re module, and still that module is used in production code. If you restrict the solution space of a problem to what you can read and understand at the lowest level possible, maybe software would took ages to get into production... Of course, you can't solve every problem in sw using regexes, sometimes a simple looping solution solves the problem well enough to move on in development.

Thread Thread
 
ashleyjsheridan profile image
Ashley Sheridan

But there's still no way anyone would be able to write anything close to it in an interview.

Thread Thread
 
jfsoft profile image
Jonatan R. Fischer

I agree, and if you find yourself having to write that nonsense perl regex to get a job, it will be better for your mental health not getting it.

Thread Thread
 
tanami profile image
Tanami

I had this funny experience once when I was applying for a Perl job and they asked me to analyse a 300 line sort routine... I guess that's their version of the regex