Linked Questions

21 votes
6 answers
7k views

How do I document my code for minimum time review? [closed]

I want to document my code such that there is minimum need for reading and browsing the code again months later. I know that there are different types of documentation (in source code and outside, ...
Reza Akraminejad's user avatar
1 vote
5 answers
919 views

Avoiding exceptions for performance optimization

In our code base, I see a lot of code like this var error = ValidatePhoneNumber(userId, phoneNumber); //if validation fails, return error if(!string.IsNullOrEmpty(error)) { return error; } If I ...
Microsoft Excel's user avatar
13 votes
3 answers
472 views

Using static type checking to protect against business errors

I'm big a fan of static type checking. It prevents you from making stupid mistakes like this: // java code Adult a = new Adult(); a.setAge("Roger"); //static type checker would complain a.setName(42)...
J-bob's user avatar
  • 299
5 votes
3 answers
329 views

How to design and join more complex entities

I am developing a small ERP software. I'm wondering how to design entities as well as where to join them. I'm just gonna start with an example, that makes it way easier. Say I'm modelling a ...
DFENS's user avatar
  • 375
2 votes
3 answers
283 views

When defining constants, which is more important? Easier to find? Or narrower scope?

For example, consider I have constants VOL_MIN and VOL_MAX, which is used inside 1 function only: public void setVolume(int val){ final int VOL_MIN = 1; final int VOL_MAX = 10; val=Math....
ocomfd's user avatar
  • 5,712
2 votes
3 answers
4k views

Is it bad practice for my backend to call 3rd party API's synchronously when processing a request?

I use a third party API on my webapp that is accessed when the user requests a particular ressource. I'm worried that the successive API calls happening upon user's request might cause the user to ...
Jad S's user avatar
  • 561
0 votes
3 answers
6k views

ASP.NET MVC - Using Session Variables or Caching to prevent unnecessary calls. Is it a good practice in general?

I have an application that consists of multiple sections of which each section will need to load data from various API calls. Now I'm thinking of taking advantage of Session variables(or caching) to ...
knewit's user avatar
  • 17
3 votes
2 answers
367 views

Minimizability or readability?

I am authoring a lot of plugins for the content management system that I am writing. I believe it to be of utmost importance that script files (especially if they're plugins) should load quickly, ...
Luke Madhanga's user avatar
1 vote
2 answers
126 views

Preload Lookup Values on Startup of Application, or Fetch Them As Necessary?

We have all kinds of Lookups in our application, stored in a separate table, LOOKUP_T. Should the application load them all on startup, and keep them in a global lifecycle variable -- or is it OK to ...
gene b.'s user avatar
  • 315
1 vote
2 answers
879 views

Separate methods or single method with if statement?

I'm working on a .NET application and I'm wondering if I should use separate methods to handle the click events of two different buttons. They essentially do the same thing, just on different objects ...
Cuthbert's user avatar
  • 201
14 votes
1 answer
802 views

How to prevent a colleague introducing extreme complexity and abstraction?

I am having a very difficult time because my colleague seems to exhibit Premature/Unnecessary optimization efforts Premature deduplication with questionable abstractions For example, we use a ...
Earl Grey's user avatar
  • 628
2 votes
1 answer
85 views

Making use of constant data

My team is working on an android app. A co-worker and I have different ideas on how to load constant data. To clarify, the data we are going to use are 100 × (n × 〈integer-integer pair〉) where 10 &...
Attacktive's user avatar
1 vote
1 answer
957 views

Does it make sense to use byte instead of int in Java? [duplicate]

Recently, I had to implement a business rule in a certain project. The rule basically consisted of checking a range between 1 and 12, values that would be used later, in some way, with Bootstrap. ...
Warlock's user avatar
  • 59
0 votes
1 answer
160 views

Am I overengineering my application? [duplicate]

At present moment, my desktop application operates purely on file names. That is, it parses file names and then reasons about the data contained therein. However, in the future, I see that there is a ...
the_endian's user avatar
  • 1,152
-3 votes
1 answer
108 views

Pythonic way of writing `for my_var in my_iterable` [closed]

A very common pattern in python is: for something in ['an', 'iterable']: func(something) I almost always see the iterable as a list (like in this example), but it could very well be a tuple, set,...
s g 's user avatar
  • 115

15 30 50 per page