DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

White Space or Not, That's the Question

Erich Styger user avatar by
Erich Styger
·
Oct. 07, 12 · Interview
Like (0)
Save
Tweet
Share
3.63K Views

Join the DZone community and get the full member experience.

Join For Free

there are times when i want to know *exactly* what is inside my source files. in my article on ehep explains how to get down to the hex bytes of a source file. but in many cases i’m interested to see the non printable/white characters only. showing white spaces in the sources is easy in eclipse: i use the ‘ show whitespace characters ‘ toolbar icon:

show whitespace characters

show whitespace characters

in case that icon is not present in the tool bar, here is how to show it in the toolbar. i use the menu window > customize perspective and enable it:

enabling show whitespace for toolbar

enabling show whitespace for toolbar

i happens to me when i integrating sources from somebody else, that it looks like this: a lot of bytes wasted with white spaces. not that i’m worried by the disk space used (we have plenty of disk space these days), but these spaces are simply not needed.

trailing white spaces in source file

trailing white spaces in source file

remove them by hand? create a regular script expression to have them removed? nope!

as in my post on anyedit , there is a plugin which allows advanced editor manipulations, including removal of white spaces. but there is anther way for removing trailing white spaces. eclipse has an option for that: i go to window > preferences > c/c++ > editor > save actions :

save action to remove trailing white spaces

save action to remove trailing white spaces

here i can select the option to remove trailing whitespace . additionally an option ensures that there is always a newline at the end of the file. and my source files are clean! :-)

:!: warning: this ‘save action’ option does *not* work in eclipse 3.6 version (which is in codewarrior for mcu10.2). but it *does* work in eclipse 3.7 which is part of mcu10.3 :-)

happy spacing :-)

Space (architecture)

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Web Application Architecture: The Latest Guide
  • Top 5 PHP REST API Frameworks
  • Artificial Intelligence in Drug Discovery
  • Three SQL Keywords in QuestDB for Finding Missing Data

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: