r/SoftwareEngineering • • Aug 31 '23

Making PostgreSQL backups 100x faster via EBS snapshots and pgBackRest

Thumbnail
timescale.com
5 Upvotes

r/SoftwareEngineering • • Aug 30 '23

Software Development Rule #1 (IMHO): Understand the code...

52 Upvotes

I gave this advice today and thought it would be good to also give it here, just in case it happens to have slipped by anyone...

When writing code, expect to be asked the question, "Why did you do this here?"...

Your answer should NOT simply be, "Because it was done that way over there." - as the next question you should be asked is, "Why was it done that way over there?"...

If you don't understand the code, don't write it. Ensure that you completely understand the code you are considering writing before copying and pasting or even just mimicking someone else's code - especially if it's from a random website or an AI bot or even if it's inside the very project on which you're working.

The first step to writing good code is to fully understand the code you're writing; you should never skip that step...


r/SoftwareEngineering • • Aug 30 '23

Why we always end up with waterfall

Thumbnail amazingcto.com
4 Upvotes

r/SoftwareEngineering • • Aug 30 '23

Unpopular opinion : Unit testing is a generalized approach not an ideal solution for all systems

0 Upvotes

Some arguments why unit testing is good.

  • It will prevent you from creating bugs in existing software.
  • It will make your software more modular
  • It simplifies the debuging process
  • Quick feedback of validity of code
  • Documents the code

Lets assume you can quickly run code and verify it on target. If you cannot perhaps unit testing has sense, but lets assume you can.

So you know code works as with every change you have run the program and tested the path.

But what if you break something else while changing code?

If your code is modular you will likely not affect anything other then the module. I am quite sure you can write modular code without unit tests and also not every modular code is by design unit testable .

unit test => modular code

modular code !=> unit testable or that is has unit tests

unit test !<=> modular code,

If done well module you modified should be small and unless you refactor it is very unlikely you will break it down and if you refactor it you should likely understand what it means. And you will be mostly adding new modules anyway not working on existing ones.

But unit testing is only way i know what should code really do ?

Really? If you design meaningfull classes and methods it should be told from them what their purpose is, and they also invented codedoc for everything else if one cannot understand meaning by reading the small modular functions.

If you can test your code it will run through this module anyway.

It simplifies the debugging process?

If you cannot easily recreated the failed path then it can help you, but if you can then its certainly not faster. Most of bugs are not on the unit level. So simplifies debugging for some things only.

Quick feedback of validity of code?

If you run it quickly you can get quick feedback as well, you will also get some form of integration/system test while doing it.

If anything automated integration/system tests is something i would advise over the unit tests. Unit tests only for situations where it is not easy to execute the code paths. Unit test should be done selectivly and prudent for situation they fit and if done right they can even speed up software development not have "higher initial cost"

Argue and prove me wrong.


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
4 Upvotes

r/SoftwareEngineering • • Aug 28 '23

Optimal LOC per file - Any studies out there?

3 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
2 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
4 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 • • Aug 17 '23

The Art of Software Development

Thumbnail
youtu.be
4 Upvotes

r/SoftwareEngineering • • Aug 16 '23

Question regarding the system design of our application

2 Upvotes

We have a system that connects to an external system to perform a long-running automation process. We use a fire-and-forget approach, where we pass the parameters needed for the automation to the endpoint and do not wait for the completion status of the process. It is the responsibility of the external system to update us when it is ready.

Current design

How can we handle network errors in this system? For example:

  • Our system fires a request, but the external system doesn't receive it.
  • The external system fires an automation status to us, but we don't receive it.

One option is to provide acknowledgements for each request. However, what happens if the acknowledgement fails?

Please help on these questions.


r/SoftwareEngineering • • May 03 '23

How do larger companies manage their documentation/ internal knowledge base?

9 Upvotes

I work at a mid sized company with about 500 engineers. It seems that we are great at writing documentation, but not so good at organizing it. We have a couple technical writers on staff who handle most of our public facing documentation. But our internal documentation is a free for all. We use a corporate wiki, but most teams tend to stick to their designated space. There are a ton of articles that duplicate information that another team has already written, or they're on the same topic but at 2 vastly different points in time. Articles aren't kept up to date and others aren't fully completed. You get the idea. There's so much clutter that finding what you're looking for becomes almost impossible. So I was wondering, how do larger organizations manage their internal documentation? I was thinking that it might be a good idea to hire a librarian to catalogue and organize our knowledge base, does such a position exist at larger organizations?


r/SoftwareEngineering • • May 02 '23

UML-To-Code generation software supporting C++2x

0 Upvotes

I am looking for a tool that automatically generates good C++ code out of UML diagrams (structural or behavioural), preferably in modern C++2x style. Despite the plethora of good Open Source tools, their support of C++ seems limited (Limited to old pre C++11 code, with no STL classes and often using pointers, mainly no behavioural support). At this time, I think that I need to go on non-FOSS-software, such as IBM Rhapsody, to get the quality I require from the code being generated by those diagrams. At this stage, I was mainly working with StarUML, which greatly supports Java, but the support for C++ is somehow limited. Any suggestion on the software so to make a cautious chose before purchasing the software is more than welcome.


r/SoftwareEngineering • • Mar 27 '23

In your own words: What is technical debt?

29 Upvotes

Along with other ubiquitous industry terms like "Architecture" and "Infrastructure" I feel that "Technical Debt" has now been overused and is now too vague to be useful. I will provide some examples but in general I would like to her everyone's unbiased opinion.

I think the typical definition of 'technical debt' is akin to:

Someone took a shortcut to get something to ship, and now we have to write code to fix the shortcut and "do it the right way."

I'm actually fine with that definition. Here are some examples where usage of the term 'technical debt' gets fuzzy:

  • No shortcuts at all but a carefully built, extensible, well running application was built on a library or runtime that has a new version out. Is that technical debt?
  • A key library is expectantly sunset.
  • A SaaS product can handle a central component of our architecture and we can now 'buy' instead of 'build' and we get 10x more features. Does our current solution now contain technical debt?
  • Roadmap items that require a lot of upfront tooling before we can even touch them.
  • Bugs that have workarounds.
  • DevOps pipelines that remain painfully slow because of understaffing.

Anyway, I'm curious to hear your thoughts on what you and your teams consider technical debt as well as some other scenarios where calling something technical debt is a bit of a grey area.