3 ms·
> The goal was to see how similar code is, and how little it matters which language you pick. I think that’s a pretty bad result of the exercise. The point of
by bmitc 4y ago
> The goal was to see how similar code is, and how little it matters which language you pick.
I think that’s a pretty bad result of the exercise. The point of software isn’t just to do a thing. Good software should properly encode a domain or idea and communicate that to others.
If one took the analogy of driving a nail into wood, there are many tools that can do the job, but only a couple that properly handle the job. Because the goal isn’t to just drive the nail, it’s to do it efficiently and ergonomically and in a way easily communicable.
- WJW 4y agoYou can write good software in almost* any language though. Encoding of domain and/or clear coding style is mostly orthogonal to language syntax. The OPs exercise is exactly to show that language choice is not all that important, since you can write good software in bad languages and you can write bad software even in the best languages. * Excluding some deliberately opaque languages like brainfuck and malbolge.
- OkayPhysicist 4y agoI would describe programming languages less as encoding problem domain, and more of encoding/enabling solution domains. For example, if you're in Java the language steers towards defining objects that have methods that express your solution, where as in Haskell you'd be more inclined to your solution in terms of a composition of functions. At a lower level, your Java program is more likely to use loops and iteration whereas your Haskell program is more likely to use a recursive solution. Anyone who's tried hammering a Java-shaped solution into an Haskell-shaped language will eventually see the folly.
- ketralnis 4y agoI think you read a comment that they didn’t write. But to take your argument there is still value there. Learning that the goal is to get the nail into the wood and give you a tour of some ways to do that provides different value to practising your memorised best practise of 3/8” 95% iron alloy hammer swings at 20 degree arcs 1.2 times per inch of nail bed. Maybe that’s valuable too but you need to know both. I interview a lot of programmers and I often get told that one of my questions is just impossible because it’s slightly awkward to express in Java. (It’s only Java folk incidentally, even though it’s roughly equally awkward to express in most of the long list of languages we let candidates use.) By analogy these are folk that would have to sit around waiting for their hammer delivery rather than just make do with a mallet for a few minutes.
- TYMorningCoffee 4y agoEven with the latest java? With records and switch pattern matching on records, you can model some stuff better. It's not as good as pattern matching in other languages but getting better. I agree with your point though. I remember being asked a question and I blanked with how to model it in Java. Then I switched mid interview to python and it clicked for me.