Re:Adding Optimistic Locking to an API
by quadrature on Thursday August 26, 2021 @10:45AM
(#28315608)
It definitely a scary proposition. But it's worth mentioning that two of the world's biggest money moving platforms (Stripe and Shopify) are written in ruby.
Re:Adding Optimistic Locking to an API
by valenterry on Thursday August 26, 2021 @10:58AM
(#28315763)
Stripe decided to write a type checker for it though, probably for good reasons: https://sorbet.org/
It should be mentioned that their reasons were mainly developer convenience/productivity, and not “correctness”.
I think people severely overrate the value of the language when it comes to avoiding bugs. We already know how to minimize bugs: Extensive testing regimes (automated, manual, or both) and a general focus on correctness over “shipping on an artificial deadline”.
Re:Adding Optimistic Locking to an API
by karmakaze on Thursday August 26, 2021 @07:55PM
(#28322580)
You can have something that aids convenience/productivity and not correctness. You can also have something that aids correctness that increases developer convenience/productivity. I treat static typing as the latter.
Edit: Btw, the github.com/sorbet/sorbet project is really well run and surprisingly easy to get into. I've been drafting PRs. C++ is not nearly as rough as I remember from decades ago.
Ironically, advocates of dynamic typing often claim that it improves developer convenience and productivity.
Re:Adding Optimistic Locking to an API
by quadrature on Thursday August 26, 2021 @11:36AM
(#28316274)
Yup, also being used at Shopify. Types are awesome, but these companies got very far by betting big on the productivity of ruby before this became a concern.
Re:Adding Optimistic Locking to an API
by valenterry on Thursday August 26, 2021 @11:44AM
(#28316392)
Not claiming that ruby isn't productive, but I could as well rephrase that into "these companies got very far despite the lack of productivity of ruby before this became a concern". It's not really giving any new insight.
Re:Adding Optimistic Locking to an API
by mflamespin on Thursday August 26, 2021 @10:25AM
(#28315358)
There's lots of Java development that deals with money movement that is suspect. All languages and frameworks are just tools. It depends on how you use them. Compilers are no guarantee for correctness if how you're modeling types is improper.
Re:Adding Optimistic Locking to an API
by ianpurton on Thursday August 26, 2021 @10:49AM
(#28315671)
Well to me it's defence in depth.
I've used Ruby in a cryptocurrency project and I've used Rust. I know there are no guarantees but I wouldn't go back to ruby. There are just too many times when the compiler catches something I missed.
I really wouldn't want to write a service that deals with money in an unsafe language. It's so easy to make a mistake in ruby there's no compiler to help you.