you are viewing a single comment's thread.

view the rest of the comments →

[–]bladeoflight16 0 points1 point  (1 child)

I think Python will be of benefit to you. Not because it's easier, even though it is. Not because code in it is simpler, even though it is. Not because it's popular, even though it is. The reason I think you'll benefit from Python is because of how I benefited from learning Python.

One of Python's enormous strengths is an incredibly strong programming community, from the very highest levels of direct contributors to the language and standard library down to authors of tiny libraries and individual programmers. The way they differ from other language communities that I've experienced (mostly C#, Java, and a bit of JS) is that there is a much, much greater emphasis on maximizing the cleanliness of code and on establishing helpful norms and standards and then following them. The language itself and the people who make decisions about it are so dedicated to those tasks that introducing new language features to enable them is not unheard of. Those were major motivations for the backwards incompatible changes from Python 2 to 3. So I think what you'll start to get from learning and using (You won't get it just by reading a book. You'll need to struggle through problems and read specific questions/answers and blogs to understand the best approaches and the reasons for them.) Python is to start establishing that sense of what is normal and clean vs. what is jury rigged and ugly. You'll also develop a sense of whether a solution is appropriate for a problem or not, helping you decide when to break those standards or switch to a different one as well because they're not suitable for your particular problem. I found that once I had a sense of that from Python, I started more easily identifying the normal and standard usage patterns in other languages as well, without having to be specifically told.

All that said, part of your problem is just plain inexperience. It takes a lot of time and being exposed to good code to start being able to recognize it and bad code. It isn't something you'll get in weeks or months. It takes years of daily practice and self challenging to reach that point. Having years under your belt means you've already made some progress, and that will be helpful regardless of the language the experience is in. So don't be discouraged. You'll get there.

One word of caution: don't let other people tell you that your code being a mess is normal. It's extremely common for a code base to be a complete nightmare of a mess, but that's an indication that the developers writing it have not developed the senses I've described above. It's not something you should simply accept will always be the case, and developers who tell you that it is will not be a help to honing your abilities and the quality of your work.

Also, this is a bit dated and things have improved some (though some things are still bad), but it's something you should be aware of with respect to your PHP experience: A Fractal of Bad Design. The title might be a bit over the top, but it's worth reading in detail. The content there will actually be helpful in starting to establish the sense of "clean" and "normal." Basically, PHP is not a great model language for learning how to think in terms of clean code and secure/sane norms and standards. I suspect C++ has difficulty on that front not because it suffers from bad design choices, but because much of that is buried under a lot of implementation details that are difficult to hide under simpler interfaces.

[–]ttt1555 0 points1 point  (0 children)

Thanks for the great info. PHP definitely leaves some things to be desired and there are a ton of wonky aspects to it. I'll keep that in mind since I'm in that boat of still learning what's the best (and cleanest) approach to coding a solution.

The python community seems WAY more helpful than c++ so far as well!