卿少納言

卿少納言

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 computer-related articles.

This article is based on the discussion in 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 computer-related articles.

For example, if an article contains something like this:

[1,2,3]

To translate it into English, we need to see what programming language the article is discussing. If it's Python, we would call it a list, which is generally translated as 列表 in China; if it's JS, even though it looks exactly the same, we would 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 might not be the best, but what I want to express is: even translations that are considered non-literary have 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 Variable values refer to objects and arrays, which you can modify directly. (This might sound a bit abstract.)

This is quite different from Python (considering that everyone here might be more familiar with this language). You can understand this statement as a feature of JS. So far, the only book I've 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’s 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 — for example, it doesn't make sense to modify the content of a number. 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 statement "In JavaScript, strings are immutable" completely made me give up the idea of easily refactoring "Japanese Non-Dictionary Form Dictionary v3" using JS, and I couldn't help but feel: Python is really too suitable for students in the humanities to learn... A string cannot be changed, and regular expressions seem useless; what is the point of learning them? (Just kidding, there’s no favoritism here; 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.