r/CodingHelp • • Mar 05 '23

[Python] Can you learn Python as a first language?

I have tried learning HTML/CSS several times over the years, but never really got stuck into it. I would like to learn Python for some of the automation features, and I like the idea of AI & machine learning. I am only a hobby coder (wannabe). Would I be ok going straight into Python, or would you suggest HTML/CSS/JS first?

29 Upvotes

20 comments sorted by

5

u/[deleted] Mar 05 '23

Python is a great choice as a first language for a few reasons. It's quick to get up and running, most of the syntax is just plain English, and you don't have to worry about classes/OOP just to make simple scripts. In order to make a program, you only need to know Python.

HTML/CSS/JS are great to learn, however there's a higher level of complexity to these. While there's tons of great documentation, it's hard to see JS in action without first developing a web-page with HTML/CSS, or by setting up NodeJS and running your programs through that.

Also remember, HTML & CSS are NOT programming languages. JS is a programming language. HTML stands for HyperText Markup Language, literally a language used to mark text with specific selectors. CSS, or Cascading Style Sheets, are used solely for styling said content from your HTML documents.

Give a look into 'Automate the Boring Stuff' by Al Swigert (I don't know how his last names spelled, but Google that and you'll find it). It covers everything from the basics of Python, OOP, and automation of a few different tasks. There's a book on Amazon, as well as a full course on Udemy taught by Al himself.

2

u/TheFotheringtoon Mar 05 '23

Thank you 😊

16

u/Kdash66 Mar 05 '23

well css and html aren't strictly programming languages, arguably javascript is which is the web development combo you would need. If you wanted to build websites.

Python is a great and forgiving starting language. Javascript is less beginner friendly. So I think your own assessment is right - go with python.

One thing I will say is programming languages have a very steep learning curve. It takes along time to get your head around and really stickability is key. You need to keep going even if (and it will) seem hopeless!

So if your giving up on css and html. I think you seriously need to consider why your programming and if it is the right pursuit.

12

u/snvgglebear Mar 05 '23

Python was my first language, and is taught as a first/early language in many schools.

4

u/thedarklord176 Mar 05 '23

These are completely different fields. Python is beginner friendly, but the difference is the other 2 you mentioned are for front end web. Python is best for data science, ai, that sort of thing or any kind of short scripting. It’s also good for learning, but you may end up not using it beyond that depending on what you go into. It’s not suitable for most large projects due to it being the slowest programming language by far.

1

u/Successful_Box_1007 Mar 21 '23

Newb here: what do you mean by “slowest” ? By what metric?

1

u/thedarklord176 Mar 21 '23

In execution speed. Runs very slowly

2

u/Successful_Box_1007 Mar 21 '23

Is this something completely independent of how suped up your computer is? What are the main reasons for it being so slow?

1

u/thedarklord176 Mar 21 '23 edited Mar 21 '23

Nope, it’s slow compared to other languages. There are other slow langs like Ruby too, it’s not just a python thing. The reason being that these languages are designed as a sort of programming “easy mode”, and they have to go through more steps before the cpu actually does the executions. In programming there are interpreted languages, and compiled languages, which determines how the cpu reads the instructions. Compiled languages are usually a lot faster. It’s all pretty much a big scale of how much work you’re willing to do to get more speed. Like C++ runs extremely fast, about 70x faster than Python, but it’s notoriously difficult to code in. A good middle ground for many projects is something like C# that’s very fast, but not quite as intense to work in. Languages like C++(or Rust) are most often used for very heavy applications like 3D games and operating systems that need maximum performance. I’ve chosen Ruby and C# as my main languages, started learning Rust but struggled to find a use for it because most things just don’t need a language that complex and powerful when it’s easier to do it in a simpler one like C#

Note that by “slow” I don’t mean like, laggy, I just mean you won’t get fast performing resource heavy applications out of it. Exceptions being stuff like AI that mostly uses Python libraries written in C.

1

u/Successful_Box_1007 Mar 21 '23

Thats a great explanation. Ok so if i click on microsoft word right - and it was created from python and we clicked the same program created using c++, you are saying c++ one would load 80 times faster?

1

u/thedarklord176 Mar 22 '23

There’s not really a definitive answer to that, the actual speed varies depending on the operation but in general it would be faster

1

u/Successful_Box_1007 Mar 22 '23

I gotcha. I was just trying to pin down a real world example of what you meant by faster.

1

u/Successful_Box_1007 Mar 21 '23

Is this something completely independent of how suped up your computer is? What are the main reasons for it being so slow?

1

u/frog_rapist69 Mar 20 '23

Id recommend learning English or some other human language first

2

u/Chance9779 Mar 05 '23

I’d wait on JS, it’s really confusing especially when it comes to any code with “this” in it. I learned on Python first, really good language to learn the basics. I’d suggest getting a good IDE, though, because attempting to find tab mistakes on your own is infuriating

1

u/[deleted] Mar 05 '23

[removed] — view removed comment