understanding javascript promises book question and thoughts

20 views
Skip to first unread message

Mark Edwards

unread,
Apr 28, 2023, 2:53:09 PM4/28/23
to Zakas Books
first off, THANK YOU for writing this book.  i have looked at a number of promises resources, all equally confusing.   this one is the first one that acdtaully makes any sense!

i strongly admire anybody who writes technical books.  and especially today when the knowledge contains in the books seems to have a short "shelf life".  its as if anymore you cannot even get them published fast enough before they go obsolete.

on page 8 i read:

Assigning Handlers with then()

The then() method is present on all promises and takes two
arguments.  The first argument is a function to call when the
promise is fulfilled, called the fulfillment handler.

is the first .then() argument to be returned an actual function?   to me it looks more like a returned object.

also (suggestion) - i see the following:

const promise = ....

many technical book examples use variable names that are EASILY mistaken for a reserved word to a newbie idiot like myself.   imho i like to see something more like:

const nicholasPromise = ...   // no mistaking this for a reserved word!

lastly, is there any way i can get this book in print?   (ya old school guy here...)

Nicholas Zakas

unread,
May 5, 2023, 1:43:34 PM5/5/23
to zakas...@googlegroups.com
Replies inline

On Fri, Apr 28, 2023 at 11:53 AM Mark Edwards <ma...@edwardsmark.com> wrote:
first off, THANK YOU for writing this book.  i have looked at a number of promises resources, all equally confusing.   this one is the first one that acdtaully makes any sense!

Thanks, I’m so glad you found it useful. 


is the first .then() argument to be returned an actual function?   to me it looks more like a returned object.

Sorry, I’m not quite sure what you’re asking here. If you can share some example code that would help. 

many technical book examples use variable names that are EASILY mistaken for a reserved word to a newbie idiot like myself.   imho i like to see something more like:

I understand this inclination, but longer variable names tend to make examples both harder to understand and harder to format in a readable way. In most cases, the confusion is limited to the first couple examples before it clicks for folks. 

lastly, is there any way i can get this book in print?   (ya old school guy here...)






--
You received this message because you are subscribed to the Google Groups "Zakas Books" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zakasbooks+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zakasbooks/068f4966-c365-4ffb-93ca-983fb5cb038bn%40googlegroups.com.
--

______________________________
Nicholas C. Zakas (@slicknet)
Owner, Human Who Codes LLC

Mark Edwards

unread,
May 6, 2023, 4:56:18 PM5/6/23
to zakas...@googlegroups.com
your book arrived from amazon today!    and now its time to look into getting it autographed by the author......  😊

>>>   Sorry, I’m not quite sure what you’re asking here. If you can share some example code that would help. 

sorry i misunderstood earlier.    i was mistakingly referring to what the previous promise actually returns, not what we feed to the promse.   i forgot that we do something like:

`then ( (stuffReturnedFromPreviousPromise) =>  { console.log('this is my function executed by the current promise');})`

my mistake!  


>>>  I understand this inclination, but longer variable names tend to make examples both harder to understand and harder to format in a readable way.

just thinking something short like:

`const myPromise = ....`

to avoid confusing names with reserved words.   imho.


for whatever reason, promises has been a difficult subject for me to grasp.  maybe it's because i was first learning async/await/resolve/reject but never really gained any traction.


Thank you,

Mark Edwards


You received this message because you are subscribed to a topic in the Google Groups "Zakas Books" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zakasbooks/lW35SFT_Hc8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zakasbooks+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zakasbooks/CAOkd9h%3DiPKsENi%2BeG9TsmxMgFkPMUiqQCNpx9z%2BwgTcnd7Lj%2Bw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages