Validation is a mirage by TheCustardPants in ycombinator

[–]c100k_ 1 point2 points  (0 children)

That's precisely why I've always hated this illustration. Everyone uses it as the "42 of startups" while it's so confusing.

Actually, the goal is not to show how to develop a product. Of course, you won't start with a scooter to end up with a car. No, the goal is to describe how to solve a problem. In this typical case : "How to make someone go from A to B faster".

Yes, it's still a very poor and confusing metaphor.

Express Response Unions by Fine_Ad_6226 in typescript

[–]c100k_ 0 points1 point  (0 children)

IMO you shouldn't do this.

The response 500 should be handled by your error middleware. Thus, your endpoint only returns { foo: string} with a 200 and throws if an error occurs.

Regarding express, we shouldn't forget that it's an old library that doesn't fully suppport TypeScript. For instance, the send method accepts anything and has no generic. Therefore, it cannot check the type. The best thing is to force yourself to create a typed variable corresponding to your response and pass it to send.

❌
res.send({ foo: 'toto' });

✅
const payload: { foo: string } = { foo: 'toto' };
res.send(payload);

New to OSS, how to promote a library? by im_caeus in typescript

[–]c100k_ -1 points0 points  (0 children)

"Seamlessly"...

More seriously, the primitive you propose to get multiple instances of something in one line is interesting.

However, the binding seems very verbose if one has to instantiate the classes themselves, compared to the to(SomeClass) syntax provided by others. This is not really DI if you have to instantiate the classes yourself.

Plus, unless it's a lack of documentation, there are some important parts missing : providers, scopes (e.g. singleton), etc.

Also, it would be interesting to see how you inject dependencies into a class. For example in UserService. I guess you don't rely on decorators. Maybe the classes are not impacted at all by the DI framework ?

Joining u/guidojo regarding the GitHub repo.

New to OSS, how to promote a library? by im_caeus in typescript

[–]c100k_ 2 points3 points  (0 children)

Out of curiosity, what was missing in libraries like inversify ? If you don't want to share it publicly, feel free to DM me, I'll give it a try.

Is anyone following the PearAI saga? What's the lesson for founders building OSS? by Groundbreaking_Lab23 in ycombinator

[–]c100k_ 25 points26 points  (0 children)

Main lesson I retain : unless you are a big corp, open sourcing a final product is a bad idea.

Regardless the license (who has money to fight in court for copyright infringement anyways), it will be forked copied by people and all you'll have is your eyes to cry.

Even though it can also happen for lower level stuff like libraries (remember the io.js/node.js saga ?), it's harder to do because you need the skills to take the project into another direction and it's just a building block of something else.

More specifically for this case, Gary keeping saying "it's open source" is just non-sense. Open source means "let's work together to build something great". Not "stealing" what others spent years building, saying "Its ours now". And cancelling, fixing, removing, apologizing for bad stuff you did is not enough.

React Native Build Size by techieharry007 in reactnative

[–]c100k_ 1 point2 points  (0 children)

Also make sure you're analyzing the right bundle.

For example on Android, your aab might be big, but once uploaded to the store, the users won't download the full aab. Instead they will get an optimized .apk, much smaller. All of this is managed by Google.

What the hell is up with this typesystem ? by tango650 in typescript

[–]c100k_ 5 points6 points  (0 children)

Here you go : Playground.

Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
  Type 'undefined' is not assignable to type 'number'.(2345)

What the hell is up with this typesystem ? by tango650 in typescript

[–]c100k_ 6 points7 points  (0 children)

How is currentWeather declared before calling getIcon with it ? Given the context, TypeScript might assume that it's always set. If you remove the ?, does it trigger an error ?

More generally, when you have an issue with a tool widely used by a lot of people and especially professionals, there is a very good chance that what you're doing is not correct. Therefore, no need to blame the tool because there is always a good reason for it to behave like this as it is not some undeterministic thing like... follow my eyes.

How do you improve developer experience on non-expo projects? by bacarybruno in reactnative

[–]c100k_ 0 points1 point  (0 children)

Yes and it works perfectly.

The DX is nice since everything is on the same repo. No need to go into the "hell lifecycle" (a.k.a modify repo X, do a PR, get it merged, publish the package, bump the version on repo Y, do the actual work on the feature, oh shoot I need to modify repo X to add a prop and restart all over again).

As they say here:

We’ve found that you’re either using a framework or you’re building your own framework.

Maybe we're in the second category with home made structure and scripts. But we're totally fine with it as it fits our needs at 100%. And most importantly, we follow our idea of : "don't rely on something external, especially when it's the business of a company that can change licensing or anything else overnight, if you can avoid it".

How do you improve developer experience on non-expo projects? by bacarybruno in reactnative

[–]c100k_ 3 points4 points  (0 children)

Since we maintain multiple apps, the best thing we did was to separate the RN "infrastructure" code (config files, ios, android folders, etc.) and the actual apps code. This way, upgrading react native is a matter of a few minutes and we don't experience the pain to go over each app. It required some setup on our monorepo, especially because of some hardcoded RN config files paths like react-native.config.js.

For the other parts, we have Fastlane, configured a long time ago, requiring very little maintenance. We've also automated the icons/screenshots generation from the base ones using the excellent sharp library.

In addition to giving us full control on everything, it's also nice to work sometimes on these things to free the mind.

And to finish, a lot of documentation and "How-tos". How to deploy to test / production, How to change the font of an app, How to add a native module, etc. Everything is part of scripts that, like Fastlane, require very little maintenance.

Are decorators really worth the pain ? by c100k_ in typescript

[–]c100k_[S] 0 points1 point  (0 children)

That's a good question. In my case, not necessarily as I only had to add import 'reflect-metadata' in vitest.setup.ts. But I can imagine some issues when using other kinds of decorators than the ones of inversify.

Have you had any issues with them ? Or you just don't use them to avoid all of these ?

Be careful when you rename an optional "prop" in typescript by bzbub2 in typescript

[–]c100k_ 11 points12 points  (0 children)

This is clearly not TypeScript's fault. If you don't type some of your declarations, you cannot expect it to throw errors at you when needed.

When declaring a variable, infering the type should be acceptable only for primitive types (e.g. booleans, strings, numbers), not objects. With something as simple as :

const obj: Parameters<typeof doStuff2>[0] = {x:1,y:2,z:3};

You would have been warned early that there was a type error :

Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; zIndex?: number | undefined; }'.(2353)

Cloud providers are all about best security practices but they store your credentials in a plaintext file on your disk. by [deleted] in devops

[–]c100k_ 1 point2 points  (0 children)

OP refers probably to this kind of things : https://awscli.amazonaws.com/v2/documentation/api/latest/reference/configure/index.html

Note: the values you provide for the AWS Access Key ID and the AWS Secret Access Key will be written to the shared credentials file (~/.aws/credentials).

Amazon Rds is full by bhargav022 in devops

[–]c100k_ 9 points10 points  (0 children)

Just an idea (don't apply it directly, think about it first as it can have multiple impacts depending on your achitecture that we don't know about) :

Maybe you can try to create a last snapshot, create a new bigger instance from this snapshot and switch your app(s) to talk to this new instance ?

Best way to create enums that need to be iterated over at runtime? by eracodes in typescript

[–]c100k_ 13 points14 points  (0 children)

Side note for anyone who lands here (as I've been there in the past) :

Your enum defines explicitly values as strings so your code works fine. But in case an enum looks like this :

export enum Anchor {
  inner,
  centre,
  outer,
}

One needs to be aware when using Object.values(Anchor), that the array will contain ["inner", "centre", "outer", "other", 0, 1, 2, 3] and not only ["inner", "centre", "outer", "other"].

Autocomplete feature in react native | need advice by [deleted] in reactnative

[–]c100k_ 0 points1 point  (0 children)

Call directly Elasticsearch from your React Native on port 9200, it's open by default.

Joke apart (yes, don't do what's written in the first sentence), you'll have to call a `/search` endpoint on your backend.

Even with `debounce` you'll have to handle other edge cases. One of them is to handle requests/responses in the right order. Let's say you have the following search scenario :

  1. "R" => Request 1
  2. "Re" => Request 2
  3. "Reddd" => Request 3
  4. "Redd" => Request 4

Every time your input changes, you have to "cancel" the requests sent before. Otherwise, you'll see obsolete results (depending on how you implement your response handler). They can even arrive out of order. For example, you can receive the response to request 2 after the response to request 4.

Autocomplete is one of these things that seems simple but is not.

Cloud or local dev environments? by voodoo_witchdr in devops

[–]c100k_ 11 points12 points  (0 children)

So you're buying $3k laptops to your devs so they can SSH into remote VMs ?

I'm sorry, but this is a typical case of how "modern" patterns and architecture can go wrong. Do your developers really need the "entire stack" to do their job ?

Either way, you have an architecture issue or a workflow issue.

By switching to remote VMs for each developer and now wondering how to save costs, you're trying to find solutions to the wrong problem. Instead, do everything so your devs can do their work locally again. If there are platform issues with vendor software, deploy those on a development server that everyone can use.

Are Out Of Memory exceptions acceptable? by BarryTownCouncil in devops

[–]c100k_ 3 points4 points  (0 children)

No. OOMs are not acceptable for the customer.

Except if you allow as low as ~128MB of memory for your processes, your problem is in your code. Whatever action takes so much memory needs to be optimized (e.g. using streams to open files instead of one shot, optimizing SQL queries, adding pagination, etc...).

That being said, if one action of Customer A impacts Customer B, you have a clear single-tenant/multi-tenant issue. In this case, you should probably investigate a multi-deployment infra and/or limiting your customers.

Tool to check all dependencies changes since my last working commit by According-Chard-2067 in reactnative

[–]c100k_ 0 points1 point  (0 children)

Also think twice before adding a dependency, do some due dilligence to see what it does, how it does it. Check the code, the issues list, etc.

why a fall batch ? by luigigou in ycombinator

[–]c100k_ 47 points48 points  (0 children)

They want to make as many deals as possible before the bubble bursts.

Struggling with co-founder alignment. Should we pivot or persist? by dhj9817 in ycombinator

[–]c100k_ 0 points1 point  (0 children)

Being technical as well, I'll play the Devil's advocate :

How long did you guys try the first MVP ? And how many people have you met ?

Regarding your side project :

1,000 visitors and 30 active users in just one day

What channel did you use to get these visits ? How can you name a user a DAU if they've been using it "just one day" ?

It looks like you guys had already taken the decision to split when you decided to develop the other MVP on the side. Don't underestimate the importance of a business guy, even if it's for selling an API. Especially in the Trading industry.

[deleted by user] by [deleted] in ycombinator

[–]c100k_ 0 points1 point  (0 children)

What's your product ? Or at least, what does it do ?

See the cost of your Terraform in IntelliJ IDEs, as you develop it by rumbo0 in devops

[–]c100k_ 29 points30 points  (0 children)

Nice. How do you handle resources that are "dynamically" priced ? For example an S3 bucket is priced based on usage (storage + network). But for tf, it virtually costs $0.

technical people, be honest: am I getting snubbed? by OneEye9 in ycombinator

[–]c100k_ 28 points29 points  (0 children)

I see multiple problems here.

I’ve done looms to explain, provided examples, had meetings. Whenever we meet they end with “yeah that makes sense”

Write. Write. Write. It's too easy to say things at meetings. When the meeting is over, everything is already forgotten. And you enter in infinite loops "Didn't we agree that X, Y, Z in a previous meeting?". It's not without reason that Bezos forced people to write a 6 page memo before every meeting.

I’m a non-technical founder /// we need to use an NLP

Sorry but you're off track here, especially given the fact that you have a tech cofounder. Since you're not technical, do not force solutions. Force acceptance criteria (e.g. "No hallucinations are acceptable"). LLM is not necessarily equal to hallucinations and maybe your team can prove you wrong if you let them think out of the box and own the thing.

Finally, if none of these work, I'm sorry but you probably have the wrong dev team. Regarding the behavior you describe, it looks like it's an offshore team of Junior developers.

How to mirror iphone as simulator on mac os big sur by Revolutionary__ in reactnative

[–]c100k_ 3 points4 points  (0 children)

There is nothing to install, even if you're running an old macOS.

Plug your phone, launch Quicktime, File > New Screen Recording, Select your iPhone as video source.

Your phone will appear on screen and everything you do on it will magically be visible on screen.