6,110 reputation
1641
bio website
location Los Angeles, CA
age
visits member for 4 years, 2 months
seen 18 hours ago

I love strange shrimp.

eh, string stream.


Nov
25
awarded  Nice Answer
Nov
24
comment How many lines of code does the average programmer write in a day?
As people says, between 10 - 1000. But this is not a measure of productivity. Rather it is the amount of code due to accidental complexity and essential complexity, as described in No Silver Bullet. As an example, I develop image processing algorithms in C++. The average C++ class consists of 10 line of code of mathematical significance, embedded in about 300 lines of scaffolding code that is necessary to execute those 10 lines of code. Can you skip those 300 lines of code? I can't, but maybe you can.
Nov
24
revised Function guaranteed to never return the same value twice
added 800 characters in body
Nov
24
answered Function guaranteed to never return the same value twice
Nov
23
comment How to break up a programming project into tasks for other developers?
I guess the paragraph on TDD could be eased with "a test harness with mocks" so that people would not be writing "code that compiles individually but won't run together". TDD is a design technique, something the author was already trying to do with pencil and paper.
Nov
23
comment Is it normal for a programmer to not have 100% clarity over their own code at times?
Seems to me you have an extremely good education with a solid foundation, and that you have internalized the knowledge to a very high level. I guess this is somewhat rare among the typical programmers. Most typical programmers (including me) have to struggle to keep up with the knowledge needed for today's task, because the technology changes so rapidly.
Nov
23
comment Is it normal for a programmer to not have 100% clarity over their own code at times?
If the "five dimensional array" is merely a map from a 4-tuple or a 5-tuple to a strategy, the author could have used a hash table or a helper lookup function. However, if the author spends most of the time coding the mechanics of initializing the array (nested for-loops), then the actual "algorithm insight" is going to be drowned in the pile of "mechanical code". Programmers seek to keep the latter kind of noise separate. Thus, good programmers must know how to write libraries primarily to house those mechanical code.
Nov
17
comment When do you use float and when do you use double
I endorse this answer with one additional advice: When one is operating with RGB values for display, it is acceptable to use float (and occasionally half-precision) because neither the human eye, the display, or the color system has that many bits of precision. This advice is applicable for say OpenGL etc. This additional advice does not apply to medical images, which have more strict precision requirements.
Nov
15
comment Why do code-bases in n-tier development have an equal amount of, if not more, JavaScript code now?
Because mobile has more network infrastructure in between and therefore highly affected by latency? A high latency means one must make fewer round-trips to the server-side (say, per second), and therefore more of the computation must happen client-side. That in turn motivates more computational power on the client-side.
Nov
12
answered Real AI in a compiled language
Nov
12
comment Concurrent Processes - Monitors and Reader/Writers
By "the code that enforces ..." (the code that implements monitor), I refer to the code responsible for: registering with the condition variable; blocking the thread (either by spinning or putting the thread to sleep or by switching to another unblocked task or somehow invoking the OS to do the same), and reviving (continuing) the execution once the mutex is grabbed.
Nov
12
comment Concurrent Processes - Monitors and Reader/Writers
You need a clearer (and a bit more formal) definition of what "monitor" refers to. Not the concept itself, but whether "monitor" refers to the code that enforces exclusivity of some other code, or the code that is being protected (enjoying the guarantee of exclusivity) thanks to the monitor. Thus, your question is as much a word question as a computer science concept question.
Nov
10
comment Can every language be compiled? And can every language be interpreted?
@wannik: See "all swans are white" fallacy, in Falsifiability
Nov
10
comment Can every language be compiled? And can every language be interpreted?
Some language features such as dynamic code generation (often confused with reflection; no, they're different) cannot be statically compiled.
Nov
10
comment Can every language be compiled? And can every language be interpreted?
Machine-code binaries can be executed in an emulator. The best known example is QEMU, because it is able to run binaries compiled for one CPU architecture on top of a different CPU architecture - a clear sign that the original machine code is not executed in its original form. Whether total CPU emulation shall count as "interpreted", "binary-translated" or "dynamically executed" is up to you.
Nov
10
comment Can every language be compiled? And can every language be interpreted?
Assuming that by "compiled language" you refer to "a mode of program execution by compiling the source code into the machine code for use with the target CPU's architecture, and then executed there", there are several sub-categories: AOT (ahead-of-time), JIT (just-in-time), or IL (intermediate language). Statically-compiled binaries may be yet another one, but some may consider it to be same as AOT.
Nov
10
comment Can every language be compiled? And can every language be interpreted?
First of all, most "useful and sensible" questions can be rendered nonsense or unprovable by qualifying with the word "every".
Nov
9
comment Is it bad to feel guilty using lots of libraries?
Questions about personal feelings is somewhat out-of-topic on Programmers.StackExchange. If this is about occupational psychology please seek professional help. (If this is a medical emergency please hang up and dial the emergency number.)
Nov
9
comment Is it bad to feel guilty using lots of libraries?
Have you received a request from someone else (either a more experienced developer, team lead, or anyone who knows your work) that you use less libraries? Have your app faced a bottleneck due to heavy use of libraries? (e.g. breakage or bugs due to a low-quality library; copyright or licensing issues; lawsuits or legal threats; app being rejected due to use of certain libraries, etc)
Nov
2
comment Testing non-central features
If the software is sold as a commercial product, the software vendor has to invest in quality control measures up to a reasonable economic limit. Failure to do so makes the software vendor liable for defective products or "unfit for purpose". Usually this means the software vendor will be ordered by the court to offer refunds to their customers, even if the software license precludes this possibility. At minimum a software vendor must maintain a bug-tracker. (Disclaimer: I am not a lawyer.)