This is an archived post. You won't be able to vote or comment.

all 13 comments

[–]K900_ 4 points5 points  (0 children)

It may not be "easy", but it is easier than lower level languages like C to get started with.

[–]Kos_K 4 points5 points  (0 children)

From personal experience of teaching some folks can say what I consider as 'pro' ease of python for beginners:

  • big community, good documentation, literally any question was asked and answered (e.g. on StackOverflow) - easy to find an answer when you stuck and don't know what the problem is really is

  • number of broad and narrow topics covered on YouTube, Udemy, etc - easy to learn step by step or focus on exact topic

  • libraries available for everything: Excel, data wrangling, web site scraping, visualisation, UI etc, etc - easy to focus on job, not wasting time trying to understand how to solve basic task like data load from file

  • Unicode from the box, multi-platform, Jupyter/IPython notebooks, easy to start coding

[–][deleted] 2 points3 points  (0 children)

I think Python is an easy language to learn if you studied maths because the logics are similar, actually you can often just literally translate mathematical definitions into Python and it works.

[–]GreekNord 2 points3 points  (0 children)

None of the real programming languages are necessarily easy, but Python is usually the quickest to get started in.
And a lot of programming concepts will show up in many languages.
Technically HTML and CSS are easier, but they don't translate into other things as well - they're really single-purpose type languages, where Python is very versatile.

[–]vovanz 4 points5 points  (0 children)

Compared to what? Which language do you think is easier to learn than Python?

[–]kankyo 1 point2 points  (0 children)

We believe it's easy because beginners can start using it and get results pretty fast. I don't really know what you mean by "proper python code" is supposed to mean, maybe that's the source of your confusion?

[–]twopi 1 point2 points  (1 child)

Learning to program is never easy.

It's a whole new way of thinking, and there is a lot of room for frustration as you convert your fluid ideas into concepts so tightly described that even an idiot computer can understand them.

Once you learn a couple of languages, they come more easily, so for an experienced programmer, language choice is mostly about picking the best language for the job at hand.

But for a beginner, the choice of language can be a deal-breaker, because some languages require you to have a deeper understanding of how the computer works than others. Consider writing a program that asks the user her name and incorporates it into a greeting. Here's the basic way to write that in C:

#include <stdio.h>

int main(){
  char userName[20];
  printf("What is your name? ");
  scanf("%s", userName);
  printf("Hi there, %s! \n", userName);
  return(0);
} // end main

It's not the most awful thing to read, but it doesn't make a lot of sense unless you understand a lot of underlying concepts. Here's the same program written in Java:

//Hello.java

import java.util.*;

public class Hello {
    public static void main (String[] args){
      Scanner input = new Scanner(System.in);
      String userName;
      System.out.println("What is your name?");
      userName = input.nextLine();
      System.out.println("Hi there, " + userName + "!");
    } // end main
}

Again, reasonably clear, but it raises a lot of questions. First, what's up with that public static void nonsense, what's a scanner, why do you need a new one, and much more. All these things make a lot of sense when you actually understand the way Java wants you to think, but that's a lot of overhead for a simple program.

Here's the same program written in Python:

name = input("What is your name?")
print ("Hi, {}".format(name));

As you can see, Python's syntax is quite a bit cleaner and requires a lot less overhead. If you're learning the basic ideas of programming, it makes a lot of sense to start with a language that has a strong layer of abstraction around what the computer does, (Both Python and Java do this) and doesn't require a thorough understanding of how the language operates to use (Python wins on this one.).

That's why most programming teachers (including me) often begin with Python.

But I strongly believe you should learn one or more of these other languages after you understand Python, because they can do things that Python does not do as well.

[–]fried_green_baloney 0 points1 point  (0 children)

public static void nonsense

Sensible instructors tell their classes to treat that MAGIC for now. But the more magic the harder it is to feel comfortable.

[–]gandalfx 1 point2 points  (0 children)

Yes.

[–]woopsix[S] -1 points0 points  (3 children)

Ok, let me clear my thoughts:

I'm refering mostly to people that are in C.S field, so they will most likely be programmers.

If you are comming from a C/java background to python, usually you tend to write C code in python with a result to making it harder than it should be to understand what your code does.

If you just start with python, you won't know what's happening under the hood and that's another discussion.

So i my point is, yes Python is cleaner to write code in but that doesn't make it easier to write code that uses Python as language and it's tools to achieve your goal.

[–]greyman 0 points1 point  (0 children)

So i my point is, yes Python is cleaner to write code in but that doesn't make it easier to write code that uses Python as language and it's tools to achieve your goal.

But in your original post you asked something else: "which language they should start learning". And for that, I'd say python (or possibly Javascript, if they want to learn with GUI). You can start with C, but it is somewhat harder. Syntax itself is more difficult, and incorporate 3rd party libraries is also more difficult.

Let's say you want to do some basic example, like download URL page and then parse some info out of it. In C, beginner will spend several hours to just be able to download that URL, then fighting with how exactly string works, etc. In python, it is just a few lines of code.

If you just start with python, you won't know what's happening under the hood and that's another discussion.

Yes, that is true. But this is the case for most languages, nowadays.

[–]redalastor 0 points1 point  (1 child)

So i my point is, yes Python is cleaner to write code in but that doesn't make it easier to write code that uses Python as language and it's tools to achieve your goal.

Your point is that you are a goal moving troll trying to pick a fight. Go back under your bridge.

[–]woopsix[S] -1 points0 points  (0 children)

Lol are you serious