Live data from Hacker News

“Swift is the only language I could find with over 100 keywords”

twitter.com

1–10 of 26 posts

Re: “Swift is the only language I could find with over 100 keywords”

#2
VB6 has close to 300

And while some vb6 code is truly terrible, it isn't because of keywords. It's because beginners have no idea what they are doing.

So I imagine Swift code may be terrible because there are a lot of noobs out there doing whatever it takes to ship.

Re: “Swift is the only language I could find with over 100 keywords”

#3
I don't think this is fair to Swift. Swift seems to have taken a view that the langauge will force you to be explicit about what you want. For example, the "indirect" keyword. Early Swift did not let you have recursive enums, apparently this can be something of a performance killer I guess was the reasoning. However they are really useful, so Swift added them. However rather than just automatically using an indirect Enum which is easily detectible, Swift forces you to use the "indirect" keyword. Rather than implicitly doing work for you, the Swift compiler stops to ask "are you sure this is what you really want to do? Do you understand the tradeoffs you are making?"

Personally I'm a fan of the Swift approach even if it does balloon the keyword count a bit.

Re: “Swift is the only language I could find with over 100 keywords”

#9
post #8
post #7

Depending on how you count keywords, SQL has over 400. See https://github.com/ballista-compute/sqlparser-rs/blob/main/s... . SQLite has 147 keywords - https://www.sqlite.org/lang_keywords.html .

COBOL has over 300 too

I count 417 reserved words at https://www.ibm.com/docs/en/iis/9.1?topic=words-cobol-reserv... .

I see there's "ZERO", "ZEROES", and "ZEROS" - I didn't realize that both plurals are acceptable in English! - https://english.stackexchange.com/questions/3824/what-is-the... .

My favorite reserved word on that list is "KANJI". From https://www.ibm.com/docs/en/cobol-zos/4.2?topic=expressions-... :

> The class condition determines whether the content of a data item is alphabetic, alphabetic-lower, alphabetic-upper, numeric, DBCS, KANJI, or contains only the characters in the set of characters specified by the CLASS clause as defined in the SPECIAL-NAMES paragraph of the environment division.

Post reply on HN