9 ms·
> it seems human nature is preferring languages such as C, Python, C# and Java, exactly due to their expressiveness and distance from the pure math side of thin
by amelius 10y ago
> it seems human nature is preferring languages such as C, Python, C# and Java, exactly due to their expressiveness and distance from the pure math side of things
I personally think humans prefer imperative languages because they are closer to the metal, and hence more predictable in terms of performance.
- taeric 10y agoAlso closer to how most of us learn and are taught. Consider, I often tell my kids that they need a cup if they want water. I just as often have to change that to "go get a cup, and I'll get you water." Declarative seems to be natural at a desire level, but at an action level, imperative seems to be more common. I believe this is flipped for topics and actions that are well internalized. When my kids are older, I can just say "cup". If cups aren't in the right drawer, I have to provide imperative to where to check, though. And yes, all of this is anecdotal. YMMV. I'm highly interested if folks know of studies or counter examples.
- hood_syntax 10y agoYou're right that it's closer to how people are taught, but there's no reason we can't teach from the FP perspective. Consider the imperative cup_of_water get_water (cup_loc, water_loc) { cup = get_cup(cup_loc); return fill_cup(cup, water_loc); } or something like that, versus getWater :: CupLoc -> WaterLoc -> Cup Water getWater cupLoc waterLoc = fillCup (getCup cupLoc) waterLoc It's just a slightly different way of thinking about things.
- hyperpape 10y agoThere's nothing in either example that is intrinsically functional or imperative, they're just different syntax.
- taeric 10y agoThis is dodging things by all being symbolic. Which is well after the point my kids are at in these examples. I'm taking about my one year old. It is amazing how they can understand well before they can say words. Or read and write them. Sign language can be taught really early. Not sure what data that adds here. But, I believe that imperative makes sense because so much in life is imperative. Especially directions we give each other. For things that can be done symbolically, declarative can be a big boon. But it does seem to be the minority.
- pjc50 10y agoNow audit each cup-filling in a database. (Easy in an imperative system, painful in a functional one where you have to start passing monads around and caring how many times the cup is constructed rather than how many cups you end up with.)
- digi_owl 10y agoOr it could simply be that your kids have wrapped the imperatives in a object called cup. All this gets me thinking back to the micros and how they booted straight into a BASIC interpreter. In a sense while booting to a mouse (or touch) driven GUI helps with getting now common tasks done out of the box. That no mainstream OS ship with something that allows someone to sit down and instruct a computer similarly to how it was done back then seems to have turned modern personal computers into near appliances.
- taeric 10y agoI believe this is a common line of thinking. More so with phones, which are surprisingly difficult to get self written programs on. Compared to early computers where I literally bought printouts of programs. (Toys, but still...) Not that it is impossible, but it is surprisingly difficult and not shocking that fewer do it. (Of course, I question myself on that claim. Fewer, but by what measure? And do I have proof?)
- digi_owl 10y agoThing is, back around the early days of Android Google offered a online dev environment that could sideload APKs to phones. I think it was based on Scratch. But they have since handed the whole project over to MIT. Frankly Android could have been a computer in our pockets, and i get the feel Rubin wanted to take it in that direction. But around the time of 3.x-4.0 there was pressure from elsewhere in Google to take in a more iOS direction. We see this with the introduction of music and video into the then named Android Marketplace (later renamed Google Play). And then there was the whole push towards ChromeOS as the choice of businesses, complete with Citrix being a launch day demo. Only in the last few years have Google done an about face regading Android. Both with Android apps coming to ChromeOS, and with various functionality being added to Android to make it more business friendly.
- godmodus 10y agoI have my hopes up for Nokia and Microsoft - win10 devices are more or less a pocket PC. When Linux Support gets properly implemented into Windows, a brilliant new era will dawn. Not to mention c# is a beautiful language.
- lacampbell 10y agoI am not sure what can be gained by comparing human languages or speech to computer language paradigms. I mean I could easily encode "go get a cup, and I'll get you water." as (ocamlish/F#ish) get_a_cup |> Option.map(fill_with_water)
- taeric 10y agoMy assertion is that people are more comfortable with imperative programming, because we are learning imperative thinking from a very early age. That is, there is no intrinsic advantage to imperative, by my assertion. Just that it is something we are much more comfortable with from experience.
- lacampbell 10y agoWhat I am trying to get in as I am not sure that this kind of thinking/speech is inherently imperative or declarative in (in the computing sense). The idea of modifying and controlling bits of state which other processes depend is fairly novel to the novice programmer, isn't it? I'm sure it tripped me up a lot.
- taeric 10y agoI'm not sure I follow. Imperative/Declarative in the programming sense is no different from the speech sense, is it? Quickly skimming the wikipedia page [1] for imperative mood makes it look similar enough to me. The page for imperative programming [2] references the grammar page, even. As for the state, I think in life everything has state. Kids are quickly learning which ones have states that they care about. It is not uncommon to see them learn that cups filled with water need to be held a certain way, otherwise they spill. Now, like more formalisms, computing and programming is much more strict. But that is a matter of rigor, moreso than of form. That is, it is the same form, just not forgiving in syntax/content. Though, seriously, if I am abusing terms here please let me know. Is not my intent. [1] https://en.wikipedia.org/wiki/Imperative_mood https://en.wikipedia.org/wiki/Imperative_mood [2] https://en.wikipedia.org/wiki/Imperative_programming https://en.wikipedia.org/wiki/Imperative_programming
- godmodus 10y agoThat's why a hardware change would be a step towards a change. If the metal was less von neumann and more Turing/number theoretical approach, it'd be a deep change. So far the limitation of what's practical were/are the driver of industry. And von neumann did solve a real problem they had back then. These days were facing a software engineering problem which is more high level, and most faculties are triaging the situation - but I can't really blame them. Many unis lack the funding for ground breaking experimental work - and the likes of Turing/von neumann/knuth/dijkstra et Al, only come once a generation.
- godmodus 10y agonot to mention they're battle tested. and C is predictable, period. no other language can come close bar ASM. even Rust has a long way to go before it matures to C11 levels - in terms of industry trust, community adoption and backtrack of delivering. but ill have to still admit ignorance to a greater understanding of Rust.
- ianamartin 10y ago> and C is predictable, period. Really?
- godmodus 10y agoIf it's written spartan style, yes. If you go nuts with its dark corners things do get wierd. It's why it's a hard labour to write safely - and a contributing reason to JVM success. It's the mother of all, and abusing it in ways that make it unpredictable is more than likely.
- kahnpro 10y agoIf you have to add that qualifier, then is it really a predictable like language?
- godmodus 10y agoI don't see a problem with proper use of qualifiers. It has to be said that I'm a "right tool for the job" kind of man, and spend less time worrying about the perfect-ness of a language. Can't think of a better language to write crypto/network routing code with. Though a colleague did implement some mDNS craziness with java. Don't shoot me. Heh.
- Buttons840 10y agoI think once someone has done enough programming to understand or care about being closer to the metal, they prefer what they already know, which is usually imperative languages. I wonder which paradigm a total beginner would prefer? As a beginner they would not be influenced by "how the metal works" because they don't know or don't care. My guess is that beginners would prefer imperative languages as well, even though it has nothing to do with "the metal".
- DigitalJack 10y agoMy experience is that most software engineers don't really understand the hardware at all, so the idea that "how the hardware works" is influencing anything is a red-herring in my opinion. I say this as a hardware designer.