Question about math.pi is mutable
Steven D'Aprano
steve at pearwood.info
Sat Nov 7 22:07:15 EST 2015
On Sun, 8 Nov 2015 04:46 am, Marko Rauhamaa wrote:
> Bartc <bc at freeuk.com>:
>
>> (Yes, 'const' in C is a waste of time, and half the people using it
>> don't appear to know what it means.
>
> It cannot mean anything meaningful; it's completely useless.
>
> For example, what could one think of standard library functions whose
> prototypes are:
>
> char *strstr(const char *haystack, const char *needle);
>
> int execve(const char *filename, char *const argv[],
> char *const envp[]);
Surely that is obvious? I don't speak much C, but I would expect that inside
the functions, const parameters can be read, but not assigned to. "*const"
is a mystery to me though.
> Ok, enough of C.
Amen to that.
If I had a dollar for every crime against computing committed because of C,
or enabled due to C's design decisions, I would be rich beyond the dreams
of avarice.
Fortunately, C is not the only other computer language, and we are by no
means limited to the two choices of the status quo (no constants in Python)
and what C does.
--
Steven
More information about the Python-list
mailing list