Spaces in Paths

This is an update of the previous post originally created on April 20, 2016.

A number of readers have recently written me about an error they see when attempting to compile or execute an application or script in books such as, C++ All-In-One for Dummies, 4th EditionBeginning Programming with Python For Dummies, 2nd Edition, Python for Data Science for Dummies, and Machine Learning for Dummies, 2nd Edition. Development environments often handle spaces differently because they’re designed to perform tasks such as compiling applications and running scripts. When you see an error message that tells you that a file or path isn’t found, you need to start looking at the path and determine whether it contains any spaces. The best option is to create a directory to hold your source code and to place that directory off the root directory of your drive if at all possible. Keeping the path small and simple is your best way to avoid potential problems compiling code or running scripts.

The problem for many readers is that the error message is buried inside a whole bunch of nonsensical looking text. The output from your compiler or interpreter can contain all sorts of useful debugging information, such as a complete listing of calls that the compiler, interpreter, or application made. However, unless you know how to read this information, which is often arcane at best, it looks like gobbledygook. Simply keep scanning through the output until you see something that humans can read and understand. More often than not, you see an error message that helps you understand what went wrong, such as not being able to find a file or path. Please let me know if you ever have problems making the code examples in my books work, but also be sure to save yourself some time and effort by reading those error messages. Let me know if you have any thoughts or concerns about spaces in directory paths at [email protected].

C++ All-in-One for Dummies Errata on Page 188

There is a mistake on page 188 of C++ All-in-One for Dummies, 4th Edition that is based on a supposed April Fool’s prank that was actually initiated on March 26, 2018 (see https://www.modernescpp.com/index.php/no-new-new) and spread throughout the Internet to sites such as: https://www.fluentcpp.com/2018/04/01/cpp-will-no-longer-have-pointers/.  The problem with pranks, especially pranks that linger because the people who perpetuate them haven’t removed them, is that other people tend to believe them, as in this post: https://stackoverflow.com/questions/59820879/are-new-and-delete-getting-deprecated-in-c#. Later, much later, as in the note on the Fluent C++ site, people admit that it was a joke, but still leave the errant material in place.

 After I had discovered that this information was a joke, I had meant to remove two sentences from the book, but somehow they stayed intact.  The two sentences in question appear in the “Understanding the Changes in Pointers for C++ 20” section:

Readers who already know something about pointers need to be aware of the changes in pointers for C++ 20, which is why it appears first. The essential thing to remember as you move to C++ 20 (where new is deprecated) and then to C++ 23 (where new is removed) is that pointers are going to change.

If you find any other references in the book that state that new is deprecated or removed, they too will be modified or eliminated during the next printing. I apologize for any problems that the error has caused, especially to readers who are new to C++, and have submitted an errata to the publisher so that the error is fixed during the next printing. If you have any questions at all about the book, please contact me at [email protected].

Completed! Book Drawing for C++ All-in-One for Dummies, 4th Edition

Five people now have a copy of C++ All-in-One for Dummies, 4th Edition coming their way. Please wait four to six weeks for delivery and let me know when you receive your book. These people are:

  • Eva Beattie
  • Thomas McQuillan
  • Michael Flores
  • Syam Poolla
  • Tom Taylor

I hope that each of you enjoys the book and will provide a review of it on Amazon. Thank you for your support, it’s really important to me. Your reviews will help other readers as well. If you have any questions at all about the book, please contact me at [email protected].

Book Drawing for C++ All-in-One for Dummies, 4th Edition

I’ve just released a new book, C++ All-in-One for Dummies, 4th Edition, and I’d love to give five people in the US a chance to read it for free (I can’t accept requests from other countries due to the amount of postage required to send a book to you). There’s only one catch. In exchange for the free book, I’d appreciate your review of it on Amazon.com. Your reviews are important because they give other people some idea of what the book is like outside of my opinion of it.

This new edition contains an amazing amount of changes from the 3rd Edition, many of which you requested. Of course, I started by updating everything, so you see the latest version of Code::Blocks used in this book. Working with Code::Blocks makes C++ coding a lot easier, but Code::Blocks tends not to hide the details or add any odd background code like some IDEs do. In addition to the updates, you can expect to see these changes:

  • Instructions on how to use your mobile device to write C++ code.
  • Updates on how to work with for loops.
  • Using functional programming techniques.
  • Employing new operators, such as the spaceship operator.
  • Understanding modifications to the Standard Library.

This new edition of the book comes in at a whopping 912 pages, so there is no expectation that you’ll read it cover-to-cover. What I would appreciate is your honest viewpoint on the topics that appeal to you most. If you’d like to participate in this drawing, please contact me at [email protected] by 8 March 2021 by email with a subject of “C++ Book Drawing”. I need your name and address. I’ll post the winners of the contest (sans email addresses) in a future blog post.