Skip to main content

Questions tagged [default-values]

0 votes
1 answer
67 views

I have a class in which there are several methods that can act as an "entry point" to its private innards (or the "fruit" thereof). Said functions might be called multiple times ...
Shay's user avatar
  • 103
12 votes
5 answers
7k views

In many cases I can formulate some boolean parameter equally well positively as negatively, e.g. isOn or isOff. Which one should I pick then, in case I want the argument to have a default value? Is ...
DaveFar's user avatar
  • 1,466
-1 votes
2 answers
7k views

I'm currently creating a class in C# that will be utilized to help standardize calls to restful web services in my company's code. While the majority of my code has been written and well tested, I ...
Taco's user avatar
  • 1,175
-2 votes
1 answer
76 views

In my code let's say I have a function which does most of the work: def compute(x=3, y=5): ... And I have a CLI wrapper program using argparse. I intend end users to use the CLI program and not ...
qwr's user avatar
  • 332
0 votes
2 answers
644 views

In one of the projects I work for, we have just added karma to run unit tests. When reviewing the MR of a coworker, I noticed the karma.conf.js (the configuration file) has 120 lines, which seems to ...
Gonzalo.-'s user avatar
  • 161
5 votes
3 answers
9k views

For example, to store whether sound is on, I have a boolean originally named "isSoundOn": private boolean isSoundOn=true; however, the default value of boolean is false, but I want my application to ...
ocomfd's user avatar
  • 5,760
3 votes
2 answers
2k views

Today, I and my colleague had a difference of opinion regarding the usage of default values in software configuration. We both agreed that for a consumer software, the default configuration should be ...
Mukul Gupta's user avatar
1 vote
4 answers
3k views

When writing a switch statement that only ever has to deal with a known set of values (imagine an implicit enumeration), I find myself wondering what should be the last entry in the construct. I'm ...
Dev-iL's user avatar
  • 233
3 votes
1 answer
533 views

Default values are often suggested to be part of failover mechanism for microservices. At a high level, for any services (say microservices here) the nature of the operation can be broadly classified ...
Divs's user avatar
  • 197
0 votes
1 answer
105 views

If I've got a script that uses a config file (or defaults to a generic config file) that calls another module which needs the config file passed to it as a parameter should I always File 1 (the ...
Peter Turner's user avatar
  • 6,985
3 votes
3 answers
442 views

The business team in my company has come up with a new field to add to one of our entities. For new instances of this entity, it'll be calculated dynamically, but for previously existing instances, we ...
user3748908's user avatar
  • 1,667
4 votes
1 answer
5k views

When attempting to set default values for parameters that may exist in environment variables in JavaScript, I often see this pattern: var lag; try { lag = process.env.THROTTLE_LAG; } catch ( e ) ...
msanford's user avatar
  • 750
3 votes
1 answer
10k views

I know in C#, by default, referenced type variables are passed by reference to a method. I have a function which sometimes I just need its return value and sometimes both return value and the changes ...
Ahmad's user avatar
  • 1,866
0 votes
3 answers
1k views

I created a table in a Postgres database. I would like to create a form in a Java application to insert rows into that table. Certain fields have default values. What is the best way for the database ...
Reinstate Monica's user avatar
4 votes
6 answers
2k views

First, let me show you an example (written in ActionScript 3.0): class GameObject { public static function MakeFromName( pName:String, pAtlas:TextureAtlas ...
chamberlainpi's user avatar

15 30 50 per page