Forwarded from Ask GNU/Brett (Archived)
Imperative vs functional programming? why should I learn one over the other?
Both are useful for different reasons, but I EMPHASIZE a learning of functional programming for the following reasons. You tell me which one you think is better.
— The Development Cycle
[Imperative]
Using informal language a specification may be open to interpretation. Using appropriate testing strategies we can improve confidence - but not in any measurable way.
Mistakes/bugs are common and difficult to spot and correct.
[Functional]
Using logic we can state the specification exactly. Using mathematics we may be able to prove useful properties of our programs.
Mistakes/bugs are not common and relatively easy to spot and correct if they are not caught by a type checker.
— The Development Language
[Imperative]
Using structured programming or object oriented techniques we can reuse code. Using structured programming or object orientation we can partition the problem into more manageable chunks.
[Functional]
Using structured programming or declarative techniques we can reuse code. We can partition the problem into easy to use chunks - plus there are often "higher-level" abstractions which can be made ML which would be difficult or impossible in a traditional language.
— The Runtime System
[Imperative]
The compiler can produce fast compact code taking a fixed amount of memory.
Parallel processing is either not possible, or extremely unpredictable and unsafe.
[Functional]
Code is usually type-checked at a high degree of precision, but the memory requirements can be variable and unpredictable.
Parallel processing is easily possible and have guarantees of safety.
Both are useful for different reasons, but I EMPHASIZE a learning of functional programming for the following reasons. You tell me which one you think is better.
— The Development Cycle
[Imperative]
Using informal language a specification may be open to interpretation. Using appropriate testing strategies we can improve confidence - but not in any measurable way.
Mistakes/bugs are common and difficult to spot and correct.
[Functional]
Using logic we can state the specification exactly. Using mathematics we may be able to prove useful properties of our programs.
Mistakes/bugs are not common and relatively easy to spot and correct if they are not caught by a type checker.
— The Development Language
[Imperative]
Using structured programming or object oriented techniques we can reuse code. Using structured programming or object orientation we can partition the problem into more manageable chunks.
[Functional]
Using structured programming or declarative techniques we can reuse code. We can partition the problem into easy to use chunks - plus there are often "higher-level" abstractions which can be made ML which would be difficult or impossible in a traditional language.
— The Runtime System
[Imperative]
The compiler can produce fast compact code taking a fixed amount of memory.
Parallel processing is either not possible, or extremely unpredictable and unsafe.
[Functional]
Code is usually type-checked at a high degree of precision, but the memory requirements can be variable and unpredictable.
Parallel processing is easily possible and have guarantees of safety.
Forwarded from GNU Propaganda (Archived)
www.fsf.org
Talos II Mainboard and Talos II Lite Mainboard now FSF-certified to Respect Your Freedom
Forwarded from Ask GNU/Brett (Archived)
whats wrong with always committing to master?
Stop making destructive changes and rebases necessary in your git tree. Using branches is hygienic, and makes your git tree smell nice.
Repeat after me:
SQUASH 👏 AND 👏 MERGE 👏
Stop making destructive changes and rebases necessary in your git tree. Using branches is hygienic, and makes your git tree smell nice.
Repeat after me:
SQUASH 👏 AND 👏 MERGE 👏