What is the philosophy of literals in programming?

How to explain literals? Why should we use it in C # and ...?

Literals are very common in C #. I want to know the philosophy and history of literals.

+3
source share
1 answer

Literals are very common in C #. I want to know the philosophy and history of literals.

Oddly enough, I'm on the bus right now, writing a blog entry about this exact topic. Look at my blog in the next couple of weeks for the whole article (assuming I finish it.) But for now, here's the sneak peak.

The main philosophical influence of string literals in programming languages ​​is that they allow the developer to distinguish between the mention and use of the structure of a programming language. For instance:

string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Console.WriteLine(alphabet.Length); // 26
Console.WriteLine("alphabet".Length); // 8

. " , , ".

, ; "Godel Escher Bach" ; .

, , " "; "", , . lambdas # 3 ( "", .) - Lisp "", . , .

+13

Source: https://habr.com/ru/post/1766872/


All Articles