White Space Wars

WhiteSpace.jpg

To make the picture I found a manual typewriter in storage. I wound the ribbon to find a place with some wet ink. I then typed the term "White Space War!" which I will examine at the end of the post.

Motivation for this Post

The Learn to Code Tribe recently launched the BYTE Token to reward users for posts about computer code.

I've participated in many coding forums in my day and was looking forward to launch of the tribe but, as the launch date approach, I began dreading the idea of talking code in public.

I've had good and bad experiences.

My favorite forum was CompuServe. CompuServe was a pre-Internet forum designed for slow modems.

CompuServ was founded in 1969 as a time-sharing service for Golden United Life insurance. They began offering a dial-in information service in 1979.

With CompuServe one would connect via a 1200 BAUD modem and download a branch of a forum.

BAUD means bits per second. So 1200 BAUD would download 150 words per second.

So, I would wait in anticipation then eagerly read all of the posts for the day.

Users would write their posts offline. Edit for brevity and upload.

The first forums I used were hosted by people trying to figure out the computers that they just purchased and the forums were magical. They were filled with useful information.

I noticed that, as forums aged, the forums would start becoming terse. Many of the once helpful people devolved into trolls who would snap at newbies for the same mistakes that they had made only months before.

NOTE: People in the academic world used a service called "Usenet" which was started in 1979 ... the same year as CompuServe. Usenet was restricted to government, military and education use. When the public at large gained access to the forum, it had already become quite terse. There was a huge amount of spam and people from the business world weren't welcome.

By the late 1990s, most of the forums I had used had become toxic. Even worse many forums became political. For example, some of the people who learned Object Oriented Programming became attacking those who used traditional languages and databases as "legacy coders."

IMHO: Different coding styles have different strengths and weaknesses. I love Relational Database Design. It is a solid, proven technology. I like the versatility of OOP, but it does not provide the solid data structure that companies need.

I designed Object Oriented interfaces for relational databases.

Sadly, many people in the OOP world became vicious toward the database design community. I watched people in OOP destroy companies because they did not like the database.

Sadly, we see the same attitudes on HIVE. People claim that Web3.0 will completely overshadow and reduce Web2.02 and Web1.0.

Different technologies have different strengths.

In my opinion, coders should learn different technologies because different technologies have different strengths.

The forums I followed gradually veered away from teaching code into polemics about different platforms. They went from helpful to being terse.

Why were they doing this?

I slowly stopped participating in coding forums.

I've spent the last few weeks reading coding forums and tutorials. Some of the forums have good content. However, I still encounter some of the hostility that ruined my favorite coding forums.

The White Space Wars

I was trying to find a way to discuss political conflicts in the programming world that didn't focus on code examples. It dawned on me that the best subject for this discussion is "white space."

Or, is the word "whitepace"?

There was an effort to remove the space between white and space during the 1990s as we can see in this Google ngram:

wspace.jpg

In the written world, "white space" refers to the blank areas on a page.

White space has a dramatic effect on the appearance of a page.

Proper use of white space can help people focus on important parts of a page. It is not uncommon for businesses to develop standardized templates for forms. People who interface with the legal community want their documents to look like the other legal documents. This simplifies the handling of the documents.

When one designs a template, one considers the white space of the template.

There are people in every industry who take the format of the documents in their industry seriously.

If you were a trucker then you would want logs that inspectors understand.

White Space in Mathematics

White space plays a role in academics.

Mathematicians love to write formulas on the chalkboard. It is not uncommon to center proofs around the equal sign. It is standard to use a 2D layout for fractions. Mathematicians like to put the numerator above the denominator with a line between the two.

They like to write powers in superscript. Some symbols like the integral put the parameters for the integral on different lines.

While mathematicians pretend that they value logic over appearance, The classical mathematical equation is a highly stylized affair.

The white space in traditional mathematical formulas often convey meaning. While mathematicians pretend that they deal exclusively with abstract logical concepts. The written formulas in mathematics are complex structures dependent on white space.

It is difficult to layout mathematical formulas. Attempts to create a common structure for mathematics like MathML tend to fall flat.

The War Between CRLF and LF

There have been great battles over the end of line character. Typewriters and early printers used two functions to start a new line. The line feed operation advances the roller a notch. The carriage return operation moves the print carriage to the beginning of a line.

A line feed usually takes less energy than a carriage return. So, most traditional typewriters performed the line feed first and carriage return second. The typewriter I used has a little arm on the carriage. Pushing the arm lightly feeds a line. Pushing hard feeds a line then pushes the carriage to the start position.

Many computer programs ended lines with a CR then a LF. They have a different order than the standard typewrite.

It became standard for text editors in the business world to end lines with a CRLF.

Again, this seems strange to me. Typewriters go LFCR.

Microsoft DOS emerged from the IBM world. The text editors for Microsoft programs usually ended lines with CRLF.

There is no need to use two characters to end a line. UNIX and many other applications settled on using the LF character for a new line.

The tiff between MS and Unix caused some problems. It was common for users to write their code on MS. UNIX programs wouldn't know what to do with the extra character.

Competing formats could wreak havoc on fixed length data files.

Lines edited by DOS programs would have one more character than those written on UNIX.

Word Wrapping

I probably should mention. Typing paper is fixed width. One could only get about 70 to 80 characters on a line.

Old style typewriters would ring a bell as the end of line approached. One would end the word, then hit the carriage return. If the word was long, one would reach the end of a syllable, type a hyphen and hit the carriage return bar.

A long typewritten paragraph would have multiple LFCR breaks. The LFCR breaks did not symbolize the logical end of a paragraph. They simply indicated that the typewriter ran out of space.

Your web browser will add line breaks to format the paragraphs I write for your screen.

Variable Length Fonts

Typesetters took a completely different approach to white space. Publishers saw a page as two dimensional space and took a completely different approach to laying out pages.

While the computer industry used fixed space fonts, typesetters used different font sizes for headers and used variable length fonts for words. Typesetters had radically different approach to the page than typewriters.

White Space in Computer Languages

People in the programming world use the term white space for non printable characters. There are a number of characters like the space, line feed, carriage return and tab which move the head of the printer but that do not lay any ink on the page.

Proper use of white space can help clarify programming structures. For example, it is common for programmers to indent blocks of code.

Programmers are an ornery lot. There is a great deal of disagreement on how one should indent their code. People will argue for days about the number of spaces and tabs to use in a document. I like to use the tab character for indents. I like to set the tab stop at two spaces.

I've known programmers who set the tab stop at ten characters. They get mad at me when they look at my code.

Many people prefer to indent with a fixed number of spaces.

People who have strong feelings about white space often launch inter-office wars. I've had programs rejected because I used a different spacing schema than the main office.

Interpreting White Space

Since people assign meaning to whitespace there is often a push for programming languages to give special meaning to white space. Many languages used the end of line character to denote the end of a statement. Python and Ruby use indent levels to denote blocks.

Many developers of programming languages balk as the use of invisible characters for program control. For example, C ignores most white space characters and uses a semicolon to denote the end of a statement.

To emphasize this point Bjarne Stroustrup issued a proposal on April Fool's Day in 1998 that allowed, among other things, the ability for programmers to overload whitespace characters.

Allowing programmers to overload whitespace would lead to chaotic results.

In 2002, Edwin Brady and Chris Morris took the April Fool's prank one step further. They created the programming language "whitespace" that used only whitespace operators. A program in Whitespace would consists of tabs, spaces and line feeds.

The program would compile and do things. Whitespace is difficult for programmers that use eyeballs to read as the printed code was invisible.

A print out of Whitespace code would be a blank page ... a very difficult to debug.

Proper use of white space can help programmers read code; however, it is best to avoid using white space for logical operators.

I said that C ignores most white space characters. It treats the non-printing ASCII character 00 (aka NULL). C treats NULL as some sort of super character with magical properties.

For example, C expects all strings to end in NULL. Some standard C functions will result in memory fault errors if a string does not end in NULL.

// The pseudo code
while (str[i++] is not null) {
  // do something
}
// will break if str[] does not end in null.
// This could lead to a segment fault.
// Hackers could use the segment fault to hack your system.

C programmers need to add an extra space at the end of every string ... which is silly.

Several other white space characters like End of File can lead to strange results in C.

The Wars Over White Space Continue

Many programs use a curly brackets to symbolize the the start and end of programming blocks. Some programmers like to put the open bracket on its own line. Some people like to put it at the end of the statement that started the block.

This issue does not affect code. The placement of the curly bracket seems to affect people.

// A coder asks: Should I use 

if (condition) {
  // do something
}

// or

if (condition)
{
  // do something
}

// a war over white space erupts.

I guess it is slightly easier to follow code blocks when the bracket is on a new line. Putting the curly bracket on a new line makes the code longer, readers have to scroll through more lines of code to find the end bracket. It's sixes to me.

If you enter the programming world; you are likely to encounter people who have strong opinions about minor formatting issues.

The best course of action is to follow the conventions of your coworkers and to avoid becoming a whitespace troll.

WhiteSpace Affects Hashing

Computer programs often interface with other computer programs. Some code repositories record a file hash. The hash looks at each character in a file and adds up the characters, including the white space, and produces a number.

If you recalculate the file hash and it has changed, then you have cause for concern.

There are programs, and people, that automatically reformat the white space.

When they do this they change the hash, which raises a warning.

Again, I bring up the fact that MicroSoft and Unix had different line endings. Simply opening a file in a different operating system could affect the length of the file.

Conclusion

There are numerous ways to solve any given problem.

Unfortunately, people are prone to argue about the best way to solve the problems. Many of the arguments are about form and not substance.

I thought that a discussion about white space might be a good opener as people have been dealing with the issue of white space since the dawn of writing.

One should always follow best practices. However, many of the practices are about appearance and not substance.

Consistently formatted documents are easier to follow. The best course of action is to follow the coding convention of one's employer. One should avoid becoming emotionally attached to a format style.

When learning code, it is best to learn different styles. This way you will be able to adjust to whatever style your employer prefers.

People will judge you for stupid things like the number of spaces used for indents. I really don't know what to do in those cases.

Styles change with time. So, I did some research on white spaces since this has been a preoccupation of scholars for several millennia.

I asked Night Cafe for an image of a lady dancing with a typewriter for this post.

whitedance.jpg



0
0
0.000
5 comments
avatar

I have tried to convince the Ğ1 community to use Hive instead of a centralized forum for years, but without any success. I will try again to convince Ğ1 coders to use the Codetolearn community, but you know sometimes people are reluctant to new good ideas and they prefer to go on with well known solutions, even if they aren't as good as innovations, for psychological reasons which are difficult to understand.
https://g1currency.org/?PagePrincipale

0
0
0.000
avatar

That looks like an interesting project.

Sadly, I think that G1 should avoid HIVE like the plague.

G1 wants to create an honest currency that avoids debt.

HIVE has chosen to make the 20% interest on HBD (aka debt) the primary focus of the platform.

!WINE

0
0
0.000
avatar

Different technologies have different strengths.

In my opinion, coders should learn different technologies because different technologies have different strengths.

Wise words! People often choose conflict, even if it is always collaboration what really helps building a better future.

Curated with @arc7icwolf.byte for the #LearnToCode community.

0
0
0.000