Skip to content

Commit

Permalink
Merge pull request #208 from wyattscarpenter/master
Browse files Browse the repository at this point in the history
Update faq.md - flip "confusion" and "convenience" in "is outweighed by" clause.
  • Loading branch information
gingerBill authored Jun 24, 2024
2 parents 671e3a4 + a8b11f5 commit 5b33e73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Character literals such as `'g'`, `'芋'`, and `'\u0123'` are all untyped runes,

Implicit conversions complicate things and would be difficult to make consistent across architectures. To increase portability and to simplify the language, Odin uses explicit conversion.

In C, the confusion caused by implicit numeric type conversions is outweighed by the convenience it provides. There are many rules in C which are not at all obvious nor simple to the reader of the code (e.g. is this expression unsigned does this expression over/under-flow? etc).
In C, the convenience provided by implicit numeric type conversion is outweighed by the confusion it causes. There are many rules in C which are not at all obvious nor simple to the reader of the code (e.g. is this expression unsigned? does this expression over/under-flow? etc).

The exceptions to this are that: all pointer types can automatically coerce to a `rawptr`, and untyped constants can be converted to a type - if that conversion is valid. The constant system does reduce a lot of the issues regarding types as "numbers just work"; there is no need for literal suffixes like in C.

Expand Down

0 comments on commit 5b33e73

Please sign in to comment.