1
vote
4answers
185 views

Is there a good way to communicate the intent that a class only contains referentially transparent methods?

My workplace mostly uses C# for writing code. I'm trying to figure out a good way to indicate that a class with referentially transparent methods is intended to be referentially transparent (i.e., ...
1
vote
2answers
110 views

Is input validation necessary?

This is a very naive question about input validation in general. I'm a MATLAB user (1.5 years old) and I learned about input validation techniques such as "parse" and "validatestring". In fact, ...
8
votes
5answers
793 views

Zero as a constant?

I have come across this programming idiom recently: const float Zero = 0.0; which is then used in comparisons: if (x > Zero) {..} Can anyone explain if this is really any more efficient or ...
7
votes
4answers
678 views

Readability of || statements

On HTML5 Boilerplate they use this code for jQuery: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script>window.jQuery || ...
10
votes
12answers
1k views

Maintainability of Boolean logic - Is nesting if statements needed?

Which of these is better for maintainability? if (byteArrayVariable != null) if (byteArrayVariable .Length != 0) //Do something with byteArrayVariable OR if ((byteArrayVariable != ...
22
votes
12answers
2k views

How do people manage to write and maintain extremely complex and hard to read code? [closed]

Reading SQLite source code is IMO mission impossible. Yet it is a usable piece of quite complex software (it's a full-blown embedded database after all) that can be downloaded, compiled and used from ...