Tagged Questions
3
votes
3answers
523 views
articles in variable names and hard-coding strings
re-edited by author: no this is not 2 questions. This is one question about code review questions containing two separate points. Please do not edit my question.
For naming variables, the two sides ...
0
votes
1answer
73 views
Writing contextually related control statements next to each other [duplicate]
Recently I've been messing around with this. Note that I'm not using LINQ because while this could be easily be done that way, I could do this in any language.
Allow me to exemplify:
foreach ( var i ...
1
vote
2answers
111 views
Is repeating links to the same class in a single javadoc comment a bad practice?
I'm currently writing an API and its documentation. For example I have something like this:
public interface Event {
}
public interface Process {
}
public interface EventProcessor {
/**
* ...
1
vote
5answers
181 views
Is it a good practice to write a method that gets something and checks the value? [duplicate]
Occassinally I have to write methods like this:
string GetReportOutputDirectoryAndMakeSureExist()
{
string path = Path.Combine ( ... ) //whatever logic
if(!Directory.Exists(path)) ...
2
votes
2answers
256 views
Choosing between words with different spellings for function names
A question has been bothering me for a while: when developing international projects, it is common sense to use English as the reference language since it is the language that the most people ...
4
votes
4answers
276 views
In which order should I do comparisons? [duplicate]
I'm a strong proponent of writing if statements like this:
variable == constant
Because to me it just makes sense, it is more readable than the inverted:
constant == variable
Which seems to be ...
1
vote
4answers
691 views
Switching from ActionScript to JavaScript, tips for writing code?
I am quite comfortable with using actionscript3 and flash. I also have some experience with Java. But recently, I started learning JavaScript and node.js. I ultimately want to make a 3d game in ...
0
votes
2answers
244 views
Need some advice and feedback on my code's design
I am looking for feedback on the design of my program.
I have a shell script call function.sh that defines a lot of helper functions. My intent is to use those bash functions defined in functions.sh ...
6
votes
3answers
420 views
Does studying other people's programs help in self growth?
Should I be studying big softwares written by other people in our company? My work may be a small sub module on the top of that software, and I may not be required to know what goes beneath the hood, ...
1
vote
4answers
316 views
Is extensive documentation a code smell? [closed]
Every library, open-source project, and SDK/API I've ever come across has come packaged with a (usually large) documentation file, and this seems contradictory to the wide-spread belief that good code ...
6
votes
3answers
241 views
Style bits vs. Separate bool's
My main platform (WinAPI) still heavily uses bits for control styles etc. (example).
When introducing custom controls, I'm permanently wondering whether to follow that style or rather use individual ...
26
votes
9answers
2k views
Simple vs Complex (but performance efficient) solution - which one to choose and when?
I have been programming for a couple of years and have often found myself at a dilemma.
There are two solutions -
one is simple one i.e. simple approach, easier to understand and maintain. It ...
11
votes
9answers
851 views
Should a programmer take writing lessons to enhance code expressiveness?
Given that programmers are authors and write code to express abstract thoughts and concepts, and good code should be read by other programmers without difficulties and misunderstandings, should a ...
2
votes
4answers
268 views
Linking in code comments (to other unique anchors/comments)
How would you recommend creating "anchors" in code comments, so that during maintenance, developers can easily cross-reference other code comments.
I realise that software should be intelligently ...
11
votes
6answers
1k views
A defense for boilerplate?
To me, boilerplate code is obviously bad. However I've met a developer who displays resistance in any attempt to reduce boilerplate. I realized I didn't have a readily formed, well thought out ...