Follow

what do you prefer stylistically?

ignore the concrete type (could also be float, int,…)

· · Web · 2 · 1 · 0

I'm actually not sure which I prefer but casts are faster and my colleague considers them more readable so I guess I'll use those

@noiob I prefer casts if its a well defined operation that's relatively simple, like casting between number types, where you don't really need any additional parameters to do the conversion

I don't like casts if it's doing a more complex conversion, like parsing out a float from a string, which relies on locale etc

Sign in to participate in the conversation
Awoo Space

Awoo.space is a Mastodon instance where members can rely on a team of moderators to help resolve conflict, and limits federation with other instances using a specific access list to minimize abuse.

While mature content is allowed here, we strongly believe in being able to choose to engage with content on your own terms, so please make sure to put mature and potentially sensitive content behind the CW feature with enough description that people know what it's about.

Before signing up, please read our community guidelines. While it's a very broad swath of topics it covers, please do your best! We believe that as long as you're putting forth genuine effort to limit harm you might cause – even if you haven't read the document – you'll be okay!