347 reputation
18
bio website
location
age
visits member for 4 years, 6 months
seen 12 hours ago

12h
comment Should we define types for everything?
What does /// mean?
Mar
5
comment Phrasing a requirement about filename encodings
Remember, we're talking about the filename itself, not the contents of the file. Odds are the web server has no way of knowing the filename's encoding, so if the it claims that the filename is in a certain encoding, it's probably lying. If you try to convert from UTF-8 to UTF-16 but your filename is really ISO-8859-1, you're likely to get a crash. Also, see blogs.msdn.com/b/oldnewthing/archive/2007/04/17/2158334.aspx for an example of how bad heuristics are for guessing encodings from filename-sized samples of text.
Mar
5
comment Phrasing a requirement about filename encodings
While NTFS stores filenames in Unicode, most other filesystems store filenames as byte streams without any specified encoding. Given that case, how would you even know what encoding to guess?
Jan
21
comment What are the caveats of implementing fundamental types (like int) as classes?
@supercat: Yes! Since FORTRAN passes all arguments by reference (by default), even integers would need to have a constant pool. It was originally implemented on an IBM 704, which had 15-bit pointers but 36-bit ints and floats.
Jan
2
comment What are the caveats of implementing fundamental types (like int) as classes?
@MasonWheeler: Typical FORTRAN implementations pass by reference, so if you pass a constant value (like 7), the compiler has to pass a pointer to the value. Since the compiler can use the same pointer for every instance of that value, any function it's passed in to can change the value of the "constant".
Dec
23
comment Is every language written in C?
The original C++ compiler (called cfront) really compiled to C. That is, when you compiled a C++ program, you got a C program, which you then compiled using a C compiler. So you could definitely say that C++ was originally written in C.
Dec
23
comment Are there programming languages that support both static and dynamic typing?
@Doval: Being able to call o.getClass().getMethod("xyz").invoke(o); is not the same as being able to call o.xyz();. If it were, then even C would be a dynamic language.
Dec
22
comment Are there programming languages that support both static and dynamic typing?
What makes this different from dynamic typing is that Java doesn't let you access a method or field that it doesn't know about at compile time. You can't say Object o = foo; o.xyz(); because Object does not have a method called xyz. If you do that in a language like VB the code will wait until runtime to see if there's an xyz method.
Nov
18
comment Every function is a closure?
@mebob: So a C++ method isn't a closure, but a C# method is because it can be automatically turned into a delegate, and a delegate with a target object is a closure?
Nov
18
comment Every function is a closure?
@Doval: In other words, instance methods are closures, while static methods or functions are not?
Aug
30
answered What specifically does expressive power refer to?
Aug
29
comment “Ever change the value of 4?” - how did this come into Hayes-Thomas quiz?
To be more specific, FORTRAN passes by reference. So if you pass a constant as a function parameter, you can change that value for every use of that number.
Aug
3
comment When would you want two references to the same object?
If a and b always reference the same Dog, then there is no point to it. If they sometimes might, then it is quite useful.
Jun
14
comment Is my work on a developer test being taken advantage of?
You're completely right; I'm just saying that under any circumstances the interviewer should expect to provide whatever environment that is needed to complete the given task.
Jun
13
comment Is my work on a developer test being taken advantage of?
It's completely legitimate to have a problem like, "Given these EF classes, write a query that returns some complicated criteria and display the results in a form". I can't imagine asking the interviewee to create that kind of environment themselves rather than just give them an existing VM with everything all set up.
Apr
21
comment Strategy for generating unique and secure identifiers for use in a “sometimes offline” web app
It strikes me that UUIDs already satisfy the 5 listed requirements. Why are they insufficient?
Mar
23
answered Is better Show() + Hide() or SetVisible(bool visible)?
Jun
16
comment Forcing people to read and understand code instead of using comments, function summaries and debuggers?
"By the time you are done cleaning up," you've introduced several new, unknown bugs.
Dec
7
awarded  Critic
Dec
6
comment What is the historical basis of using Javascript in web programming?
OK, so JS has closures (which I believe implies first-class functions and lexical scoping) and dynamic typing, like Scheme. Since C# has closures, dynamic typing, and a limited form of S-expressions, does that mean C# is even more Scheme-like than JS?