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].

Understanding the Continuing Need for C++

I maintain statistics on all my books, including C++ All-In-One for Dummies, 3rd Edition. These statistics are based on reader e-mail and other sources of input that I get. I even take the comments on Amazon.com into account. One of the most common C++ questions I get (not the most common, but it’s up there) is why someone would want to use the language in the first place. It’s true, C++ isn’t the language to use if you’re creating a database application. However, it is the language to use if you’re writing low-level code that has to run fast. C++ also sees use in a vast number of libraries because library code has to be fast. For example, check out the Python libraries at some point and you’ll find C++ staring back at you. In fact, part of the Python documentation discusses how to use C++ to create extensions.

I decided to look through some of my past notes to see if there was some succinct discussion of just why C++ is a useful language for the average developer to know. That’s when I ran across an InfoWorld article entitled, “Stroustrup: Why the 35-year-old C++ still dominates ‘real’ dev.” Given that the guy being interviewed is Bjarne Stroustrup, the inventor of C++, it’s a great source of information. The interview is revealing because it’s obvious that Bjarne is taking a measured view of C++ and not simply telling everyone to use it for every occasion (quite the contrary, in fact).

The bottom line in C++ development is speed. Along with speed, you also get flexibility and great access to the hardware. As with anything, you pay a price for getting these features. In the case of C++, you’ll experience increased development time, greater complexity, and more difficulty in locating bugs. Some people are taking a new route to C++ speed though and that’s to write their code in one language and move it to C++ from there. For example, some Python developers are now cross-compiling their code into C++ to gain a speed advantage. You can read about it in the InfoWorld article entitled, “Python-to-C++ compiler promises speedier execution.”

A lot of readers will close a message to me asking whether there is a single language they can learn to do everything well. Unfortunately, there isn’t any such language and given the nature of computer languages, I doubt there ever will be. Every language has a niche for which it’s indispensable. The smart developer has a toolbox full of languages suited for every job the developer intends to tackle.

Do you find that you really don’t understand how the languages in my books can help you? Let me know your book-specific language questions at [email protected]. It’s always my goal that you understand how the material you’ve learned while reading one of my books will eventually help you in the long run. After all, what’s the point of reading a book that doesn’t help you in some material way? Thanks, as always, for your staunch support of my writing efforts!

 

Beta Readers Needed for Beginning Programming with Python For Dummies

I’m starting a new book project entitled, Beginning Programming with Python For Dummies. Python is a really neat language and it’s used for all sorts of commercial tasks. The main benefits of using Python are that the code is succinct, it’s easy to read, and it’s easy to learn.

This book is intended for someone who has never written any code before. The focus of the book is to make things simple and easy to understand, so if you’re already a Python developer, you probably won’t find too much in the way of new information. Here is a list of the topics you’ll find in my book as you read:

 

  • Part I: Getting Started
    • Chapter 1: Talking to Your Computer
    • Chapter 2: Getting Your Own Copy of Python
    • Chapter 3: Interacting with Python
    • Chapter 4: Writing Your First Application
  • Part II: Talking the Talk
    • Chapter 5: Storing and Modifying Information
    • Chapter 6: Managing Information
    • Chapter 7: Making Decisions
    • Chapter 8: Performing Tasks Repetitively
    • Chapter 9: Dealing with Errors
  • Part III: Performing Common Tasks
    • Chapter 10: Interacting with Modules
    • Chapter 11: Working with Strings
    • Chapter 12: Managing Lists
    • Chapter 13: Collecting All Sorts of Data
    • Chapter 14: Creating and Using Classes
  • Part IV: Performing Advanced Tasks
    • Chapter 15: Storing Data in Files
    • Chapter 16: Sending an Email
  • Part V: Part of Tens
    • Chapter 17: Ten Amazing Programming Resources
    • Chapter 18: Ten Ways to Make a Living with Python
    • Chapter 19: Ten Interesting Tools
    • Chapter 20: Ten Libraries You Need to Know About


As you can see, this is a really useful book for the novice. By the time you complete this book, you’ll be able to perform some useful tasks with Python and you’ll be able to read other books without the usual head shaking and complete frustration. The goal isn’t to turn you into an expert, but to reduce the learning curve so that you can actually follow other texts that you might want to use.

This isn’t a platform specific book. It doesn’t matter whether you work with a Mac, Linux, or Windows. I’m looking for people from all walks of life and my only expectation is that you know how to perform essential tasks with your platform of choice, such as install applications and work as an administrator on that system.

Of course, I still want to avoid making any errors in the book if at all possible. That’s where you come into play. The biggest complaint people have about computer books is that they’re obviously written by an expert and not the people reading them. I take all of the input from the beta readers to avoid that sort of problem. In addition, beta readers often find errors that other people miss. In short, you’re an incredibly important part of the writing process.

As part of being a beta
reader, your name will appear in the book Acknowledgements (unless you
specially ask that I don’t provide it). However, one of the bigger
benefits to you is that you get to read the book free of charge and gain
the skills that it can provide for you. Imagine what learning a new
programming language can do for your career. Even if you don’t need Python
for work, you can use what you gain to create applications for your own
needs and to obtain a better understanding of how computers work. Just contact me at [email protected] if you’d like to work with me on this project.

 

Methods of Learning

More than a few readers write me about the best way to learn. Many of them are asking about the best way to learn how to become a programmer-a topic I discuss in my Becoming a Programmer post. However, more and more often, readers are asking me about learning in general. The fact is that I can point you to different techniques for learning, but I can’t determine what will work best for you. You’re the only person who can make that determination and you won’t know until you try a number of techniques. In a society ever more devoted to success at all costs, learning requires that you fail in order to make gains. When you fail, you learn what doesn’t work and possibly why it doesn’t work. So, trying various techniques is the only way to discover what works best for you and that process involves some level of failure. This is a philosophy that educational providers like Venture Lessons embody, interactive lessons that you can fail in will teach you so much more than lecturers.

I imagine that my answer frustrates a lot of people because they don’t want to fail at something, so they ask what works best for me. Mind you, what works for me probably won’t work for you. I personally learn best by working through examples written by other people. When it comes to programming, I rely on application examples written by other developers and scrutinize them intensely using the debugger so that I can see precisely how they work. Then I create applications of my own that use those techniques to ensure I actually do understand how things work. Likewise, I use examples from other woodworkers, gardeners, or other professionals as a basis for my own hands on learning experiences. In addition to these hands on techniques, I also read a large number of books and articles every year. Often, all I really need to learn a new technique, is a good explanation of it. I read books and magazines in every area that interests me-everything from application development and computer hardware to new gardening techniques and animal husbandry. In some cases, I also attend lectures and seminars to augment my learning, but given that lectures and seminars tend to be expensive, I focus on my primary means of learning new things whenever possible.

Don’t limit yourself to what I use though. There are many other ways of learning that are just as viable and just as important. The only requirements of learning is comprehension (the ability to understand what you’ve learned) and retention (the ability to remember what you have learned). How you achieve your goal is up to you. Here are a few other methods you might consider trying in addition to those that I commonly use.

 

  • Instructor Led Training: There is a good reason that children go to school. An instructor (teacher) can answer questions about a particular skill immediately and fully. The interactive communication that occurs helps the student learn faster and with fewer problems.
  • Tutorials: A tutorial is essentially a set of precisely written procedures meant to guide the student along a particular learning path. It’s a combination of reading and doing that helps someone develop a skill quickly.
  • Interactive Media: This is a newer form of the tutorial that relies on sight and sound to convey meaning. Interactive media includes animations and graphics that help a viewer visualize the content better. Hands on exercises included with the interactive media help the student know when a particular training goal is achieved.
  • Observation: The subtle art of observation isn’t mentioned very often anymore-probably because people are too busy or impatient to use it. I know that I’ve learned more than one new task though simply by watching someone else do it. Observing someone means watching and thinking about what they’re doing. You don’t necessarily ask any questions (and may annoy the person you’re observing when you do).
  • Experimentation: Of all of the methods used to learn, this method provides the highest gains when successful, but also incurs the greatest amount of failure. It’s a matter of asking a question, deciding on how best to answer that question, and then creating an environment in which to determine the answer. In order to ensure that the question is answered correctly, you often have to repeat the experiment a number of times in various environments. Experimenters often discover new knowledge or rediscover lost knowledge, but at the cost of failing a lot.
  • Cooperation: A cooperative learning environment is one in which two peers have part of an answer and choose to share their part with someone who has another part of the answer. The exchange benefits both parties because both now have two parts of the answer. Of course, a cooperative learning environment requires trust on the part of both people.
  • Dissection: When I was younger, I couldn’t be bothered to keep anything in one piece. I dissected everything in an attempt to discover how it worked. Often, that meant not putting the item back together because the dissection process is destructive. Even so, you’d be amazed at how many things you can learn by dissecting an object to see how it’s put together.


This list is incredibly short. Over the years I’ve seen people learn an amazing array of knowledge using all sorts of techniques that boggle the mind. In every case, the successful learner has experimented with various techniques until he or she finds the techniques that work best. These techniques won’t work best for someone else, but they work best for you. I encourage you to fail in order to learn. Don’t be afraid of trying something and then discovering it doesn’t work because that’s the only real way to learn anything. Let me know about your favorite learning technique at [email protected].

 

Profession Versus Job

I often find inspiration for posts in places that you wouldn’t think to look. Today’s post comes courtesy of Bill Bridges from his Green Market Press blog. The post in question is the Taipei Journal entry for today—there are many of these journal entries, all entertaining and educational about the human condition. Bill is a professional journalist and a good friend who has often inspired me to excel with his seemingly simple posts. The reason that today’s post struck a chord with me is that it answers part of the question of how to become a programmer. My initial post discussed the mechanics, the precursors that someone might pursue to become a programmer, but that post didn’t answer the question of how to make programming a profession.

Today’s journal entry answers the question of profession versus job rather succinctly. Susan writes an article that constantly mentions “the French system of government” without ever explaining what the term means. Bill asks her about it and her response is, “I did sort of wonder about that.” Susan has a job, Bill has a profession. Education, no matter how complete, is only a precursor to a profession. In order to turn a job into a profession, one must also become involved, learn to think for oneself, and have a desire to excel. An aspiring programmer must have integrity as well and be willing to devote long hours toward the goal of delivering the best possible code. Mind you, the code a particular individual delivers is unlikely to be perfect and it’s always possibly that someone else will write better codeI’m talking here about excellence within the individual’s ability to deliver it.

Anyone can perform a job. Only a few people have a profession. However, I’m not talking about a particular sort of profession. When Rebecca and I lived in San Diego, we’d go to a particular restaurant (the name escapes me at the moment, but the restaurant is no longer there anyway). There was a man named Kevin there who waited tablesit was his profession. You could see it in the way he performed the tasks of his tradewith enthusiasm, vigor, and more than a little subtle humor. You felt honored to be served by him and the lines were often long with people who specifically asked for him. Application development is a trade that requires no small amount of education, but I’ve seen more than a few people obtain the required skills by simply reading a book. The difference between a job and a profession remains the samethe professional takes responsibility for successful completion of the task and delights in seeing the task well-done.

While my previous post described a job, this one describes a profession. Many people have questioned why America has been losing it’s place in many different technology areas. First of all, I submit that statistics lie and often tell the story that they’re designed to tell. Don’t believe the lies that you readthink for yourself. Americans still have what it takes to create some of the most amazing technologies ever and I’ve discussed more than a few of these technologies in previous posts. If America has truly lost its edge, then where do these technologies come from? Second, far too many Americans are focused on getting a job, rather than a profession. When you view America of the past, you discover that we have had an array of professionals that delivered new technology is all sorts of waysmany never thought about before.

The bottom line is that you need to consider what sort of programmer you’re going to be as part of your journey. Education isn’t enough. If you really want to become a good programmer, then you must be willing to do what it takes to become a professional. As a professional, you’ll have a higher quality of life, discover the benefits of job satisfaction, and contribute to society in ways that you can scarcely imagine. So what do you havea job or a profession? Let me know your thoughts at [email protected].

 

Becoming a Programmer

I’ve had more than a few readers write and ask how someone becomes a programmer. Of course, that’s a loaded question. The first thing that you must decide is what a programmer does, who they are as a member of society, and what they contribute to society. There are many fields that could be construed as programming. Anyone who writes a set of instructions that somehow directs that actions of a computer is a programmer. This definition encompasses everyone from the administrator or power user who writes macros to the designer who creates engineers huge projects to the low level developer who creates operating system code. Theoretically, the ingenious person who actually succeeds at programming their video recorder to start and stop at certain times to capture a favorite television show is a kind of programmer. Today I’ll focus on the computer scientist, because that’s what I am.

Aptitude is part of becoming a good computer scientist and you need to decide whether you have the required talents, skills, and desires. A love of the abstract is a requirement. Despite the best efforts of companies such as Oracle and Microsoft (and a huge number of others) to create an environment that mirrors the concrete world, creating good code is the domain of those who embrace the abstract. It isn’t simply a matter of knowing how to work with numbers. A computer scientist is an expert in many arenas of abstract thought and can actually feel the numbers in a way that few others can. Developing great computer applications is an art and many of the best computer scientists have an artistic bentthey play music, craft words into books, paint, or otherwise put into physical existence the abstract concepts of the mind.

Most computer scientists are naturally curious. It isn’t sufficient to know that the device workshow the device works is far more interesting. Taking things apart to see how they work and putting them back together again to ensure a true understanding of the underlying principles exists is a joy for the computer scientist. Nothing is too complex and in everything there is wonder. Where others see the mundane, the computer scientist sees the amazing.

Of course, there is the practical to consider as well. My first exposure to computers and programming was punch cards (yes, I’m dating myself here). I was in a typing class and part of that class was to work on a keypunch machine. The fact that holes in a card could control a huge machine was amazing to me. In those early years I also studied computer hardware in depth (right down to the chemical reactions that occur within a transistor) and discovered things like paper tape machines and light panels. This sort of education isn’t available to aspiring computer scientists today, but it’s where I began. Those early days were critical to my development as a computer scientist. Your early days are equally important.

So, where would someone begin today? There is a fear that everyone seems to exhibit about destroying their computer. Get an older machine that you don’t have to care too deeply about, but still works. Take it apart, learn how it works, and put it back together. A computer scientist understands that every line of code does something to the hardware. We’ve lost touch with that connection todaya real loss. Obviously, you don’t need to know absolutely everything about the functioning of the hardware, but you should at least know the basic parts of your computer.

Start small. If nothing else, install an old version of Office on your machine and use it to write macros. For that matter, try working at the command line for a while and write some batch files for it. You could also try working with JavaScriptit’s free and there are some excellent tutorials for it online. Experience the small things and you’ll gain understanding that you can’t get any other way. Most importantly, keep in mind that you’re trying to affect the world around you by writing commands.

Eventually, you’ll want to start working with a programming language. My first true programming language was BASIC. I learned it at a time when DOS was kingbefore Windows was even a twinkle in Microsoft’s eye. Visual Basic or C# are great languages to start with. You can write some extremely useful applications without a very large investment in either time or money. If you prefer, learning Java can be a good experience, but I’ve found it requires a little more time to learn than some other languages. But if you really wanted to stick with learning Java, as my friend did, you could always follow his lead by deciding to see how assignment guidance, that you can get from somewhere similar to bookwormhub can help you when it comes to completing studies that you may find hard to understand. My friend had many experiences like this, but his life was made much easier after using this service. Since I didn’t use it, I found it quite difficult and time-consuming, but my friend had a completely different experience with it, so you may find it easier to handle than me.

Discover a low level language. For me it was assembler. Actually, I learned to work with assembler on a number of systems. Today you’ll want to learn C++ because few people use assembler anymore. Even embedded system programming (the last frontier of truly custom systems) relies on C or C++ for the most part now.

Don’t confine yourself to a single platform or language though. Before I even entered college, I had been exposed to three different computer languages. During college I learned three more. Today I learn whatever seems to be the best language to accomplish a particular task. It wasn’t long ago that I learned IronPython. I’ve worked with PERL, LISP, F#, Java, PHP, and many other languagesthey’re all ways to express something that I need to do with the computerthey’re all beautiful languages for a particular task.

The important thing is not to make writing applications a chore or workkeep it fun. If you’re thinking about a career as a computer scientist, I think you have some amazing things to look forward to because computers are become ever more capable of interacting with the outside world. Let me know your thoughts about computer science at [email protected].