Coding style is a set of guidelines that helps readability and understanding of the source code.

learn more… | top users | synonyms (2)

-4
votes
2answers
112 views

Should one always start a boolean with “is” or “has”? Or write it as it makes more sense grammatically?

Examples: isKeyValid -> keyIsValid hasPostThumbnail -> postHasThumbnail The first case is easier to remember (convention). The second is easier/more natural to read. Which should I use?
1
vote
0answers
113 views

SQL Query and Java Constant Abuse?

I am currently charged with taking over a lot of code that is written with fields names placed into Java constant at the top of the file, and then the SQL queries constructed using string ...
1
vote
0answers
86 views

Pointers vs IDs for “context-specific” functions

I need to be able to load, use, and free resources from a single monolithic object. I have two requirements: 1. That the resource loaded is owned by the object that created it and 2. All objects in a "...
0
votes
0answers
37 views

JavaScript coding and project organizing conventions

Recently, I've started working with JavaScript projects closely and with my C# background I am already wondering about some conventions. I see a lot of source files that use dots to separate words (i....
0
votes
0answers
55 views

Where do you put your profiling code?

I just developed an algorithm and additional to the usual unit tests I wrote a profiling "test" that I was using to measure and optimize its performance. It is structured similar to a test (arrange: ...
0
votes
0answers
107 views

Check some value between each function call

Can you recommend a nice way of checking a particular value between calls to a set of functions? E.g. something like this in Python (might not be terribly 'Pythonic'): self.error_code = 0 # this ...