r/learnprogramming • • Feb 08 '19

Two mistakes that trap new programmers

Most aspiring programmers get trapped and fail to move forward. As a teacher, I get to observe how some programmers keep moving forward. Here's two signs you are trapped.

Trapped coders focus on anything but coding.

Trapped programmers love to debate which language or framework is best. They spend their time figuring out what to learn and end up learning nothing at all. So let me answer all your questions.

Learn Python.

But what if I need to learn C#?
Learn C# after.

Isn't Javascript the language of the future?
Learn Javascript after.

My developer friend told me I should learn C++ because all languages are based on it.
Learn C++ after.

New programmers fear they could be wasting time learning the "wrong language". Programming is the fastest industry in history. Good developers learn new languages and frameworks on a yearly basis. Three years from now, your knowledge will be outdated. If that scares you then find a different career.

Trapped coders following directions too well.

Trapped programmers follow tutorials like mindless robots. Copying pasting code doesn’t teach you anything. Imagine starting a python tutorial that taught you how to print “hello world”.

print(“hello world”)

Most people copy/paste this and move on. If you were my student, I'd push you farther.

  1. Change the code so it prints “howdy”.

  2. Print two alerts. One that says “whats up?” and “take care”.

  3. Continue with the tutorial (usually goes to variables). After a few problems, print “hi” from mental recall.

  4. Since we probably encountered variables by now, what will the code print below? Why?

    greeting = “howdy”
    print(greeting)
    print(“greeting”)
  5. Fix the code below so it prints “hello”.

    Print(hello)

By the end of my exercises, you would have a strong idea of how print statements work. A simple line of code can create a myriad of problems. Most people brush past it only to get stuck in the future. I always recommend finding a school or mentor for guidance. If you can't do that, be proactive with your learning and keep at it.

Good luck!

1.7k Upvotes

349 comments sorted by

View all comments

140

u/TheChance Feb 08 '19

Most universities are teaching C++ or Java. Most aspiring game devs will be using C++ or C#.

I firmly believe that everybody should be working on two very different projects at once (one in your spare time and one for a living/school/etc.)

And I always advise people to learn Python, as well, but I suggest learning it as the “spare time” activity, because it’s the ubiquitous scripting language, and it’ll let you move on to algorithms and data structures and paradigms sort of in isolation. It divorces what you’re doing from the language itself in a way that lower-level languages just can’t.

If you’re approaching the first year or two from both ends, a C-style language by day and Python for hobby learning, you’ll also get a much clearer picture of how the moving parts fit together in a large application, and damn near every other tool you’ll ever use will look vaguely familiar.

But that’s my big thing. Maybe not everyone’s.

Edit:

New programmers fear they could be wasting time learning the "wrong language".

Tell them it’s like worrying about the right power tool for a beginner woodworker to learn first. Ludicrous concern. You’ll use them all eventually.

11

u/ReaperOverload Feb 09 '19

I'm currently learning C in university (and will most likely switch to Java next semester). I'm currently trying to learn webdev in my free time to 'expand my horizon' and wanted to learn Python after that - do you think it would be smarter to do Python first, and webdev later?

6

u/firecopy Feb 09 '19

Start with JavaScript for web development.

Most languages can be used for web development on the backend, but JavaScript is the language used by browsers (Chrome, Edge, Internet Explorer, Safari, FireFox, etc.) on the frontend.

If you want to learn web development and start with JavaScript, you can use both on the browser and your web server.

7

u/sldyvf Feb 09 '19

You can do webdev in Python.

Edit: For example, Flask.

0

u/[deleted] Feb 09 '19

[deleted]

5

u/TheChance Feb 09 '19

The advice most students need, but never get:

Programming languages are tools, not activities. You don’t “write Python,” you write a program in Python. Programming is the activity.

To the extent that there is one correct tool for the job, it’ll have to do with libraries and choosing not to reinvent the wheel. Hypothetically, if it’s a complete language, you could write Quake in it. Eventually.

Otherwise, just try to avoid using the wrong tools for a given job, rather than trying to figure out which tool is perfect.