Talk:C (programming language)/Archive 3: Difference between revisions

Content deleted Content added
refactor archives to address length concerns
 
MalnadachBot (talk | contribs)
m Fixed Lint errors. (Task 12)
 
Line 28:
:I don't believe the image portrays anything particularly unique to the C language. You can achieve the same result by misusing pointers in Pascal or assembly, for example. Also, the submitted image seems to be illustrating a crash inside a virtualised DOS window running Turbo C, however modern day operating systems won't let you write directly to video memory from userland, so the image isn't a common depiction of what would happen after a C program has crashed, assuming the article needs one. See [[Crash (computing)]]. [[User:Ozzmosis|ozzmosis]] 13:15, 29 January 2006 (UTC)
 
:: Me, I quite liked the image. It reminded me immediately of a spectacular bug which (A) I perpetrated 20 years or so ago, and which (B) occured under Unix. I was trying to add visual attributes ('''bold''', <font color=whitespan style="color:white; background:black">inverse video</fontspan>, <u>underline</u>, etc.) to a full-screen, emacs-like editor I was writing, and I was trying to save memory by doing it with 4 bits per character cell, or two character's worth of attributes per stored byte. Naturally this involved some concise, cryptic pointer manipulations, and naturally I got it wrong at first. The etiiology was different than Camillus's, though: instead of scribbling on screen memory (which this editor didn't use; it was doing everything with ANSI escape sequences sent down the RS232 wire to a terminal), I had accidentally used a random pointer as the source of my array-of-nybbles screen attribute overlay. The rest of the code actually worked perfectly, displaying the proper underlying text, but with each individual character cell receiving <b><u><font color=whitespan style="color:white; background:gray">o</fontspan></u></b><font color=whitespan style="color:white; background:gray">n</fontspan><fontspan colorstyle="color:gray;">e</fontspan> <b><u>o</u></b><b><u><fontspan colorstyle="color:gray;">f</fontspan></u></b> <u>1</u><b><u><font color=whitespan style="color:white; background:black">6</fontspan></u></b> <fontspan colorstyle="color:gray;">d</fontspan><b><u>i</u></b><font color=whitespan style="color:white; background:gray">f</fontspan><b><u><font color=whitespan style="color:white; background:black">f</fontspan></u></b><fontspan colorstyle="color:gray;">e</fontspan><b><u><fontspan colorstyle="color:gray;">r</fontspan></u></b><u><fontspan colorstyle="color:gray;">e</fontspan></u><font color=whitespan style="color:white; background:gray">n</fontspan><u><font color=whitespan style="color:white; background:black">t</fontspan></u> <fontspan colorstyle="color:gray;">r</fontspan><b><u>a</u></b><u><font color=whitespan style="color:white; background:black">n</fontspan></u><b><u><fontspan colorstyle="color:gray;">d</fontspan></u></b>o<b>m</b> <b><u><fontspan colorstyle="color:gray;">c</fontspan></u></b><b>o</b><b><fontspan colorstyle="color:gray;">m</fontspan></b><b><font color=whitespan style="color:white; background:gray">b</fontspan></b><fontspan colorstyle="color:gray;">i</fontspan><b><font color=whitespan style="color:white; background:black">n</fontspan></b>a<b><font color=whitespan style="color:white; background:black">t</fontspan></b>i<b><u><fontspan colorstyle="color:gray;">o</fontspan></u></b><b>n</b><b><font color=whitespan style="color:white; background:gray">s</fontspan></b> o<b><u><font color=whitespan style="color:white; background:black">f</fontspan></u></b> <font color=whitespan style="color:white; background:black">a</fontspan><b><font color=whitespan style="color:white; background:gray">t</fontspan></b><u>t</u><b><font color=whitespan style="color:white; background:gray">r</fontspan></b><b><u><font color=whitespan style="color:white; background:gray">i</fontspan></u></b><b><u><fontspan colorstyle="color:gray;">b</fontspan></u></b><b><font color=whitespan style="color:white; background:black">u</fontspan></b><u><font color=whitespan style="color:white; background:black">t</fontspan></u><b><font color=whitespan style="color:white; background:gray">e</fontspan></b><b><u>s</u></b>. It was a marvelous piece of screen confetti, and it ended up being a nice affirmation of the fact that the rest of my attribute-rendering code was robust and properly general.
 
:: No, Camillus's image is not of a particularly common, specific consequence of a pointer error, nor are these errors unique to C, but it ''is'' a plausible consequence, and it is certainly a vivid, demonstrative, accessible image, particularly for the novice or non-programmer. As [[User:Deco|Deco]] notes, it's hard coming up with images for programming-related concepts, and I think we ought to celebrate the fact that we've actually got a half-decent one here. [[User:Ummit|Steve Summit]] ([[User talk:Ummit|talk]]) 16:30, 29 January 2006 (UTC)