Linked Questions

352 votes
19 answers
66k views

How would one know if the code one has created is easily readable, understandable, and maintainable? Of course from the author's point of view, the code is readable and maintainable, because the ...
105 votes
14 answers
13k views

A recent bug fix required me to go over code written by other team members, where I found this (it's C#): return (decimal)CostIn > 0 && CostOut > 0 ? (((decimal)CostOut - (decimal)...
Bob Tway's user avatar
  • 3,636
50 votes
6 answers
13k views

I am a home, amateur developer for 25 years and I just had a bright idea regarding comments. Like all such novel bright ideas, someone has probably already done it and there is probably a consensus on ...
WoJ's user avatar
  • 1,661
16 votes
5 answers
2k views

Assume we have a software module A that implements a function F. Another module B implements the same function as F'. There are a number of ways to get rid of the duplicate code: Let A use F' from B. ...
Frank Puffer's user avatar
  • 6,459
2 votes
5 answers
3k views

I know some languages (C comes to mind) its best to declare as few variables as possible. In a language with memory management like C# is it better practice to continue with this philosophy or should ...
Mwspencer's user avatar
  • 157
4 votes
5 answers
419 views

I have a disagreement with one of my colleagues on whether or not functions should have inverse functions available. I would like to know when/if inverse functions should be used. For example, say we ...
Byebye's user avatar
  • 346
3 votes
3 answers
4k views

I often define variables that will never change, i.e. constants, at the top of a script/module. But recently I've been wondering if it makes sense to define them at the function scope level if they ...
pstatix's user avatar
  • 1,047
3 votes
2 answers
420 views

A commmon pattern I've noticed in my Python code follows this simple structure: value = get_val_from_thing() value = mutate_that_val(value) I find myself first grabbing some specific value(s) from ...
Luke's user avatar
  • 49
1 vote
3 answers
509 views

If I'm writing Scala functions and have to check for nulls in situations where I can't avoid it (say, working with Spark UDFs and some legacy Java types), is it better to turn things into Option or to ...
wrschneider's user avatar
  • 1,369
1 vote
3 answers
316 views

We're trying to update our style guide (using google's guide as a starting point) and I'm currently in the middle of a debate with my colleagues about column limits. I believe we're all in agreement ...
Zachary Coffin's user avatar