DEV Community

loading...

Discussion on: Why I use python

Collapse
barbaroja19 profile image
barbaroja19

I really wish that my first class in programming was in Python. We used Visual Basic instead which has a much smaller use case.

If you really love Python though I would encourage you to learn some C programming, as one of the main compilers for Python is written in C. It may open the door to a deeper understanding of the language.

Also I can't recommend bash enough. Not only does it allow you to work more efficiently in *nix environments, it is really useful for working with personal and enterprise servers.

Just my two cents!

Collapse
codemonkey51 profile image
Codemonkey51 Author

Hi, I have looked at C before just a bit, maybe I'll re-visit it.

About the bash thing, I should clarify bash scripts are great, but I find it hard to write really complex bash scripts, so in that case I prefer to use something like python instead.

Collapse
barbaroja19 profile image
barbaroja19

Fair enough! They can be very complicated and Python is an excellent alternative. The cross platform capabilities are much greater with Python as well.

Thread Thread
codemonkey51 profile image
Codemonkey51 Author

Yea, I would bash for simple stuff like an install script, or just for a list of commands I would like to execute without typing them out one at a time. But python is much more consistent, because you know exactly how it will execute, even in weird environments (where some bash commands different/ aren't there)

Collapse
stevepryde profile image
Steve Pryde

Just going to add another 2c to the mix.

I learned C fairly early in my coding journey (started with BASIC - long before visual basic was a thing, which might show my age, then moved to Pascal and then C) and I found the "C for dummies" book pretty helpful at the time.

I regard C as one of the most important languages to know/understand but never use. It teaches you so much about memory management and how computers work and even when using other languages just being aware of when memory is being allocated helps a lot. C makes this kind of thing second nature.
However these days I think the only real reason to actually use C is for embedded programming with low power hardware.

As for bash, almost every time I've used it to just whip up a little shell script I end up regretting it later as the complexity inevitably grows. Python or perl are installed almost everywhere nowadays or if they're not then it's easy to install them (maybe that's the part to use bash for). Bash is good for bootstrapping something or a quick download here or there but anything more complicated than that and you'll have basically something only you can maintain (and in 6 months you'll come back and wish you'd used something else). I still use it occasionally but it just feels so nasty and prone to easy mistakes. Maybe with a good linter it might be better.

Collapse
barbaroja19 profile image
barbaroja19

Great points! If you're just scripting Python is definitely more scalable. However, BASH is absolutely indespensible if you're regularly working with enterprise servers.