Hot answers tagged

82

In 16 years I've never actually found a workable metric of the sort you're looking for. Essentially to be useful anything would need to be measurable, representative and ungameable (that is the system can't be played by clever developers). There are simply too many variables within software development to make it measurable as piece work in this way. The ...


46

Yes, it is irrelevant. Computers are tireless, near-perfect execution engines working at speeds totally un-comparable to brains. While there is a measurable amount of time that a function call adds to the execution time of a program, this is as nothing compared to the additional time needed by the brain of the next person involved with the code when they ...


44

It's worth noting that languages are not interpreted or compiled, but rather language implementations either interpret or compile code. You noted that Ruby is an "interpreted language", but you can compile Ruby à la MacRuby, so it's not always an interpreted language. Pretty much every Python implementation consists of an interpreter (rather than a compiler)...


39

As said in the other answer, most compilers will automatically optimize multiplications to be done with bitshifts. This is a very general rule when optimizing: Most 'optimizations' will actually misguide the compile about what you really mean, and might even lessen the performance. Only optimize when you have noticed a performance problem and measured ...


37

Run your tests in a virtual machine with limited memory and only one core. The old machines people still may have now are mostly Pentium 4 era things. That's not that unrealistic - I'm using one myself right now. Single core performance on many current PCs normally isn't that much better, and can be worse. RAM performance is more important than CPU ...


37

Metrics work best in factories, and programmers don't work on an assembly line. I completely understand the desire to measure productivity. But would you use the same metric for a family doctor and a heart surgeon? How about for Michelangelo painting the Sistine Chapel, and some guy in Mexico cranking out black velvet Elvis paintings? Louis de Broglie ...


37

Are there any practical considerations that I am overlooking which making binary search better than linear search? Yes - you have to do the O(n log n) sorting only once, and then you can do the O(log n) binary search as often as you want, whereas linear search is O(n) every time. Of course, this is only an advantage if you actually do multiple searches ...


36

Microsoft has done some very interesting research in this direction, if you look into Singularity: http://research.microsoft.com/en-us/projects/singularity/ Also, Mothy Roscoe et al have been working on Barrelfish which uses the Eclipse constraint programming language as an OS service to sort out all kinds of OS management and resource allocation problems: ...


35

Indentation One-liners like that do introduce a bit of a hazard in terms of keeping the brackets correctly matched. Most decent editors will match the brackets visually to help, but it is easier to expand it. (function($) { $('#element[input="file"]').hover(function() { $(this).fadeOut(); }, function() { $(this).fadeIn(); }); })...


34

I lead a small team and I can tell you now that I will NEVER allow it in my workplace. Here's why: It sucks if you are NOT a developer. The last thing my QA and Admin people want to see is people having fun while they are working. They don't care if it might make sense, it just pisses them off and I'll have to deal with department heads that have ...


34

A lot depends on where you put the division between low-level and high-level languages. For example, different people tend to put a language like C++ on different sides of that divide. Regarding your questions: I don't believe there is such a difference between low-level and high-level languages, but more a difference between interpreted languages and ...


33

Maybe because productivity is something hard to measure, whereas hours of being apparently working are not, so they often choose the easy way.


31

In my experience, the simplest answer is that [ several, many, most ] of your coworkers don't share your passion for development. They're just there for the paycheck. If a pool table or Xbox was available, the extra policies and monitoring to prevent abuse of these perks would cost more than the productivity that someone like you might gain. That said, ...


29

Research Material There are a few but not all are current or applying exclusively to our field: Work-at-home and the quality of working life Substitution between working at home and out-of-home: The role of ICT and commuting costs The perils of working at home: IRB “mission creep” as context and content for an ethnography of disciplinary knowledges ...


25

Your questions has the answer in it. Adding man-power to a project that is running late, only makes it worse because the communication overhead increases in a non-linear way. It's already been studied. Read "The Mythical Man-Month".


24

I used to run an IT department for a small business in Florida, where hurricane strikes were a very real threat. After our first very-near miss, we started getting a lot of inquires from our customers about our disaster preparedness plans. So, we started looking at telecommuting as an integral part of our company's disaster preparedness. In the event of a ...


23

It depends. In the glacially-slow world that is Web programming, where everything happens at human speeds, method-heavy programming, where the cost of the method call is comparable to or exceeds the cost of the processing done by the method, probably doesn't matter. In the world of embedded systems programming and interrupt handlers for high-rate ...


23

The compiler recognizes constants and converts multiplies to shifts where appropriate.


22

I start out like this {}, then usually fill them with something. Whenever you type {, type a corresponding } and stick it on a new line. The worst thing you have to do in that case is fix indentation prior to committing. Good syntax highlighters will often alert you to a problem, but not always. My preferred editor KATE, for instance, choked on a JSON ...


22

My first personal issue: "Trying to use a technology you do not master." That's not "inefficiency" at all. That's "learning". You're calling it the wrong thing and you're thinking about it the wrong way. I often need to spend significant time correcting code because my assumptions were plainly wrong. Correct. That's called "learning" ...


21

You need an experienced developer or teamleader (who is not associated with those remote programmers) to estimate how long some task may take, and the effectiveness is measured by comparing their required time against the estimates. To be sure that the estimates are good, you could randomly pick a few tasks and have them executed by an in-house team you have ...


21

First off, any sort of interactive debugging is great. You want that in your toolkit, because if not yet, then someday you will really benefit from having it. (Details vary by language, platform, and IDE.) requiring interaction with an external server, and unable to implement automation due to authentication, software architecture, or complexity. I'd ...


20

Python will fall under byte code interpreted. .py source code is first compiled to byte code as .pyc. This byte code can be interpreted (official CPython), or JIT compiled (PyPy). Python source code (.py) can be compiled to different byte code also like IronPython (.Net) or Jython (JVM). There are multiple implementations of Python language. The official one ...


19

"Efficiency" is all about tradeoffs, and the "best" algorithm will depend on many factors. In the case of indexOf(), one of those factors is the expected size of strings. The JDK's algorithm is based on simple indexed reference into existing character arrays. The Knuth-Morris-Pratt that you reference needs to create a new int[] that's the same size as the ...


18

The two extremes are about equally bad: On one side the architecture astronauts/academics who can't even look at a class without defining two factories and a strategy pattern. On the other the self-aclaimed "duct tape programmers", often powered by at least some part ignorance, who subscribe to YAGNI ("You ain't gonna need it") to the extreme. Good ...


16

Whether shifting is faster than multiplication depends on the architecture of your CPU. Back in the days of the Pentium and earlier, shifting was often faster than multiplication, depending on the number of 1 bits in your multiplicand. For example, if your multiplicand was 320, that's 101000000, two bits. a *= 320; // Slower a = (a<<7) + ...


15

In General text columns are non standard and implementation specific. In many cases, depending on the database they may have a combination of one or more of the following restrictions: not indexable, not searchable and not sortable. In Postgres All the types map to the same implementation details under the hood. In MySQL The text column is a specialized ...


15

How is it possible to reduce an image by 90% without losing quality? Formats and compression options There are three popular image storage formats for web (not counting the promising WebP), and each format has its own compression options. A clueless coder may pick the wrong format and use wrong options, resulting in less-than-optimal image quality and ...



Only top voted, non community-wiki answers of a minimum length are eligible