Choosing a First Language to Learn

My first programming experience (during the time of the dinosaurs) involved using a light panel to enter machine code into a rudimentary computer with 3 KB (yes, that’s KB) of RAM. The output was also in light form and I needed to decode the lights to determine if my code worked right. I worked with various systems in various ways over the next several years. By the time I got to college, the first language I learned there was BASIC (Beginner’s All-purpose Symbolic Instruction Code), then PC assembler, followed by Pascal. In fact, I’ve just stopped counting the number of languages I’ve learned over the years because each language has a place in my programmer’s toolbox. Of course, the question is what language you should learn first. I get asked that question quite often because there are a huge number of languages available today and no one wants to invest time in a language that’s going nowhere.

Part of the answer to the question of what to learn first is what you intend to do with the language. Each language has features that make it better at performing specific tasks. Programming languages can be split into those that are designed for a special purpose and those that are designed for a general purpose. A special purpose language, such as Structured Query Language (SQL), could be a good choice if you intend to move into database work immediately. However, for most people, a general purpose language works better because you can use it for a wider variety of tasks without bending yourself into a pretzel shape to do it.

A good place to start if you want to choose a language that’s popular enough to help you get a job afterward is the TIOBE index. It shows a listing of which languages are most popular today. As I’m writing this, Python is the most popular language on the list, but that could change tomorrow. Generally, any of the top ten languages on the list are good choices.

Of course, you want a programming language that is easy to learn. C/C++, C#, and Java are all complex languages with great flexibility. Furthermore, C/C++ and C# can help you work at a low level with the computer hardware. These languages have a steep learning curve and may not provide the best choices for a starting point. That said, if you have a line on a job that uses any of these languages, you could do worse than start here, just be prepared to burn the midnight oil learning.

The language I suggest people learn as a starting point is Python. In fact, Beginning Programming with Python For Dummies, 3rd Edition makes a point of showing you just how easy things can be. You don’t even need to invest in any special software, the book shows you how to use Google Colab so that you could conceivably learn how to program on your smartphone or TV. Others must agree with me because Python has turned into the language that the education industry turns to most often for budding programmers.

There are a lot of programming languages available today. You need to research the choice by taking into account what your personal needs are and what sort of job you want to get afterwards. You might find that something like JavaScript or Ruby will provide benefits that you can’t get with Python. Which language do you think will work best for you? Let me know your reasons at [email protected].

Understanding the Continuing Need for C++

This is an update of a post that originally appeared on February 23, 2015.

I maintain statistics on all my books, including C++ All-In-One for Dummies, 4th 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 and schools now prefer Python as an introductory programming language for older children. 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 converter tool.

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!

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

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