Skip to main content

Questions tagged [clean-code]

The term "clean code" is used to describe computer programming code that is concise, easy to understand, and expresses the programmer's intent clearly. Questions with this tag relate to the process of writing clean code, or refactoring old "dirty" code to be clean code.

Filter by
Sorted by
Tagged with
1 vote
1 answer
222 views

I'm learning Domain-Driven Design (DDD) and studying different architecture patterns, and I’ve come across two seemingly conflicting design philosophies around domain modeling. 1. Rich Domain Model ...
Penchala Yegu's user avatar
2 votes
3 answers
1k views

I'm programming a .NET WebApi application from services. What is the scope of an integration test within the following schema? Order creation scenario: Order is created -> stored in db -&...
Petr Klekner's user avatar
0 votes
2 answers
364 views

Which code style is preferred in Java? final boolean result = isCausedBy(e, ExceptionType1.class) || isCausedBy(e, ExceptionType2.class) || isCausedBy(e, ExceptionType3.class) |...
Andriy Makukha's user avatar
2 votes
1 answer
243 views

With the introduction of JEP 358 in Java 14, which provides more informative NullPointerException (NPE) messages, is it advisable to remove existing explicit null checks in cases where the null-check ...
ftb457932's user avatar
2 votes
4 answers
205 views

Assume I have a value object in my application with random numbers for underlying values. These value objects will serve as attributes to my entity (aggregate root). In my specific case (just for ...
alaboudi's user avatar
  • 285
2 votes
1 answer
174 views

I have a Spring Boot REST API that will copy content from one Amazon S3 bucket to another. The source and destination buckets are specified in the body of a POST request sent to the API. This works ...
Space Cadet's user avatar
0 votes
0 answers
106 views

I reproduced a small example of kerkour's Rust Clean Architecture on the Rust Playground. The code is just an example and the methods code makes no sense at all. This architecture leaks DB information ...
Fred Hors's user avatar
  • 139
5 votes
1 answer
576 views

Using assimp I've created a function to load 3D models and it does everything I need and I don't plan to use another library or write something custom, however, I am curious how techniques such as ...
Konjointed's user avatar
-2 votes
1 answer
524 views

Say I have a class with a function do_thing that is comprised of multiple steps, which themselves segregate into functions (first_process and second_process). At what point would this be considered ...
Tim Kirkwood's user avatar
5 votes
1 answer
512 views

We're working an agile project and designing as we go on a new python commandline app / systemd service for some fancy in-house project. Right now, we're supposed to be adding an observability / ...
Peter Turner's user avatar
  • 6,985
-1 votes
1 answer
249 views

I am currently writing a PHP / JavaScript application library, which I intend to use in the future for several other applications. The library includes functionality for handling a database, creating ...
user avatar
1 vote
3 answers
481 views

I've been working at this company for about a year now. it's a growth company working in B2B. I'm one year out of university, with a major in computer science. I work in the web team, using an Angular ...
Jeremaia Scott's user avatar
-2 votes
1 answer
124 views

About formatting Here are two scenarios in which the details of the formatting are described. How should in the clean code way, this be formatted Scenario 1: Dependent functions of dependent functions ...
user13047397's user avatar
13 votes
4 answers
5k views

Let's say that I have a class called Mission. This class is intended to represent a mission requested by a professor working in a faculty. Mission has a private enum field representing whether the ...
Mehdi Charife's user avatar
6 votes
2 answers
13k views

I am rewriting a streamlit app that is an interface to a laboratory management system (LMS). This means, that I have to make a lot of requests to that LMS through its python library (PyBIS). The way ...
Jan's user avatar
  • 251
10 votes
2 answers
10k views

I am trying to improve the architecture for my React app project that has grown in size lately. I'm looking at Hexagonal architecture and Clean architecture, and I couldn't really see the difference ...
rickvian's user avatar
  • 119
0 votes
1 answer
373 views

I'm looking for some best practices for readability (and clean code in general) for naming modules/classes within more extensive projects. More specifically, is it reasonable to add the package's name ...
Thomas Vanhelden's user avatar
9 votes
4 answers
3k views

I'm writing this library in which the user can provide custom code defining the algorithm used for finding an optimal solution. In the papers that I have read, the targeted user thinks in terms of ...
Mehdi Charife's user avatar
1 vote
1 answer
292 views

I'm and entry-level developer straight out of college. I am the only developer at this company. I feel the challenges I face are different to most people working with sub optimal or very poorly ...
mpAppProg's user avatar
0 votes
2 answers
383 views

I have recently encountered this problematic method (minimal reproducible sample in C++ but this question aims to be language agnostic past the syntax): void MyObject::twice_bind_cycle() { _bind1()...
goober's user avatar
  • 117
3 votes
3 answers
1k views

Part of my current product uses GPT-4 with a prompt to extract information from plain text. As behaviour of large language models is inherently opaque and failure cases unpredictable, I was wondering ...
Armin's user avatar
  • 65
3 votes
1 answer
306 views

I have an application with dependency injection that consumes a REST API. The API calls are abstracted into entity-specific repositories. Some of the repositories are: HttpNotebookRepository, ...
Amal K's user avatar
  • 111
-1 votes
1 answer
217 views

I was going through an old, largely untouched part in my company’s codebase and found one API. It does the following things. A POST API with path host/entities/trigger which fetches a list of entity ...
elliot's user avatar
  • 11
1 vote
2 answers
640 views

As part of an university project I am currently working on an eeg-biosignal classifier. While the project itself doesn't really focus on design ("anything that works") I am trying to learn ...
J. Lo's user avatar
  • 21
1 vote
0 answers
224 views

I am implementing clean architecture in my new back-end project and getting stuck with a particular use case. I have a CreatePhysicianUseCase what is responsible for creating a new physician user in ...
z0mbieKale's user avatar

1
2 3 4 5
11