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

Show parent comments

13

u/[deleted] Feb 09 '19

Javascript? Easy to learn???

No. Hard no.

3

u/PC__LOAD__LETTER Feb 09 '19 edited Feb 09 '19

Just because a language has a lot of accumulated edge cases that beginners won’t be doing anything complicated enough to run into doesn’t mean that the language is “hard” or unsuitable for beginners.

Kids are taught JS in some curriculums. It’s a fine language to begin with.

Maybe you’re thinking about the plethora of different JS frameworks for web dev, in which case, that’s not really a matter of language as it is to development frameworks.

9

u/gyroda Feb 09 '19

Yep. I don't like JS. I work with it daily so it's not even an unfamiliarity thing, I just think it's got far more than it's fair share of warts.

But it's not hard to learn the basics of, and it lets you get results quickly (let's be honest, making a basic web page can feel more relevant/inspiring then text thingies in the console) and because we have browsers it's a couple of things fewer to learn (no special compiler, interpreter or commands to use, just use your regular browser).

-1

u/Yithar Feb 09 '19

Yep. I don't like JS. I work with it daily so it's not even an unfamiliarity thing, I just think it's got far more than it's fair share of warts.

I feel like you could say that about any language though. Like Java definitely has its warts. Checked exceptions are a pain in the arse in Java, for example.

It's funny because my compilers professor used Javascript as the quintessential example of why you shouldn't make a language just because you have a thought of making one.

Even though a bunch of new languages coming out. Thought I want to make a new programming language. Next thought should be “No.” This is how really bad programming languages get out there in the world. Javascript is a good example. Javascript was designed and implemented by this guy who went to the university of indiana. I used to make fun of colleagues. Made a scheme interpreter. Working at Netscape. Need some langauge to script webpages in web browser. I know i'll just do it with scheme. Curly braces lot faster than parentheses. Notation that C programmers will lkie and call it Java-something for marketing purposes. In a week, came up with first Javascript implementation. No going back. On every computer and phone. Can't make any changes, so many JS programs in the world. Argubaly the most widely used programming language.

2

u/gyroda Feb 10 '19

Like I said: JavaScript has "more than it's fair share of warts".

Every language has flaws. Some of the things I don't like in Java are fixed in Kotlin for example, and I have some criticisms of Kotlin that I don't have of Java.

But JavaScript has more issues than most languages of a comparable size/popularity/importance, both in the language itself and in the ecosystem (and I'm not even talking about nodejs and web framework land, I'm talking vanilla JS in the browsers).

1

u/circlebust Feb 10 '19

Something like Python is still exponentially easier to learn than JS, not least because JS requires you to explicity throw errors for error handling, vs. Python being 100% strict about exceptions.

2

u/PC__LOAD__LETTER Feb 10 '19

Good point about error handling. But I don’t think that Python is “exponentially” easier to learn for an absolute beginner. At that stage they’ll be learning about printing output to the screen, writing for-loops, conditionals, and basic data structures like arrays and maps. There’s nothing about JS that makes this a magnitude harder than Python.

To be abundantly clear, I would personally recommend Python over JS for a beginner. I just don’t think the difference is so significant that JS should be warned against as a beginner language, especially for those who want to learn how to program to make some sort of website.