473,799 Members | 2,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

White space at the end of a line

I'm thinking of adding a command to vim for removing
white space from the end of each line of a C source
file. Can anyone think of a situation where such white
space might be useful ?
Dec 3 '07 #1
15 2830
On Dec 3, 7:52 pm, Spiros Bousbouras <spi...@gmail.c omwrote:
I'm thinking of adding a command to vim for removing
white space from the end of each line of a C source
file. Can anyone think of a situation where such white
space might be useful ?
//\<no-space>
printf("Never called!\n");
//\<space>
printf("Called! \n");
Dec 3 '07 #2
In article <a8************ *************** *******@e1g2000 hsh.googlegroup s.com>,
<vi******@gmail .comwrote:
>I'm thinking of adding a command to vim for removing
white space from the end of each line of a C source
file. Can anyone think of a situation where such white
space might be useful ?
>//\<no-space>
printf("Neve r called!\n");
//\<space>
printf("Called !\n");
He said "useful", not "obfuscatin g"!

-- Richard
--
"Considerat ion shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Dec 3 '07 #3
On Dec 3, 5:58 pm, vipps...@gmail. com wrote:
On Dec 3, 7:52 pm, Spiros Bousbouras <spi...@gmail.c omwrote:
I'm thinking of adding a command to vim for removing
white space from the end of each line of a C source
file. Can anyone think of a situation where such white
space might be useful ?

//\<no-space>
printf("Never called!\n");
//\<space>
printf("Called! \n");
I wouldn't call a construct like

//\<no-space>
printf("Never called!\n");

useful. But thanks for the suggestion.

Dec 3 '07 #4
On Mon, 3 Dec 2007 09:52:17 -0800 (PST), Spiros Bousbouras
<sp****@gmail.c omwrote:
>I'm thinking of adding a command to vim for removing
white space from the end of each line of a C source
file. Can anyone think of a situation where such white
space might be useful ?
Consider

#define foo \<space>
#define foo \<no_space>

The behaviours are different.

Richard Harter, cr*@tiac.net
http://home.tiac.net/~cri, http://www.varinoma.com
In the fields of Hell where the grass grows high
Are the graves of dreams allowed to die
Dec 3 '07 #5
On Mon, 03 Dec 2007 18:49:22 GMT, cr*@tiac.net (Richard Harter) wrote:
>On Mon, 3 Dec 2007 09:52:17 -0800 (PST), Spiros Bousbouras
<sp****@gmail. comwrote:
>>I'm thinking of adding a command to vim for removing
white space from the end of each line of a C source
file. Can anyone think of a situation where such white
space might be useful ?

Consider

#define foo \<space>
#define foo \<no_space>

The behaviours are different.
What Richard Tobin said.

--
Al Balmer
Sun City, AZ
Dec 3 '07 #6
Spiros Bousbouras <sp****@gmail.c omwrites:
I'm thinking of adding a command to vim for removing
white space from the end of each line of a C source
file. Can anyone think of a situation where such white
space might be useful ?
As others have said, the example presented by vippstar isn't what I'd
call *useful*, except perhaps to determine which programmer to fire.

Before I saw that example, I would have guessed that there's no case
where trailing white space is significant. One exception, sort of, is
that a line-joining \ can't be followed by white space (which is a
dumb rule IMHO), but in that case the white space makes the program
illegal.

However, depending on what text editor you use, it might be convenient
to have blank lines indented by the same amount as the non-blank lines
surrounding them. For example (end-of-line marked with '$'):

int x;$
$
x = 42;$

vs.

int x;$
$
x = 42;$

It makes no difference to the compiler, of course,

--
Keith Thompson (The_Other_Keit h) <ks***@mib.or g>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Dec 3 '07 #7
rich...@cogsci. ed.ac.uk (Richard Tobin) wrote:
<vipps...@gmail .comwrote:
I'm thinking of adding a command to vim for removing
white space from the end of each line of a C source
file. Can anyone think of a situation where such white
space might be useful ?
//\<no-space>
printf("Never called!\n");
//\<space>
printf("Called! \n");

He said "useful", not "obfuscatin g"!
This isn't useful either...

puts("Something with a \\<space>
to illustrate a point.");

--
Peter
Dec 3 '07 #8
Spiros Bousbouras wrote:
>
I'm thinking of adding a command to vim for removing white space
from the end of each line of a C source file. Can anyone think of
a situation where such white space might be useful ?
Yes.

--
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home .att.net>
Try the download section.
--
Posted via a free Usenet account from http://www.teranews.com

Dec 3 '07 #9
On Mon, 03 Dec 2007 09:52:17 -0800, Spiros Bousbouras wrote:
I'm thinking of adding a command to vim for removing
white space from the end of each line of a C source
file. Can anyone think of a situation where such white
space might be useful ?
I can't, but of course a danger with such file modifications
is that (some) source control systems/patchers might be fooled into
thinking you had made many changes, for which others working
on the same code might not thank you.
Dec 4 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
16175
by: Grumble | last post by:
Hello all, I want to read lines from a text file, where each line has the following syntax: token1:token2:token3 There could be white space between tokens and ':'
17
9132
by: Stanimir Stamenkov | last post by:
Is it possible to make two inline elements to appear adjacent stripping any white space appearing in between in the source? Example: <span class="adj">1</span> <span class="adj">2</span> <span class="adj">3</span> --
5
12351
by: Applebrown | last post by:
Hello, basically, I'm just learning intermediate CSS and trying to convert my old table webpage completely to CSS. Hoorah, right? Well, it's not quite going as planned. It's an extremely simple layout, and I'm finding myself stuck with small white space in between my images where I planned for the graphics to be stacked up right on top of one another. Here's the simple vertical layout: width is 640px, centered with a CSS border. I'd...
0
15192
by: Mark Moore | last post by:
I'm trying to layout a couple text input fields and their corresponding labels without using a table. When I was trying to debug my understanding of CSS, I was *very* surprised to see that span's with borders behave counter-intuitively (IMHO) when using style="white-space: nowrap;". Below is a fairly small chunk of XHTML that demonstrates what I'm talking about. What gives? -Mark
5
718
by: Michael Shell | last post by:
Greetings, Consider the XHTML document attached at the end of this post. When viewed under Firefox 1.0.5 on Linux, highlighting and pasting (into a text editor) the <pre> tag listing will preserve formatting (white space and line feeds). However, this is not true when doing the same with the <code> tag listing (it will all be pasted on one line with multiple successive spaces treated as a single space) despite the fact that...
38
24010
by: Xah Lee | last post by:
sometimes i wish to add white space in <p> as to achived effects similar to tab. what should i do? using empty image seems the sure way but rather complicated. (and dosen't change size with font) Woudl some of the space character in unicode work? (my html files uses unicode) Xah
12
7225
by: JA | last post by:
Is there a way to remove all the white space in the fields? I have been using Find-and-replace - looking for 2 or 3 or 4 or 10 spaces and replacing them with none. I don't want to replace single spaces, those are the spaces between the words. But most of what is in the fields has been cut-n-pasted from online forms, and the results can be VERY spread out. I could probably save 80% of the space if I could get rid of the extra white space....
12
4574
by: snow | last post by:
Hi All, I noticed if file path has a white space, for example "C:\my document \test.txt", the function File.Exists(filePath) always return false in release mode. How could I make this function work for the file which is located in a direcotry with a white space? Thanks!
5
2577
by: Richard Maher | last post by:
Hi, Can someone please show me how to tell Firefox to preseve white-space when returning the selectList.option.value attribute? I have change the style so that the white-space is preserved on the screen, but for some bizarre reason when I try to substring out a series of bytes (aka a fixed-length string or field) from a given option it squashes everything up and corrupts the result.
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10268
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10247
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10031
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9079
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7571
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.