Hacker News new | past | comments | ask | show | jobs | submit login
Short tutorial on Haskell for C programmers (haskell.org)
27 points by socratees on Dec 30, 2008 | hide | past | favorite | 5 comments



Two 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.


I'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.


Not arguing with you, but what does VB have to do with Haskell and C?


> 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.


Basically a nice hold-my-hand introduction to functional programming for imperative programmers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: