News for hackers. Stuff that matters.
Re:Rails API is coming to Rails 5 by ad_hominem on Tuesday April 21, 2015 @12:38PM (#9415241)
Not really: https://twitter.com/maccaw/status/576437511729221632

If you want true stability you probably have to switch to a language with a stronger type system. That Sinatra bug proves that even small codebases can suffer from basic type errors.

Re:Rails API is coming to Rails 5 by pjonesdotca on Tuesday April 21, 2015 @12:55PM (#9415366)
Actually a good testing suite fixes that issue. It's probably the most bogus "issue" strong type addicts bring up.
Re:Rails API is coming to Rails 5 by jallmann on Tuesday April 21, 2015 @01:05PM (#9415437)
The only thing better than having tests is not needing tests. That's what a robust type system gives you.

Type systems don't eliminate all testing, but they do eliminate a large swath of possible errors that need to be tested for, like the one that has (had?) been afflicting Sinatra.

Re:Rails API is coming to Rails 5 by erokar on Tuesday April 21, 2015 @01:26PM (#9415583)
You might want to watch this talk for some data on this subject: https://vimeo.com/74354480

"Some programming language theorists would have us believe that the one true path to working systems lies in powerful and expressive type systems which allow us to encode rich constraints into programs at the time they are created. If these academic computer scientists would get out more, they would soon discover an increasing incidence of software developed in languages such a Python, Ruby and Clojure which use dynamic, albeit strong, type systems. They would probably be surprised to find that much of this software—in spite of their well-founded type-theoretic hubris—actually works, and is indeed reliable out of all proportion to their expectations."

Re:Rails API is coming to Rails 5 by ssmoot on Tuesday April 21, 2015 @02:22PM (#9415934)
As someone who worked with Ruby since ~1.8.1, has written a ridiculous amount of OSS Ruby and now works mostly in Scala, this is the exact opposite of my experience.

YMMV, but I've never seen the Ruby project that didn't suffer from stupid bugs even the most basic type system would have caught.

One of the biggest advantage of type-systems for me is that they don't suffer from No True Scotsman. If you don't have a test that covered this bug, people are happy to tell you you're doing it wrong. The type-system doesn't have that problem. It doesn't "rot". It expresses only what you tell it to. It enforces maintenance and rigor in a way that tests, as non-integral code, fundamentally can't.

But that's just my opinion man.

Re:Rails API is coming to Rails 5 by grandalf on Tuesday April 21, 2015 @06:29PM (#9417566)
What's your thought on something like contracts or facebook's flow (for js) ?
Re:Rails API is coming to Rails 5 by sanderjd on Tuesday April 21, 2015 @03:50PM (#9416578)
I'm not a programming language theorist or in any sort of functional-programming-static-type-system ivory tower – I just want to catch more bugs prior to runtime without needing to write tedious mechanical tests of method contracts. I find good type checking insanely refreshing. I find that I need fewer tests, they are easier to write, and they test more essential attributes of the program.

I've written lots of useful stuff in Python and Ruby, but I've also sunk lots of time into tests that I would have preferred not to need to write.

Re:Rails API is coming to Rails 5 by jallmann on Tuesday April 21, 2015 @02:33PM (#9416008)
I can't watch because no subtitles, but man that intro is condescending. Not saying that academics are completely innocent either, but maybe if the description focused more on the substance of the data, it wouldn't seem like the smugness was a cover-up for trying to rationalize their choice of language.

Anyway, I'm no PL theorist, only a schlub that's a better programmer because of ML. Yeah yeah, sample size of one...

Re:Rails API is coming to Rails 5 by counterplex on Tuesday April 21, 2015 @02:08PM (#9415849)
The politest put down ever?
Re:Rails API is coming to Rails 5 by grandalf on Tuesday April 21, 2015 @12:45PM (#9415289)
uh, it appears that a chance to Rack's API caused that bug, no?
Re:Rails API is coming to Rails 5 by beat on Tuesday April 21, 2015 @12:53PM (#9415355)
Same problem, though. Ruby's dynamic typing comes with some wonderful advantages (yay metaprogramming!) but some pretty bad disadvantages as well.
Re:Rails API is coming to Rails 5 by grandalf on Tuesday April 21, 2015 @06:24PM (#9417542)
Definitely. I like things like contracts and optional type annotations very much. Some code is just hard to understand without those kinds of things, which leads to bugs.