卿少納言

卿少納言

JavaScript & Japanese, Python & Polyglot, TypeScript & Translate.
zhihu
github
email
x

FreeMdict_Fixed value is not a computer vocabulary, which dictionary includes it?

Abstract: "Talking about translation without context is just nonsense" also applies to articles related to computers.

This article is a discussion on Is Fixed value not a computer term? Which dictionary includes it?:

Is Fixed value not a computer term? Which dictionary includes it?

It seems that everyone is not concerned about the context in which the original poster encountered this term... "Talking about translation without context is just nonsense" also applies to articles related to computers.

For example, if an article contains something like this:

[1,2,3]

When we translate it into English, we need to see what language the article is discussing. If it's Python, it should be called a list, which is generally translated as 列表 in China; if it's JS, even though it looks exactly the same, we have to call it an array (数组)—and the thing in Python that is essentially similar to a JS array is generally called a tuple, but they look different...
(This example may not be very good, but what I want to express is: even in what everyone considers non-literary translation, there is context, and we should not ignore it.)

Sorry for digressing, I feel that the Fixed value here seems to refer to the five basic data types: string, number, boolean, null, and undefined, because in JS, they are all immutable; you cannot directly modify their values, while the opposite, Variable values, refer to objects and arrays, which you can modify directly. (This may sound a bit abstract.)

This is very different from Python (considering that everyone here may be more familiar with this language). You can understand this statement as a feature of JS. So far, the only book I have seen that discusses this issue is "JavaScript: The Definitive Guide," which has relevant explanations at the beginning of Chapter 3 and in Section 3.7. Here is a part of it:

JavaScript types can be divided into primitive types and object types, and can also be divided into types that can have methods and types that cannot have methods, as well as mutable types and immutable types. The values of mutable types are modifiable. Objects and arrays belong to mutable types: JavaScript programs can change the property values of objects and the values of array elements. Numbers, booleans, null, and undefined belong to immutable types—modifying the content of a number itself doesn't make sense. Strings can be seen as arrays of characters, and you might think they are mutable. However, in JavaScript, strings are immutable: you can access the text at any position in the string, but JavaScript does not provide a way to modify the text content of a known string. Section 3.7 will explain in detail the differences between mutable and immutable types.

The sentence "In JavaScript, strings are immutable" made me completely give up the idea that I could easily refactor "Japanese Non-Dictionary Form Dictionary v3" using JS, and I couldn't help but feel: Python is really too suitable for liberal arts students to learn... a string cannot be changed, and regular expressions are like a chicken rib, what is the point of learning them? (Just kidding, no offense intended; everyone should follow their own preferences.)

After working all afternoon, I saw this on the forum and couldn't help but type so much.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.