Took me a year before I found a dev/manager that even scratched at that power. A dev that pushed me to learn it. Before that I was a rails dev writing elixir. :)
I should mention there is no problem not going there. I respect my teammates. Ruby/Rails is a great way to get things done. I would 100% use it as my MVP lang.
Your original statement lacks any nuance except "E are bad because no pure functional programming". Any attempts to clarify resolve to basic "it's for the good of the whole program".
Whereas easy-to-use concurrency primitives, effortless parallelisation and concurrency, and even the most basic stuff like ability to put a logging statement anywhere in the code without re-engineering half of your program trump whatever imagined advantages of pure functional programming you may come up with. Any day of the week, and twice on Fridays.
In theory, theory beats practice. But in practice...
I did not intend to write an essay of why PFP would be great to have in Elixir/Erlang. I'm just posting my opinion here and I'm happy to explain it as you can see from my answers.
> ability to put a logging statement anywhere in the code without re-engineering half of your program
Let me ask you a question: does it change the semantics of your (whole) program if that logline, that you are talking about, is not executed for some reason - or if it is executed more than once?
If your answer is "it doesn't really matter, might at most be a bit annoying but it's just a log, no stakeholder of the program can ever notice" then there is no problem with putting this logline into the program. No need to re-engineer anything.
If, however, this logline is critical and will be e.g. parsed and used by another system and actions might be taken due to it, then I would argue it is good if you are forced to consider the potential impacts to your program. If that means that you need to re-engineer half your program then there is a good reason for that, since the potential impact is huge. Such a thing has never happened to me in many years while working on different kind of applications. Sometimes a couple of 100 lines need to be rewritten - that is the max that I ever had to do. And indeed sometimes this rewrite in fact caused me to find and resolve problems that would have otherwise been introduce by accident.
Because yes, it's a fact that in a "pure functional program" you need to re-engineer half of the program if you need to put the log somewhere where it's "oh so pure", and where you didn't need logging before [1]. Or thread IO through the entire program to begin with.
> Sometimes a couple of 100 lines need to be rewritten - that is the max that I ever had to do.
Where in a pragmatical language you just add `Logger.log` or equivalent
[1] Spare me the pontification of "if you need logging, you're doing something wrong, this must be covered by tests or type systems". There are things you must log like metrics, audit logging, tracing values through the system, and it is a 100% certainty that you will add logs to places where no logging existed before.
> it's a fact that in a "pure functional program" you need to re-engineer half of the program if you need to put the log somewhere where it's "oh so pure", and where you didn't need logging before
It's most certainly not a fact. It's trivial to insert Debug.trace, for example.
You have completed ignored my question and the explanation of why I asked. I have to assume you just want to rant a bit here. Sorry for your bad experiences, but they are hardly representative.
> You have completed ignored my question and the explanation of why I asked
I did not. I wrote that it amounts to demagoguery.
The reason is simple: a pragmatic language lets you write a single `Logger.log` line without pseudo philosophical discussions on the semantics of a program and "sometimes re-writing 100 lines of code".
It's no wonder any discussion on "how to do logging in Haskell", for example, devolves into discussing the merits of various types of monads and "composable co-monadic contravariants" with 15 equally cumbersome ways of using them.
Not that I'm a fan of Haskell, but I believe that if this log is critical to the behavior of the program AND it is inserted in a place where important effects have previously not been expected (such as pure mathematical calculations) then it is a good thing that the language makes you aware of that. Someone might for example be caching/memorizing those calculations and suddenly your log isn't always executed and that might be a bug.
I much rather prefer to evaluate the impact in advance rather than having to find and figure it in production.
> I much rather prefer to evaluate the impact in advance rather than having to find and figure it in production.
See, this is exactly the zealotry and demagoguery I am talking about.
99% of use cases: we need to add a single line of logging here
Pure functional programming cultists: first we must consider the semantics of the program and the implication of logging on the grand scheme of things. Consider the criticality of a log line. What is a log line? ... <two hours later> ... an lo, once you've done the refactoring to consider the co-variants ... <another two hours later>
Edit. I'll reiterate:
Easy-to-use concurrency primitives, effortless parallelisation and concurrency, and even the most basic stuff like ability to put a logging statement anywhere in the code without re-engineering half of your program trump whatever imagined advantages of pure functional programming you may come up with. Any day of the week, and twice on Fridays.
If you need hours to figure out if a log line is relevant or not, then you have much more important problems to take care of.
For example, if this is a log line for audit logging in an enterprise product then it's clearly relevant. If this is a trace log line in case you need to debug some minor issue, then that's a different story. Has nothing to do with zealotry, just common sense. If you don't understand that there is a difference between those two cases then the discussion ends for me here.
> If you need hours to figure out if a log line is relevant or not, then you have much more important problems to take care of.
I don't.
> Has nothing to do with zealotry, just common sense.
Ah yes. "does it change the semantics of your (whole) program if that logline, that you are talking about, is not executed for some reason - or if it is executed more than once?" vs. "this logline is critical and will be e.g. parsed and used by another system and actions might be taken due to it, then I would argue it is good if you are forced to consider the potential impacts to your program. "
etc. etc.
And yet the fact is that if you need to log something your precious "mah purity" function is doing, you're stuck with "sometimes a couple of 100 lines need to be rewritten".
Where as non-cultists just do a `Log.info` etc.
If you can't understand that, well :shrug:
Edit. I just re-read that inane pseudo philosphical bullshit about "the semantics of the whole program a log line". No, I definitely don't need to consider the semantics of the whole program to add a bloody log line.
Quebec was part of France for more than 200 years before it was forcibly incorporated into British North America. Most French Canadians today are descendants of 800 French women who settled in Quebec from 1663-1673: https://www.cbc.ca/2017/canadathestoryofus/most-french-canad...
Yes, it’s part of Canada now. But maintaining its independent French identity was a fundamental part of the bargain of that union.
If you are talking about the "Today" view (one screen to the left of the first home screen) then it's press and hold to delete a widget (just like for apps). I would bet a good bit of money no one paid Apple to put the news widget there, Apple probably did it attempt to get people to use their news app more and eventually pay for news+. I'm perfectly ok with all of that, especially since I deleted it immediately without issue. That said, if I was going to use a free or paid news service then Apple News+ would be high on my list for a number of reasons.
I get that, I'm just saying there is a world of difference between unremovable (or hard/paid to remove) carrier-installed lockscreen ads (or start menu ads for that matter, looking at you Windows) and a widget on a screen that I'd bet 50% of users have never seen and can remove in <5 seconds. Personally I never use/look at the today screen.
You first say that you had to go “hunting” to remove the widget but somehow removing it was “easy enough” in the next post? Something seems a bit hyperbolic between these two posts… which was it? Easy to remove or so hard you had to go hunting?
I've never used News and have no plans to use it and yet it occasionally popped up alerts until I finally got off my ass and dug through the giant list of notifications to turn it off.
I've discovered something similar, I also noticed ADHD type behaviors which led me to build my own thing as well: https://getartemis.app. I'd love to test out yours as well though, maybe we can give mutual feedback?
That does not mean it becomes the benchmark for everybody.