Difference between revisions of "2309: X"
m (→Explanation) |
(→Explanation) |
||
Line 12: | Line 12: | ||
[[Cueball]] has developed a new {{w|programming language}} with novel syntax. These languages are classified as {{w|esoteric language}}s, which are programming languages developed for no practical use (although that doesn't stop people from trying) other than novelty. The classic example of these are {{w|INTERCAL}} and {{w|brainfuck}}. | [[Cueball]] has developed a new {{w|programming language}} with novel syntax. These languages are classified as {{w|esoteric language}}s, which are programming languages developed for no practical use (although that doesn't stop people from trying) other than novelty. The classic example of these are {{w|INTERCAL}} and {{w|brainfuck}}. | ||
− | Normally, there is no law against developing bad programming languages or bad code (although some would argue there should be). The law often has to play catch-up with technology. However, as when the EPA took an interest in Cueball's [[Laptop Issues]], and [[:Category:Cueball Computer Problems|Cueball's other tech support problems]], it seems that | + | Normally, there is no law against developing bad programming languages or bad code (although some would argue there should be). The law often has to play catch-up with technology. However, as when the EPA took an interest in Cueball's [[Laptop Issues]], and [[:Category:Cueball Computer Problems|Cueball's other tech support problems]], it seems that a judge has previously ordered Cueball to stop developing new programming languages, possibly because the result was so egregious as to cause real harm. However, the ruling was overturned on appeal, and Cueball is free to inflict his work on the world once again, unless and until there is another appeal. Cueball's use of the phrase "''higher'' court" suggests that he did not get a ruling from the Supreme Court of the United States or whatever state has jurisdiction over him, or else he would have said so, and evidently the offscreen voices hope to appeal to them and get Cueball's injunction reinstated. |
A {{w|Variable (computer science)|variable}} is a piece of data (such as an integer or a string of text) that can change in value. Variables can usually be named any string of alphanumeric characters. For the sake of readability, variables are usually named something relevant to what the variable represents. For example, a variable counting how many seconds have passed since the program was launched might be called elapsedTime. Some programmers, particularly if they are working under time pressure, will give their variables names (such as 'x') that do not describe what they do, and are thus almost completely meaningless. This is considered bad coding practice, because anyone reading the code who is not familiar with it will not understand what the variable does, and possibly also the original programmer after an arbitrary amount of time - somewhat likely after years of being untouched and unconsidered, but possibly even after minutes of frantic 'improvement' of some convoluted spaghetti-code that is now 'merely' tagliatelle. | A {{w|Variable (computer science)|variable}} is a piece of data (such as an integer or a string of text) that can change in value. Variables can usually be named any string of alphanumeric characters. For the sake of readability, variables are usually named something relevant to what the variable represents. For example, a variable counting how many seconds have passed since the program was launched might be called elapsedTime. Some programmers, particularly if they are working under time pressure, will give their variables names (such as 'x') that do not describe what they do, and are thus almost completely meaningless. This is considered bad coding practice, because anyone reading the code who is not familiar with it will not understand what the variable does, and possibly also the original programmer after an arbitrary amount of time - somewhat likely after years of being untouched and unconsidered, but possibly even after minutes of frantic 'improvement' of some convoluted spaghetti-code that is now 'merely' tagliatelle. |
Revision as of 14:12, 21 May 2020
X |
Title text: The worst is when you run out of monospaced fonts and have to use variable-width variables. |
Explanation
This explanation may be incomplete or incorrect: Created by a COMIC SANS X AND A NEW PROGRAMMER. This page needs an expanded explanation of what esoteric languages are. Do NOT delete this tag too soon. If you can address this issue, please edit the page! Thanks. |
Normally, there is no law against developing bad programming languages or bad code (although some would argue there should be). The law often has to play catch-up with technology. However, as when the EPA took an interest in Cueball's Laptop Issues, and Cueball's other tech support problems, it seems that a judge has previously ordered Cueball to stop developing new programming languages, possibly because the result was so egregious as to cause real harm. However, the ruling was overturned on appeal, and Cueball is free to inflict his work on the world once again, unless and until there is another appeal. Cueball's use of the phrase "higher court" suggests that he did not get a ruling from the Supreme Court of the United States or whatever state has jurisdiction over him, or else he would have said so, and evidently the offscreen voices hope to appeal to them and get Cueball's injunction reinstated.
A variable is a piece of data (such as an integer or a string of text) that can change in value. Variables can usually be named any string of alphanumeric characters. For the sake of readability, variables are usually named something relevant to what the variable represents. For example, a variable counting how many seconds have passed since the program was launched might be called elapsedTime. Some programmers, particularly if they are working under time pressure, will give their variables names (such as 'x') that do not describe what they do, and are thus almost completely meaningless. This is considered bad coding practice, because anyone reading the code who is not familiar with it will not understand what the variable does, and possibly also the original programmer after an arbitrary amount of time - somewhat likely after years of being untouched and unconsidered, but possibly even after minutes of frantic 'improvement' of some convoluted spaghetti-code that is now 'merely' tagliatelle.
Here, Cueball is developing a language where the only way to differentiate variables is to write the letter "X" in different fonts. Typically, code is written in plain text without a way to specify a font, which would mean that Cueball has implemented a lot more processing in the compiler or IDE in a fashion typically seen as unconventional. This 'feature' would be a nightmare to program with, as all of the variables would look very similar unless careful attention is being paid, and there would be little to no way to determine what each one does, since font names are typically not particularly descriptive. Additionally, the fact that some fonts look similar (such as Arial and Helvetica) would require the programmer to have an intricate knowledge of different fonts and how to distinguish them from only one letter. Programs would also be difficult to edit if two programmers do not have the same fonts installed.
This is also a jab at mathematicians who are in addition to using variable names which are short and nondescript (e.g. "x"), are also "typeface sensitive" (in addition to case sensitive). In other words, one can typically find a statement involving three different "X" variables, referring to three different objects, and they are distinguished by their font and case.
The title text references the fact that most IDEs use a monospaced font (i.e. one where every character is the same width), as opposed to variable-width fonts, in which some characters like 'I' are narrower than others. This is partly because fixed horizontal alignment is sometimes useful when dealing with certain text strings.
'Variable-width variables' refers to the fact that the letter X, like all letters, has different widths in different fonts. This would make this fixed alignment almost impossible, thus creating yet another reason why Cueball's language would be highly unpleasant to use. It likely also directly (mis)refers to systems such as variable-width encoding in which the data linked to in a variable storage is packed into an unfixed number of bits and/or bytes. Such systems often use Huffman-type encoding to progressively differentiate, from the initial elements, how many more elements are needed to fully define the value, but a reserved deliminating value marking the end of a cummulative arbitrary-length array might be considered another form.
Transcript
This transcript is incomplete. Please help editing it! Thanks. |
- [Cueball holds a laptop with code visible on the screen.]
- Cueball: I've developed a new programming language!
- Offpanel voice: Didn't a judge order you to stop doing that?
- [In a frameless panel, Cueball holds the laptop with one hand and types on the keyboard.]
- Cueball: Higher court threw out the ruling!
- Cueball: I'm back, suckers!
- Offpanel voice: Dammit.
- [Cueball holds the folded down laptop at his side.]
- Cueball: But I promise it's good this time!
- Cueball: Just normal code. Good clean syntax. Nothing weird.
- Offpanel voice: Okay...
- [Cueball holds the laptop at his side, and raises a finger on his other hand.]
- Cueball: Except the only variable name is "X". To refer to different variables you have to write "X" in different fonts.
- Offpanel voice: I'm calling the court.
- Another offpanel voice: Maybe we can appeal.
Discussion
id certainly use that language lol (172.69.70.101)
-- haXkell is a X-based dialect of haskell
X :: Integer -> Integer
X 0 = 1
X X = X * X (X-1)
Capncanuck (talk) 02:35, 21 May 2020 (UTC)
https://esolangs.org/wiki/X isn't taken. --Blacksilver (talk) 02:40, 21 May 2020 (UTC)
- It has been taken as expexted. 108.162.245.69 05:24, 18 June 2022 (UTC)
Some unique looking variable names would be X and x in the fonts Webdings, Wingdings, Wingdings 2, and Wingdings 3.
They are respectively as follows:
X
x
X
x
X
x
X
x --Dstrube (talk) 02:49, 21 May 2020 (UTC)
- This comment is quite uninformative to someone who doesn't have those fonts installed. Angel (talk) 09:57, 21 May 2020 (UTC)
As well as esolangs, among which I would consider the likes of Whitespace and b****fuck as potential inspirations, I think I'm also minded of TempleOS and its creator as vaguer but possibly still related influences... 162.158.158.163 03:28, 21 May 2020 (UTC)
- I find it ironic that you censored the word "brain" but left in the word "fuck".
- ProphetZarquon (talk) 16:09, 21 May 2020 (UTC)
I added an explanation of what a variable is and why it's bad to have every one named X. It's pretty rudimentary though, hope someone more experienced than me will improve it. Goodbye, world! (talk) 04:39, 21 May 2020 (UTC)
- Forth basically doesn't use variable names. Commands operate on and consume the last number mentioned. A Forth program "1 2 3 . . ." prints 3, then 2, then 1. "2 3 + ." prints 5 I think??
- In Microsoft "Transact-SQL" you can script variables named starting @ and temporary objects starting #. I promise I try to resist naming objects @ or # and especially if @ or # is going to be a different object in each program... or is not. And if someone else needs to reads this (and I don't want to punish them). Not to mention "@ " for instance. Robert Carnegie [email protected] 141.101.98.54 09:21, 21 May 2020 (UTC)
Psh you're all chicken. Chicken chicken chicken.
[Language where you can have return keyword in a if condition],
[Language that uses unicode symbols for built_in operators],
[Language, I have no words to describe],
and this this X thing is winning so far...
162.158.89.139 06:35, 21 May 2020 (UTC)
- Yeah, but C++ does that shit either unintentionally or at user demand (although, to be clear, I'm not saying it's any good; C++ and Java are possibly the worst programming languages in terms of shoddy design). The X programming language is just the designer being an asshole. 172.68.189.205 07:04, 21 May 2020 (UTC)
- Those links have nothing to do with C++/Java and you can Not do those things in C++ or Java (except an if in an assignment).162.158.92.208 08:02, 21 May 2020 (UTC)
- Those look like pretty sane language features; just looks weird because of the Eliza effect; those keywords don't behave like you'd expect them to based on experience of other languages. In the first example, you can certainly do that in Perl using "if (defined wantarray)"; it's just unusual (but comprehensible) to name the keyword "return". What language is that? Angel (talk) 09:57, 21 May 2020 (UTC)
- Language is called ShapedLikeItSelf, but it currently has no runner. Documentation is just of images like these on discord server.
- [This is link to it] if you are intersted. 162.158.89.19 10:19, 21 May 2020 (UTC)
Did Randall refer to this comic? https://xkcd.com/1537/ I vaguely remember another one about an esoteric language. Is there a category of programming languages on explainxkcd?
Am I the only one that tried fiddling the CSS on the page to see if the X would change? Spoiler -> It didn't. Xseo (talk) 08:54, 21 May 2020 (UTC)
If X is the only variable name, can it be omitted? For example, writing a single-argument function name in a different font to imply which X should be treated as its argument. And that gets me wondering how the source is stored; will the IDE allow use of fonts not installed on your system? Will the compiler fail if it can't find the font, requiring you to track down all of the fonts a developer used in order to compile their code? And what would be the legality of mixing open-source code and proprietary fonts? Angel (talk) 09:57, 21 May 2020 (UTC)
"… and array indices start at 8, because anything smaller than that would be unreadable." Angel (talk) 10:00, 21 May 2020 (UTC)
Who is going to implement this first??108.162.216.122 13:03, 21 May 2020 (UTC)
Hey guys what coding language did he do to almost be arrested? 162.158.187.139 14:18, 21 May 2020 (UTC)Anonymous
- Well, I've got this one with just four operands, everything's a relative address in 4-cored circular memory and there's no paractical differentiation between the packed opcodes, addresses and data (or their 2-bit lower-limit boundaries) when operated upon from elsewhere. Everything suggests it should be be Turing-complete. 162.158.155.242 11:47, 22 May 2020 (UTC)
Isn't the fixed vs variable width a pun on the variable's internal size, eg. a 64-bit integer [fixed width) vs a string (variable width) ?
I sure hope this new language at least supports indexed tuples. If so, that wouldn't be so bad, unless for some reason I needed more than one tuple in the same scope.Whiteheadw (talk) 23:01, 21 May 2020 (UTC)
Harrumph. I'm sticking with LOLcode http://www.lolcode.org/ and thats an end of it. Cellocgw (talk) 14:03, 22 May 2020 (UTC)
Is this a continuation of the Code Quality series? TomW1605 (talk) 14:05, 22 May 2020 (UTC)
I'm not sure that this: "ℝ denotes the set of natural numbers, and is distinct from R" is strictly true. The way I was taught is that boldfaced R does stand for the real numbers, except when it doesn't, and blackboard-bold ℝ (and Q, and C, and Z) are just what you write on the blackboard since it's impossible to make a clear boldfaced R with chalk. Not that the main point doesn't stand--too many circumstances where plain P, bold P, italic P, and fancy curly script P all mean different things. 162.158.62.105 18:57, 22 May 2020 (UTC)
- Blackboard Bold isn't a reliable convention but, generally, N is the set of naturals, R reals. https://en.m.wikipedia.org/wiki/Blackboard_bold 172.68.143.30 20:32, 22 May 2020 (UTC)
And to continue on the "jab at mathematicians" line of thought... Either the recently mentioned P's or an "a vs alpha" (a in the Symbol font) or something similar might make better examples than that N in #Explanation... -- 162.158.19.37 16:41, 23 May 2020 (UTC)
A few ago it was Java and C++. And Xul. And JavaScript. And VB. And VB.Net. And C#. And Kotlin And M4. And Lua. And Python2. And Python3. And Perl. And PHP. And Typescript. But now everyone creates their own programming language => Perhaps we should make another law against introducing non-weird programming languages, too. Gunterkoenigsmann (talk) 07:12, 24 May 2020 (UTC)
This comic was tweeted by Guido van Rossum (creator of Python), and apparently this is legal Python since PEP 3131! Divieira (talk) 19:53, 26 May 2020 (UTC)
This is the only comic I have Noticed where the title is shorter than the number, Also You cold have upper and lower case X.
Gunterkoenigsmann (talk) 07:57, 09 Jun 2021 (UTC)
- If you scroll through the archive you'll find plenty of 3-letter titles, many of these belonging to 4-digit comics. --Lupo (talk) 13:03, 10 June 2021 (UTC)
Is Twitter being rewritten in this language? 172.68.174.174 14:50, 16 September 2023 (UTC)