Skip to main content
replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

Related:

My concrete examples usually contain some proprietary things. Even a variable name or package name can convey something that is not meant to be public.

From Stack Overflow I've learnt to simplify, minimize, and isolate the problem.
(ask specific questions, MCVE, ...)

Examples of question one may want to ask:

What is the recommended way of passing arguments to a function in JavaScript?

var f1 = function(firstname, lastname) { ... };

var f2 = function(options) { ... };

f1("Michal", "Stefanow");

f2({firstname: "Michal", "lastname": "Stefanow"});

It is hypothetical code, yet in my opinion it is a perfectly valid question about best practices in terms of code structure and readability.

Another one I would like to ask personally but I cannot post it to Code Review as it is hypothetical. And I cannot include the actual code because variable names convey some meaning and I want to avoid paying hefty compensation.

What would be the best way to ask the question about following code?

Option 1:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
if (iammicrowave) {
    var settings = { blah : 42 };
    magicFunction(settings);
} else {
    magicFunction();
}

Option 2:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings;
if (iammicrowave) {
    settings = { blah : 42 };
}
magicFunction(settings);

Option 3:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings = imamicrowave ? { blah : 42 } : undefined; // or maybe {} here?
magicFunction(settings);

Should I:

  • Post on Code Review anyway?
  • Post on Stack Overflow?
  • Read more books?
  • Make friends with developers who are better than me?

The actual question asked herehere.

Related:

My concrete examples usually contain some proprietary things. Even a variable name or package name can convey something that is not meant to be public.

From Stack Overflow I've learnt to simplify, minimize, and isolate the problem.
(ask specific questions, MCVE, ...)

Examples of question one may want to ask:

What is the recommended way of passing arguments to a function in JavaScript?

var f1 = function(firstname, lastname) { ... };

var f2 = function(options) { ... };

f1("Michal", "Stefanow");

f2({firstname: "Michal", "lastname": "Stefanow"});

It is hypothetical code, yet in my opinion it is a perfectly valid question about best practices in terms of code structure and readability.

Another one I would like to ask personally but I cannot post it to Code Review as it is hypothetical. And I cannot include the actual code because variable names convey some meaning and I want to avoid paying hefty compensation.

What would be the best way to ask the question about following code?

Option 1:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
if (iammicrowave) {
    var settings = { blah : 42 };
    magicFunction(settings);
} else {
    magicFunction();
}

Option 2:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings;
if (iammicrowave) {
    settings = { blah : 42 };
}
magicFunction(settings);

Option 3:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings = imamicrowave ? { blah : 42 } : undefined; // or maybe {} here?
magicFunction(settings);

Should I:

  • Post on Code Review anyway?
  • Post on Stack Overflow?
  • Read more books?
  • Make friends with developers who are better than me?

The actual question asked here.

Related:

My concrete examples usually contain some proprietary things. Even a variable name or package name can convey something that is not meant to be public.

From Stack Overflow I've learnt to simplify, minimize, and isolate the problem.
(ask specific questions, MCVE, ...)

Examples of question one may want to ask:

What is the recommended way of passing arguments to a function in JavaScript?

var f1 = function(firstname, lastname) { ... };

var f2 = function(options) { ... };

f1("Michal", "Stefanow");

f2({firstname: "Michal", "lastname": "Stefanow"});

It is hypothetical code, yet in my opinion it is a perfectly valid question about best practices in terms of code structure and readability.

Another one I would like to ask personally but I cannot post it to Code Review as it is hypothetical. And I cannot include the actual code because variable names convey some meaning and I want to avoid paying hefty compensation.

What would be the best way to ask the question about following code?

Option 1:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
if (iammicrowave) {
    var settings = { blah : 42 };
    magicFunction(settings);
} else {
    magicFunction();
}

Option 2:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings;
if (iammicrowave) {
    settings = { blah : 42 };
}
magicFunction(settings);

Option 3:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings = imamicrowave ? { blah : 42 } : undefined; // or maybe {} here?
magicFunction(settings);

Should I:

  • Post on Code Review anyway?
  • Post on Stack Overflow?
  • Read more books?
  • Make friends with developers who are better than me?

The actual question asked here.

replaced http://meta.codereview.stackexchange.com/ with https://codereview.meta.stackexchange.com/
Source Link
replaced http://meta.codereview.stackexchange.com/ with https://codereview.meta.stackexchange.com/
Source Link

Related:

My concrete examples usually contain some proprietary things. Even a variable name or package name can convey something that is not meant to be public.

From Stack Overflow I've learnt to simplify, minimize, and isolate the problem.
(ask specific questions, MCVE, ...)

Examples of question one may want to ask:

What is the recommended way of passing arguments to a function in JavaScript?

var f1 = function(firstname, lastname) { ... };

var f2 = function(options) { ... };

f1("Michal", "Stefanow");

f2({firstname: "Michal", "lastname": "Stefanow"});

It is hypothetical code, yet in my opinion it is a perfectly valid question about best practices in terms of code structure and readability.

Another one I would like to ask personally but I cannot post it to Code Review as it is hypothetical. And I cannot include the actual code because variable names convey some meaning and I want to avoid paying hefty compensation.

What would be the best way to ask the question about following code?

Option 1:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
if (iammicrowave) {
    var settings = { blah : 42 };
    magicFunction(settings);
} else {
    magicFunction();
}

Option 2:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings;
if (iammicrowave) {
    settings = { blah : 42 };
}
magicFunction(settings);

Option 3:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings = imamicrowave ? { blah : 42 } : undefined; // or maybe {} here?
magicFunction(settings);

Should I:

  • Post on Code Review anyway?
  • Post on Stack Overflow?
  • Read more books?
  • Make friends with developers who are better than me?

The actual question asked here.

Related:

My concrete examples usually contain some proprietary things. Even a variable name or package name can convey something that is not meant to be public.

From Stack Overflow I've learnt to simplify, minimize, and isolate the problem.
(ask specific questions, MCVE, ...)

Examples of question one may want to ask:

What is the recommended way of passing arguments to a function in JavaScript?

var f1 = function(firstname, lastname) { ... };

var f2 = function(options) { ... };

f1("Michal", "Stefanow");

f2({firstname: "Michal", "lastname": "Stefanow"});

It is hypothetical code, yet in my opinion it is a perfectly valid question about best practices in terms of code structure and readability.

Another one I would like to ask personally but I cannot post it to Code Review as it is hypothetical. And I cannot include the actual code because variable names convey some meaning and I want to avoid paying hefty compensation.

What would be the best way to ask the question about following code?

Option 1:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
if (iammicrowave) {
    var settings = { blah : 42 };
    magicFunction(settings);
} else {
    magicFunction();
}

Option 2:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings;
if (iammicrowave) {
    settings = { blah : 42 };
}
magicFunction(settings);

Option 3:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings = imamicrowave ? { blah : 42 } : undefined; // or maybe {} here?
magicFunction(settings);

Should I:

  • Post on Code Review anyway?
  • Post on Stack Overflow?
  • Read more books?
  • Make friends with developers who are better than me?

The actual question asked here.

Related:

My concrete examples usually contain some proprietary things. Even a variable name or package name can convey something that is not meant to be public.

From Stack Overflow I've learnt to simplify, minimize, and isolate the problem.
(ask specific questions, MCVE, ...)

Examples of question one may want to ask:

What is the recommended way of passing arguments to a function in JavaScript?

var f1 = function(firstname, lastname) { ... };

var f2 = function(options) { ... };

f1("Michal", "Stefanow");

f2({firstname: "Michal", "lastname": "Stefanow"});

It is hypothetical code, yet in my opinion it is a perfectly valid question about best practices in terms of code structure and readability.

Another one I would like to ask personally but I cannot post it to Code Review as it is hypothetical. And I cannot include the actual code because variable names convey some meaning and I want to avoid paying hefty compensation.

What would be the best way to ask the question about following code?

Option 1:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
if (iammicrowave) {
    var settings = { blah : 42 };
    magicFunction(settings);
} else {
    magicFunction();
}

Option 2:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings;
if (iammicrowave) {
    settings = { blah : 42 };
}
magicFunction(settings);

Option 3:

var iammicrowave = /(microwave)/.test(navigator.userAgent);
var settings = imamicrowave ? { blah : 42 } : undefined; // or maybe {} here?
magicFunction(settings);

Should I:

  • Post on Code Review anyway?
  • Post on Stack Overflow?
  • Read more books?
  • Make friends with developers who are better than me?

The actual question asked here.

added 3 characters in body
Source Link
Mast Mod
  • 13.5k
  • 2
  • 34
  • 85
Loading
added 163 characters in body
Source Link
Loading
added relevant tags, rewrote minor parts, corrected grammar and sitenames
Source Link
Vogel612
  • 25.3k
  • 1
  • 36
  • 63
Loading
Source Link
Loading