Readit News logoReadit News
fmorel commented on Modern Node.js Patterns   kashw1n.com/blog/nodejs-2... · Posted by u/eustoria
tanduv · 25 days ago
I never really liked the syntax of fetch and the need to await for the response.json, implementing additional error handling -

  async function fetchDataWithAxios() {
    try {
      const response = await axios.get('https://jsonplaceholder.typicode.com/posts/1');
      console.log('Axios Data:', response.data);
    } catch (error) {
      console.error('Axios Error:', error);
    }
  }



  async function fetchDataWithFetch() {
    try {
      const response = await fetch('https://jsonplaceholder.typicode.com/posts/1');

      if (!response.ok) { // Check if the HTTP status is in the 200-299 range
        throw new Error(`HTTP error! status: ${response.status}`);
      }

      const data = await response.json(); // Parse the JSON response
      console.log('Fetch Data:', data);
    } catch (error) {
      console.error('Fetch Error:', error);
    }
  }

fmorel · 25 days ago
Except you might want different error handling for different error codes. For example, our validation errors return a JSON object as well but with 422.

So treating "get a response" and "get data from a response" separately works out well for us.

fmorel commented on Onlycats   onlycats.gg/... · Posted by u/rustystump
fmorel · a month ago
Reminds me of I Can Has Cheezburger https://en.wikipedia.org/wiki/I_Can_Has_Cheezburger%3F
fmorel commented on I convinced HP's board to buy Palm and watched them kill it   philmckinney.substack.com... · Posted by u/AndrewDucker
halflife · 3 months ago
I was working at HP during that time.

They sent a company wide email asking people to develop applications for the OS, and receive a Palm Pre for free.

I created an app that simply turns off the screen, and called it a mirror app (because you could see your reflection). I really enjoyed my free Palm Pre.

I tried resurrecting it a few years ago but couldn’t find a replacement battery after the original died.

fmorel · 3 months ago
My parents got a cheap Touchpad when they were getting rid of them, and used it for years. Especially after people got AOSP running on it.
fmorel commented on Swift at Apple: Migrating the Password Monitoring Service from Java   swift.org/blog/swift-at-a... · Posted by u/fidotron
misiek08 · 3 months ago
I would love to see such post from Microsoft about C#. "We looked into few alternatives and chose our own language, it fitted the task, worked great and came as best overall in terms of technology, devex and maintainability".

Great read, thanks for sharing! This means to me you are mature, sharing stuff instead of making obscure secrets from basic stuff existing at many companies <3

fmorel · 3 months ago
They've done quite a few user stories on https://devblogs.microsoft.com/dotnet/category/developer-sto... and related blogs, especially about .NET Framework to .NET migrations.
fmorel commented on Tornado warnings delayed because of DOGE cuts   mesoscalenews.com/p/torna... · Posted by u/aaronbrethorst
siilats · 3 months ago
yeah why cannot that guy sit in california or new york in a normal time zone? not like there are tornadoes in every state, its so silly to keep a person at night in an office when weather is good
fmorel · 3 months ago
There's only a 6 hour different between the East coast and Hawaii. You can't entirely avoid a night shift, so you might as well have them all work from the same location.
fmorel commented on Obsidian is now free for work   obsidian.md/pricing... · Posted by u/s1291
hu3 · 6 months ago
Can you use something like iCloud, Google Drive or Microsoft OneDrive to get sync for free? Does it work well?

Many do that with Joplin.

fmorel · 6 months ago
I have multiple vaults in my OneDrive, and use https://play.google.com/store/apps/details?id=com.ttxapps.on... (OneSync) on Android to have them available there as well. It's been working great.

If I was making edits more often, I might run into sync conflicts. But I mostly edit on my PC, then might make small edits to recipes while I'm working in the kitchen.

fmorel commented on Apple's requirements are about to hit creators and fans on Patreon   news.patreon.com/articles... · Posted by u/miiiiiike
duxup · a year ago
I only recently started using Patreon (as in giving someone money).

I really never thought of the app and I just went to the website.

Is there some reason to use the app?

fmorel · a year ago
If you wanted notifications there instead of email.

But I've been using the website for over a year and don't feel like I'm missing out.

fmorel commented on Things I know about Git commits   jvt.me/posts/2024/07/12/t... · Posted by u/sea-gold
jraph · a year ago
The git log should still stand on its own. The ticketing platform could get migrated in a way ticket numbers are not kept or old tickets are a bit less convenient to find, or just temporarily down.

When working on the code, it's also very useful to access the history without having to open each ticket. Being able to hover a line, having the message of the commit which last changed it, and be able to say "ah ok, it was for this" is quite useful.

> I’m not staying long enough in this company to see them changing from Jira to something else, so I don’t care about the Jira dependence to understand commits

Isn't this a terrible argument in favor of "Fixes NNN" commits? Someone who care about the longevity of a versioned thing should care. If you don't care anyway, nothing matters much.

fmorel · a year ago
> Being able to hover a line, having the message of the commit which last changed it, and be able to say "ah ok, it was for this" is quite useful.

Honestly, this just sounds like we need better integrations with JIRA into dev tools. I'm not going to rewrite tickets in commits / PRs. That ticket has its own history, linked tickets, acceptance criteria, epics, related bug tickets, etc.

fmorel commented on Things I know about Git commits   jvt.me/posts/2024/07/12/t... · Posted by u/sea-gold
lucasoshiro · a year ago
If you want more controversial things about squash, here are two that I posted here last week:

1. "How squash merge can break Git repos with submodules", about a situation where squash merges silently broke a repository: https://news.ycombinator.com/item?id=40846596

2. "Git: please stop squash merging!" giving some technical explanation about what squash merges actually are under the hood and how the misconceptions about Git leads to invalid "pros" about squash merging: https://news.ycombinator.com/item?id=40840572

fmorel · a year ago
The first is solvable with a PR check. You can do whatever you want with the submodule on your branch, but if you want it to merge to `main`, then your changes to the submodule have to merged to its `main`. We have a check that makes sure the referenced commits is on `main`, and not older than 10 PRs.
fmorel commented on CamelCase vs underscores: Scientific showdown (2011)   whatheco.de/2011/02/10/ca... · Posted by u/miohtama
cletus · a year ago
I'm firmly in the camp that doesn't care what the rule/style is, I just want an unambiguous rule. I'll just use whatever the language conventions are. Snake case in Java, for example, would be a hate crime. So would camel case in C.

My general preferences beyond that are:

- Opening braces on the same line (I see the article has examples where it's on a new line);

- Two space indent, no tabs

- No trailing white space. This should be automatically removed so it doesn't generate extraneous changes on commit;

- A reasonable line length between 80 and 120 characters, depending on the language. You need to be able to look at 3 files side by side without wrapping.

- Don't put the return type on a separate line. This is a really old school (K&R) C style

- Don't align function parameters with opening parentheses. Change the function name and you generate a bunch of changed lines for the parameters.

- No space before semi-colons eg for (i=1; i<100; i++) not for (i = i ; i < 100 ; i++ )

fmorel · a year ago
I've gone for tabs ever since I realized it helps with accessibility https://gomakethings.com/tabs-are-objectively-better-than-sp...

Every developer can control how those tabs are rendered to their preference.

u/fmorel

KarmaCake day94March 13, 2014View Original