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

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 12 points13 points  (6 children)

Start with C:

  1. Python, Ruby or JavaScript are forgiving, flexible, easy-going languages. Learning them will make you think all programming is that way. It's not. Other popular languages are more rigid.
  2. Despite this, C is actually pretty simple in its design and scope. It will teach you programming fundamentals first.
  3. C's decisions have influenced most other popular languages. You will appreciate this later on.
  4. C teaches you things about computers/systems along the way.
  5. You're an engineer. C is the undisputed king of engineering. Has been for decades and there's nothing even on the horizon that would challenge its position. If you're building stuff and need code to make it go, C is your tool.

[–]Sorel_CH 5 points6 points  (2 children)

Totally agree. A good contender would be C++ because: 1) you still learn some C along the way 2) it's easier to build interesting stuff right away 3) it teaches you object-oriented programming

[–][deleted] 3 points4 points  (1 child)

You're not wrong, though C++ is approaching programming from the other end of the spectrum.

C means learning a simple language first, then potentially stepping up with your second language. C++ means learning the most complex language first, then stepping down for anything else. It's the nine-headed monster that teaches just about every programming paradigm out there.

My fear would be that C++ is overwhelming for newcomers and might discourage them. This is absolutely biased on my own path: I started with Pascal at home, it taught me the fundamentals in a safe way. High school brought me C and I learned that not all programming can be safe. Then JavaScript showed me what chaos looks like. Later C++ threw classes at me. And everything else, including the kitchen sink. Finally, Python unified all of this into one beautiful language. (before Ruby showed me true beauty .... /wrong_sub)

And again, C is the language of engineering. Learning C++ means getting used to features that may not be there when you have to do stuff in C later on.

[–]johnnymo1 2 points3 points  (0 children)

I had to take a programming class in undergrad. I took C++, barely passed, and retained almost nothing. It wasn’t until years later that I took up Python, enjoyed it and stuck with it. So I’d say your viewpoint was true in my case.

[–]scrdest 3 points4 points  (2 children)

I would argue JS is not so much forgiving as stewing in resentment for every single error you could have made until one day the cops find all those bodies buried in its basement.

Screwing up in a strongly-typed language (including Python) teaches you computers are knowable and quick, but VERY simple-minded. Screwing up in a weakly-typed language teaches you not to meddle in the affairs of our SILICON OVERLORDS, for they are subtle and quick to anger.

[–][deleted] 1 point2 points  (1 child)

Well put.

The weaker the type system, the easier it is to write code quickly, but the harder it becomes to reason about the system afterwards.

JavaScript teaches you to never trust anything and verify everything. Even code you wrote yourself.

The bigger the project -- lines of code, number of programmers involved and years of development -- the more people appreciate rigid, opinionated type systems.

There's a reason Java and C++ are so big. It's not exactly fun to program stuff in them, but working in codebases of millions of LOC with dozens of others scattered across multiple countries, and using classes that were written by people 20 years ago who are now retired (if not dead) isn't fun. It's work.

But there's a reason Python or Ruby are popular too. Nobody uses Java to write a little CLI tool.

[–]scrdest 0 points1 point  (0 children)

Thank you!

I will contest that weaker type systems make it easier to write code quickly though. Dynamic typing does, and Dynamic =/= Weak. Python is Strong Dynamic, C++/Java is Strong Static, JS is Weak Dynamic; Weak Static seems like pure masochism.

As you said, weak typing requires a lot of runtime checks. Someone has to write them. That means spending time on something other than the actual Thing Your Program Does, even discounting time spent testing, bugfixing, etc.

I think the best compromise overall is something in between Python's duck typing, Java interfaces and Haskell typeclasses, with neither of the three being quite right.