Syntax - Tasty Web Development Treats
Syntax - Tasty Web Development Treats

Code Styles: Readable Rules and Petty Preferences

In this episode of Syntax, Wes and Scott talk about their preferred coding styles and preferences they use, and why. Linode - Sponsor Whether you’re working on a personal project or managing enterprise infrastructure, you deserve simple, affordable, and accessible cloud computing solutions that allo

Featured Speakers

Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers Host

Topics Discussed

Episode Summary

Executive Summary: The episode is a wide-ranging “petty preferences” debate about JavaScript and general coding style, where Scott and Wes compare readability-first practices across functions, arrays, loops, conditionals, typing, and formatting. They largely favor explicit, immutable, and readable code, while allowing concise syntax only when it remains clear and maintainable.

Main Topics: Function definitions and arrow functions: They prefer named function declarations for regular functions, while still using arrow functions freely for callbacks. TypeScript typing convenience, function overloading, and readability are major factors. Readability vs brevity in expressions: They discuss implicit vs explicit returns, reduce vs other array methods, and ternaries/switches/if statements. The recurring theme is that concise syntax is fine only when it stays easy to parse and debug. Immutability, variable creation, and data shaping: They strongly favor creating new variables instead of mutating existing ones, using destructuring when properties are known, and preferring object/array transformations that preserve clarity and reduce accidental bugs. Looping and async control flow: They compare for/forEach/map-style iteration and conclude that for loops are best when awaiting inside loops, while higher-order array methods are often more readable for transformations. Syntax preferences and formatting rules: They cover tabs vs spaces, trailing commas, semicolons, and increment operators. Their opinions are driven mainly by tooling support, consistency, and minimizing friction in diffs and maintenance. Types, coercion, and explicitness in JavaScript: They discuss converting strings to numbers, boolean coercion, and the value of explicitness in TypeScript-oriented codebases, reflecting a broader move away from clever shorthand. Personal updates, sponsors, and recommendations: The episode includes Scott’s site launch QA stress, sponsor reads, and personal sick picks. These segments frame the discussion but are secondary to the coding-style debate.

Key Arguments: Named function declarations are generally more readable than assigning functions to variables, though arrow functions remain ideal for callbacks and TypeScript typing convenience. Implicit returns are acceptable for one-liners, but explicit returns are preferred once a function spans multiple lines because they improve debugging and augmentation. Alias-based or absolute-style file paths are cleaner than deep relative paths because they reveal structure more clearly and scale better across larger projects. Reduce is powerful for deriving data, but readability often improves when transformations are split into multiple map/filter/reduce steps rather than compressed into one complex reduce. For loops are the best choice when async/await requires pausing iteration, while array methods are often preferable for transforming data or building new structures. Creating new variables instead of mutating existing ones improves testability, type safety, and naming clarity; mutation can lead to accidental bugs and confusing state. Destructuring is preferred when object properties or array positions are stable because it reduces repetitive references and improves readability. Spreading arrays/objects is favored over more explicit array conversion helpers because it is familiar, concise, and supports immutable updates and overrides. Simple, linear conditionals are preferred over deeply nested logical expressions; if logic becomes too complex, split it into multiple if statements or a state machine. Trailing commas, no semicolons, and tool-enforced formatting are preferred because they reduce diff churn, simplify edits, and are mostly handled automatically by modern tooling.

Data Points: Sponsor count: 3 - The hosts mention three sponsors at the start: Linode, LogRocket, and FreshBooks. Podcast episode format: ~20 preferences - They say they will go through a list of probably 20 different coding preferences. Public episodes for Video Archives: 19 - Wes says Quentin Tarantino’s Video Archives podcast has 19 public episodes. Free credit from Linode: $100 - Linode sponsor offer at linode.com/syntax. Free trial from LogRocket: 14 days - LogRocket sponsor offer mentioned during the read. Free trial from FreshBooks: 30 days - FreshBooks sponsor offer mentions a 30-day free trial with no credit card required. Wi‑Fi standard: Wi‑Fi 6 - Scott describes upgrading to Wi‑Fi 6 in-wall access points. Network speed target: 1 gigabit down - Scott says their previous setup could not fully use their gigabit internet speed. Cache/aggregation improvement: 20-second map/filter/reduce to 100 milliseconds - Wes cites a performance improvement after moving data transformation logic into MongoDB aggregations. Repeated code shorthands: 2 spaces / 4 spaces - They discuss indentation preferences and how editors can render tabs at different widths like two or four spaces.

Pivotal Quotes: "“I generally try to side with more readable code over being a hot shot.”" — Scott/Wes intro: This frames the entire episode as a readability-first discussion of coding preferences. "“Tools over rules is wonderful.”" — Wes: They emphasize relying on linting/formatters and editor tooling instead of personal discipline alone. "“Variables are free.”" — Wes: Used in the context of preferring new variables over mutating old ones, and encouraging clearer naming.

Implications: Listeners are encouraged to prioritize readability, immutability, and consistent tooling over clever syntax. The broader message is that modern JavaScript can be concise without being cryptic, but teams should standardize styles to avoid confusion.

🔓 Sign Up for Unlimited Episode Search

About Syntax - Tasty Web Development Treats

View all episodes from Syntax - Tasty Web Development Treats