Jump to content
Xtreme .Net Talk

IceAzul

Avatar/Signature
  • Posts

    46
  • Joined

  • Last visited

About IceAzul

  • Birthday 08/01/1985

Personal Information

  • Visual Studio .NET Version
    VS 2003 Pro, VS 2005 beta 2 Team
  • .NET Preferred Language
    C#

IceAzul's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. You could change the TextBox to readonly and Borders property to None.
  2. I think the code should be (!= -1) because IndexOf() returns -1 if its not in the array (0 is a valid position).
  3. The file doesn't exist yet, I just want to check if the name is valid. I was just checking if there was some method in the System.IO namespace, seems kind of weird that there is none. One more thing, I think the char array I want to use is InvalidFileNameChars (I think the InvalidPathChars is for when you are parsing an entire path, is this correct?)
  4. Is there a System.IO method that can analyze a filename for validity?
  5. Many structs probably should have been classes, for example a Rectangle, which may be one because of the need for speed. I think the only problem is that "Production Level" structs CAN be used for such purposes. imo there should be an unsafe-type keyword for allowing an instance method or property to change the inner values of the struct, or simply allowing internal or private structs to use this behavior. Structs and Value types add a kind of beauty to the language, when everything can be used in a similar fashion and has a place in C# type land, while removing those annoying special cases (for example, primitives in java). Mutability ruins this illusion.
  6. Well thats just a problem with the fact that a struct has methods which seem to do actions other than generating a new one. A better way to add a DateTime would be the + operator and having the static method String.Replace(x, y) would be more intuitive than the instance method x.Replace(y). Struct methods and properties should simply return values to show their internal state, and use operators or static methods to operate on them. This forces you to treat every struct as you would an Int32 for example (change by assignment and operators).
  7. You're right, I dont know what I was thinking, other than possibly when inheriting from an ArrayList in the olden days (I do know for a fact that my code was messing up from something similar to above).
  8. I've always had this problem, and this is why I think structs should ALWAYS be immutable: rects[0] = new Rectangle(20, 20); rects[0].Width = 10; // rect[0] will still have a width of 20 It makes for confusing code if you can edit a struct like this, because indexers will only return a copy of the value, and not the value itself.
  9. Both. I am looking for particular formats for writing XML Documentation and for exception messages (for example if (x < 10) throw new ArgumentException(???)...)
  10. They have been working on F# for at least 3 years. I started a thread on it on the other forum. It is similar to O'Caml.
  11. Just one more question (there is a theme here), does anyone have any tips for exceptions? (Inheritence, messages, etc.).
  12. Does anyone have any tips on how the descriptions should be formed? Is there some sort of guildeline on how to write the documentation?
  13. I was under the impression that it did work by table lookup, not because I disassembled the compiled code, but because of how the debugger worked. In a switch, it jumps to the correct case, but by if-else-if-else, if tested each one. Obviously that may not mean anything when it comes down to execution speed, it does make it a little less grating when stepping through code though.
  14. What about a case like this: switch (integer) { case 1: break; case 2: break; case 3: break; case 4: break; case 9: break; case 10: break; case 11: break; }
  15. For simple matching, is switch-case more efficient than a long list of if-elses? I think I read somewhere that it is compiled internally to a hashtable, or something similar.
×
×
  • Create New...