5 ms·
(tl;dr: VB.NET can be every bit as expressive as Python. See my translation of Norvig) Here's a line-by-line translation of Norvig's code into VB.NET. Exactly
by stevecooperorg 16y ago
(tl;dr: VB.NET can be every bit as expressive as Python. See my translation of Norvig)
Here's a line-by-line translation of Norvig's code into VB.NET. Exactly the same number of lines, unless you count the block terminators like `End Function` and `End If`.
https://github.com/stevecooperorg/Norvig-Spelling-Corrector-in-VB.NET/blob/master/NorvigSpellChecker.vb https://github.com/stevecooperorg/Norvig-Spelling-Corrector-...
The translation was fairly straightforward; I'm not a regular VB.NET programmer but I cut and paste Norvig's code into Visual Studio and did some pretty trivial rewrites -- 'def train(features)' -> 'Function train(features)' -- and that got me most of the way there.
I translated idiomatic python (list comprehensions) into idiomatic .net (linq expressions) but the translated code is almost identical in structure and number of code points.