Welcome to Choosing Your First Programming Language, volume 23,097!
A joke, of course. There are an abundance of articles out there about choosing your first programming language. So, what makes this different? Hopefully I can provide an unique perspective that alleviates the questions and indecision that so many face when starting out.
The Cold, Hard Truth
Perfect Practice Makes Perfect Software
Practice, practice, practice. Practicing 20 minutes a day 7 days a week is better than 2 hours 1 day a week. Ideally, you want to improve on something every day. Something to consider is learn something new every day. If you can't learn something that day, teach something. You may teach yourself something new while teaching others. Document your discoveries or share a cool thing you learned in the book you're reading. Athletes don't become champions or record breakers overnight, in a month, or a year. The same can be said with musicians, composers, and rock stars. Expect the work you put into learning and mastering software development to be what you get out of it.
Pick One and Move On
Carving your own path is a bit more difficult, whether you're learning to change careers or find a new hobby, but you are given a little more flexibility. The important thing to do is once you pick your language, master it. Resist flipping between two or three languages at a time. It will stint learning and delay progress. Once you understand computer logic and the syntax that you're writing programs and tools that suit your needs, learning another language or three will come more easily and you'll be able to directly apply concepts to a new language that solidify that understanding.
Knowing What I Know Now
If I could do it all over again, I would have gone with another language over C++ as my first language. I learned a lot, and I am deeply appreciative of my professors from my early Computer Science studies. However, I think there are other system level languages that are more accessible for students over C++.
A strongly typed programming language is beneficial as it teaches making data types compatible with each other. While you don't have to declare the data type of a variable in Python, you do have to make sure the data is compatible before doing any arithmetic or concatenation. This introduces the programmer to thinking about their data before runtime happens, and influences writing better software (ideally).
Some great resources for learning Python are Learn Python3 the Hard Way, Python Programming: An Introduction to Computer Science, and Python Crash Course.
Many Linux components are running Python and a lot of tools in the Information Security realm are in Python as well. If you want to build a website, you have Django and Flask to provide a framework to work within and accelerate your development process. It is a language worth learning, at least to gain familiarity with. It serves as a great introduction to computer programming.
C is a hard introduction. Despite the titles of some books, you will not learn it in 24 hours. With C you will get an incredible base to springboard into other languages that were influenced by C. You will also be able to build your own language with C!
The language has been around for a long time, so there are a lot of strong opinions on how to use it. There is also a diverse community surrounding the language. That comes as a pro and con, so think twice about which community you go to. I would avoid asking questions on StackOverflow and use something like cboard.cprogramming.com -- StackOverflow often comes with some dialog that is discouraging to a new programmer.
Something to note, You will be told to read this book:
I do not recommend the book for beginners. K & R wrote the book with a lot of presumptions. They leave out a lot that a new, modern developer will need to know. Personally, I feel like their ego got in the way of teaching. It makes a great second or third book on C, but as a beginner, I do not recommend it.
Personally, this is the language I would have chosen to start with doing it all over. Rust allows system level programming like that of C or C++, and has an awesome package management tool called Cargo that helps with packing, building, and shipping software. There is also a ton of support for expanding on this with
cargo-build-deps, two packages that ease the process when deploying with Docker.
Their e-book lives free on their documentation site. If you want a physical copy, you can check it out on Amazon or No Starch Press.
If you want to get into embedded systems, networking, operating system development, or just want to be part of a great community that welcomes developers from all areas of the Internet, check out Rust. Seriously, the first book I've read that goes over doing something in Unix, Linux, Command Prompt, AND PowerShell. Most books have a Windows section that glosses over installation or says "Go figure it out". While I'm not doing Rust programming on Windows, I appreciated their open arms and attention to detail (PowerShell is not CMD).
Their standard library comes with (mostly) everything out of the box. Networking, web server, graphics, processing, etc. It can serve as a foundation for a great, monolithic application, or as a simple script to check on running processes and report back. Go is flexible, fast, small (doing a lot with a little), and compiles down to a single binary. Go offers type-safe memory handling, with a package (aptly named "unsafe") that you can import to get around this for low level programming and systems engineering.
Go is strict in the sense that formatting matters, but still allows the programmer to decide their method (or function ;) ) of writing software. There is a built in tool called
gofmt that allows one to check the style of their code compared to the Golang standards. This not only improves readability of Go, but provides a unified method of writing Go that leaves little room for error.
Had Rust not existed in the time machine that I decided to use to go back and learn programming, Go would have been my language of choice. There is a $GOPATH environment variable and series of tools provided with go that make developing with the language, whether it's software or tools, a joy to work with.
go install, with a properly configured $GOPATH, adds the compiled software directly to your $PATH and makes it immediately available after compilation.
go install $GOPATH/awesome/software allows for the
software command to be called at any time, anywhere in the system.
[chris@battlestation]$ software run will start the program, if "run" is a valid argument.
Definitely check out Go if you're interested in system programming that allows for flexibility and contained packaging. The Go Programming Language makes a great, yet difficult introduction. Work through the book, feel free to skip the exercises if you don't understand them, but be sure to revisit when you've gained competency. The Tour of Go should help quite a bit as well.
var keyword and loosely interpreted types allow a beginner to focus on the logic of programming over the syntax and other nuances.
C#, Microsoft's Java, surpassed Java many years ago. While Java has been steadily catching up, especially with JDK 10, C# is a fantastic language to learn if you're developing for Windows, making games with Unity or Unreal Engine, want a great dancing partner for MS SQL Server, or want a solid backend for web development on IIS. With the advent of .NET Core, C# is now a more capable cross platform language that can be developed, compiled, and ran on OS X, Linux, and Windows.
I hope you enjoyed living vicariously through my regrets and interests. Maybe this will help you the way it could have helped me in 2012! Hopefully you've found this beneficial, entertaining, or at least readable. Definitely let me know!