News for hackers. Stuff that matters.

damacaner

can we make everything constant like C# does please

Models.GeminiNano04

boom

Ask HN: What do you think about documenting code with GPT?

I literally don't know what is the convention for this.Is it a bad thing to write everything about function, then dump the function / functions that the documented function calls to ChatGPT, and let it handle the documentation? It saves a lot of time documenting, but I feel like it is a bit verbose, and it never thinks like "hmm people reading this will know how to code" and goes into every...

( Read More... | 1 comment | on HN )
Formatted a bit.

What do you think about this type convention on back end?

Hello, everyone, homies, ladies, gentleman, turtles. I am making this post before sleeping, please make some good discussion till I wake up.Ahem.In the company I currently work for, we use FastAPI, and convention goes like this:- project root-- src--- routers---- user.py--- models---- user_models.pyAnd, as you already guess lets say we haveasync def ILoveMyDad()router andclass...

( Read More... | 1 comment | on HN )
Re:Do you think writing backend with Python feels wrong? on Thursday June 15, 2023 @04:29PM (#36346065)
Aiohttp is too risky to code,and it is only good if you are only one working on that project, or you are working with good friends of yours.

Give it in a hands of bad programmer, you are fucked harder than any pornstar I have ever and yet to seen in my 21 year lifespan.

You are right about pip too, I don't know how did they achieve to come with a package manager that is worse than NPM. Such a feat.

Re:Do you think writing backend with Python feels wrong? on Thursday June 15, 2023 @04:24PM (#36346001)
Yeah I know, even smallest feature "json schema" made my jaw drop in Pydantic. Maybe we had it in V1 too, but it works so seamless now, especially too useful with MongoDB. As you said, there are so many absurdly things that I couldn't even dive in.

...I will tell my boss to use v2 on new project lol.

For the first part, dude my head is aching so hard that its at a point to kill me. I will comeback to you when I am somewhat clear-minded.

Re:Do you think writing backend with Python feels wrong? on Thursday June 15, 2023 @04:19PM (#36345927)
Even, it's only enforced in routing functions.

Outside of it, like utility packages, MongoDB or such so, you are not enforced, go with whatever you want.

...guess what my coworkers prefer! urgh.

Re:Do you think writing backend with Python feels wrong? on Thursday June 15, 2023 @04:17PM (#36345899)
Yes that is right too.

Dynamic typed languages always feels like I am 6 again, with my crayons all over the place, doing random bullshit go till something sensible comes out.

Good luck finding what is wrong if a bug occurs, good luck if you will refactor it and think how can you replace it, how can you rewrite it without destroying the whole aesthetic of the code. just like my parents trying to figure out how will they renew the wall after I draw a huge chunk of random shit to the wall with my crayons.

Do you think writing backend with Python feels wrong?

Because I think like that.I tried Django, Flask, FastAPI till now, maybe there is other frameworks that is good enough, but I only had experience with "production-ready" frameworks.And it feels... wrong? I don't know why, but it feels like something is wrong.In Django, I barely ever feel like coding. It was just writing config files, like I didn't feel like I was coding.Same in Flask and...

( Read More... | 16 comments | 4 points | on HN )
Yeah, at least getting used to signings might come useful in the future.
I am trying to work with MWS, and AWS SDK of GoLang horribly fails when tried to use standalone (I only need the signer part), but oh my oh my.

https://github.com/canercetin-randomguy/club-noira/blob/main...

This is only the auth&sign part. and it doesnt work. and it is already 150 LoC. god.

Does anyone else finds AWS and other Amazon services overly complicated?

I think AWS and its signature system is making things more complicated than it should be, like this is a normal signing in process to API:1. you request client credentials, which is normal.2. construct request URL, normal.3. add headers, eh, normal.4. signature... fuck.First you need to convert the URL you have from step 2, mash it with headers from step 3, add header keys to signed headers,...

( Read More... | 140 comments | on HN )
Re:For all React coders out there, why and how? on Sunday October 30, 2022 @09:37AM (#33394399)
Everything from a business perspective always sounds non-sense to me.

I cant even find a library or language to code front-end, like I am burning my time since six days to find something that is dev-friendly. Everything is just, is it secure or fast? yeah ship it, we dont care about how developers feel about it.

really sad.

For all React coders out there, why and how?

How do you guys constantly write React, let alone learning it? And why?I am trying to learn it for two days (probably 12 hours by the time I write it) and... everything about it is pure annoyance that is shaped into a form of language.Help from google? Nah fam it is outdated and not documented in official documentation.Need sensible errors? .........fuck off.Syntax? My eyes are burning.Writing...

( Read More... | 11 comments | 3 points | on HN )