

Ask HN: If I learn one programming language, what should it be? - reesdreesd

I want to dedicate a few months to learning a programming language (part time) in order to achieve the following two goals:<p>1) Be better prepared, as a founder, to understand engineers.
2) Add a &quot;hard&quot; skill I can use to earn money on the side (e.g., while bootstrapping).<p>To clarify, I&#x27;m not a founder yet, but that may change soon. I have very basic knowledge of programming: a semester of C++ (15 years ago) and some dabbling in AppleScript, shell scripts, and html&#x2F;php&#x2F;css.<p>Of course, I realize that I won&#x27;t master anything with only a few months of study. Nevertheless, I&#x27;d like to do what I can to improve my chops in the time I have.<p>If you were in my shoes, what language would you invest in?
Can you recommend any resources to help me learn it (e.g., books, online resources)?<p>I&#x27;d really appreciate advice from the HN community.
======
dragonwriter
I'd have to say Python; while its not always the best choice to use, its a
great language to learn, because its used in lots of domains and because it a
very good place to learn the basics of lots of different aspects of
programming, and it has great learning material available for both general
programming and many specific application domains and platforms, so it
supports lots of approaches. If you decide to continue with it, its easy to
keep learning with it; and if you decide to switch languages, its easy to take
the lessons learned in Python to lots of other languages.

------
alansmitheebk
I would recommend Java. Recent surveys of programming languages have ranked
Java as the second most widely used programming language after JavaScript.

Java is a strongly-typed "classical" object-oriented language with C-like
syntax. These characteristics make it an ideal foundation upon which to build
your knowledge of programming.

Many of the newer and more popular languages deviate from the "classical" way
of doing things. For example, many are loosely typed. Some use a simpler
syntax without semicolons or curly braces. Others have a non-traditional OO
model, or a hybrid OO / functional model.

You will likely encounter problems if you skip over the "classical" style
languages and head straight for something like Ruby or JavaScript. For
example, when you start to get into the more advanced parts of JavaScript, all
of the books and tutorials explain things by contrasting with Java or C#.
Therefore, if you don't have that classical knowledge, the comparisons will be
meaningless.

If you start with a loosely typed language, you won't understand why your
JavaScript developers are debating using TypeScript, or why your Ruby devs are
debating switching to Java or Scala to build the app to scale. If you start
with Ruby or Python you will never be comfortable with languages that use
curly braces and semicolons.

I started out by learning PHP. It was a mistake. If I could go back in time I
would have learned Java first. When I started to learn object-oriented
programming it was tough because I had to unlearn the procedural way of
thinking which was very common amongst PHP developers at the time. When I
wanted to learn Android development I was confused by the use of types in
method signatures. I had to go and learn Java-101 before I could do anything
more than write a layout file.

I hope this helps...

------
Todd
There are a number of good answers here on general programming. If you want
your knowledge to be relevant to your startup, it might depend on what kind of
startup you're doing. Will it be mobile focused or Web, for example?

If web, you might go after JavaScript and some back end language (you already
have some PHP background), plus HTML and CSS. Build a simple Web site.

If mobile, pick your poison. Many mobile startups start with iOS. Now is a
great time to learn iOS since Swift lowers the barrier to entry significantly.
If you're going after the larger Android ecosystem, then Java. Android also
has the advantage that you can develop on other OS'es like Windows.

I would also recommend getting a great book and working though the examples.
Then supplement with what you can find on the Web.

Good luck learning and with your startup!

------
davidw
Javascript is pretty widely applicable these days, even if it's maybe not a
thing of beauty.

~~~
antoniuschan99
I agree. A lot of people have adopted it and there's a large community.
Perfect for someone starting out. You will be googling/stack overflowing a lot
so its good to know there are a lot of resources behind it. Plus you know th e
language is growing not dying.

~~~
reesdreesd
I really appreciate the feedback. JavaScript is supposed to be complicated.
Let's say I study 20 hours a week for three months. Can I get off the ground
with it?

~~~
davidw
JavaScript is kind of ugly in some ways, but not really complicated. You could
easily pick up the basics in that time frame.

I've heard people say good things about this book:

[http://www.amazon.com/JavaScript-Good-Parts-Douglas-
Crockfor...](http://www.amazon.com/JavaScript-Good-Parts-Douglas-
Crockford/dp/0596517742/?tag=dedasys-20)

But I've never read it myself.

~~~
reesdreesd
That's encouraging. Thanks for the reference.

------
serg_chernata
First pick a platform, are you more interested in native mobile or something
web based. I primarily work with PHP but I've also tried Ruby and Python.
Either one could be my next. Truth be told, just make sure you keep asking
"why" and understand the basics. After that, switching to a different language
will be pretty easy and you'll mostly have to worry about learning the popular
frameworks and libraries.

------
TheKickOff
Java. Despite what you may hear about it, this remains the number one or two
(depending on who you ask) language in use.

It has a HUGE amount of libraries available and the standard library (SE and
EE) cover a lot of ground.

~~~
GoldenMonkey
nada, too much overhead... get something lightweight... you can run python in
the terminal.

~~~
bnejad
You are aware that you can also run Java "in the terminal" right?

------
mak4athp
Whatever strikes your fancy. If you're pursuing startup culture at your age,
and you aren't trying to become a developer/engineer yourself -- you have all
the freedom in the world.

You've probably got more honed skills to contribute actively, and you won't
have opportunity to make especially useful contributions programming in
anything that's widespread. So you can dable in something popular to be able
to read it better, explore something esoteric to have something novel in your
toolkit, or just pursue something that's personally practical like the systems
scripting and web stuff you've already been toying with.

Don't overthink it. Just find the one that gets you excited and spend whatever
time on it you'd like.

------
c4obi
Python if looking at a dynamic language! It will get you up and running in no
time; the syntax is also very easy to understand and easy on the eyes...If you
want a statically typed language then go with Go..it feels like python with
types

------
Blackthorn
While I hate actually using it for production tasks, I have to admit that
Python is the best language ever to learn. Its syntax doesn't really get in
the way at all and it is extremely understandable. It's also widespread.

~~~
reesdreesd
Why do you hate using Python for production tasks?

~~~
Blackthorn
In my experience/opinion: get over a certain number of lines of code and the
type system starts getting in the way rather than getting out of the way. This
number is not obvious and is very easy to pass without realizing it until it's
too late.

~~~
itsybitsycoder
Hey, not arguing, just curious, do you have some examples of times where the
type system has gotten in the way? And what languages you prefer to use for
production systems that don't have those problems?

~~~
yen223
Simple example: Say you're working with an external library. And say you need
to work with this function:

    
    
        def convert_to_int(val):
            ....
    

What type should val be? Do you pass the object, or a string representation of
the object, or...?

The problem with Python - and non-statically-typed languages in general - is
that function signatures don't need to be defined upfront, which leaves it up
to the programmer to figure out the inner workings of the functions. This is a
huge pain point when working with other people's code.

Python 3 introduced function annotations, which is great. But again, the
problem here is that function annotations are opt-in. It's still up to the
developer to add the annotations.

------
wz1000
> Be better prepared, as a founder, to understand engineers.

Be careful, you may start to suffer from the Dunning-Kruger effect[0]. You
would only begin to understand what engineers are doing after a substantial
experience with programming real world applications. However, your limited
experience may make you over-confident in your abilities.

[0]:
[http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect](http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect)

------
mod
Really should tailor it somewhat to what you intend to build.

I'd recommend Python or Javascript without knowing more.

Python is useful in a variety of applications, both web and desktop, multi-
platform, low barrier to entry but will get you a long way.

Javascript _can_ be all you need on the web (though my stacks all have another
language involved).

Python is great for the web as well, but you'll need javascript, too. It's
pretty inescapable.

------
M8
A multi-paradigm, multi-type-system, multi-runtime, cross-platform one: C#.

------
marvel_boy
If you have a background on C++ I recommend to try something radically
diferent like Clojure:
[http://www.braveclojure.com](http://www.braveclojure.com)

------
jpetersonmn
I'd vote python. It's pretty easy to learn and is very helpful for many types
of programming.

------
drallison
Why learn a single _programming language_? Why not several? and by doing so
get an understanding about what programming and computation is all about. From
100,000 feet, most programming languages are similar. When you know several
you begin to see the unifying structures they support, and that may give you
some insight into how computation is related to problems.

~~~
gamechangr
I think learning one sounds hard for someone new, so learning two sounds
impossible.

Inch by inch...

~~~
drallison
I strongly disagree. Learning multiple languages imparts understanding and
provides an important perspective on what programming is about and how
programs work, and how they go together. Languages are, for the most part,
easy. What's hard is the other stuff.

------
lingua_franca
python might be best for a non-technical person to pick up.

------
totony
Java it teaches you how to use pure programing schemes :)

------
DanielStraight
Python 3.

It is fairly simple to learn. It is cross-platform. It is suitable for server-
side programming. It has an extensive standard library and an active ecosystem
for additional libraries. It has IPython. It uses, and therefore helps you
learn, but does not force object-oriented programming. It has enough
functional programming to let you explore that concept. It is widespread and
easy to find support for. It has numerous tutorials taking a wide variety of
approaches, you can easily find something that works for you. It has more
active projects on GitHub than any language but JavaScript or Java
([http://githut.info/](http://githut.info/)).

Why not Python 2? Python 3 is better out of the box (comes with pip, has
better standard libraries) and more consistent. As a new programmer, you won't
need anything that's limited to Python 2.

Why not JavaScript? It's too strange. Most of what you learn in Python is
fairly applicable across languages. JavaScript has a strange object model,
doesn't distinguish int/float, has odd rules for scoping (var/no var,
hoisting), has too many ways to do the same things (function / var f =
function, new Object() / {} / Object.create), has a confusing concept of
'this'. Learning JavaScript will not help other mainstream languages click the
way Python will.

Why not Ruby? Ruby and Python are, from a new programmers' perspective,
completely equivalent, but Python seems to be winning the popularity contest,
so you'll likely find more libraries, more tutorials, more help, etc. Ruby
also tends to be more web-focused and thus less general-purpose (by the
numbers, not by any technical limitation).

Why not C/C++? They are simply too low level for someone who isn't interested
in programming full-time.

Why not Java? Java is improving but is historically bloated and incredibly
verbose. You have deal with compilation and probably need an IDE. You
absolutely must use object-oriented programming. Support for functional
programming is either effectively non-existent or simply not as smooth
depending on which version of Java you're using. Too much overhead (in terms
of what you have to understand and deal with) for small, simple programs.

Why not Go or Rust? Too new to have thorough support. Uncertain future.

Why not Haskell / Clojure / Erlang / Factor / etc / etc / etc? Too esoteric
for a new programmer.

Why not Objective-C or Swift? Too limited in scope.

Why not C#? Actually, if you're on Windows, this is a pretty good choice, but
it's not fully cross-platform (yet) and doesn't have the variety of choices
for server-side programming that Python does. It also doesn't have as
extensive a set of open source libraries.

~~~
reesdreesd
Thank you for the detailed reply! A number of comments here favor Python for
ease of entry and utility.

Do I understand correctly that Java is important, but with a much steeper
learning curve?

~~~
DanielStraight
Java is widespread. Whether it's important or not depends on the project. It's
not so much that Java has a steep learning curve, it's that Java has the Java
way of doing things (namely, object-oriented programming taken to the extreme)
and you are required to do things that way. It's less flexible than Python in
the way you can write your code. You have to have a firm grasp of object-
oriented programming to do _anything_ in Java. There's a lot of theory you
have to learn just to get started, which in Python can just be brushed aside
until you're ready to tackle it.

And with Java, you're probably going to need a heavyweight IDE instead of just
being able to use a plain text editor or a REPL or other interactive
environment (which Java doesn't have).

------
enkiv2
There's no point in only learning one language. If you can only program in one
language, you literally can't program.

~~~
reesdreesd
I've had the same thought myself. However, I'm willing to take the risk.
Besides, one thing leads to another.

~~~
enkiv2
This is not to say that learning one language is a waste of time when you then
proceed to another language. But, learning one language isn't learning how to
code, any moreso than learning how to punch is the same as learning karate --
you haven't begun learning karate until you have the basics of a wide variety
of punches, kicks, and blocks; in the same way, you haven't begun to learn
programming until you know the basics of a wide variety of languages and
techniques.

At best, stopping at your first language will give you a false sense of
competence that will lead you into making poor decisions.

By all means, learn a first programming language. But, which you choose
doesn't much matter, because you'll need to learn a second and a third before
you start to understand what it's all about.

~~~
Rainymood
You don't know 'true' mathematics until you study 18th century books in German
... I sense some sort of logical fallacy here.

If you can work with frameworks, write loops, classes, know inheritance, side-
effects, polymorphism etc but don't know functional programming, then you're
still a programmer in my eyes.

It's a scale imo, everything is relative.

~~~
enkiv2
Being a programmer implies a kind of mastery over the concepts, of the type
that you only get with experience. You only get that experience by having
experience with a variety of tools.

Knowing how to use a hammer doesn't make you an engineer. Knowing calculus
doesn't make you a mathematician. Knowing how to make a fist doesn't mean you
know karate. Knowing C doesn't make you a programmer. Instead, to be any of
these things in any meaningful way, you need mastery of a whole constellation
of related tools and techniques and ways of thinking, as well as the practice
and experience to make them work together.

You can do a lot of things with a hammer, just as you can do a lot of things
with any given programming language -- both are very useful general-purpose
tools. A programmer should understand the hammers of the programming world
(C), the flathead screwdrivers of the programming world (python), the phillips
head screwdrivers of the programming world (SQL), the power jigsaws of the
programming world (prolog), the needlenose vice-grips of the programming world
(awk), and even some of the nylon jeweler's mallets of the programming world
(erlang, haskell, befunge) in the same way that you would expect even a
relatively mediocre mechanic to recognize and understand the use of all these
tools.

A language is a single tool. Concepts are concepts, and you can apply concepts
with inappropriate tools just fine (you can write object-oriented code in c or
functional code in java the same way you can remove a bolt with vice grips or
hammer in a nail with the handle of a chainsaw).

