Meaning of 'strf' in 'strftime'
Asked Answered
B

2

16

What does 'strf' in 'strftime' stand for? I've googled this question numerous times, but haven't found an answer. Knowing what the letters stood for would enable me to more easily remember the name of this function.

Biagio answered 27/4, 2018 at 15:53 Comment(6)
string format probablyDewdrop
string-format-time?Bemoan
You can thank C programmers who have the religious belief that you only get so many vowels in your lifetime; the more vowels they type, the sooner they will die. Yes, it is string-format-time, and strptime is string-parse-time. Why the methods were not simply named "time_to_string" and "time_from_string" like sensible people would do is beyond understanding.Striped
@EricLippert: When you do not use IDE with code completion and other features it is easier to have short names that you can type in reasonable time ;)Burroughs
Yes, but I want to know the words they stand for. I don't like to operate in the dark.Biagio
Apropos such abbreviated terms: does a comprehensive coding glossary exists anywhere for such terms?Biagio
P
9

From man 3 strftime:

STRFTIME(3)

NAME
       strftime - format date and time

So that's str -- as in, string, the data type that the function works with -- format.

The manpage specifically refers to strftime as it's defined in the C standard library. Many modern languages with functions named strftime have so named them by convention based on C (because as @EricLippert implied in a comment, no sane modern language would use this kind of naming convention).

For completeness, no part of the strptime(3) manpage explicitly says that the p stands for parse (or print, although strptime doesn't print anything in the first place), but it very likely stands for parse.

Prudish answered 17/1, 2019 at 18:50 Comment(0)
A
0

strftime means string from time . we can format the time in different desirable ways.

This is the name reason only. For information about this method, Kindly click here Other link from Quora

I hope you understood.

Alard answered 17/1, 2019 at 15:19 Comment(1)
Pretty sure the 'f' in str*() is for the word format, as it's a primary feature of the function. For example the difference between a function like println() and printf().Aleron

© 2022 - 2024 — McMap. All rights reserved.