
Code to joy: learning to code in middle age - js2
https://www.1843magazine.com/features/code-to-joy
======
mwcampbell
I wonder if a guided introduction to JavaScript, restricted to just the good
parts and using some tools such as a linter to enforce that, would have made
it more approachable to the author. Maybe use TypeScript in strict mode, along
with a project template for a minimalist framework (e.g. Vue).

I loved Python for years, going back to when I discovered it in the Red Hat
Linux installer in 1999. But it seems to me that Python has been sliding into
irrelevance for a while. Even now, 10 years after the introduction of the
ihone App Store, I don't know of any mature way to develop a mobile app with a
native UI in Python. The same goes for using Python in the browser. So for the
things that most people actually want to do with code, Python is relegated to
the server (assuming there is one), and they have to learn something else
anyway. So, might as well start with the something else that will get you the
farthest.

~~~
nicoburns
Python has huge relevance in data science, which is a vast and growing field.
It isn't going anywhere.

------
japhyr
I had the pleasure of meeting Andrew Smith (the author of this article) at
PyCon a few weeks ago. He was really interesting to talk to.

He said he was interviewing one of the people who walked on the moon a while
back. The guy stepped out of the interview to take a phone call, and when he
came back he said he just learned that one of the other men who had walked on
the moon had just died. Andrew reflected on this, and recognized that these
men are dying and soon there will be no one left alive who has walked on the
moon.

He decided to track down each of the people who were still living who had
walked on the moon, and hear their stories firsthand. The premise of the
conversations was, "What do you do after you've walked on the moon?" He wrote
a book about it, called Moondust. I haven't read it yet, but it's in my Amazon
cart at the moment.

~~~
Stratoscope
You might want to read the one-to-three-star reviews before ordering. If they
are to be believed, Moondust is less about the astronauts and more about
Andrew Smith.

------
Bromskloss
Help! My mother has expressed an interest in learning programming. How do I do
this best?

~~~
Doxin
For people without a specific goal in mind I'd recommend getting them set up
with the Python3 turtle module. It's fairly self-contained and allows for
immediate results. Additionally it's very easy to nudge people when they are
using the turtle module. e.g. after introducing loops ask if they can draw a
square using only one forward() and one rotate(). after introducing functions
you can ask if they can make a functions to draw N-gons. what happens if you
try to draw a 100-gon? etc etc.

After use of the turtle module is comfortable python offers no end to
possibilities in other areas.

That said, "best" is surprisingly subjective when it comes to programming, so
feel free to go a different route if that feels more appropriate.

------
giblaz
The error in the author's code seems to be better described as an "unnecessary
function call" than a "stray parentheses". I spent more time looking for that
stray parentheses than I should have before noticing the call to .title().

Very good article though.

~~~
lozenge
str.title is a method, the code is correct - it's the fixed version.

------
Barrin92
Very well written article. I think everyone can definitely emphasize with the
confusion that comes with having to dig through APIs and tooling for the first
time.

When a friend asked me to teach him some python the most stressful part for
him was setting up the editor, understanding the command line and how an API
worked as well. Like the author he grasped fundamental python pretty quickly.

I think there's still no really good solution to make the whole process
appealing. You can have people write puzzle solutions which circumvents the
API and documentation issue but doesn't produce a real project, you can give
them an IDE which avoids the command line but doesn't teach much and often is
too complicated for a simple script, and so on but there's always some nasty
issue for beginners in the process.

~~~
noonespecial
The Lazarus IDE short circuits most of these problems and can quickly build
some very "real" feeling apps that can solve real problems for people just
learning to code.

It is object pascal (with the attendant quirks) but it seems to be code-ish
enough that people can transfer on to more modern languages without too much
fuss.

[https://www.lazarus-ide.org/](https://www.lazarus-ide.org/)

~~~
cylinder714
Jeff Duntemann has uploaded a draft of his upcoming ebook, _FreePascal from
Square One_ , a revised version of his earlier books on Turbo Pascal and
Borland Pascal:

 _The book’s mission is to be what Assembly Language Step By Step is to
assembly language: An absolute beginner’s tutorial on programming in Pascal.
This includes people who have not yet learned what programming is and have
never written a line of code in their lives._

[http://www.contrapositivediary.com/?p=4034](http://www.contrapositivediary.com/?p=4034)

------
Clubber
>For the very first time I began to suspect that coding really was an art, and
would reward examination.

It certainly is. Back in the day, software developers were called "authors."

>BookOmatic9000

That's ... just ... horrible. Yea, naming things is tough.

Anyway, good luck. I've been doing it since 3rd grade in the 80s, and it's
still interesting. Except Javascript; that's the opposite of interesting.

~~~
thelastidiot
I second the comment on javascript. I hate the language so much I keep hitting
refresh daily on webassembly to monitor its penetration. Javascript is just a
joke and like everything that makes no sense it gets the votes from the
industry.

~~~
cjmoran
Hm. Have you taken the time to learn all the new features and develop
something with them? Most people who work with JavaScript these days seem to
like it quite a lot, myself included. Since ES6 released it's become a solid
language with a few strange quirks, whereas it used to be a crappy language
with a few useful features.

~~~
linkmotif
ES6 is really nice but it’s still JavaScript so it’s untyped and therefore
much less pleasant to work with at any kind of scale than, say, Java+IntelliJ
which is like butter. Not sure which static typed languages will be
WebAssembly-able, though? Go? Rust?

~~~
joepie91_
JS isn't "untyped", it's _dynamically_ typed. And this is absolutely not a
problem at scale if your development practices are up to scratch - or at
least, not a bigger problem than the myriad of other design tradeoffs that
every major language has to deal with.

Static typing is massively overvalued. It has non-zero value, but it's a
_tradeoff_ with other things, and the amount of importance that people tend to
place on it is absolutely out of proportion with the _actual_ value it
provides.

EDIT: This extends beyond just 'static typing', as well. The design of
programming languages is an exercise in tradeoffs, and people rarely take the
time to understand the tradeoffs introduced by their pet language feature,
instead presenting it as some inherently ideal thing where any language that
doesn't have it must _therefore_ be bad.

~~~
Clubber
It's not scaling issue, it's a refactoring / maintenance issue. Weakly typed
languages cost much more to maintain because you can't have good refactoring
tools.

In a strongly typed language, if I want to rename a parameter that is used in
20 places, I can hit "Rename," rename it, and it will rename all 20 instances
with perfect precision, and that's it. With weakly typed languages, you have
to search and replace, which is much more prone to error. This is much more of
an issue for JS applications that are much larger than just doing some stuff
on a page.

I agree, it's a tradeoff. Many languages these days can do both. The best is
strongly typed until you are dealing with JSON or something of that nature.

~~~
joepie91_
There is absolutely no reason why this wouldn't be possible in a dynamically
typed language. I'm in the process of building such a tool for JS, in fact.

You don't need static typing to do codebase-wide renaming, it just makes it a
little easier to _build_ the refactoring tools, but since that is a one-time
cost it's not really a particularly important factor in the language design.
Other language design decisions have much more influence on this development
cost, too, such as reassignability and scoping rules.

"Strong typing" is also something totally different from "static typing" \-
I'm not sure why you're bringing it up here. The two are not interchangeable
terms.

EDIT: Actually, doesn't Webstorm _already_ do such mass-renaming for JS?

EDIT 2: I also object to the use of the word 'refactoring' to refer
exclusively to renaming variables. Proper refactoring involves _much_ more
work, most of which isn't automatable regardless of the language you're using.

~~~
linkmotif
> You don't need static typing to do codebase-wide renaming.

But you do. WebStorm isn’t magical. It can’t understand your untyped code like
it can understand typed code.

The more I’m reading your comments on this thread the more I’m not sure you’ve
ever used a static typed language with a good IDE. If I am correct, I think it
makes more sense for you to try Java/IntelliJ and then weigh in on this
subject. You may have a very different opinion.

