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

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.

1

u/lead999x Feb 12 '19

Oh me too. Of all the languages I've tinkered with, Rust is my favorite by far. And on top of its stellar language design it has Cargo which alleviates one of my biggest headaches as a hobbyist dealing with C and C++: building and using libraries. I especially despise ones with a shit ton of dependencies where you have to download them all and add a bunch of headers to your include path and add their corresponding static libraries to the linker path and hope you got it all right. Here's hoping C++ modules alleviate this somewhat in the future.

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.

4

u/gyroda Feb 09 '19

C is a good start if you're trying to bece a well rounded programmer/CS person and you're willing to put a lot of effort in. It's great for taught courses where you've "trapped" someone in to a structured plan of learning because it helps inform things like computer architecture and how compilers work and other fundamentals. I recommend it for any course where students have opted in.

But for a brief "I just want to see if this is for me" or "introduce the masses to programming" python let's you get to some of the joys of programming easier. It's let's you build faster and have something to show for it easier. This makes it a very good "hook" to see if people might be interested in studying it further. I'd also put web development in here, despite my dislike of JS, because of the ease of getting something graphical up and running in a single, initial sitting.

2

u/strikingLoo Feb 09 '19

Bit out of topic but, what kind of project do you do where you get to use C often?

4

u/thezennihilist Feb 09 '19

I write firmware for a line of automated chemical sensor instruments. The hardware I work on is a handful of microchips on different circuit boards that control things like motors, heaters, and various sensors.

2

u/Yithar Feb 09 '19

I'd argue C is a better start. I'd also argue that Python teaches you things that don't transfer to other languages well.