6 ms·
I love static typed language. With a proper IDE, code navigation, completion work like magic. I end up doing less typing than the dynamic typed language. Have
by trung_pham 14y ago
I love static typed language. With a proper IDE, code navigation, completion work like magic. I end up doing less typing than the dynamic typed language.
Have you ever tried to auto complete the 'init' function in RubyMine? It will ask you which one of the 100 init functions do you mean. :)
Not with static typed language. There is only one init function to choose from because the IDE knows the exact type you are working with at all time.
- fshen 14y agoYes. I can't agree more. One example to backup: Eclipse makes Java fun.
- chadmaughan 14y agoIs this sarcasm? =) If you want to know how real auto-complete works, try out IntelliJ. Auto-complete on Eclipse is like slowly being pecked to death by ducks. A more accurate statement in my mind is "Eclipse makes Java palpable, IntelliJ makes Java fun."
- fshen 14y agoI am downloading IntelliJ. I've use Eclipse for years, It works for me. I will give Eclipse a try.
- trung_pham 14y agoIntelliJ is the best IDE out there. It might be pricy, but it will save you so much time in the long run. Since time is money, you will end up saving money too. :)
- Mr_T_ 14y agoThe Community Edition is free of cost. The choice depends on what you need: http://www.jetbrains.com/idea/features/editions_comparison_matrix.html http://www.jetbrains.com/idea/features/editions_comparison_m...
- thebluesky 14y agoyeah free version supports Java SE, with a really nice Scala plugin for download via the plugin manager.
- hasenj 14y agoI'm also starting to find that a language with static typing and generally an enforced structure is easier to deal with. With dynamic languages, you have to hold a lot in your head. Having an enforced structure offloads some things off your brain so you have more mental space to think clearly and not panic or get burned.
- irishcoffee 14y agoI think the counter-argument here would be that dynamically-typed languages let the person behind the keyboard run the show, as opposed to the IDE.
- eru 14y agoAlas, nobody has written a really good IDE for Haskell, yet. So we still have to run the show for that statically typed language manually.
- protomyth 14y agoIf I ever develop a program language, the first action I will take is the clang approach and make it a library based architecture. That way, people can build tools for the language including IDE integration without having to reinvent the wheel.
- pcwalton 14y agoYes, this has been invaluable for us in Rust. One cool thing we've been able to do with this architecture is to write a fuzzer -- a tool that uses the Rust compiler itself to generate random Rust programs to test the compiler's correctness.
- tikhonj 14y agoI think GHC does something like that. At the very least, it exposes an API that lets you do all sorts of fun things. There are projects like Scion[1] that let you integrate that into an editor. [1]: https://github.com/nominolo/scion/ https://github.com/nominolo/scion/ However, there is simply less drive to develop tooling like that for Haskell than there is for Java. Haskell is a much easier language to use given just a moderately intelligent text editor and a REPL than most others. Java, on the other hand, it verbose and annoying even with a very good IDE. So Haskell can have good support, but since it isn't terribly necessary it isn't anything like a top priority.
- obtu 14y ago
- eru 14y agoStatic typing also makes overloading your f.unctions on return type instead of just arguments types possible. Not a lot of languages do this, though. I only know of one, but it's invaluable there.
- mikebike 14y agoPerl's a dynamic language, but return type can vary based on context. I once saw this really bite someone where the presence of parentheses on the left-hand side of the expression changed the behavior of the function being called on the right-hand side. Not fun to debug that one.
- Evbn 14y agoOnce? That is a daily occurrence in Perl development. Perl is more like a friend than a tool. It does what it wants, not what you say, and usually what it thinks you want, but sometimes it stabs you in the back.
- trung_pham 14y agoExactly. Duck typing sucks. I don't know why it was invented...
- batista 14y agoThe above is not an example of duck typing. Even if it was, one example of a difficult bug in one system does not invalidate a whole concept. And duck typing is almost as old as programming itself...
- jroesch 14y agoIt only "sucks"(causes problems rarely, and can be quite useful regardless) in dynamic languages. Languages like Go, Rust, and Haskell provide the same flexibility with static guarantees. All you must do is define type specific implementations to satisfy the interface(or typeclass). For example in Haskell, I can so something like: class Stream s where read :: s -> (a, s) write :: a -> s -> s and extend it to any type: instance Stream [Int] where read s = ... write a s = ... instance Stream File where ... and so on, and I can now pass any type that is a member of Stream, to a function that expects one.
- cageface 14y agoI do too but I'm finding that a lot of the time there are so many untyped inputs to a system that the static typing doesn't buy you that much. There always seems to be a ton of xml configuration data, incoming JSON from web services, databases with different type schemes etc.
- MaxGabriel 14y agoI don't know about other environments, but on iOS I just create a class that I store the e.g. JSON data in.
- alexatkeplar 14y agoAs soon as you receive an untyped input, make it conform to a typed data structure, and throw some kind of error if you can't. That way you catch any issues in your input data long before it bubbles through your app and causes a problem which is super-hard to track down. See e.g. DictShield for Python (https://github.com/j2labs/dictshield https://github.com/j2labs/dictshield), Jackson for JVM (http://jackson.codehaus.org/ http://jackson.codehaus.org/), Swiz for node.js (https://github.com/racker/node-swiz https://github.com/racker/node-swiz)...
- cmelbye 14y agoWhich IDE do you use with Go?
- wonderzombie 14y agoI use Sublime Text 2 with GoSublime. http://www.sublimetext.com/ http://www.sublimetext.com/ https://github.com/DisposaBoy/GoSublime https://github.com/DisposaBoy/GoSublime
- irahul 14y agoVim with gocode https://github.com/nsf/gocode https://github.com/nsf/gocode
- Erwin 14y agoIntelliJ's Python module (Pycharm) does a as decent job as you might expect based on code and your type annotations (i.e. if your docstring says that foobar is a BlahManager, it will complete foobar methods based on that and warn you if you are calling something foobar doesn't have).