Top tag
Next privilege 500 Rep.
Access review queues
7 13
~7k people reached

  • 0 posts edited
  • 3 helpful flags
  • 466 votes cast
comment Is it good that testers are competing to see who opens more bugs?
@amon that TDWTF was a derivative version of the original:
comment What is best practice to handle whitespaces when letting the user edit the configuration, the name=value pairs?
@mainma That oversized equals sign renders perfectly on my win7 box in everything I've tried that's unicode aware.
comment Leaving intentional bugs in code for testers to find
The first thing that jumped to my mind was Wally's going to code someone else a minivan this afternoon
comment How are financial organizations planning for the degradation of old programming languages such as COBOL?
+1 for "But as long as there are money to be earned, people will learn necessary skills." And because very few people graduate school saying "I want to be a COBOL developer", companies that need them have to offer a salary premium to recruit staff. Put enough money into it and you can get some people to do almost any otherwise less appealing job.
comment How to test when arranging the data is too cumbersome?
Something I've done in cases where the parser itself is an expensive operation (eg reading data out of Excel files via com interop) is to write test generation methods that run the parser and output code to the console recreate the data structure the parser return. I then copy the output from the generator into more conventional unit tests. This allows reducing the cross dependency in that the parser only needs to be working correctly when the tests were created not every time they're run. (Not wasting a few seconds/test to create/destroy Excel processes was a nice bonus.)
comment Which are the cases when 'uint' and 'short' datatypes are a better fit than the standard int(32)?
Adding to what @AdamD.Ruppe said, the reason why smaller ints are normally padded in memory to a larger size is that aligning data structures to the size of the CPUs native int size is that depending on the architecture a misaligned read/write to memory is typically either slower than an aligned one or an invalid operation. Historically CISC processors generally did the former and RSIC ones that latter; but there're no hard and fast rules since it depends on how the instruction set was designed.
comment How do big companies maintain their products' source code without it falling into wrong hands?
In addition, copies of the Windows codebase have been leaked more than once; but you don't see copycats using the leaked code to build their own knockoff versions of the OS.
comment Should I accept empty collections in my methods that iterate over them?
I don't think recycling the empty collection for a return is a good idea. You're only saving a tiny bit of memory; and it could result in unexpected behavior in the caller. Slightly contrived example: Populate1(input); output1 = TransformNodes(input); Populate2(input); output2 = TransformNodes(input); If Populate1 left the collection empty and you returned it for the first TransformNodes call, output1 and input would be the same collection, and when Populaten2 was called if it did put nodes in the collection you'd end up with your second set of input in output2.
comment Name/Fix for Production Code Whose Sole Purpose is to Facilitate Testing?
For testing file IO, IMO it's generally simpler just to accept that the WriteFile() and ReadFile() methods of the class will only be covered by relatively lightweight integration tests that do actual file io instead of trying to mock the file system itself.
awarded  Notable Question
comment Sense of unit tests without TDD
@DougM writing tests first and intending to only write code needed to pass the tests does not guarantee that no untested code will be written (intentionally or by accident). To achieve that you need to have something (most likely a CI system) that generates a failure if code coverage falls below 100%. Setting that up is independent of if tests or code are written first.
comment Quantifying the advantages of a modern version control system
The biggest nightmare I had with clearcase was that, like CVS, it only versioned at the individual file level; meaning merge problems/etc would result in the newest version in CC to become a broken build and the inability to roll an entire codebase back to an arbitrary date/time. Using the option to do a local view instead of a virtual network drive greatly reduced pain from IO latency.
comment Client-side coding: How to prevent malicious use?
Any attempt to protect secure resources client-side is doomed because it violates several of the immutable laws of security. #2/3 - if your software is running on your adversaries computer it's not your computer by definition and you've already lost. #7 attempting to protect a resource by encryption is doomed since you also have to provide the client the decryption key. #10 no technology can fix the above.…
comment Should the commit history be used to convey critical information to developers?
@Klors As long as you don't restrict yourself to the most pedantic definitions of unit tests and refuse to do other types of automated tests, a test based on checking the file system/etc for the libraries name (if it has the version encoded in it) or a hash/checksum of the file itself could be used to throw a red flag at anyone wanting to update the library even in cases where the new versions flaw is difficult/impossible to capture in a test. (eg multi-threaded race conditions)
comment Should temporary code be put under version control and how?
@MainMa does that still work when the dll you need to reference is part of an application that needs to be installed conventionally?
comment Should temporary code be put under version control and how?
With VS, you sometimes need to take care to make sure you don't have absolute paths sneaking in. I've ran into more than a few problems with busted references when upgrading to win64 and having libraries for 3rd party platforms move from C:\Program Files\... to C:\Program Files (x86)\...
comment Is it a good idea to “#define me (*this)”?
Why not just go all out, and do: #include "vb.h", #Include pascal.h, or #include FOTRAN.h and have the next person to touch your code submit it to TDWTF.
answered Does it make sense to write tests for legacy code when there is no time for a complete refactoring?
awarded  Good Question
comment What are the safety benefits of a type system?
my misgivings are that you should try for 100% coverage in both types; and the use of a percent is obscuring the key fact: that 100% in a strongly typed language is significantly fewer tests than in a weakly typed one, or that phrased alternately a significant bit of the latter's required 100% is given free by enforcing type.