|
I'm not an employee, I'm a resource.
|
|
|
|
|
F-ES Sitecore wrote: I'm not an employee, I'm a resource.
You realise technically that's far worse, both in meaning and implication.
If anyone ever called me that they would never see me again.
Sin tack
the any key okay
|
|
|
|
|
Lopatir wrote: You realise technically that's far worse, both in meaning and implication.
Exactly
|
|
|
|
|
Lopitar, you're a resource of the earth. I guess I'll never see you... again.
|
|
|
|
|
Well, you won't when you respond to someone else's post.
This space for rent
|
|
|
|
|
|
Resources are things that are dug up, chopped down and consumed by people who don't care about them. Always hated the term "Human Resources."
|
|
|
|
|
No, M/F/R with reasonable limitations is not Turing complete, so it cannot cover everything, so there must be procedures that do other things than mapping, filtering or reducing. Besides, if you factor out the functions that you map over things, or the predicates, or the reduction function, those often have no M/F/R internally - they're more likely to be just some small arithmetic circuit over scalars (of course you could write arbitrary functions there..).
More practically, I'd say there are a couple of common patterns that are not secretly M or F or R (or some combination of them) in disguise:
- Arbitrary iteration (instead of over a collection). "Do this thing X times" is not a map, filter or reduce. Sure you could prepare a list of size X and then map over it, but that's a hack to force it to be done with the M/F/R paradigm, not a trick revealing that all loops are maps. Also if the iterations depend on each other, that's not a
map , maybe a fold . "Do this until [cond]" is even less of a M/F/R. I'm sure someone would like to argue at this point that such repetitions are merely parts of M/F/R if you look at a broader picture, but that is far from always true. Consider for example numerical algorithms that iterate until they converge, or simulations of systems that have to be evolved for X time steps. - Things that involve a "scatter". That's a lot of things. For example, inverting a permutation - again you can do some dirty hack, but the regular way is iterating
result[input[i]] = i for all valid i , which is not like an M/F/R or parts thereof. The "inner" code chooses where to write, so it's not just map ping some function over the array. - Almost anything that involves a more complicated data structure such as a heap, tree, disjoint sets, graphs (sometimes. some adjacency matrix algorithms do have an M/F/R structure). It will almost always rely on a specific ordering of side effects, you can't usually just apply operations to the data structure in a different order and get the same (or equivalent) results. Even if the global structure is "sort of like a
map ", I would argue that the requirement to evaluate strictly in-order makes it not-a-map - proper map s should not have an ordering constraint between evaluations of the function it is applying.
That, I think, covers most non-trivial algorithms, except naive matrix multiplication and its generalizations (such as Floyd–Warshall).
|
|
|
|
|
Great points. Thank you for your detailed answer!
Marc
Latest Article - Create a Dockerized Python Fiddle Web App
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
I don't even know what those are, so I suspect I have never done them at all.
|
|
|
|
|
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
My first boss told me many years ago that all functions convert some input into some output and thats all there is, mind you he also told me if I wrote functions that were more than 11 lines long I was doing it wrong...
|
|
|
|
|
Generally speaking, your boss was right
It's certainly a good way to look at code.
|
|
|
|
|
When it comes to the DB, it's all crud.
|
|
|
|
|
Not sure if it's only filter, map and reduce, but A LOT of programming is just working and transforming collections.
Which makes sense, because what I do (and what a lot of programming is) is collecting data, collections of things basically, and apply some statistics (mostly costs, profits, distances, weights, etc.)
|
|
|
|
|
Hmm. We lone wolves in the process control and embedded world will ignore your contention with quiet dignity and grace.
Software Zen: delete this;
|
|
|
|
|
Programming is a repetition of 3 things:
- map data from an external source to some kind of internal representation
- use algorithms to transform properties of the internal representation (change location, persistency, unit conversion, hierarchy..)
- filter and visualize the internal representation in some way
So no, I don't think map, filter and reduce are correct.
Map, filter, transform look better.. but that's just an optical illusion TBH.
In truth, you "map & transform" input into something with persistency and then "transform & filter" to get your output.
The skillful coder will only "map & transform" once per project, and "transform & filter" once per output device.
Just my 2 cents.
|
|
|
|
|
I thought this was settled with RPG:
Input
Output
Process (Compute)
|
|
|
|
|
Marc Clifton wrote: Would you say it's accurate that all programming is essentially the process of writing functions that implement map, filter, and reduce?
It was explained to me in the 1970s by those in the know that 90% of the work a computer does is sorting. Nowadays there are objects, classes, thunks and Lambdas, and Map/Filter/Reduce are just new ways of sorting.
I'm retired. There's a nap for that...
- Harvey
|
|
|
|
|
If I said that, "I love Microsoft." The flame war would decimate a couple of continents, and dry up an ocean or two. I use Win 10 and 7. I also use two versions of Linux. My son is a developer and he uses Mac. This is just to show I really don't have much of a dog in the race here.
Why does everyone want to waste there time hating MS? Net Market Share reports that 84.57% of desk top operating systems are MS. I know MS. I don't have to spend hours learning more. Linux takes up a chunk of my time learning the directory/file system and how to move around in it. I don't have time for Mac.
I live in a cold, dark place called reality where I have to use what the shop is using and at home I just want to work the Sudoku, watch some electronics how to videos on you tube. I don't care what the platform is.
Leadership equals wrecked ship.
If you think you are leading my look behind you. You are alone.
If you think I am leading you, You are lost.
|
|
|
|
|
I have little troubles with Win as I never bought a copy in 26 years, and cured versions come with all the tools to shut the flock up of any updater.
At work there are slightly more troubles but since I'm paid to work 8 hrs/day and no one gives a flock about how I work and how productive I am I simply roll with it.
* CALL APOGEE, SAY AARDWOLF
* GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
* Never pay more than 20 bucks for a computer game.
* I'm a puny punmaker.
|
|
|
|
|
den2k88 wrote: I never bought a copy in 26 years You have joined the 95% of people in S.E. Asia who never bought a copy, then: but, I am sure your copies were obtained legally !
«Beauty is in the eye of the beholder, and it may be necessary from time to time to give a stupid or misinformed beholder a black eye.» Miss Piggy
|
|
|
|
|
Legally they were backup copies of the original and any "cure" was already there I swear, it must be a virus.
* CALL APOGEE, SAY AARDWOLF
* GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
* Never pay more than 20 bucks for a computer game.
* I'm a puny punmaker.
|
|
|
|
|
I not say "hate," rather "dislike." - less strong.
Briefly why: They are the BMW drivers of the software world.
Sin tack
the any key okay
|
|
|
|
|
Lopatir wrote: They are the BMW drivers of the software world.
So you're saying that MS software is like a really nice car, and everyone who uses it is a dick?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|