News for hackers. Stuff that matters.
Re:Why does nobody seem to know what imperative and declarat... by tshaddox on Friday July 29, 2022 @11:12PM (#32283967)
> Depends on your definition of "flow control".

Yep. That’s why this is a potentially useful rule of thumb for comparing programming languages, especially ones that skew very far in one direction or the other, but it’s not a rigorous definition of the concepts.

Some incredibly simple algorithms are difficult to explain naturally without it sounding like control flow. How would you describe the absolute value function without saying “if” or “when” or specifying one particular element from a set? Obviously any computer system needs to be able to determine what steps to take depending on specified conditions.

Re:Why does nobody seem to know what imperative and declarat... by naniwaduni on Friday July 29, 2022 @11:36PM (#32284068)
> How would you describe the absolute value function without saying “if” or “when” or specifying one particular element from a set?

I don't think you even want a conditional when describing the absolute value function on the complex numbers.

Re:Why does nobody seem to know what imperative and declarat... by TedDoesntTalk on Friday July 29, 2022 @11:26PM (#32284025)
> How would you describe the absolute value function without saying “if” or “when

How is this? absolute value is distance a number is from 0.

I get your point, though.

Re:Why does nobody seem to know what imperative and declarat... by tshaddox on Friday July 29, 2022 @11:52PM (#32284132)
True, the syntax will obviously depend on what primitives the language provides. Of course it could also just provide the abs() function directly.