User: Password:
|
|
Subscribe / Log in / New account

A look at two new languages: Vala and Clojure

A look at two new languages: Vala and Clojure

Posted Jun 4, 2009 14:01 UTC (Thu) by alankila (guest, #47141)
In reply to: A look at two new languages: Vala and Clojure by walters
Parent article: A look at two new languages: Vala and Clojure

I'd like to say that type inference makes it somewhat possible to write code without an IDE. Static languages like C# and Java are chock full of classes, and you'd be dipping into the manuals all the time to figure out which returns what and so on.

With a C# keyword like "var" you can make the type information implicit, which makes it easier to write and change the code. Plus there's just something about:

Reader reader = new Reader()

collapsing to:

var reader = new Reader()

that makes the code much more readable to me. It's removing the type information that looks and feels like noise to me.

Then again, when there's a typo somewhere and the compiler can't figure out what the implicit type stands for, the errors that result are almost incomprehensible. I'm hoping Mono people can fix the parser to abort earlier instead of filling "var" with "object" and proceeding until it crashes and burns 5 lines later with missing methods and wrong types for calls etc. Usually the first thing to debug problems like this is to add some type information back so you'll pĆ­npoint the line where it goes wrong.


(Log in to post comments)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds