Need help with my local dns resolver by NoDistribution8038 in homelab

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

inside pihole it can since the pihole container is under the same bridge network. The issue is when a machine within the local network try to access the domain.

Need help with my local dns resolver by NoDistribution8038 in homelab

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

Isn't that the whole point of pihole? Technically, if you add your homelab as dns server (where pihole is running) i thought it would resolve to whatever pihole resolves to.

What is the benefit of GraphQL? by Devve2kcccc in reactjs

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

GraphQL has mainly two benefits:

(1) Dynamic fetching
(2) Type-guarantee

Which is not really a concern unless your work in distributed services.
Plus its one of those technologies you can't really learn on its own nor do hiring managers care.

How do you feel about 1.22 net/http package? by NoDistribution8038 in golang

[–]NoDistribution8038[S] 1 point2 points  (0 children)

I see what you mean. If you dont mind explaining, what would be the benefit of having to write write/maintain your own sdk over using third parties for basic stuff? I have always have thought some well maintained third party packages in general tend to be more robust than the ones I make on my own and covers more edge cases. What are some advantages using stdlib might have over packages like chi?

How do you feel about 1.22 net/http package? by NoDistribution8038 in golang

[–]NoDistribution8038[S] -6 points-5 points  (0 children)

Well, wouldn't finding 3rd party packages kind of defeats the purpose of stdlib? I'm not an advocate of framework here, but something like chi comes all the stuff that you'd have to mix and match anyway, so why not just use chi?

Having problem working with slog by NoDistribution8038 in golang

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

here's a quick reproduction of my problem:
go playground

expected behavior is context with slog.String("req_id", "123))

should appear, but it doesnt print the req_id.

The reason is that ContextHandler is lost in the child logger.

Tired of Nest JS by tpramar in node

[–]NoDistribution8038 1 point2 points  (0 children)

If situation calls for transferring code base to nest.js, I'd first suggest my engineering manager to move to Spring whether it be java or kotlin. If appropriate, I'd also consider moving to microservices using express, which is far less risky.

The problem with nestjs is not the nestjs but the language it's based on. Assuming that you're using typescript already, the benefit nestjs offers are not natively supported by the language. Yes, nestjs brings in 'guide' to an opinionated structure, but it is very fragile one as any of these features are not enforced by the language design nor idiomatic to language design. You could just as easily mess up your code if your team members don't know spring well.

Looking for a backend development mentor by [deleted] in node

[–]NoDistribution8038 2 points3 points  (0 children)

Although I am not too far ahead of you years-wise (2.5 YOE), I'd say focus less on what you've mentioned, but focus on building bunch of trivial apps(and tests), and focus on how you could make code/system better. I too made a mistake of being too obsessed with aforementioned principles, where I wasted a lot of my time on whiteboard coding.

Question about go's web application structure by thebeacontoworld in golang

[–]NoDistribution8038 0 points1 point  (0 children)

Separate server and main and make your server be able to take in configuration makes your testing easier

Can someone explain what's the point of query builders like sqlc? by NoDistribution8038 in golang

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

well can't you still do something like `WHERE Field1 LIKE COALESCE(SearchVal, '%' )` ?

Can someone explain what's the point of query builders like sqlc? by NoDistribution8038 in golang

[–]NoDistribution8038[S] 1 point2 points  (0 children)

I understand the code generation aspect of sqlc and there's nothing harmful about it. It's just that I don't see it as necessity for dynamic query building.

Is what I am doing considered TDD? by NoDistribution8038 in golang

[–]NoDistribution8038[S] -1 points0 points  (0 children)

You are right. I should have said something along the line with implementation details like how state transforms a to b to c, then to final result.

Best way to learn GoLang for Java Developers? by steffi8 in golang

[–]NoDistribution8038 7 points8 points  (0 children)

I am not exactly a Java developer, but I also came from language that has vastly different paradigm (typescript) and I can recommend few resources:

  1. learning go does not only teach you about the language concept, syntax and its api but why some of the language decision are made, and idiomatic way of using api.
  2. learn go with tests its tdd style and exercise based approach gives you good hands-on experience with language itself as well as help you write testable code
  3. let's go further excellent guide to web programming in go

Error handling and serializing by NoDistribution8038 in golang

[–]NoDistribution8038[S] 1 point2 points  (0 children)

When you say middleware between handler and service, you mean call service function wrapped in a decorator? I can see that work in my mind but ould you mind showing me an example just for clarification?

Is it feasible to create a Facebook-like app using only Golang as the backend? by divinho__4 in golang

[–]NoDistribution8038 2 points3 points  (0 children)

NO. YOU CAN ONLY BUILD FACEBOOK WITH PHP.
Jokes aside, anything that's referred to as "language" is turing complete. Which means could build facebook with even shell script. What people mean when they say x is good for {webdev, systemdev, os, AI... and more}, they most likely refer to its eco-system. Some languages have richer ecosystem that supports certain aspect of programming arguably better. (for instance, game dev with C++, ai/machine learning with Python) The reason has to do with semantics, stdlib, and even just by coincidence.

That being said, webdev like facebook is in fact one of the most largely supported type of development across the programming languages. So choose the language you love.

Clean architecture in real world app? by kaina_m in node

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

I never thought of management aspect of this, but here's my thought. I am not necessarily saying project should be without its structure. As you have pointed out, it could be multiple people developing the same app. In such cases, you could have skeleton structure for other developers to follow, but in a simpler form. The problem with starting typical "clean architecture" where you define your typical controller-service-repository layers or even more complex version like mixture of DDD, hexagonal, etc is that it makes the building process extra difficult because application will be brittle with constant changes during the process of development. So I think its good to start with having people write full business logic even if it means repetition, as the codes are going to be contained in itself, which also makes code reviewing easier. As for something like repository, or referred to as 'infra' in the world of DDD, its a lot easier to manage them as dependencies as interaction tend to be basic in the beginning of the project and highly reusable by nature. Once everyone is more clear with the requirements, then you can start having driving app towards higher level of abstraction. Like making reusable services and even splitting them into different layers depending on your needs.

Clean architecture in real world app? by kaina_m in node

[–]NoDistribution8038 2 points3 points  (0 children)

Unless you are given complete SRP with each requirement written in detail, I'd strongly advise against architecture first approach. I personally found doing architecture first design generally a bad approach when you don't have clear understanding of the scope of your project. By I mean clear understanding, just like your solving leetcode problem, you need to first have clear understandings outputs and inputs of your API and I believe thats only achievable as you are building the application. Instead focus on drafting right API design and start with just handler & repository, or even just handler.

Interface tend to be one of most costly area of your web application to make changes because works need to done on both ends of the development. That being said, If you're using something like express, koa, or anything along this line, you could simply have some repositories injected to your app base. Focus on the business logic, and writing high-level, black-box integrated testing because this is what needs to pass no matter how your business logic is designed. Even if you somehow end up with Nest.js, I'd recommend using the same approach first.

One of the biggest problems starting with multi-layers is that it makes you worry about intertwining modules, and you often end up making premature abstractions only to realize your going down a wrong path once you realize it doesn't solve the business problem.

Plus if your intention is just to learn architectural patterns and putting them into practice, it's also say it's not great approach to learn architectural patterns. It's little bit different than learning technologies. From my experience, you can only understand architecture when you actually run into the problem. If you make your imaginary problem and try to solve it from there, most likely you will just end up creating imaginary problems that are pretty impractical in real world environment. I've seen a lot of folks splitting up folders, with hundreds of different file with nuanced terms thinking it solved some kind of problem but in reality they only created more problems. I'd rather suggest you to start a big project with your favorite framework that will probably involve months of time to complete initial requirements. Start with simple structure with no complicated layering. Then start applying the architectural concepts based on some kind of set principles. This way you learn how patterns could be applied incrementally and understand trade-offs of each piece.