Skip to main content
Filter by
Sorted by
Tagged with
Best practices
1 vote
5 replies
78 views

this program prints a pyramid (its from a cs50 problem set). I call the function recursively by decrementing n, but i also wanted to keep track of its initial value in all the loops after the first ...
Leopold's user avatar
Best practices
3 votes
3 replies
69 views

I’m part of a team of 10 developers, and recently our product team requires us to use feature flags for almost every new change. The idea is that they can always “roll back” to the previous behavior ...
Jon's user avatar
  • 464
Best practices
1 vote
4 replies
147 views

I'm trying to have an array of structure. The sprite_s struct: typedef struct sprites_s { bool *initialized; sfSprite *duck; } sprites_t; Can I, with memset, fill the array with data so I can ...
DoctorService's user avatar
Best practices
1 vote
2 replies
80 views

What's the best practice, preferably backed by a publicly available guideline issued by a tech company or a standards organization, when it comes to the order of method declarations in a Java source ...
Sergey Zolotarev's user avatar
-3 votes
1 answer
89 views

In Angular/RxJS, when should you use tap({ error }) and when catchError for side effects? How do you best separate the two logically or combine them? For example, does resetting the UI to its previous ...
Fabian Röhrle's user avatar
0 votes
0 answers
37 views

I'm new in Vue, and I'm trying to enable code style inside a <script> block in WebStorm, and in the settings everything is correct, but the style still doesn't work inside the <script> tag....
Konstantin 's user avatar
-6 votes
1 answer
154 views

I'm aware that C++11 introduced alias templates (which is well-explained in this thread) that makes it simple to reduce verbosity. For example: #include <vector> template <typename T> ...
K.R.Park's user avatar
  • 1,229
2 votes
0 answers
59 views

I'm trying to enforce this indentation style in TypeScript: const response: Asana.Response<Asana.Tag[]> = await tagsApi.getTagsForWorkspace(process.env.ASANA_WORKSPACE_GID!, opts); ...
Dzmitry Dranitski's user avatar
1 vote
0 answers
26 views

The @stylistic/lines-around-comment rule allows me to require new lines before or after comments, but I can't seem to find a way to disallow them. I thought the @stylistic/padding-line-between-...
ElJay's user avatar
  • 377
2 votes
2 answers
180 views

I am developing with Flutter using Android Studio. When I try to format the code using the Cmd + Opt + L keys, it ends up like #1 below. Is there a good way to make it look like #2? //#1 @override ...
footddangkong발달린땅콩's user avatar
-1 votes
1 answer
49 views

I am new to sonarLint rules, I am trying to findout the rule for indentation and variable naming in typescript rules.But couldn't find it. I was able to find naming rules for classes and functions but ...
Rishik Bhimavarapu's user avatar
0 votes
1 answer
123 views

I just started to use clang-format and I could set up quite a lot of things, but I am stuck with my general handling of long function headers. This is how I usually create them: void ...
FERcsI's user avatar
  • 500
4 votes
2 answers
190 views

I'm trying to set up SonarQube to have our coding conventions/rules in it. I'm looking for ideas on how to do this best. We're using C# as our dev language and Visual Studio as our IDE. We have dozens ...
MrSoundless's user avatar
  • 1,394
0 votes
1 answer
231 views

What to do if I use a switch case in a function, and the default case should not happen, yet I must return something? I tried to program some cellular automaton, where there are two possible cell ...
PlsHelp's user avatar
  • 337
0 votes
2 answers
104 views

I have a project written in C on STM32 platform. My project source code will be available for multiple hardware. I use CMakeLists For example I have 2 header for the moment hardware1.h and hardware2....
simon's user avatar
  • 1,234
-6 votes
3 answers
81 views

At first, i wrote my simple code as below: while True: try: x = int(input("what's x? ")) except ValueError: print(f"x is not an integer!") else: ...
Gaurav's user avatar
  • 1
0 votes
1 answer
59 views

I'm currently implementing an application and have for example a Customer model that's used in several different parts of the application. Each part only uses a subset of the properties from the ...
Alex's user avatar
  • 81
-1 votes
1 answer
147 views

I have the below Python code which checks whether the ssh host is up or not: `for hostname ,ipaddr in host_dict.items(): if tcp_conn.tcp_port_is_open(ipaddr, constants.TCP_PORT, ...
Saurav K's user avatar
1 vote
1 answer
53 views

I'm starting to develop a rest API in the MVC pattern using NodeJS and Typescript. In my model layer I created entities, services and repositories. My controller layer is decoupled from the framework ...
Abner Matheus's user avatar
-1 votes
1 answer
127 views

I am learning C# and learning about classes, and I have a question regarding best practices in class initialization and constructors. For instance, I was doing a practice exercise from Player's Guide ...
Hamza Waheed's user avatar
-2 votes
1 answer
49 views

I'm designing an application that uses Flutter Bloc and i'm not sure which of the two approaches is better in terms of structure. One is shorter in terms of lines of code, while the other is more ...
Manelzzz's user avatar
0 votes
2 answers
83 views

How to implement the following code without goto and unnecessary code complexity? namespace Test { static class Program { bool keyA = false; bool keyB = false; // ... ...
ng256's user avatar
  • 87
0 votes
1 answer
65 views

I'm working on a C# application and need to store application-wide values in a MVVM project, such as the path to its AppData folder. What is the recommended approach to achieve this? I'm very new to C#...
display_name_is_displayed_here's user avatar
1 vote
1 answer
45 views

I have a number of functions in my code whose data type of their input arguments are basic data types. Mostly string|int|float and sometimes null|string|int|float . public function example(string|int|...
while true's user avatar
-2 votes
1 answer
57 views

I was trying something for my first project working with Arduino about an automatic trash that open when a hand get close to her. While I was coding, I got an error. Here is the code: #include <...
cheggouri mehdi's user avatar
1 vote
0 answers
62 views

My spring boot project is structured so that i have modules contract (that handles incoming requests) and impl (that deals with the logic). Contract has a facade that passes the request to a facade in ...
alex oi's user avatar
  • 29
-2 votes
1 answer
31 views

implementing a JavaScript function to validate email addresses using regular expressions. The function needs to check whether the provided email address follows the standard format. typically try ...
Festive World's user avatar
0 votes
0 answers
78 views

Is there any way to suppress Visual Studio's this.Field code style warning only in constructors (without individually annotating each and every constructor in my code, I mean) and keep it everywhere ...
Medinoc's user avatar
  • 6,699
0 votes
1 answer
39 views

Here is the code i have. when I click on the image1, the same image1 will shown in the bigger container, however i could only place the bigger image container below the thumbnails images i have as the ...
Dave's user avatar
  • 1
-1 votes
1 answer
209 views

I'm quite new to Delphi Pascal, and i'm not sure if this Question suits SO, but i don't really know where to ask this else. My issue is, that i try to develop a Delphi Pascal application, that has an ...
xKiba's user avatar
  • 27
-1 votes
3 answers
107 views

So I have a code snippet similar to this. I feel like the if statements should be in a common function. I am not sure how to handle that because school and student should be passed to this function ...
bob's user avatar
  • 27
1 vote
1 answer
43 views

I tried running react-create-app (app_name) but ended up having a problem. I also tried cleaning the cache, --force, same issue. I tried deleting the node module file I previously had and ...
Cody's user avatar
  • 13
0 votes
2 answers
235 views

I get an error message (HTTP Error) 400 when trying to create a graph. The user has been successfully generated, as can be seen from the below message: import requests USERNAME = "...
MIchael's user avatar
1 vote
0 answers
95 views

I would like to align the following lines if (_a) { return; } if (__b) { return; } if (____c) { return; } with clang-format. Desired Result: if (_a) { return; } if (__b) { return; } if (____c) ...
Angelo D'Amante's user avatar
0 votes
1 answer
104 views

I am reading clean code and in the 17 section it is said that when a class is more interested in the fields and functions of another class it means that feature envy. then the following sample exist ...
shirin monzavi's user avatar
0 votes
1 answer
361 views

In Dart, it is allowed that change the value of parameter in method like this void changeValue(int num) { num = 10; } I know that above code isn't occur Error, but num = 10; can't change actual ...
JongHyeon's user avatar
0 votes
1 answer
29 views

I have already a project which has a file that is importing following function import theme from 'src/configs/theme' But when i created new nextjs project and created same folder structure and ...
SWIK's user avatar
  • 910
-2 votes
2 answers
59 views

If you need inner join on a left join what variant better for performance and coding-style? "Cross" joins SELECT demo.id AS demoId, demo2.ID AS demo2Id, demo3.ID AS demo3Id FROM demo LEFT ...
Makc's user avatar
  • 119
-3 votes
1 answer
42 views

enter image description here Exception in thread "main" java.lang.AssertionError: expected [true] but found [false] I tried to automate the web table code by using valid Xpath, stream, and ...
GAYATRI TANKAR's user avatar
-1 votes
1 answer
890 views

currently I am working on C project and i faced the following error - 8-print_base16.c:11: WARNING: suspect code indent for conditional statements (8, 15) related with Betty coding style. This issue ...
Shukufa Bayramzada's user avatar
0 votes
1 answer
130 views

When I auto-format with Clang-format, it is always inserting a newline before brace when requires clause is there. This constexpr auto size() const noexcept requires(!Unique) { return stdr::...
Sourav Kannantha B's user avatar
0 votes
0 answers
144 views

I have my_checkstyle.xml file. I assume it is based on Sun's checkstyle. It is located in separated module that is built together with other common modules for the project. I try to useit for the ...
andrew17's user avatar
  • 935
1 vote
1 answer
141 views

I've read quite a bit about Python properties and I understand their benefits, as well as them being generally more Pythonic than getters/setters. However, I haven't found any mention of their usage ...
pedriteau's user avatar
2 votes
1 answer
171 views

I want to change the color of the float name for the input. i set --border-color: #222428; and this change the color of borders only, i need to change color of the word password and email on hover, ...
Soufiane Akif's user avatar
0 votes
1 answer
64 views

lets just say that lenght of string is 10 than put 5 spaces on console after string , but if lenght of string is 5 than put 10 spaces on console some buid in function for this purpose in c++ lets say ...
Maham Fatima's user avatar
0 votes
2 answers
158 views

I solved a problem using different approaches. I was wondering which approach is better. I believe in terms of time complexity, the first approach is more efficient, but the code is long and looks ...
metrallador10's user avatar
0 votes
1 answer
45 views

I've a class for store scripts in data folder like this import 'package:keydata_zipcikti/models/script_model.dart'; const scripts = [ Script('create network folder bash script') | | | ]; and ...
enescangull's user avatar
0 votes
1 answer
163 views

I would like to make my project's pin layout configurable and extract all pin number definitions into a separate module. I can't erase all pins because I still want to take advantage of embedded-hal's ...
Eugene's user avatar
  • 1,011
0 votes
1 answer
384 views

My app is in Flutter/Dart. I am trying to generate an access token through OAuth2 with Azure credentials. Once I login with my credentials, it successfully authorizes, but it doesn't redirect ...
serl's user avatar
  • 1
0 votes
2 answers
175 views

public class butterflypattern { public static void Pattern(int n){ for(int i=1; i<=n; i++){ for(int j=1; j<=i; j++){ System.out.print("* ");...
Shubhjeet Paul's user avatar

1
2 3 4 5
155