Why You Should Learn Python As Your Next (or First) Programming Language

Why You Should Learn Python As Your Next (or First) Programming Language

We’ve got a major course release coming up!  We’re re-launching our Python course, with brand-new material recorded by our original teacher and CEO, Mattan Griffel.

A little over a year ago, we launched our first Python class to our largest-ever audience. We got a ton of student feedback and, based on the feedback, we closed the course for 6 months to renew, upgrade, and edit the curriculum to better meet students needs. Mattan built a new curriculum from scratch and recorded an entirely new course.

Enroll in Python now and save 10%! →

This Fall, Mattan will be teaching at Columbia Business School as well as making this course available to 100 people here at One Month for the first time. It’s one of the most popular programming languages and one of our most popular courses, so if you’re interested in joining us August 15th, sign up here for the Python course right away.

Today, I sat down with Mattan to interview him about what Python is, why you should learn it, and what kinds of projects you can build with it.

Why should you learn Python?

 

Python is an easy programming language for beginners to start out with. It’s newer than a lot of languages, so it’s easier to learn than some of the older languages (they fix a lot of the things they learned that suck about older languages), there’s a lot of demand for Python programmers (the average Python developer salary in the US is $102,000 according to Indeed.com), and you can do some really cool things with Python from data science to building websites.

What is Python?

Python is a really popular programming language used by companies like Google, Facebook, Dropbox, Instagram, and Reddit. Python is used for all sorts of things like building websites, web scraping, data analysis, machine learning, and natural language processing. The language is designed to be easy to read, while still being very powerful, which makes it a great language for beginners to learn.

Why Python and not Rails?

Both are good to learn, but Python is especially good for data analytics and sciency-type stuff. It has a lot of coding tools that make things like statistics easier to do. Rails on the other hand is specifically meant to help you build websites.

What are the different language options out there? Why is Python a good place to start?

There are a lot of potential programming languages out there: C, C++, Go, Java, Javascript, PHP, Python, Ruby, Swift being some of them. But if you were to start anywhere, I’d recommend either Python or Ruby. They both have huge developer communities with lots of resources that are friendly for beginners to learn, and there are features of the language that are easier for beginners to learn (for reasons it would be hard to explain here, but for example like they don’t require ; after every line or do crazy iterative for loops like Javascript.)

How did you teach yourself Python, personally? Why did you learn it?

I taught myself using a bunch of online resources such as Learn Python the Hard WayCodecademy, and Exercism. I learned it because I wanted to be able to compare what it would be like learning a language different from the one I know (Ruby), and I wanted to see what all the fuss what about, and also I wanted to teach this class.

I learned Python because I wanted to compare what it would be like learning a language different from the one I know (Ruby), and I wanted to see what all the fuss what about.

Any cool things you’re doing with Python right now?

Web scraping and data processing I’m doing with Python, but not regularly or anything like that. I’m still more comfortable with Ruby, so I’d probably use that more often.

What kinds of things can you build with Python?

Honestly, just about anything you can build with other programming languages like C++ or Ruby. You can build: websites, web scrapers, crawlers, scripts, interact with APIs, build your own APIs, build automated and messaging bots, make phone calls and send text messages, do machine learning, data analytics, natural language processing, statistical models, just about everything besides iPhone and Android apps (though you can build parts of those in Python).

What kinds of projects will we learn in your class? What will we build?

We’ll write scripts that calculate things for us, automate tasks, get data from APIs like stock prices and the weather, built a bot that sends text messages, write a web scraper, and build a web application.

(Yes, you’ll be able to do all of that within 30 days.)

Enroll in Python now and save 10%! →

Who is this course for?

This is for anyone who is a beginner and wants to learn Python but doesn’t know where to start.

Who is it not for?

This is not for experienced developers. It’s also not for people who are already really busy or who aren’t serious about learning something new.

The process can take a while and be frustrating, so you need to have time and patience. It’s also not really for people who don’t see a benefit in knowing how to code somehow in their life. I mean, you could learn it just out of curiosity, but unless you’re trying to get a job as a developer, automate some of your work with scripts, or apply the knowledge in some way, you’ll probably not be committed enough to remember all this stuff.

How much time do you think a student should spend on Python each week in your course?

We ask our students to take at least 30 minutes a day to work on our course. Some people do the work on the weekends and spend 3-4 hours on the weekends to watch the videos, do the projects, and figure things out. (Sometimes people get really excited and dig deeper into the research project and take 6-8 hours or more each week of class. It’s up to you to customize.)

The one thing I would recommend is making sure you do all of Week 1’s assignments during Week 1, and Week 2 during Week 2, because the benefit of these live courses is that you can ask questions, get feedback, and talk to other students who are working on the same projects you are.

Why did you change the course up and re-launch it?

Because our initial Python course focused on Django and building web apps but not really Python and a lot of the stuff you can do with Python.

We wanted to make the course better and we’re confident that we’ve developed a really good curriculum that works and will show off projects that students are really excited to complete.

What do you wish students knew in advance / before they sign up for the course?

That there’s nothing necessary to know in advance! If you don’t know much, or feel like you know nothing, that’s actually a great place to begin.

It’s helpful if students have some initial understanding of HTML and CSS, but really, it’s not essential. They should also know that this class is made for total beginners so if they already know some programming stuff and they feel like the class starts off slow, they should be patient. It gets challenging really quickly.

What are your favorite resources, books, and other tools that you used to learn Python?

Definitely the resources I used to teach myself: Learn Python the Hard Way and Exercism are two of my favorites.

Anything else you want to tell people in advance?

I hope to see you in the course! And if you have any questions about it, leave a note in the comments so I can answer it.

Oh – and how do they sign up for the course?

Sign up here for One Month: Python (starts August 15th, 2016). We’re opening the course to only 100 students in this premium course. Sign up fast before all the spots are filled!

Enroll in Python now and save 10%! →

Ruby vs. Python

Ruby vs. Python

Which is better, Ruby on Rails or Python and Django?

This is a question we get asked repeatedly. It’s an important question too. You’ll hear Ruby vs. Python compared all the time. If you’re unfamiliar with them, it’s an impossible question to answer. I’ve used them both quite a bit and can tell you that while they’re similar, they’re also different in some important ways.

To set the stage, I first learned web development through Python and Django. After spending four years building Django apps, I got a job doing Ruby on Rails and expected the transition to be really simple. That’s when it became clear to me that the two languages and frameworks are different.

So… How are they different?

The Language:

The Ruby on Rails web framework is built using the Ruby programming language while the Django web framework is built using the Python programming language.

This is where much of difference lies. The two languages are visually similar but are worlds apart in their approaches to solving problems.

Ruby is designed to be infinitely flexible and empowering for programmers. It allows Ruby on Rails to do lots of little tricks to make an elegant web framework. This can feel even magical at times but this flexibility can be good and bad at times. Sometimes code works when you didn’t expect it to and l5eaves you feeling really impressed. Other times the Ruby magic can make it very hard to track down bugs for hours.

Python takes a more direct approach to programming. It’s main goal is to make everything obvious to the programmer. This sacrifices some of the elegance that Ruby has but gives Python a big advantage when it comes to learning to code and debugging problems.

One great example showing the difference here is working with time in your application. Imagine you want to get the time one month from this very second. Here is how you would do that in both languages

Ruby

require8 'active_support/all'
new_time = 1.month.from_now

Python

from datetime import datetime
from dateutil.relativedelta import relativedelta
new_time = datetime.now() + relativedelta(months=1)

The Python version has you importing specific functionality from datetime and dateutil libraries. It’s a lot more explicit, but you can easily tell where everything comes from.

The Ruby version is a lot more magical. We import some active_support library and now all of a sudden all integers in Ruby now have these “.days” and “.from_now” methods. It reads well but it’s definitely not clear where this functionality came from inside of active_support. Plus, the idea of patching all integers in the language with new functionality is cool but it can also be abused and cause problems.

Neither approach is right or wrong, they just emphasize different things. Ruby showcases flexibility of the language while Python showcases directness and readability.

Web Frameworks

Django and Rails are both frameworks that help you to build web applications. They have similar performance because both Ruby and Python are scripting languages. Each framework provides you all the concepts from traditional MVC frameworks like models, views, controllers, and database migrations.

Each framework has differences in how you implement these features but at the core they are very similar. Python and Ruby also have lots of libraries you can use to add features to your web applications as well. Ruby has a repository called Rubygems that you can use and Python has a repository called the Package Index.

Community

Python and Ruby both have very large communities behind them. The community influences the direction of the language, updates, and the way software is built using them.

Python has a much more diverse community than Ruby does. There are a ton of academic use cases in both Math and Science that Python has thrived in. This gives it a lot of support in those areas and it continues to grow because of that momentum. Python is also installed on almost every Linux computer making it the perfect language for use on servers.

Ruby’s popularity really started when Rails came out in 2005. The community grew quickly around Rails and has since been incredibly focused on web development. As time goes on it the community around it has gotten much more diverse but2 it hasn’t seen the same diversity that Python has.

Usage

Who is using these languages? Quite a lot of companies. Both languages and web frameworks are pretty widespread in the tech world.

Python has been by companies including Google, Pinterest, Instagram, National Geographic, Mozilla Firefox, and the Washington Post.

Ruby has been used by companies like Apple, Twitter, Airbnb, Shopify, Github, and Groupon.

Conclusion

Anything you can do in Ruby on Rails you could also do in Python and Django. Which framework is better isn’t really a question of capability, it’s actually a question of what the support is like for you and your team.

My general rule of thumb is this:

If you plan on sticking with building web applications, then check out Ruby on Rails. There’s a very strong community built upon it and they are always on the bleeding edge.

If you are interested in building web applications but would like to learn a language that’s used more generally, check out Python and Django. You’ll get a diverse community and lots of influence and support from the various industries that it is used in.

Either way, you can’t go wrong. Almost everything you learn in Python can be translated to Ruby and vice versa. The same goes for Django and Rails. They both have supportive communities behind them. If you have friends doing one or the other, join them because you can always ask them for help along the way.


Ready to start learning? Check out these courses:
One Month Ruby | One Month Python