c# - What is the philosophy of literals in programming? -


how can literals explained? why should use in language such c# , ...?

literals common in c#. want know philosophy , history of literals.

literals common in c#. want know philosophy , history of literals.

funnily enough on bus right writing blog entry exact topic. blog in next couple of weeks whole article (assuming finish it.) now, here's sneak peak.

the principal philosophical impact of string literals in programming languages allow developer make distinction between mention , use of programming language structure. example:

string alphabet = "abcdefghijklmnopqrstuvwxyz"; console.writeline(alphabet.length); // 26 console.writeline("alphabet".length); // 8 

the quotation marks make big difference. mean "do not treat thing inside quotation marks part of program rather mere text has no impact on program qua program".

to describe full philosophical impact of use-mention distinction take many hundreds of pages; recommend read "godel escher bach" douglas hofstadter; these sorts of philosophical explorations.

what more interesting string literals might think of "program literals"; "literals" capture more complex structures mere string values. expression tree lambdas in c# 3 such structures (though not referred "literals", logically are.) history of lambda literal goes days of lisp, "quote" operator. i'll discussing @ more length in blog, stay tuned.


Comments

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -

openssl - Load PKCS#8 binary key into Ruby -