unidentified

I'm a software developer with a focus on Apple's platform (iOS, Mac OS X).
More information about me is available at my website. If you're into Twitter, you can follow me.
You can ask me here for personal or professional purpose.


"My pragmatic summary: A large fraction of the flaws in software development are due to programmers not fully understanding all the possible states their code may execute in. In a multithreaded environment, the lack of understanding and the resulting problems are greatly amplified, almost to the point of panic if you are paying attention. Programming in a functional style makes the state presented to your code explicit, which makes it much easier to reason about, and, in a completely pure system, makes thread race conditions impossible." »

John Carmack: Functional Programming in C++ (via Phillip Bowden)

Whenever possible:

  • Avoid mutable strings, arrays, sets, dictionaries, date or data as a property of an object.

  • Avoid creating a method that takes a reference as an input to be modified.

  • Avoid manipulating a global variable.

  • Achieve high cohesion and low coupling.

(Source: buzz)

» via buzz
» via thechangelog
» via onethingwell
» via buzz

Selectively Analyzing Source Code

While I’m watching “Moving to the Apple LLVM Compiler” WWDC 2011 video, I found new things that maybe useful in cases where I know what I’m doing with the code that I’m working on.

The first one is to control Clang diagnostics via pragmas:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmultichar"

char b = 'df'; // no warning.

#pragma clang diagnostic pop

The second one is to control Clang static analyzer diagnostics:

#ifndef __clang_analyzer__
// Code not to be analyzed
#endif

Now, what I would really like is to selectively analyze the source code via Xcode. This is because, I often need to ignore the result of analyzing 3rd party source code. In most cases, I don’t really need to change them, and I don’t want to add these pragmas or preprocessors on their files.