Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [default-values]

Filter by
Sorted by
Tagged with
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
75 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
643 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
531 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
439 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
1 vote
2 answers
2k views

I will give a simple example to help you understand my question. Suppose we have a rectangle and a Utility class with a method that creates a buffer arround a shape. The .createBuffer method has ...
jorgeb's user avatar
  • 11
2 votes
1 answer
175 views

There's a bunch of languages that automatically return the last value in a function (mostly functional) like Ruby, Haskell, Lisp, etc. Does this feature (or what do you call it) affect the ...
UncleLaz's user avatar
  • 129
2 votes
3 answers
344 views

Setup: We've got a form with default text values present within the text box itself which "goes away" when I click on them and enter a value (not if I dont enter a value). Currently the 'default' ...
siliconpi's user avatar
  • 205
5 votes
5 answers
5k views

In an embedded device, during the initializing of memory locations, is there any convention that are being practiced. I mean, say setting every byte to zero or 0xFF or any other value.
Shamim Hafiz - MSFT's user avatar