[kwlug-disc] Fw: Re: Learning Javascript

Mikalai Birukou mb at 3nsoft.com
Sat Mar 13 15:58:12 EST 2021


>> A lot of Javascript now revolves around "async/await", and there are a lot
>> of blog posts currently being written about what a nightmare this is.
> Personally when I was teaching this stuff I prefered to get through the
> mental gymnastics of Promises and async/await early on so that the students
> could get the developer experience improvements sooner. Async/await is hard
> to learn but having gotten through that I couldn't imagine building things
> without it. I think you kinda touched on that in what you were saying about
> industrial programming - but I'd go further to say async/await is useful
> for writing manageable javascript in general and not just about performance
> optimization.

I mentally can colour code before and after each await. Each section 
with different colour, each is a closure callback in a chain of 
promises. In "parallel" thing happen only with explicit 
Promise.all(promises_array). All other cases are consequent colours. And 
it is simple to reason about. More so, while you are in control flow no 
values change without you -- really easy way to write concurrent code.

>
> Also I really appreciate the reference to the color of functions article -
> that's one of my all time favourite JS articles ^_^
>
> - Rob
>
> On Sat, Mar 13, 2021 at 1:54 PM Doug Moen <doug at moens.org> wrote:
>
>> I only dabble in this stuff, but I have some opinions based on hobby-level
>> programming and blog posts. People who write javascript for a living may
>> have better opinions.
>>
>> Elm is a lovely language. It's a strongly-typed, pure functional
>> programming using the "Elm Architecture" as the framework, and that
>> requires a specific kind of thinking. It's a kind of thinking that I find
>> very easy to deal with as a programmer. Elm has nice error messages and
>> provides a guarantee that clients will never see run-time errors in their
>> web browsers when running your code. Elm compiles into Javascript.
>>
>> Javascript is object oriented (forcing you to mentally track shared
>> mutable state) and dynamically typed, the opposite of Elm. A lot of
>> industrial shops are switching to Typescript in order to get better compile
>> time checking. Typescript compiles into Javascript and is largely
>> compatible with it.
>>
>> A lot of Javascript now revolves around "async/await", and there are a lot
>> of blog posts currently being written about what a nightmare this is. (Even
>> though it is supposedly an improvement over earlier frameworks.) Many of
>> the blog posts refer back to this famous post:
>> https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/
>> I have now classified "async/await" as something to be avoided for my
>> hobby programming. And I have no corporate masters who require me to learn
>> and use it. I understand that async/await is currently essential for
>> industrial programming at a scale where you are dealing with millions of
>> network connections.
>>
>> The React framework seems to predate async/await. It is essentially a
>> third way of thinking about how to program, and about what triggers
>> functions to be called. It seems to be an improvement over the previous
>> paradigm of "callback hell". My impression is that the "Elm Architecture"
>> is nicer to work with than React.
>>
>> I understand that you can combine React with async/await.
>>
>> I think there are multiple ways of thinking about programming in
>> Javascript depending on which framework and language features you use. I
>> also think that a solo programmer building a low-traffic web site has
>> different requirements for their language and framework than an industrial
>> programmer working in a large team at Facebook.
>>
>> On Sat, Mar 13, 2021, at 1:12 PM, Paul Nijjar via kwlug-disc wrote:
>>> I do not understand JavaScript and it is holding me back.
>>>
>>> I have basic familiarity with programming in other paradigms (Python,
>>> Powershell, Java, C, even Scheme) so I understand basic syntax like
>>> variables and if statements. I do not understand how JavaScript wants
>>> me to think, and I am looking for some resources to work through so I
>>> can learn. Questions I have:
>>>
>>> - How does JavaScript want me to think?
>>> - What triggers particular functions to be run? I do not really
>>>    understand the control flow.
>>> - Do the popular frameworks (React, VUE, Angular) mean you have to
>>>    change the way you think from vanilla JavaScript?
>>> - Say I want to learn Elm. Does this hurt me or help me when trying to
>>>    learn JavaScript?
>>>
>>> Some overview articles would be good to start, followed by some
>>> hands-on tutorials that illustrate language features step by step. I
>>> do not think I want to commit to some six month course right now, but
>>> if you know of good ones then pass them along.
>>>
>>> I realize that this is not completely on topic for this forum (and
>>> maybe I will try KWTechs later) but I thought this is a place to
>>> start.
>>>
>>> - Paul
>>>
>>> --
>>> Events: https://feeds.off-topic.kwlug.org
>>> Blog: http://pnijjar.freeshell.org
>>>
>>> _______________________________________________
>>> kwlug-disc mailing list
>>> kwlug-disc at kwlug.org
>>> https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>>>
>> _______________________________________________
>> kwlug-disc mailing list
>> kwlug-disc at kwlug.org
>> https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>>
> ----- End forwarded message -----
>
-- 
Mikalai Birukou
CEO | 3NSoft Inc.




More information about the kwlug-disc mailing list