Imitating Famous Programmers' Styles
Asking ChatGPT to write code in the style of well-known programmers.
The Experiment
I asked ChatGPT to solve the same problem in the style of different notable programmers:
- Linus Torvalds (Linux kernel style C)
- DHH (Ruby on Rails style)
- Paul Graham (Lisp-influenced)
- Uncle Bob (Clean Code principles)
Results
Linus Style
Terse variable names, efficient but minimal comments, C-style patterns even in other languages.
DHH Style
Expressive method names, convention over configuration, readable prose-like code.
Paul Graham Style
Functional approach, recursion, minimal state.
Uncle Bob Style
Small functions, descriptive names, lots of extraction.
Takeaways
- ChatGPT captures general characteristics well
- Actual code style is more nuanced than stereotypes
- Useful for exploring different approaches to a problem