from Hacker News

Ask HN: What can you learn about a person by reading their code?

by ndjshe3838 on 1/25/24, 8:52 PM with 8 comments

  • by jamager on 1/26/24, 10:32 AM

    Not much about the person, but maybe something about the environment and circumstances.

    There is a world of difference between the best and worst code I wrote that has nothing to do with my personality or expertise.

  • by jruohonen on 1/25/24, 8:55 PM

    A lot. A classical research question, as well as a practice I suppose, is to try to deduce the author of a particular program, whether in source or in binary. Cf.:

    https://news.ycombinator.com/item?id=39135165

  • by jjgreen on 1/25/24, 8:54 PM

    The neater the code, the scruffier the coder.
  • by _benj on 1/26/24, 1:19 PM

    In a team I was a part of some years ago I had the distinct feeling of being able to tell which one of my teammates wrote what code.

    Something in the favorite methods to solve problems, variable names and so on (it was in Python where you have 100 ways to solve 1 thing!)

    I think something very distinct and easy to pick is how they think, at least in the board term of OOP vs functional.

    I’ve seen Go code being forced to do OOP and functional JS… it’s fascinating!

  • by sloaken on 1/25/24, 11:07 PM

    If they ever had to inherit someone elses code.

    Code with detailed comments and include some whys, really care, and have had the nightmare of others leaving.

    Although I knew one person who was notorious for just throwing their predecessors code out and re writing it. It is tough to interview to exclude that type.

  • by aristofun on 1/26/24, 6:20 AM

    Most important thing - if he likes to engineer (like most of developers regardless of experience) or solving the problem (rare kind at any seniority level).
  • by interbased on 1/26/24, 1:22 AM

    How they approach problems in the language the code is written. Variable names are also an indicator of the level of effort they put in from my experience.
  • by kosasbest on 1/25/24, 10:05 PM

    You can determine if they're sloppy and just want the project rushed out the door. Kludgy code is actually fun to read.