3 ms·
I used to be annoyed by "function" in JavaScript. That was when I thought the main job of a programming language was to help brilliant programmers write code in
by erikpukinskis 10y ago
I used to be annoyed by "function" in JavaScript. That was when I thought the main job of a programming language was to help brilliant programmers write code in the most efficient possible way.
My thinking has changed. Lately I think the job of the language is just to provide variable assignment, function calls, and a couple other basics. Most programming languages go far above and beyond and they become impossible to use for beginners, which means they can't be used on a diverse team. And worse, they tempt intermediate programmers into using complex control structures instead of doing the design work to figure out which boring-ass array processing functions they actually need to write.
I think the core challenge of programming is to write code that inexperienced people can understand quickly. Partly because your teammates may be inexperienced. Partly because 2 years from now you will be inexperienced with respect to this part of the code. Advanced programming language features are generally antithetical to that. Terseness is antithetical to that.
Instead, we get giant codebases that require full time attention from an expert programmer, in order to have any chance of extending anything.
I want code that uses the most basic possible programming primitives. I names to be as verbose as necessary so you don't have to look a lot of places to see what's happening. And I want the data model to be as simple as possible.
I want to see that the programmer told the rest of the organization "No" over and over, and that the code does very little, and uses childlike tools to do basic things. I am not impressed by wizardry, and trivialities like "function" versus "def" don't matter to me anymore at all. I am impressed when someone makes something small and simple and good.
- parenthephobia 10y ago> the core challenge of programming is to write code that inexperienced people can understand quickly This is a pipe dream. For anything significantly non-trivial, programming is inherently complex. Designing the language so that code is forced to be "simple" at the lowest scale just pushes that complexity up to larger scale code structures. Trying to make programs easier to understand by limiting the expressivity of the language is like trying to make quantum physics easier by reformulating it without using complex numbers. Whilst it may well make each individual step of a calculation easier to understand, it doesn't make the whole any easier to comprehend.
- erikpukinskis 10y agoI agree you can't force code to be simple with a language. Writing simple code is an art, and a cultural practice. I disagree strongly that code in non-trivial systems must be inherently complex. Complex code can be broken into simple pieces, but it takes time to find the abstractions. I spend at least as much time making my abstractions better as I do making things work. Many managers won't let you take that time. > Whilst it may well make each individual step of a calculation easier to understand, it doesn't make the whole any easier to comprehend You're used to the notion that programmers must keep entire codebases in their head because that's the norm: leaky abstractions where any part of the codebase could have implications for any other part. That how we in the tech world tend to build things in 2016. You need to understand the whole before you touch any part of it, or you'll likely break things. But when you find the right abstractions, you don't need to understand the whole codebase to get things done. In fact, that's how you know your abstraction is good. You stop seeing problems that span it.