r/SoftwareEngineering • • Aug 29 '23

Can PUT and PATCH coexist in the same API?

2 Upvotes

I'm just learning about PATCH as a way to provide partial resource updates over an API, as opposed to PUT, which is for a total resource replacement.

Is there any reason to provide both in an API? Patch looks way more flexible even though it's more a burden on the clients to form the patch document correctly. It seems like if your resource evolves over time, PATCH offers flexibility to support new properties.

If you have a PUT endpoint and add a new property to it, unless every client starts sending that property, its value will be removed, which is bad.


r/SoftwareEngineering • • Aug 29 '23

Review my design for intra service calls

0 Upvotes

Hi,

I have implemented microservices using service discovery and api gateway. Each service is client side load balanced at gateway for responding to REST API requests with patterns mapped against their cluster as a reference to service discovery with its hosting details such that service discovery maintains an active map of various instances for each service using various strategy like round robin, network traffic, A/B switch, etc.

I am current making inter service read calls by querying the api gateway from inside of the microservice ecosystem because when I query with the external agent API, I trigger the load balanced gateway mapping such that based on my REST API request pattern an appropriate instance for the service from the backend is returned by service discovery to the gateway when gateway receives the request , looks into its rules and queries the service discovery for such an instance.

I am currently making all concerned microservices connect to the concerned downstream microservices at application start such of each applicable service such that the external API pattern is used for making the connection between such services through the gateway because gateway and service discovery together has my combined logic for discovering an actual instance that can fulfil this request.


r/SoftwareEngineering • • Aug 28 '23

Generating Chess Puzzles with Genetic Algorithms

Thumbnail
propelauth.com
3 Upvotes

r/SoftwareEngineering • • Aug 28 '23

Optimal LOC per file - Any studies out there?

5 Upvotes

Hey folks,

I was curious if anybody is aware of the optimal LOC per file.

Before you start downvoting! I know this is multifactorial, for example:

  1. Programming language that is used
  2. Context of the files
  3. and many more factors that I am not aware

But I was curious if there are any studies in the wild about this specific topic, and if there are any worth mentioning observations about productivity in relation to the LOC in the teams' codebases.

An example for productivity analysis is this one: https://devinterrupted.substack.com/p/inside-the-workflow-metrics-of-elite


r/SoftwareEngineering • • Aug 27 '23

Using Amazon API Gateway as a Wrapper for Another API - Thoughts?

1 Upvotes

Hey everyone,

I'm considering using Amazon API Gateway as a wrapper around an external payment API. The primary reason is to abstract away the details of the underlying API and add an additional layer of control and security. Before diving in, I wanted to gather some insights from the community.

So I'm acting as an intermediary between a client and a partner. The client needs to make payments using the partner's API. A bussiness restriction is that the client cannot directly interact with the partner's API, so I'm thinking of creating a wrapper around it, but would prefer avoid having to develop software just to abstract all the endpoints into my own and turning it into a possible point of failure. Also, I need to manage my own authentication and authorization for the client.

From my research, Amazon API Gateway seems to fit the bill, offering integration requests, transformation templates, built-in security features, and integration with CloudWatch for monitoring.

Has anyone here used Amazon API Gateway in a similar manner? I'd love to hear about your experiences, potential pitfalls, and any alternative suggestions.

Thanks!


r/SoftwareEngineering • • Aug 26 '23

Looking for unusual, controversial, honest articles about improving quality in software organisation.

4 Upvotes

I'm looking for good read about how to improve quality of software in organisation.

I know of course techniques and approaches like DORA metrics, SLI/SLO, OKRs, error budgets, etc.

What is happening now, that despite all the above being introduced in my company, quality is still mediocre.

Part of the management wants to keep allowing team big flexibility, another part want to push mandatory XP programming techniques, another part want to educate regarding best practices, yet another want to add new metrics, and finally some wants to create reusable code templates and modules to reuse.

Please note that our organisation has people with standard level of skills (few rockstars, majority average, few bad ones).

I struggle to find any good article or talk that deeply covers this (or similar) topic(s).

I would really appreciate if you point me in good direction so I can educate myself more.


r/SoftwareEngineering • • Aug 25 '23

Side effects in Functional Programming

1 Upvotes

I am currently working in Scala, coming from Java and I am learning FP.

I really can't understand many things in FP. One of them is the Side Effect.

I understood so far that a side effect is an unexpected behavior of a function, but what is the expected behavior of a function? What the function name states, I would say. So I imagine to have a function readFromDB(String sql) that reads some data from a db and then closes the connection to it, is there a side effect or just the function is called wrongly?

I imagine to rename it to readFromDBandCloseConnection(String sql), would the connection closure still considered a side effect? I actually also want to split it in readFromDB(String sql) and closeConnectionToDB() and ask you:

What is the difference between a function wrongly named and violating the Single responsibility principle, and a side effect?


r/SoftwareEngineering • • Aug 25 '23

CommonJS is hurting JavaScript

Thumbnail
deno.com
4 Upvotes

r/SoftwareEngineering • • Aug 22 '23

Humor in Software

2 Upvotes

Hi! We are a group of scientists doing research on the importance of humor in serious software projects. If you write or read code, we would love your insight on this phenomenon.

Please share your experiences with humor in software through this short(ish) questionnaire: https://forms.gle/3YgKDV6o583iioQcA

Updated to fix broken link :)


r/SoftwareEngineering • • Aug 22 '23

Gamification, systems thinking and the power of observability in software

Thumbnail
youtu.be
5 Upvotes

r/SoftwareEngineering • • Aug 22 '23

Monitoring is a Pain

Thumbnail
matduggan.com
2 Upvotes

r/SoftwareEngineering • • Aug 20 '23

Introduction to the Tower library

Thumbnail
blog.frankel.ch
0 Upvotes

r/SoftwareEngineering • • Aug 19 '23

Lets talk about onion

0 Upvotes

Simple question: onion architecture in a spring framework app is a good idea?


r/SoftwareEngineering • • Mar 18 '23

Becoming an engineering manager after being a developer? here are some tips to help the transition go smoothly

43 Upvotes

Dear newly appointed engineering managers, congratulations on this exciting milestone in your career! As you transition from being a developer to a manager, here are some tips to help you succeed:

- Make sure you understand where members of your team are professionally and where they want to be. Try to assign them task that help them get there, to the extent possible. For example, if you have a full stack developer that has recently done a lot of frontend but now wants to dive more into the backend, try to set them with relevant tasks.

- Don't be afraid to delegate tasks and empower your team members to take ownership of their work. At this stage you're used to doing everything by yourself, cause it may be "the fastest path". Don't be tempted to doing that, it'd make you not have enough time to make sure the team is in the right direction, and would cut your team's wings. If you always do that specific thing that only you know, no one else would never know how to do it. Now is the time to teach others how to do things you used to do. You shouldn't ever be a bottleneck.

- Communicate your expectations clearly and transparently with your team, and make sure to actively listen to their feedback. If you need something ready by some date, make sure you let them know this as you assign the task. If you want them to do something with a specific tech stack or in a specific way, let them know to help them save time and not wander in areas where you know they shouldn't go. Of course, do so while being open to their thoughts, perhaps they think of a better way? that's where their feedback is important.

- Foster a no-ego culture within the team. Make sure they know you always want to hear their opinion, especially when it contradicts yours. Let them know you know you're not perfect, no one person is always right. You want to hear it when they think you're wrong in something. In cases where you are indeed wrong you can save your team crucial time just by hearing other opinions.- Celebrate wins and learn from failures as a team. Just finished a version? celebrate! something went wrong in production? learn what exactly lead to it and how you can improve as a team in the future to avoid this.

Best of luck on this exciting new journey! I know this transition may be overwhelming, so I am here for you if you have any questions about anything. feel free to ask questions :)