(12-14-2021, 10:40 PM)ryo Wrote: So I end up wrapping everything I make in Node into "promise.then.then.then.then..."
Just use async / await to avoid nesting callbacks .
(12-14-2021, 10:40 PM)ryo Wrote: If I don't wrap everything into promises, thought process always goes like "WTF, I just solved this one bug only to create 5 new bugs!?" (refresh) "Oh, it got fixed by itself." (refresh) "NOW THERE ARE 20 NEW BUGS!?".
That doesn't sound right. Only a few things are asynchronous in Node.js like network requests and file operations (but those can be done synchronously too), because like you said async isn't always needed in programming. Asynchronous methods return promises and only with those you have to use .then or await if you want to do something after they complete.
(12-15-2021, 03:17 AM)beta-user Wrote: (12-14-2021, 10:40 PM)ryo Wrote: So I end up wrapping everything I make in Node into "promise.then.then.then.then..."
Just use async / await to avoid nesting callbacks .
(12-14-2021, 10:40 PM)ryo Wrote: If I don't wrap everything into promises, thought process always goes like "WTF, I just solved this one bug only to create 5 new bugs!?" (refresh) "Oh, it got fixed by itself." (refresh) "NOW THERE ARE 20 NEW BUGS!?".
That doesn't sound right. Only a few things are asynchronous in Node.js like network requests and file operations (but those can be done synchronously too), because like you said async isn't always needed in programming. Asynchronous methods return promises and only with those you have to use .then or await if you want to do something after they complete.
It would still be nicer if we'd have to explicitely state it's an asynchromous code in a synchromous language rather than the other way around.
But that's perhaps the kind of debate of whether we should put ice in a glass and pour soft drinks over it, or put soft drinks in a glass and then drop ice into it.
If you're a newcomer to programming, then either way wouldn't really be a problem, since you're starting from scratch.
But if you've already been programming for over a decade exclusively in ANSI C, C++, Shell Scripting, and PHP (which is me by the way), the whole concept of promises is truely a mindrape.
母語は日本語ですが、英語も喋れます(ry
Strange :
Last night my daily driver with Mobian/Bookworm required 4 separate updates in the Software Store...?
I do not remember that ever happening before.
But every one of the downloads did have different contents.
and the phone appears to be functioning just fine now.
Although sometimes I think the OS see's the next days downloads/updates before they are "released", those throw a warning about not yet available.
Worth mentioning, as this is the first time I have needed to do multiple updates in one day.
> But Nothing seems to be wrong with the phone or Software system.
LINUX = CHOICES
**BCnAZ**
Donate to $upport
your favorite OS Team
01-20-2022, 03:35 AM
(This post was last modified: 01-20-2022, 04:14 AM by bcnaz.
Edit Reason: ADD
)
Just got my hands on a brand new keyboard today, I put it on my test phone that is running a recent release of Bookworm + nightly updates.
The combo is just a lil rough around the edges, some of the app's don't do well in landscape mode, the split screen, opening menus
I left rotation turned on for now, so I can turn the screen to see some menus, a temp. solution.
The keys do feel a little clunky at first, the more I push the buttons, and they seem to feel smoother...
Careful, the more you play with it, it starts growing on you !
This one is on my test phone, so I guess I'm going to need a second keyboard, if I want one on my daily driver.?
This is Not for everyone, the package when closed is about a full inch thick and as a package it is about an inch wider than just the phone + it's heavier.
on the Plus side it is a real "mini-laptop" that does also do cell/data, phone calls and text messages.
Some People are going to LOVE this new keyboard, (with their Mobian)
The ACE is: it will TRIPLE your run-time !
LINUX = CHOICES
**BCnAZ**
Donate to $upport
your favorite OS Team
(01-20-2022, 03:35 AM)bcnaz Wrote: Just got my hands on a brand new keyboard today, I put it on my test phone that is running a recent release of Bookworm + nightly updates.
The combo is just a lil rough around the edges, some of the app's don't do well in landscape mode, the split screen, opening menus
I left rotation turned on for now, so I can turn the screen to see some menus, a temp. solution.
The keys do feel a little clunky at first, the more I push the buttons, and they seem to feel smoother...
Careful, the more you play with it, it starts growing on you !
This one is on my test phone, so I guess I'm going to need a second keyboard, if I want one on my daily driver.?
This is Not for everyone, the package when closed is about a full inch thick and as a package it is about an inch wider than just the phone + it's heavier.
on the Plus side it is a real "mini-laptop" that does also do cell/data, phone calls and text messages.
Some People are going to LOVE this new keyboard, (with their Mobian)
The ACE is: it will TRIPLE your run-time !
Congrats on the new keyboard and thanks for a bit of insight on your experience!
(01-20-2022, 03:35 AM)bcnaz Wrote: Just got my hands on a brand new keyboard today, I put it on my test phone that is running a recent release of Bookworm + nightly updates.
The combo is just a lil rough around the edges, some of the app's don't do well in landscape mode, the split screen, opening menus
I left rotation turned on for now, so I can turn the screen to see some menus, a temp. solution.
The keys do feel a little clunky at first, the more I push the buttons, and they seem to feel smoother...
Careful, the more you play with it, it starts growing on you !
This one is on my test phone, so I guess I'm going to need a second keyboard, if I want one on my daily driver.?
This is Not for everyone, the package when closed is about a full inch thick and as a package it is about an inch wider than just the phone + it's heavier.
on the Plus side it is a real "mini-laptop" that does also do cell/data, phone calls and text messages.
Some People are going to LOVE this new keyboard, (with their Mobian)
The ACE is: it will TRIPLE your run-time !
So cool! Thanks for sharing. Looking forward to receiving the keyboard I ordered last week to use with my pinephone. However, I only ordered one! (note: I ordered a pinephone pro last week too)
Interesting :
Using the onboard 'Powersupply' app
I see about 2.2 - 2.3 watts discharging with the wifi turned off
and about 1,8 - 1.9 watts discharging with the wifi turned on
(the numbers jump around less given a few minutes)
What's up with that ?
Phone : Latest updates B/W on PMOS Convergent-on sd card
LINUX = CHOICES
**BCnAZ**
Donate to $upport
your favorite OS Team
(01-25-2022, 03:43 AM)bcnaz Wrote:
Interesting :
Using the onboard 'Powersupply' app
I see about 2.2 - 2.3 watts discharging with the wifi turned off
and about 1,8 - 1.9 watts discharging with the wifi turned on
(the numbers jump around less given a few minutes)
What's up with that ?
Phone : Latest updates B/W on PMOS Convergent-on sd card
maybe 4G consumes more energy than wifi
01-25-2022, 03:58 PM
(This post was last modified: 01-25-2022, 04:30 PM by bcnaz.
Edit Reason: Self - Reply
)
(01-25-2022, 06:19 AM)user641 Wrote: (01-25-2022, 03:43 AM)bcnaz Wrote:
Interesting :
Using the onboard 'Powersupply' app
I see about 2.2 - 2.3 watts discharging with the wifi turned off
and about 1,8 - 1.9 watts discharging with the wifi turned on
(the numbers jump around less given a few minutes)
What's up with that ?
Phone : Latest updates B/W on PMOS Convergent-on sd card
maybe 4G consumes more energy than wifi
Guess the next step would be to use the wifi/BT hardware switch ?
see how those results compare .. ?
****
okay, with wifi/BT hardware switch off 1.8 - 1.9 watts discharging
LINUX = CHOICES
**BCnAZ**
Donate to $upport
your favorite OS Team
*****
Newegg has 16gb class 10 Verbatim micro sd cards for $3.99 USD Free shipping
*****
LINUX = CHOICES
**BCnAZ**
Donate to $upport
your favorite OS Team
|