Liste des Groupes | Revenir à cl c |
On 20/06/2024 15:37, bart wrote:On 20/06/2024 11:34, David Brown wrote:
I've only been discussing Python as an example of how many programming tasks are easier in high-level languages than in C.A lot of it seems to be incantations that you can only come up as an expert user. I wouldn't have been able to come up with even basic file-reading; I'd have to go and look up examples, every time.
I seem to remember you getting really worked up about C programmers using the same identifier for structs and variables!Yes, you can have both 'struct T' and a type, variable etc called 'T'; or a type 'T' and, due to case sensitivity, a variable or function called 't'.
I mentioned 5 ways of doing it, you added one or two more. That is my point: when a simple feature isn't built in, solutions have to be provided in lots of disparate ways.Both have mutable elements. Neither allow arbitrary attributes (so impossible to misspell member names). And if the FFI demands it, pointers to structs or ints can be passed.You can do all this with Python. I showed you how to have structures with mutable elements - and immutable structures, and structures with or without the ability to add new fields.
No, the complaint was getting it so wrong in the first place, then taking too long to fix it. (I think it was in Python 3 that you could type 'range' instead of 'xrange'.)>So your complaint now is that newer versions of Python have made some common tasks more efficient? There's no pleasing some people.
But Python even then completely disregarded performance. In the 1990s, if you wrote a loop like this:
>
for i in range(1000000):
....
>
it would actually create an object with a million elements so that you could iterate along it. It sounds absolutely crazy, and it was.
>
Later they added xrange() which didn't do that, and later on 'xrange' morphed into 'range'.
>
Les messages affichés proviennent d'usenet.