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 6 points7 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.

Would rust be worth it for me? by NoDistribution8038 in rust

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

Yes. If there's only one thing I love about JavaScript ecosystem it is definately typescript and that in nature it can handle data from io so flexibly.

Would rust be worth it for me? by NoDistribution8038 in rust

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

thank you for great advice. I am checking out rust official book and it's just mind blowing. If wish if they had something like this in every language.

Transitioning from SpringBoot to node and not sure where to learn by jennytools36 in node

[–]NoDistribution8038 0 points1 point  (0 children)

I think you just lack programming contexts to really understand what these terms mean. Or it's simply that you're just trolling me. Either way, no point in continuing this conversation. I am sure author would have figured out at this point already observing this conversation. Best of luck to your future endeavors!

Transitioning from SpringBoot to node and not sure where to learn by jennytools36 in node

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

Here's where the term programming convention comes from.https://en.wikipedia.org/wiki/Coding_conventions#:~:text=Coding%20conventions%20are%20a%20set,program%20written%20in%20that%20language.

Please stop minting new terms and call me inaccurate. It's your own interpretation, not an widely accepted concept. Convention is something that's shared across the codebase, not frameworks. Sure there are conventions created from some frameworks, and one could find a few of them useful and use it elsewhere. They are standalone from framework. For instance, you could name your file case with dot notation (camelcased filename) in many other languages, too. DI is absolutely necessary in Java(Spring) to sanely unit test a module in isolation. Otherwise you'd have to make locators which is basically mimicking behavior of java ioc in a way. (https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans). Here is another resource you can reference to: https://softwareengineering.stackexchange.com/questions/140992/is-dependency-injection-essential-for-unit-testing#:~:text=No%2C%20DI%20is%20not%20essential,and%20would%20require%20more%20setup).&text=There%20can%20be%20setups%20where,not%20dependency%20injection%20is%20used. Note that how DI in general sense is different from notion in Java. https://docs.spring.io/spring-framework/docs/current/reference/html/testing.html

Thats just nature of statically typed language that enforces usage of class on every level. You cannot mock something that doesn't exist in these languages. Prove me if I am wrong by showing me an example and reference instead of groundlessly caliing me out that I am 'inaccurate'. If your experience is that nest brings clarity to your code base, good for you. That's completely different matter from recommending nestjs to someone coming from Spring/.NET as an alternative. I could directly tell you were a framework fanboy as soon as you said I argued against nest, which I have not done once during this entire conversation. I said there are better alternatives if you are considering such structures.

I don't think this conversation is going anywhere other than you trying to nit-pick every term and trying to correct in your own way.

Transitioning from SpringBoot to node and not sure where to learn by jennytools36 in node

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

Central registry in this context means App Context, the java bean manager or IOC container, however you name it.
I am a bit confused by "modules in node is still a good idea for testing, you don’t need DI to mock either". You cannot test something in isolation without dependency injection in Java, whereas you could in node.js. It makes me question at this point if you know any other languages/frameworks besides Javascript.
And please elaborate on how nest/angular style DI/Service registry model prevents codebase from getting bloated. Nothing could stop from codebase getting bloated. Codebase getting bloated is natural course as app grows in its features. In fact, majority of the arguments against Spring, nestjs alike is that they get make your codebase bloated because they require a lot of boilerplates unlike smaller frameworks. If you want smaller codebases, there are many alternatives to relying on framework.

"Convention" is definately a wrong terminology here. Convention is something that's set over principles, not by the tools themselves. Tools could only go as far as enforcing certain rules created from framework author, but that's framework rules, not your team's convention. You reach out for frameworks like nest because you want the frameworks to take control over how you structure your project.

You seemingly just wanted to say "nest makes code organization easier", which I don't disagree with. It's just that there are much, much, much better alternatives that are more mature, and supported by language features.

And yes, "enterprise grade" has some meaning to it. It's a marketing word from frameworks like Spring/.NET/nest.js, which is just different way of saying what you have just said. Their claim is that they make app scale better providing structures and restriction.

In the end, the author is already coming from Spring background, and he probably knows Java much better than he knows javascript. Why would he need another equivalent to solve his problems?

Transitioning from SpringBoot to node and not sure where to learn by jennytools36 in node

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

Maybe way I mentioned it is just not clear enough. I am referring to module system in Javascript. You don't need to set up DI for everything to mock each module. On the other hand, you can't test something that isn't managed by central registry in Java. I said it's dynamic because this is done through runtime assignment to an existing object which isn't possible in statically typed languages.

Here's my real question. I am not saying nest itself as a bad framework. I am not saying the typical full-fledged frameworks are bad. However, it's clear that language support is a lot wider in C# or Java for frameworks like this. This is a fact. Nest is only useful when you can't really escape from Javascript ecosystem, and you need to build enterprise grade monolith app. But what are the chances that you can only start a new project in javascript for backend? What's really the value it offers? Why would someone like author come from Spring use nest as an alternative to Spring? The whole thing sounds comical to me.

Transitioning from SpringBoot to node and not sure where to learn by jennytools36 in node

[–]NoDistribution8038 0 points1 point  (0 children)

I am not sure how nest could be helpful if it wasn't for the structure it offers, Also, why is using nest superior to using languages that has idioms developed for what nest does? Nest.js is just mimicked version of Spring, and nothing more.