P2P group video calls don’t work well unfortunately. Most people barely have enough upload bandwidth to upload one video stream. Needing to upload a stream per peer is a nonstarter for most people.
"Peer-to-peer calls require more bandwidth than calls routed through a server and are thus not suited for a large number of participants. In the future, we plan to also develop calls via a forwarding server to solve resource issues on the client side and to allow for calls with more participants."
It's even worse than that. P2P means that connection differences between peers also makea difference. User A might see users B and C, but user B might on see A due to a connection difference between user B and C. It is very annoying to enter a group chat and hear:
User B: Is user C's stream dead for anyone else?
User A: I see user C.
User C: Sorry, what? I'm right here.
Honestly, other than a 1-1 chat, I can't think of a situation where p2p is worthwhile. Even then, it's almost always better to use an SFU.
Sorry, but state is everything. If you don’t have state, then you’re essentially doing useless work computing an answer that is already known. Computation is only useful because of state.
import Data.List (nubBy)
refuteGoldbach :: Integer
refuteGoldbach = head $ [ n
| n <- [4,6..]
, not $ n `elem` [ p1 + p2 | p1 <- primesTo n, p2 <- primesTo n ]
]
where primesTo n = takeWhile (< n) $ nubBy isMultiple [2..]
isMultiple m n = n `rem` m == 0
If you think you already know the answer to this computation, get yourself a Field's medal.
And then there are pure functions. Every time you compute a function using an input no-one has tried before, you are probably computing something that is not already known. You do this routinely even with a calculator.
In typical functional languages state is managed so that it doesn't hurt, not completely absent.
For example, a REPL keeps state in the messages it prints to the terminal and this state isn't visible in the pure function definitions and expression the program is concerned with.
This is a really poor take and you know it. State can exist in functional systems - as results of computations passed to other computations. Recursion where the new argument is the state.
No one was saying "don't use state" they were saying we need to adjust how we use it.
// change anything, anywhere, in the entire database, the biggest state
execute_sql(user_input)
You might want controls around that state so not anyone can change it. It might be read only for some users - that is, immutable.
Is this your program?
log_to_database(financial_event for $5.00)
You probably want your financial logs to be immutable. Nobody should be able to mutate that $5.00 event to be $500.00.
Is this your program?
o.foo = complex_function(...)
... 1000 lines later ...
o.foo = null
... 1000 lines later in another file ...
o.foo.do_stuff() // oops! foo was set to null somehow - but where?
The above scenario has shared state with "foo". Somewhere it was set to null somewhere. It could be set to null anywhere in your program. Good luck tracking the bug. If "foo" was immutable, you would know immediately where null came from, because it can only be initialized one time. It lowers the cognitive load, knowing that certain actions are impossible makes it easier to focus on what matters.
Is this your program?
thing = computation()
return thing + 2
Many program are a series of computations - fresh state is created on each line, nothing is mutated. There is no reason not to be using immutability. In fact, if immutability were throughout, a compiler wouldn't have to worry about things like aliasing.
This is all the tip of the iceberg, there are many reasons to enjoy using immutability.
but, in your foo example, presumably complex_function() returned some data that was important, and foo was set to null for a reason, so that when you call do_stuff() you need to know was it supposed to be called on using the result of complex_function, or should it not be run at all because there is a missing null check.
I guess what you are saying is that foo should not have been changed, but a new variable created called "can_do_stuff" and it should have been checked before the call do_stuff()
I think the old Carmack article linked somewhere below makes a very good case for why pure functions are a good thing, and I see the value of making small atomic changes to an apps state, but ultimately, almost every applications job is to mutate data.
This question was not snark for FP pure functions or otherwise; no ill-will! It needs a legit answer maybe with a small lecture on why radix trees can be FP not pure FP. Hey, I can read and learn.
Other sorts of streaming operations --- message in, transform to new object which is logged or put into a data store most certainly do not need mutation so long as they are cache friendly, performant. FP and friends might even argue: yah ok it's some 10 pct slower but no race conditions, no weird sync. Formal methods are easier there to deploy. Those secondary arguments can be effective too; I'd bite
With mutable state, your function mutates state somewhere in the environment (typically a global variable or the class in which the function resides).
With immutable state, your function returns an immutable value, never modifying anything. I program Java for the most part, and this is how I do most things. Mutable state is the enemy, not OOP. Some people think mutable state and OOP are inseparable but they are just looking at a definition of it that is easy to criticize. If you make every object immutable , OOP actually becomes a much nicer model to work with.
What’s amazing about Dr. Suess is how much creativity and fun he packs into a very simply written book. Most children’s books are so asinine. “Sally went to the farm. She saw a pig. Sally can drive a tractor. Etc. etc.” There is rarely a point to the book. Dr. Suess uses similarly simple language: “You can think about red. You can think about pink.” While simple, the underlying message is usually profound, and that makes it so much more interesting.
I don't think I said anything of the sort. Regardless, fiber is food for the microbes in the gut. Eating fiber from a diversity of sources is important as well as quantity.