Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
75 views

This is going to be a bit hard to explain, but I'll try nevertheless: So, I'm a novice trying to turn a Kahoot Generator I made into a library to share on GitHub. After thinking about how I wanted the ...
Jediweirdo's user avatar
0 votes
0 answers
44 views

Context Writing a Power Query function to read binary data from a binary stream where some fields are preceded by their length as a 32-bit Little Endian Integer. A systematic error occurs when using ...
Djé's user avatar
  • 61
1 vote
1 answer
110 views

Consider the following two code snippets (assumed to be inside an async function that returns void / we don't care about the return value): Long version (without await): if (condition) { ...
Vipul Naik's user avatar
0 votes
2 answers
132 views

I have a code logic as below: // Option 1 try { String result = x.getResult(); if (result == null) { // some handling logger.error("xxx"); } } catch (Throwable t) { // ...
eriee's user avatar
  • 396
1 vote
1 answer
1k views

I just scaffolded a project using Template Studio WinUI v5.3 and when I press Ctrl K D to format document, the getter and setter is placed on new lines. current.cs public class MyClass { public ...
Mihai Socaciu's user avatar
0 votes
0 answers
85 views

Edit: Changed bools to const bool, Added argument to anotherValueTest. May have oversimplified it before. I am using a MSP430 and the integrated Compiler from the IAR Workbench. Link to workbench ...
kremerf's user avatar
  • 31
-1 votes
1 answer
64 views

I'm programming Human Resource data sync batch program. This program reads user and department data from customer company's database and save to our database. For example, there is class named 'User' ...
Companion Cube's user avatar
-2 votes
3 answers
143 views

Code def addition(num): if num: return num + addition(num - 1) else: return 0 res = addition(10) print(res) Explanation I know what the function is doing: it is a recursive ...
Rozita Ghasemi's user avatar
-1 votes
1 answer
51 views

I know Java does not have pre-processor, but I struggle to find a way to do this. I am looking to create macros to improve code readibility, to specify which of the functions or parameters are for ...
IlluSion's user avatar
0 votes
1 answer
98 views

I was going through this Javascript tutorial when I came across a call for “one line – one action”. alert( 2 * counter++ ); Though technically okay, such notation usually makes code less readable. ...
hallofren's user avatar
  • 121
0 votes
1 answer
217 views

New programmer here. I need to write a program using dynamic arrays to simulate an election. The program should first ask for a number of candidates, then take the candidate names and the number of ...
huntr_gathr's user avatar
0 votes
1 answer
122 views

First of all I do not know if these types of questions are appropriate in stackoverflow. I have the following dict: file_dict = {"asda_20221003:ada":1, "scdfws_20221104eaf2we":5, &...
david.t_92's user avatar
  • 2,051
-1 votes
1 answer
213 views

I used Macros at top of class to tell what is 1 and 45.00 instead of just writing magic numbers. Question is why using Macros in following class (see the default constructor) is not a good idea? Why ...
codingnoobs's user avatar
1 vote
2 answers
3k views

Most people when declaring strings in C++, or most other languages, do it like so: std::string example = "example"; However I've seen some code samples where it is done like this: std::...
ConnoisseurOfCookies's user avatar
0 votes
2 answers
200 views

I have this simple code which i have reduced to as little lines and made as readable as possible. I feel i did a good job but was wandering if it is possible to reduce down further? Any help would be ...
Junaid Razaq's user avatar
2 votes
1 answer
508 views

I'm using the cv::HoughCircles() function from OpenCV to detect circles in an image. The function takes an output parameter of type cv::OutputArray to provide the results. Based on the example code I ...
oliver's user avatar
  • 6,890
0 votes
1 answer
1k views

Please help reduce the cyclomatic complexity of this method. I don't really understand how this can be done, I need all the conditions in this method and obviously there are no duplicates. private ...
Valeriy K.'s user avatar
  • 2,914
0 votes
1 answer
256 views

Looking for a reference to a good reading or sharing an experience of what is better from the code readability/maintenance/best-practice perspective. There are two options on how to assign values to ...
Lock-o-motiffe's user avatar
2 votes
2 answers
207 views

Currently, I am writing a laravel application with a part for sending messages between the staff at the company and the clients. So, I have a field named "status" in the database. In this ...
ZOHREH's user avatar
  • 37
0 votes
2 answers
121 views

With the following code, how could I improve its readability using reflection and generics? It's a lot of repeated code, but I'm new to these concepts. "dl" is an interface but I'm not sure ...
Mark Jonh's user avatar
0 votes
1 answer
56 views

I had a datastructure as a numpy array. Python accessing a data structure Instead, I see I can get it as a panda dataframe. To write readable code, I'd like to address the data in the values column (...
havarsak's user avatar
0 votes
4 answers
109 views

How to go about reusing my js code without just copying it and changing the names of variables? I want to add more questions but reuse the same code? This is a simple web test/quiz. CURRENT CODE ...
DozerDog's user avatar
0 votes
1 answer
39 views

Is there any short form for writing MySQL CASE statements as in PHP switch? For example, if i have: SELECT CASE Type WHEN 1 THEN "A" WHEN 5 THEN "B" ...
Masoud Shariati's user avatar
-1 votes
4 answers
2k views

How to wrap this expression in java for more readability with the constraint that the sub expression (shouldSendSomething(x) && loooongFunctionName1(x) && looooongFunctionName2(x)) ...
Athul T R's user avatar
0 votes
0 answers
116 views

Is there a programming language that is purely written left to right? Example (close to Python syntax): Normal Python: a: int = 2 + 3 Left to Right Python: 2 + 3 = a: int The assignment should be ...
Semmel's user avatar
  • 575

1
2 3 4 5
7