What Makes a Good Function
summary
Argues that good functions avoid surprises and fail early by using clear type rules, showing surprising c() behavior where combining factors, dates, and NULLs returns integers or loses timezones. Demonstrates a concrete fix: a new vctrs package with vec_c that applies consistent coercion, and contrasts base ifelse with dplyr's strict if_else that errors on mixed types. Emphasizes useful error messages, predictable return types, and small composable functions.
AI-written summary · about
chapters (9)
- 0:00Start
- 0:03The Design of Everyday Functions
- 0:48The Practitioner versus the Programmer
- 2:49The First Notebook War
- 6:46How Do You Get Rid of a Legend in Ggplot2
- 7:46What Makes a Bad Function
- 12:08Atomic Vectors
- 19:56Group by Function
- 29:07Types of Functions
related talks
01h 02mFunctional C++
01h 01mFunctional C++
01h 47mFunctional C++
49m“Applying functional programming in code design"
01h 01mfunctional: What's New, And Proper Usage
01h 31mFunctional Programming in Modern C++: The Imperatives Must Go!
01h 04mFunctional C++ For Fun And Profit
01h 08mThinking Functionally with C#
