Documentation is a miracle
-
I found this shining example of excelent documentation. C++'s vector class has a back() function. Apprarently someone over at cppreference is not fond of writing documentation.
-
@thame90 Looks fine to me: it fully describes the method and what it does.
What I find a though is the method is called
back()
, when it should really be calledlast()
.
-
@raceprouk I meant the contents of the vector used to demonstrate the functionality :P
And to be honest, the counterpart to back() is defined as front(), so I don't necessarily see the problem with it.
-
@thame90 said in Documentation is a miracle:
I meant the contents of the vector used to demonstrate the functionality :P
Hm?
looks again
Oh...
@thame90 said in Documentation is a miracle:
And to be honest, the counterpart to back() is defined as front(), so I don't necessarily see the problem with it.
It doesn't really make sense though, does it? A vector is basically a list, right? Lists don't have fronts and backs, they have heads and
orange flying kitsunestails, and also a first and last element.
-
@raceprouk I never said I found it logical, I just don't have a problem with it.
They are at least consistent with the naming across different list types.
-
@thame90 said in Documentation is a miracle:
the counterpart to back() is defined as front()
So it's back to front?
-
@raceprouk said in Documentation is a miracle:
@thame90 said in Documentation is a miracle:
I meant the contents of the vector used to demonstrate the functionality :P
Hm?
looks again
Oh...
@thame90 said in Documentation is a miracle:
And to be honest, the counterpart to back() is defined as front(), so I don't necessarily see the problem with it.
It doesn't really make sense though, does it? A vector is basically a list, right? Lists don't have fronts and backs, they have heads and
orange flying kitsunestails, and also a first and last element.There's nothing wrong with front and back. That's clearer and more direct than head and tail, if anything, which are implying exactly front and back with an animal metaphor. I'm sure it translates easier for developers whose native language isn't English.
-
@thame90 said in Documentation is a miracle:
@raceprouk I meant the contents of the vector used to demonstrate the functionality :P
cppreference has a bunch of examples involving cats ("meow"), and a few other "funnies". I'm not sure about this, but I'd like to imagine that the former is the fault of a somewhat prolific poster in r/cpp, who also works on the VS STL implementation.
Filed under: You need to be careful about functions returning Godzilla.
-
@boomzilla said in Documentation is a miracle:
@raceprouk said in Documentation is a miracle:
@thame90 said in Documentation is a miracle:
I meant the contents of the vector used to demonstrate the functionality :P
Hm?
looks again
Oh...
@thame90 said in Documentation is a miracle:
And to be honest, the counterpart to back() is defined as front(), so I don't necessarily see the problem with it.
It doesn't really make sense though, does it? A vector is basically a list, right? Lists don't have fronts and backs, they have heads and
orange flying kitsunestails, and also a first and last element.There's nothing wrong with front and back. That's clearer and more direct than head and tail, if anything, which are implying exactly front and back with an animal metaphor. I'm sure it translates easier for developers whose native language isn't English.
fiiiiiiiiiiiiiiiiiiine
would it make you happier if i used my one and only shot at using this time machine to go back and change the canonical names in C from
head
andtail
tomouthhole
andasshole
?
-
@accalia said in Documentation is a miracle:
@boomzilla said in Documentation is a miracle:
@raceprouk said in Documentation is a miracle:
@thame90 said in Documentation is a miracle:
I meant the contents of the vector used to demonstrate the functionality :P
Hm?
looks again
Oh...
@thame90 said in Documentation is a miracle:
And to be honest, the counterpart to back() is defined as front(), so I don't necessarily see the problem with it.
It doesn't really make sense though, does it? A vector is basically a list, right? Lists don't have fronts and backs, they have heads and
orange flying kitsunestails, and also a first and last element.There's nothing wrong with front and back. That's clearer and more direct than head and tail, if anything, which are implying exactly front and back with an animal metaphor. I'm sure it translates easier for developers whose native language isn't English.
fiiiiiiiiiiiiiiiiiiine
would it make you happier if i used my one and only shot at using this time machine to go back and change the canonical names in C from
head
andtail
tomouthhole
andasshole
?I find this comment very confusing both for the content and the context switch to C from C++.
If we're taking recommendations on the time traveling, I'd rather you convinced the Java devs to not zero index months, because .
-
@boomzilla said in Documentation is a miracle:
I find this comment very confusing both for the content
head
andtail
were bad analogies so i offered to change them to something "better"@boomzilla said in Documentation is a miracle:
the context switch to C from C++.
really? cause using
head
for the pointer to the beginning of a list andtail
for the pointer to the end of the list were imported into C++ from C, so if i change them in C they change everywhere that derives from C@boomzilla said in Documentation is a miracle:
If we're taking recommendations on the time traveling, I'd rather you convinced the Java devs to not zero index months, because .
if we're fixing zero indexing errrors i would go back and beat the developers of LUA until they properly zero index their language. none of this "arrays start from one" shite.
-
@accalia said in Documentation is a miracle:
head
andtail
were bad analogies so i offered to change them to something "better"Right, but we already have non-analogies.
@accalia said in Documentation is a miracle:
if we're fixing zero indexing errrors i would go back and beat the developers of LUA until they properly zero index their language. none of this "arrays start from one" shite.
No, I quite like 1-indexed arrays. But months have well established numbers to fuck anyone who thought making January ==
0
ever made any sort of sense.
-
@boomzilla said in Documentation is a miracle:
There's nothing wrong with front and back.
If you know that they'r a matched pair then fine. If not, and you come across a call to
back()
, you're just as likely to think it's a verb as a noun, somehow instructing the vector to move back. Some sort ofpop
maybe?
-
-
@cvi I've seen material for a certain certification use dogecoin mining in examples.
-
@jaloopa said in Documentation is a miracle:
@boomzilla said in Documentation is a miracle:
There's nothing wrong with front and back.
If you know that they'r a matched pair then fine. If not, and you come across a call to
back()
, you're just as likely to think it's a verb as a noun, somehow instructing the vector to move back. Some sort ofpop
maybe?But imagine if blakey came across
tail()
. Who would pick this? This isn't an animal! What moron thought this made senseโฝโฝโฝ
-
@boomzilla said in Documentation is a miracle:
But imagine if blakey came across tail().
@Perverted_Vixen's tail?
-
@boomzilla said in Documentation is a miracle:
That's clearer and more direct than head and tail, if anything, which are implying exactly front and back with an animal metaphor.
It's more likely to have come from coins, which definitely doesn't work in other countries.
-
@coldandtired I would have guessed the unix commands.
-
@coldandtired If it came from coins, the proper terms are
obverse
andreverse
. By the way, I'm not sure whether a functionvector::reverse()
would be any more self-documenting thanvector::back()
for returning the last element.
-
@boomzilla said in Documentation is a miracle:
There's nothing wrong with front and back. That's clearer and more direct than head and tail, if anything, which are implying exactly front and back with an animal metaphor. I'm sure it translates easier for developers whose native language isn't English.
But wouldn't beginning and end be still better?
Although I guess "end" has the same double meaning problem that "back" has. I dunno.
-
@blakeyrat said in Documentation is a miracle:
But wouldn't beginning and end be still better?
Best would probably be first and last.
-
@grunnen said in Documentation is a miracle:
the proper terms are obverse and reverse.
I'm not sure anyone in the world has ever settled something by calling 'Obverse or reverse?'.
-
@boomzilla How about Alpha and Omega?
Or even better: Alphaville and TheOmegaMan.
-
@coldandtired said in Documentation is a miracle:
@grunnen said in Documentation is a miracle:
the proper terms are obverse and reverse.
I'm not sure anyone in the world has ever settled something by calling 'Obverse or reverse?'.
It happened one time, but the guy who was flipping the coin punched the guy who called obverse as he watched the coin flying through the air.
-
@blakeyrat said in Documentation is a miracle:
But wouldn't beginning and end be still better?
Although I guess "end" has the same double meaning problem that "back" has. I dunno.Oh, also,
begin()
andend()
return iterators. Thebegin()
one points to the first element and theend()
one points past the last element.
-
@jaloopa said in Documentation is a miracle:
@boomzilla said in Documentation is a miracle:
But imagine if blakey came across tail().
@Perverted_Vixen's tail?
who stole my tail?!
-
@boomzilla said in Documentation is a miracle:
@accalia said in Documentation is a miracle:
@boomzilla said in Documentation is a miracle:
@raceprouk said in Documentation is a miracle:
@thame90 said in Documentation is a miracle:
I meant the contents of the vector used to demonstrate the functionality :P
Hm?
looks again
Oh...
@thame90 said in Documentation is a miracle:
And to be honest, the counterpart to back() is defined as front(), so I don't necessarily see the problem with it.
It doesn't really make sense though, does it? A vector is basically a list, right? Lists don't have fronts and backs, they have heads and
orange flying kitsunestails, and also a first and last element.There's nothing wrong with front and back. That's clearer and more direct than head and tail, if anything, which are implying exactly front and back with an animal metaphor. I'm sure it translates easier for developers whose native language isn't English.
fiiiiiiiiiiiiiiiiiiine
would it make you happier if i used my one and only shot at using this time machine to go back and change the canonical names in C from
head
andtail
tomouthhole
andasshole
?I find this comment very confusing both for the content and the context switch to C from C++.
If we're taking recommendations on the time traveling, I'd rather you convinced the Java devs to not zero index months, because .
Even more important: Make
String#split
consistent with empty elements at the front and back. Because"ย :wtf:".split("ย ")
is["", ":wtf:"]
but":wtf:ย ".split("ย ")
is just[":wtf:"]
. This has screwed with me countless times.
-
@accalia said in Documentation is a miracle:
@boomzilla said in Documentation is a miracle:
@raceprouk said in Documentation is a miracle:
@thame90 said in Documentation is a miracle:
I meant the contents of the vector used to demonstrate the functionality :P
Hm?
looks again
Oh...
@thame90 said in Documentation is a miracle:
And to be honest, the counterpart to back() is defined as front(), so I don't necessarily see the problem with it.
It doesn't really make sense though, does it? A vector is basically a list, right? Lists don't have fronts and backs, they have heads and
orange flying kitsunestails, and also a first and last element.There's nothing wrong with front and back. That's clearer and more direct than head and tail, if anything, which are implying exactly front and back with an animal metaphor. I'm sure it translates easier for developers whose native language isn't English.
fiiiiiiiiiiiiiiiiiiine
would it make you happier if i used my one and only shot at using this time machine to go back and change the canonical names in C from
head
andtail
tomouthhole
andasshole
?
-
@accalia said in Documentation is a miracle:
would it make you happier if i used my one and only shot at using this time machine to go back and change the canonical names in C from
head
andtail
tomouthhole
andasshole
?I'm sure there's a Clerks 2 joke to be had in there.