Hacker News new | past | comments | ask | show | jobs | submit login

In the actually pycon video, he does clear this up and say that he can tell if code is not correct because python programs all look very similar in terms of structure (short lines, small units, etc.) and due to python's required tabbing, its easy to see from his desk whether or not a programmer is following these methodologies.



This is actually true of Lisp and Scheme too, though, since nearly everybody indents their code the same way (how Emacs does it). Code with lots of small functions, long and relatively flat imperative code blocks, etc. has very distinctive shapes.

Come to think of it, that's true for most languages that don't have Java-style static typing annotations interspersed throughout. Functional and imperative code in OCaml or Lua code look noticeably different, too, and there's not a whole lot of stylistic overlap between OCaml, Scheme, and Python's syntaxes. (Lua's is relatively similar to Python's.)


I believe Haskell looks different. At least with heavy use of combinators my code looks more like Forth than Python. For me small functions tend to be even smaller in Haskell than Python.


And do notation retains a lot of the typical "block of imperative code" appearance.


Yes. Though it has more in common with "strict functional programming with side effects" than traditional imperative code.


It used to be thought that you could judge someone’s character by looking at the shape of his head. Whether or not this is true of people, it is generally true of Lisp programs.

from pg's On Lisp


I've noticed in myself and other programmers an unconscious assumption that serious errors have serious symptoms. E.g. we must have fixed all the serious defects by now, because there's nothing obviously wrong with the code.

I've seen this proved wrong time and time again. Have you ever been maintaining some shipped code, and found a crash bug, where you're like: "I can't believe this shipped and we haven't heard about it."

So, I'm probably treating this out-of-context comment more seriously than it deserves, but I like to emphasize the point. Even though there is a set of errors that are detectable from the shape of the source code, there is a much larger set of serious errors that are not.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: