3 ms·
These terms are often used interchangeably, for example they're called lists in python
by bowsamic 3y ago
These terms are often used interchangeably, for example they're called lists in python
- mst 3y agoIn general, in a discussion about or adjacent to programming language design, people will tend to expect 'list' to be used to mean a data structure that behaves like a singly linked list ala lisp's cons cell based list data structures. The programming styles list-first and array-first languages encourage are sufficiently completely different that using them interchangeably tends to be a really bad idea, and honestly python's arrays being named that way irritates me even if I don't consider 'this irritates me' to be a criticism per se.
- jacquesm 3y agoThey are not used interchangeably when you're discussing programming language features, precision matters.
- kazinator 3y agoPython uses all sorts of nonstandard terminology. For instance, in computer science "literal constant" has a very specific meaning. Python calls things "literals" that are obviously not literals; for instance [1, 2, 3] is actually a constructor which allocates a new li^H^Harray each time it is evaluated. A true literal does no such thing; its syntax retrieves an object which has been placed into the program image; it typically exists before the program even starts. Programs depend on the semantics of [1, 2, 3] making a new object each time; a Python compiler cannot just deduce that because all arguments are constants, it can be turned into a literal. You don't want to learn computer science terminology (or computer science at all) from Python.