aboutsummaryrefslogtreecommitdiff
path: root/vs-c.md
diff options
context:
space:
mode:
Diffstat (limited to 'vs-c.md')
-rw-r--r--vs-c.md18
1 files changed, 8 insertions, 10 deletions
diff --git a/vs-c.md b/vs-c.md
index 926973c..116870a 100644
--- a/vs-c.md
+++ b/vs-c.md
@@ -1,14 +1,12 @@
----
-title: Comparison to C
----
+# Comparison to C
What differentiates Crowbar from C?
-# Removals
+## Removals
Some of the footguns and complexity in C come from misfeatures that can simply not be used.
-## Footguns
+### Footguns
Some constructs in C are almost always the wrong thing.
@@ -30,7 +28,7 @@ Some constructs in C exhibit implicit behavior that should instead be made expli
- The conditional operator `?:`
- Preprocessor macros (but constants are fine)
-## Needless Complexity
+### Needless Complexity
Some type modifiers in C exist solely for the purpose of enabling optimizations which most compilers can do already.
@@ -43,7 +41,7 @@ Some type modifiers in C only apply in very specific circumstances and so aren't
- `volatile`
- `_Imaginary`
-# Adjustments
+## Adjustments
Some C features are footguns by default, so Crowbar ensures that they are only used correctly.
@@ -60,15 +58,15 @@ However, sometimes it just sucks, and in those cases Crowbar makes changes.
- All string literals, char literals, etc are UTF-8
- Octal literals have a `0o` prefix (never `0O` because that looks nasty)
-# Additions
+## Additions
-## Anti-Footguns
+### Anti-Footguns
- C is generous with memory in ways that are unreliable by default.
Crowbar adds [memory safety conventions](safety.md) to make correctness the default behavior.
- C's conventions for error handling are unreliable by default.
Crowbar adds [error propagation](errors.md) to make correctness the default behavior.
-## Trivial Room For Improvement
+### Trivial Room For Improvement
- Binary literals, prefixed with `0b`/`0B`