3 ms·
I've been programming for 35 years or more, and I've yet to come across situations where the hard problem was the language. Sure, there are situations where I'
by PaulDavisThe1st 4y ago
I've been programming for 35 years or more, and I've yet to come across situations where the hard problem was the language.
Sure, there are situations where I've been grateful for the ability to use Python (because everything is so easy), or Perl (because sometimes its the right tool for the job) or Lisp (because its slippery fluidity just feels right) rather than the C/C++ that I've generally used during that time.
But the hard problems I've faced writing code would (almost?) never be made easier by using functional programming, or Rust, or Go or Swift or Brainfuck. The problems are hard because the problems are hard, and typically for me over the last 23+ years, it has been the combination of generically tough programming problems with performance requirements that ultimately make the choice of language mostly irrelevant.
Sure, someone could offer me a thread-safe sparse integer-to-integer mapping container in another language, but then I have to wonder about what design assumptions were made and how performant it is, and if the language was clearly created to prevent me from ever doing such things myself, then I'm going to be deeply suspicious from the outset that it could possibly have my (coding) interests at heart.
I understand that I'm not the typical programmer these days, and I don't work on entirely typical problems, but I can't help but feel that sometimes the focus on "languages to help programmers" comes from programmers who just don't enjoy their work enough and/or don't have enough to do.
- naasking 4y ago> I've been programming for 35 years or more, and I've yet to come across situations where the hard problem was the language The language can cause hard problems by itself. Arguably dynamic typing has been partly responsible for driving microservices beyond what's reasonable and thus introduced accidental complexity, largely because they don't have a typing discipline that enforces proper module boundaries. That's the most obvious example to me, but far from the only one.
- bslatkin 4y agoI love to swing a hammer as much as the next programmer. But if you offer me a nail gun, even with slightly lower precision, I will happily use it the majority of the time and revert to my hand tools when it's most appropriate. This is about developing force multipliers and producing leverage, not avoiding the craft.
- PaulDavisThe1st 4y agoI would say that a better analogy is that you've already got an experienced crew, some swinging hammers, some lugging nail guns and everyone's really quite good at what they do. But the plans from the architect are just really hard to build. You and the crew can do it, for sure, but the issues are not going to better or worse if the guys use the table saw to crosscut some of the framing elements or someone gets one of those new german tool widgets. I mean, sure, the tools might make a small difference to the process, but the overall experience will be dominated by the fact that the thing is just hard to build.
- bslatkin 4y agoLet's keep going with the building analogy. You're running a cabinet making company. You've got all kinds of hand tools and power tools. You build jigs to make certain repetitive tasks faster. Then a ridiculously difficult design comes in for you to build. You and your crew are flummoxed by its complexity. Suddenly, someone offers you a CNC machine that you've never used before. What seemed hard is now easy. The nature of solving problems with a CNC is different. Using a CNC presents other challenges. But you have entered a new realm of what's possible. Analogies are a lot of BS but hopefully that gets across the flavor of what I'm talking about.
- PaulDavisThe1st 4y agoIt's a fine analogy. The only problem is that I don't recall ever coming across the equivalent of a CNC machine for the class of problems I face in my work. Thread-safe lock-free sparse integer-to-integer map? No CNC for that. Translating time between two domains, one of which is linear and monotonic, and the other is non-linear and non-monotonic. No CNC for that. Generating and caching the right versions of different segments of audio waveforms at different zoom scales, in multiple threads? No CNC for that. I could go on, but you get the point. What tends to be more like a CNC machine are libraries. For example, realizing that you need some sort of reference-counting system for lifetime management, preferably combined with pointer-like behavior ... and then discovering boost::shared_ptr (later to be std::shared_ptr) ... now that's like getting a new CNC machine. But it doesn't require a new language (and realistically, it didn't even require the library - the library just made it possible to not implement it locally). I think what I'm really trying to say is that I rarely come across problems where I think that the kind of help offered by the putative "new CNC machine aka new language" is anywhere nearly as substantive as the help offered by an actual CNC machine to a cabinet making company. Put differently, the new tool (language) still leaves the problem essentially as hard as it was before. p.s. a good friend runs a high end wood shop, and I'm fairly aware of the impact their first CNC machine made to what they could do.
- not_the_fda 4y agoI've also been doing this for over 30 years and agree with you 100%. Never has the language been the impediment, or the thing keeping me awake at night. We don't need more programming languages. All languages are either hated or not used. The language isn't the problem and it a poor craftsman that always blames the tool. I've never been on a retrospective of a failed project and the reason being the language.
- sakras 4y agoI definitely agree. I think somewhere along the way we went from solving problems to bickering about _how_ to solve problems. I feel there are now plenty of languages now that exist purely for aesthetic reasons (C++, Swift, etc) rather than having some deep technical reason for existing (C, Rust). I guess I get it though, designing your own language is great fun and I’ve definitely made a couple myself in my spare time.
- Chris_Newton 4y agoI've been programming for 35 years or more, and I've yet to come across situations where the hard problem was the language. The hardest problem is usually something else, but IME some languages make it much easier to solve a given hard problem than others. Some languages are qualitatively safer. Some languages are much more expressive, in the sense that I can implement my solution with far less code/time/cost without compromising anywhere else. There is a difference between whether I can solve a problem and how efficiently and pleasantly I can solve a problem. I find choice of language rarely affects the former but often profoundly affects the latter.
- PaulDavisThe1st 4y ago100%. But that's why I mentioned performance. I work with realtime audio, and this puts most of the "pleasantly solve the problem" options off the table.
- Chris_Newton 4y agoIt’s true that for genuinely performance-sensitive applications the options are more limited, but there are worlds of difference between assembly language, C and Rust, for example. There’s still a place for each of them, but other things being equal, Rust wins by a wide margin on both safety and expressiveness.
- PaulDavisThe1st 4y agoMight be true, but since the hard problems rarely involve safety or expressiveness, it's not clear what the benefit is.
- Chris_Newton 4y agoI’m very curious about what kind of hard problems you have in mind where an implementation wouldn’t benefit from better safety and expressiveness. I’ve done my share of both mathematical and systems programming. In both cases I’d say eliminating types of bug that typically come with low-level/high-performance code was highly relevant. Also, quite often my biggest practical frustration was trying to iterate on a solution while language barriers made implementing each new attempt tedious in some way.
- anonuser123456 4y agoAs a developer I would agree. As a maintainer I would disagree. Some problems require paradigms to solve, and developing bespoke implementations makes maintenance extremely painful.
- epgui 4y ago> The problems are hard because the problems are hard I would respectfully submit that this is exactly where functional programming shines.
- AnimalMuppet 4y agoI would respectfully submit that you completely missed Paul's point. He's doing real-time audio processing. So, first, he's got performance issues. In that environment, it can be very helpful to re-use a buffer without having to allocate one (and without a garbage collector). For most functional languages, that's not a place where they shine. But, second, he's (probably) got problems like building echo cancellers. The hard problem is, how do you determine whether something is an echo? Writing it in an FP language doesn't help much with that, because the hard part is the definition (and tuning) of the algorithm, not the implementation.
- naasking 4y ago> He's doing real-time audio processing. So, first, he's got performance issues. FFTW, long the fastest FFT software available, is a program written in OCaml that generates C. You need to think more outside the box! Another example: Copilot is a Haskell EDSL that generates a hard real-time C program for avionics. You can write programs functionally and get your imperative performance too.
- kilgnad 4y ago>He's doing real-time audio processing. So, first, he's got performance issues. In that environment, it can be very helpful to re-use a buffer without having to allocate one (and without a garbage collector). For most functional languages, that's not a place where they shine. It can be via streaming. The functional portion of the program does all the map and reduce operations on streams. Buffer allocation (and reuse) is automatically handled by the compiler. It's very similar to the way NodeJS hides the event loop. I'm not familiar with audio stuff but I'm sure there's libraries out there that allow you to do extremely efficient audio processing with high level language primitives. >But, second, he's (probably) got problems like building echo cancellers. The hard problem is, how do you determine whether something is an echo? Writing it in an FP language doesn't help much with that, because the hard part is the definition (and tuning) of the algorithm, not the implementation. Neural networks can be employed here to "recognize" echos. NNs are basically functional primitives with deterministic inputs and outputs. FP is remarkably appropriate here given that audio is basically a function.
- kilgnad 4y ago>I understand that I'm not the typical programmer these days, and I don't work on entirely typical problems, but I can't help but feel that sometimes the focus on "languages to help programmers" comes from programmers who just don't enjoy their work enough and/or don't have enough to do. Indeed. There's a subset of programmers who like to solve "problems" and there's another subset of programmers who like to actualize their intent with minimal exposure to problems. The later subset is the overwhelming majority both for what programmers themselves want and for what users want out of their programs. Solving "hard" problems is simply a niche desire.
- PaulDavisThe1st 4y agoI came across a quote the other day that is a far more accurate summary of the experience I've had: "We don't do hard things because we like doing hard things; we do hard things because we thought they would be easy" Certainly I naively believed that writing a digital audio workstation would be relatively easy. That was 23 years ago and I'm still writing it.