What name is the best ?

What name is the best ?

Attached: qwe.jpg (508x239, 9K)

Other urls found in this thread:

youtu.be/ZsHMHukIlJY
twitter.com/SFWRedditGifs

none best would be return float and take float who gives a shit about the name

3 if it's the only function of its type that returns Radians, otherwise 2 (with a Radians function for each of many different potential input types).

:)

definitely not 1

function ConvertAngle(const aSourceAngle: SourceType): TargetType;

.toRadians()
or
.radians

degrees->radians
Use a less disgusting language op

.to_rad

thanks me later.

radians :: Degree -> Radian

DegToRad

radians

Radians.
Prepending 'to' is superfluous because you've already got typed input and output. So it's well communicated either way.
I would say the other options can either be classified as needlessly verbose or homeopathic naming by this guy's definition.
youtu.be/ZsHMHukIlJY
26:15.

But I would say consistency is more important.

PI/180.0 is way shorter

Based and redpilled

Best is "d2r()" Fuck overly verbose names.

whatever the best upvoted stackoverflow answer i copy.

Add a conversion operator.
If your language doesn't support this (or some conventional parametric conversion function) it's shit.

Untyped languages are also shit.

>mixing uppercase and lowercase in one name
I too enjoy bughunting for stupid typos

Depends. Is it helper/util function? If yes is it helper/util of radians or degrees or general angles util/helper? Is it static function in degrees or radians class? Too many unanswered questions.

Besides first char being capital it seems like standard camel case. Do you have issue with camelcase?

this.toRadians()

1st one

Literally when has that ever been a problem? Does your editor not highlight missing identifiers? Does your compiler not tell you about missing identifiers?

Was what I was thinking. If you have Degree objects then let them have a toRadians() method maybe.

my supervisor would have just named it R

float radians (float degree);

DegreesToRadians. Don't make it shorter for no reason, don't make your program into a liar.

Isn't it pretty trivial to add types to any lisp? AFAIK Clojure comes with a typed library ootb

(degrees->radians degrees)

This, Game Maker uses it too

RadiansFromDegrees

Radians BrutuallyRadianize(this Degrees degree)