TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Enforcing Type Returns in Ruby with Pedant

13 pointsby 0x44over 15 years ago

3 comments

gnaritasover 15 years ago
If you want strong type guarantees, don't use a dynamic language. If you're able to not make such silly mistakes and enjoy the power and expression of a dynamic language, then use them, you won't miss types much at all.<p>I use Smalltalk daily and such type errors are so rare as to be virtually non existent. If you pay attention to what you're writing, you don't make such silly mistakes often, and when you do you usually notice it immediately when you try to use the code you just wrote.<p>Bolting a home-brew type system on a dynamic language just seems rather pointless, if you need it, you're not really ready to be using a dynamic language.
评论 #785674 未加载
评论 #785534 未加载
FooBarWidgetover 15 years ago
I've been writing Ruby for years now and only a very tiny portion of my bugs are caused by type errors. I don't see how this is useful in practice.
评论 #785699 未加载
swombatover 15 years ago
I'm not sure how useful this would really be in practice. It seems that it would only be useful to debug obscure bugs if it was used consistently everywhere. However, littering your code with these calls would make it a fair bit more dirty, for a very small reduction in debugging time (apparently - that's not event 100% clear... perhaps having to read all that extra code when looking for a bug will make it take longer anyway).<p>I'll pass on this one, myself. Ruby's best used by people who have become capable of not shooting their own feet without language safeguards.
评论 #785412 未加载