7,739 questions
Best practices
0 votes
1 replies
28 views
How to avoid messy if statements when using many feature flags in Angular?
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 ...
Best practices
1 vote
2 replies
78 views
Guideline for method ordering
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 ...
0 votes
0 answers
34 views
Can't enable code editing in WebStorm with Vue cli
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....
2 votes
0 answers
59 views
ESLint rule to enforce newline indentation style for multi-line assignments/expressions?
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); ...
2 votes
2 answers
178 views
how to change code style format on flutter
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 ...
0 votes
1 answer
122 views
Wrap long C++ function heads with clang-format
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 ...
0 votes
1 answer
227 views
Switch case: Return from impossible default case
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 ...
-6 votes
3 answers
79 views
Scope Variable inside Python's Try, Except block
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: ...