4 ms·
Short tutorial on Haskell for C programmers
- vlad 18y agoTwo things that are never mentioned that show how a language like Visual Basic 6 or VB.NET (which I believe are still taught in high school or college programming courses) is just backwards for learning computer science. First, at least in Visual Basic 6, functions didn't return values like in any other language I know of; instead, the function name was set to a value, like a variable. This alone would not kick you out of the function. You had to remember to type Exit Function, unless you were at the end of the function definition already. Secondly, visual basic 6 (and .NET) evaluate the entire expression, even when it is obvious it cannot be true, which causes all sorts of issues to popup if the developer is used to C and similar languages that support short circuit operations, as described at the end of this article. For example, you could not rewrite the c statement if (n != null && n % 2 == 0) in visual basic 6 without using two nested if statements. The overall product benefitted from Microsoft's backing and ability to easily use any of Microsoft's controls, which allowed for fast development. But the language features themselves were atrocious. VB.NET introduced two keywords, AndAlso and OrElse, that do support short-circuit binary operators, which I only learned about from googling just now. The language is a pile of dung and nobody should be introduced to it any more.
- wayne 18y agoNot arguing with you, but what does VB have to do with Haskell and C?
- socratees 18y agoI'm happy the open source and the hacker community is more alive and vibrant now. If there was no open source and the hacker movements, maybe we wouldn't even have recognized if languages are good or bad. We would have accepted what is given to us.
- habibur 18y ago> First, at least in Visual Basic 6, functions didn't return values like in any other language Seems that Microsoft realized this problem and fixed it in VB.NET. You can type "return result" from anywhere and it will work as like C.
- albertcardona 18y agoBasically a nice hold-my-hand introduction to functional programming for imperative programmers.