Thanks to visit codestin.com
Credit goes to programming.dev

  • 3 Posts
  • 161 Comments
Joined 3 years ago
Codestin Search App
Cake day: June 14th, 2023

Codestin Search App






  • Just wondering why you’re singling them out like that. Especially if you want to avoid anyone that has anything to do with them. If we’re talking acquisitions from IBM, the largest owner of patents originally owned by IBM is Google (they bought around 2.5k). Companies that had significant dealings with IBM include Microsoft, which would probably not exist in its current form without the original contract from IBM to develop DOS. (Linux would also be quite different if the influence from RedHat, owned by IBM, was removed.) And pretty much every PC manufacturer who’s been in the business for long enough would have licensed IBM technologies at some point or at least copied them. Even though they failed to make money from licensing the original PC design or later inventions like USB memory sticks, IBM created a lot of computing basics such as DRAM.

    Avoiding Lenovo kind of sounds like a random easy way out. They have much less influence. I’m not consciously avoiding them and still have nothing from them. They’re not difficult to avoid at all.











  • In Rust you’re kind of stuck with it, but at the end of the day combined return types are just syntactic sugar for something a lot of languages can do. Even in plain old C there’s a pattern where you pass pointers to your return and/or error variables. In many languages you can return structs or similar. In some I’d argue it looks nicer than having to write Result<>, e.g. in Python or in Swift you can just return a tuple by putting things in parentheses. (Of course you can also still use something more explicit too. But if every function returned (result, error) by default and every call was like result, error = fn(), I don’t think it’d be necessary.)

    However I don’t really know of any language where people prefer to use this over exceptions if exceptions are available. Even in C some people used to use setjmp/longjmp in macros to implement exceptions. Exceptions have their problems but people seem to overwhelmingly be in favor of them.

    Personally I like exceptions in languages that have some kind of built-in “finally” for functions. For example defer in Swift. You can have proper error handling for a lot less typing in many cases because passing through exceptions is fine if your defer blocks handle the cleanup. And if you do want to handle an exception, Swift also has optionals, and a try? that transparently converts a return value into an optional that’s nil when an exception was thrown, and a coalescing operator ??, which means you can catch exceptions and provide a default value on one line, instead of a 4-5 line try…catch/except block or an error checking conditional for every call.