This is a good question albeit one with a boring answer. Different systems evolved different encodings for newlines in the same way they evolved different behavior for myriad other things: Each system had to standardize on something and interoperability in the days before email let alone the Internet was unimportant.
There are several ways to represent newlines. ASCII-based systems use some combination of carriage return and line feed. These derive from typewriters: A carriage return (CR) resets the typewriter carriage’s horizontal position to the far left and a line feed (LF) advances the paper one vertical line. For a typewriter, you need both, so some systems (DOS, Windows, Palm OS) adopted CR+LF as representation of a newline. Other systems, such as Unix, noted a computer didn’t have a carriage to return so a sole line feed was sufficient. Still others, such as Mac OS prior to OS X, adopted only a carriage return—arguably, this choice doesn’t make any sense, as a bare carriage return would swing the typewriter carriage back to the left but not advance the page. Still other systems used LF+CR, inverting the ASCII characters used in Windows.
Systems not based on ASCII, of course, did their own thing. IBM mainframes built around EBCDIC, for example, used a special newline character (NL). Perhaps oddest of all, VMS utilized a record-based filesystem where newlines were first-class citizens to the operating system. Each record was implicitly its own line and thus there were no explicit newline representation!
But none of this mattered, because these systems never had to interoperate with each other—or, if they did, they had to make so many other conversions that newline representation was the least of their worries.
Today, most Internet protocols recommend CR+LF but dictate compatibility with LF (CR and LF+CR are left out in the cold). Given the centrality of the Internet, the ubiquity of Unix, which heralds LF, the primacy of C and descendant languages, which (somewhat) map their newline to LF, and the fact we really only need one character to represent a newline, LF seems the clear standard going forward.
Tag archives for history
Since the fall of the Soviet Union in 1991, there have been 1,896 terrorist attacks in Russia, excluding the latest two bombings in Volgograd on Sunday 29 and Monday 30 December.
By Leonid Mamchenkov
Mikhail Kalashnikov, the designer of the world famous AK-47 assault rifle, has passed away today, at the age of 94. He was a true genius and a patriot of his country. Coming from a very simple family, with very little education, after serving as a tank mechanic and later as a tank commander, after being wounded, he designed more than 150 models of small weapons – rifles, assault rifles, machine guns, etc.
Blame the Nazi Germans for making me become a gun designer … I always wanted to construct agriculture machinery.
Such were the times, I guess – growing up in the post Civil War, Revolution and First World War country, serving during the Second World War and seeing all horrors and dangers first hand, his peaceful mind was turned the other way.
I’m proud of my invention, but I’m sad that it is used by terrorists … I would prefer to have invented a machine that people could use and that would help farmers with their work — for example a lawn mower.
Looking into his engineering genius, I see the good old principle of keeping things simple:
When a young man, I read somewhere the following: God the Almighty said, ‘All that is too complex is unnecessary, and it is simple that is needed’ … So this has been my lifetime motto – I have been creating weapons to defend the borders of my fatherland, to be simple and reliable.
Truly inspiring. RIP.
As he entered the Salon Carré, the thief headed straight for the Mona Lisa. Lifting down the painting and carrying it into an enclosed stairwell nearby was no easy job. The painting itself weighs approximately 18 pounds, since Leonardo painted it not on canvas but on three slabs of wood, a fairly common practice during the Renaissance. A few months earlier, the museum’s directors had taken steps to physically protect the Mona Lisa by reinforcing it with a massive wooden brace and placing it inside a glass-fronted box, adding 150 pounds to its weight. The decorative Renaissance frame brought the total to nearly 200 pounds. However, only four sturdy hooks held it there, no more securely than if it had been hung in the house of a bourgeois Parisian. Museum officials would later explain that the paintings were fastened to the wall in this way to make it easy for guards to remove them in case of fire.
By Leonid Mamchenkov
inMotion Hosting runs the article “WordPress through the ages“, which shows in a number of screenshots how WordPress user interface has changed from version to version. It is a long run indeed, and the one that brings a nostalgic tear to those of us who have been using the system for a while. Just look at how much it has changed, how much it has matured. From this in WordPress 1.0.1:
to this in the latest and the greatest WordPress 3.8:
I don’t think that there is a single item that was left untouched. Main menu has been reorganized a number of times, moved from top to the left, given sub-menu items, icons, and a variety of different fonts and colors. The editor has been through a tonne of transformations, adding the What You See Is What You Get (WYSIWYG) feature, icons, HTML preview, media uploader, which is a story of itself, and more. Custom post types are a fresh addition, but even they went through a bit. So did all the other elements – social networks integration, publishing options, categories, SEO, and more. And that’s just the post editing screen. As much or more has happened to the rest of the screens. Being redone in responsive layout, ready for smartphone and tablet screens comes to mind.
All these changes happened for a variety of reasons. Of course, people building WordPress learned better ways, got more feedback, and spent more time on it. But also the Web itself has changed. We are seeing faster networks, more powerful browsers, and richer interfaces.
Which brings me to another point. Pretty much every single time I was involved in building a website or an application, a non-technical client would raise the question of deadlines and phrase it like “When is this going to be finished?”. And every single time I have to explain that applications and websites they are not finite. They are more like kids – once you start, you never stop. It’s an ongoing project, with more and more features, fixes, and improvements. (There are exceptions, of course, but they are just that – exceptions). Most times, it’ll never be done. And one can’t just put everything into a single version, release it and forget about it. Instead, one should make a plan, a roadmap and decide what goes into each version, leaving some space and time for things that were unthoughtful at the time.
WordPress, like may other awesome applications, illustrates this nicely. WordPress 1.0 has been released and has been used by a lot of people. Was it done? No. More changes came in during 1.x, 2.x, and now 3.x version series. Is it done now? No, not by a mile. It is a much better system than it used to be. But there are still gazillion things to be done. And that’s a good thing! I wish such a lengthy (and successful) roadmap to every project.
And now, if you’ll excuse me, I’ll go back and drop that nostalgic tear of days gone by…
By Leonid Mamchenkov
Here is a excellent Quora question: how many lines of code, if any, from Linux 1.0 are still in the modern Linux kernel, and what is it? And an evenly excellent answer:
According to git diff, 21228 of the 176250 lines from Linux 1.0 (1994-03-14) are still present in Linux 3.12 (2013-11-03):
$ empty_tree="$(git mktree < /dev/null)" $ git diff --shortstat "$empty_tree" 1.0 561 files changed, 176250 insertions(+) $ git diff --shortstat -M -l99999 1.0 v3.12 44905 files changed, 17702349 insertions(+), 155022 deletions(-)
Over half of these lines are blank or consist entirely of punctuation; only 10419 of them have at least one letter or number.
We can go back even farther to the very first public release, Linux 0.01 (1991-09-17). Of the 10239 lines in Linux 0.01, 954 survive in Linux 3.12, of which just 242 have at least one letter or number. 123 of them were structs and constants in include/a.out.h (now include/uapi/linux/a.out.h), and 26 of them were the S_* macros in include/sys/stat.h (now include/uapi/linux/stat.h). The rest were scattered through 24 other files with at most 9 lines each.
It might appear that not much. But it is in fact impressive. How much code have you written that survived for over 20 years in a project that has changed so much – from a hobby experiment to a dominant operating system across servers, mobiles, and embedded devices?
- The average top 1,000 web page is 1575 KB.
- More than half of this page size is due to images.
- Flash is on the decrease. Custom fonts are on the increase.
By Leonid Mamchenkov
Here is a nice collection of old websites that were abandoned, but still work. Most of these were last updated in mid-90′s. And, though I haven’t seen most of them back in the day, the overall atmosphere and common elements of those time bring a nostalgic tear to my eye.
Off the whole selection, my obvious favorite one is Internet Explorer is EVIL! of course. Back in 1998, 15 years ago, way before any of the modern Web 2.0 or whatever version we are running now, some people knew the truth and were not afraid to say it. In the most expressing matter – including satanic stars, fires of Hell, and a face image of Bill Gates.
Some things never change …