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

118

u/tekneqz Feb 08 '19

Why python?

75

u/thezennihilist Feb 08 '19 edited Feb 09 '19

Really just pick any language and learn to use fundamental concepts like arrays, loops, functions, &c in that language.

Python is a great first language, it's easy to get started, it has a lot of great and useful packages, and you get high level concepts like classes/objects, iterators, even closures and higher-order functions if you really want to stretch your theory muscles.

C and C++ can be a tougher place to start, but even they aren't too bad to start with if you don't get too fancy with memory management or newer C++ features.

C is close to my heart as my first language, and it's also what I use at work. It can take some studying to really understand what happens to C code between writing it and running it but that knowledge is invaluable, IMO.

I'd recommend python and/or C but it just depends on what you want to build, really. If you want to be a front end designer then go master javascript, html, and css, and maybe learn python as a handy scripting tool.

12

u/lead999x Feb 08 '19 edited Feb 09 '19

I agree with you, C definitely is worth learning. I'm a hobby-only programmer and I started with C++98 and then moved on to modern C++, C, Rust, and D. And I'm trying to get into F# and .net. I feel like some of these languages just require more patience to learn and make things with.

3

u/thezennihilist Feb 09 '19

I'm having a blast with Rust so far. Even just the crate system feels like a huge step up from C's archaic #include nonsense.

→ More replies (2)

8

u/khante Feb 09 '19

That is the thing. Almost all universities here in India start CS programming with C language. There is enough historical data out there to tell that people who start with C/C++ do well. At this point it is pretty much a circlejerk arguement as to which language shoudl be the first and everyone is heavily influenced by what they experienced imo

10

u/don_one Feb 08 '19

Personally I think C is a better start.

10

u/[deleted] Feb 09 '19

The only real issue is someone can get hung up on the clunky things like C style strings or compiling code.

Personally I like JavaScript for a first taste simply because it doesn't require anything more than what you already have, a browser. Don't even need a text editor if you just want to paste shit into the dev console.

→ More replies (1)
→ More replies (3)

99

u/ctb33391 Feb 08 '19

It's an easy language to learn

68

u/PC__LOAD__LETTER Feb 08 '19

So’s Ruby. So’s JS.

The advice should be “just pick a language.” Not “pick Python”.

26

u/[deleted] Feb 09 '19

JS is not for beginners. It's messy, behaves weird, and is hard to write clean code. An experienced programmer can deal with these things, but a beginner will just end up developing bad habits that will be hard to unlearn.

9

u/Yithar Feb 09 '19

JS is not for beginners. It's messy, behaves weird, and is hard to write clean code. An experienced programmer can deal with these things, but a beginner will just end up developing bad habits that will be hard to unlearn.

Honestly, it's hard to argue with what you say.

TFW my co-worker graduated from a coding bootcamp that only taught Javascript and it's hard to teach her good habits. We use Typescript at work for our frontend, but she still has a lot of bad habits (using any a lot, forEach instead of map/filter/reduce, etc.).

0

u/[deleted] Feb 09 '19

[deleted]

→ More replies (9)
→ More replies (1)

3

u/gyroda Feb 09 '19

I don't disagree, the only reason I might recommend it is because web development let's you get graphical things done quickly and everyone knows what a website is, so it can be more exciting than "look, I made a text thing".

Great for getting kids interested in the field, but I agree that JS is awful and that in a structured course it should come later.

54

u/[deleted] Feb 08 '19

Just pick a language

Loving me some paradox of choice. And thats if beginners can't even make an educated decision such as "my language should be OOP".

15

u/PC__LOAD__LETTER Feb 09 '19

Anyone can google “top 5 programming languages for beginners” and just pick one.

The important piece of information is that language doesn’t really matter for learning. Not “Learn Python”.

→ More replies (7)

13

u/[deleted] Feb 09 '19

Javascript? Easy to learn???

No. Hard no.

→ More replies (6)

34

u/antiproton Feb 08 '19

The advice should be “just pick a language.” Not “pick Python”.

No. The advice is good. Because "Just pick a language" doesn't resolve the question of "which language is best". Beginners need to learn how to code. The best language is the language that teaches you how to think like a coder.

Ruby doesn't have nearly the resources that Python does and Javascript is an "easy learn difficult to master" situation.

Only people who already know how to code suggest absolute beginners learn things like Ruby or JS.

→ More replies (5)

17

u/FanOrWhatever Feb 09 '19

Pretty sure this is the kind of thing the OP is talking about.

5

u/[deleted] Feb 09 '19

no, having a specific suggestion gets past the problem, which is indecision

→ More replies (1)

4

u/Moikle Feb 09 '19

JavaScript is no way as easy to learn as python. I think you misunderstand WHY python is so easy to learn for someone who has never programmed before

6

u/mehum Feb 09 '19

If you know what you want to learn then generic advice is obviously useless, e.g. embedded => C, web => JS. If you just want to learn programming, Python is the most logical place to start. General purpose, most popular, lots of learning resources.

9

u/PC__LOAD__LETTER Feb 09 '19

JavaScript is the most popular, source. And plus, OPs entire point was that language doesn’t matter, not that Python is superior. That’s exactly the type of discussion he was arguing against.

→ More replies (43)
→ More replies (28)

39

u/Barrucadu Feb 08 '19

Because it doesn't really matter what you start with, any reasonably well-documented language would do, and you'll be learning more than one over time anyway.

→ More replies (48)

13

u/Like1OngoingOrgasm Feb 08 '19

It's designed to be extremely readable. There's tons of documentation and books to get started, and a near infinite amount of libraries to do whatever you want.

11

u/Sekret_One Feb 08 '19

Plainly, if you don't already have the answer then find that answer after- you're not going to have any context to weigh the arguments.

It's a good place to start. You can do a whole lot with it. Don't over think it.

→ More replies (1)
→ More replies (15)