Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Nathan Tuggy

@Nathan Tuggy
About
Posts
10
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • What happened to TodoList?
    N Nathan Tuggy

    I took the precaution of downloading the source code, executable, WUW, and the entire contents of the wiki site in case we need a mirror. (Old versions of the code can probably be gotten from the Internet Archive, unless something really awful happens.) Let's hope Dan shows up in a day or two and tells us it was all a joke! :~ :sigh: D'you s'pose there might have been some trumped-up DMCA problem, perhaps?

    The Lounge algorithms question

  • Javascript 'with' keyword
    N Nathan Tuggy

    Yeah... in point of fact, I rather like the VB implementation of With (not that I use it all that often, but it's handy to have around every now and then). The Javascript design for with, though, is horrible. It has all the proverbial ugliness of VB, and more so. I mean, seriously! Who thought being able to reference members as though they were global variables was cool, anyway?

    The Lounge c++ javascript architecture question

  • A small Horror
    N Nathan Tuggy

    Ah, now that would be telling... I think it's because I work in a (small) VB-only shop, and although I know C# well enough I didn't need the translation, I don't think the other devs do. A micro-horror, I guess.

    The Weird and The Wonderful csharp question data-structures lounge

  • A small Horror
    N Nathan Tuggy

    This is some sample code from an SDK, published by a medium-sized company who I will of course not name. (For one thing, my job is somewhat tied to their work... :| .) It was so bad I rewrote it in place, and I couldn't resist a side-by-side comparison of my code and the original code. (Side note: this code was apparently auto-translated by a tool from C# to VB.NET at some point during its life... it's possible that some of the horror is auto-generated, but how much of this could be from that source? And anyway, that's pretty bad in itself.)

    ''' <summary>
    ''' Parses the Input txt File by Rows and returns a array of string of input rows
    ''' </summary>
    ''' <param name="filelocation">System Path of the File </param>
    ''' <returns></returns>
    Private Function ParseTheFileByLine(ByVal filelocation As String) As String()
    ' This is my code; the XMLdoc comments and method signature are unchanged,
    ' except that I fixed capitalization.
    Try
    Using sr As New StreamReader(filelocation)
    Dim ares As New List(Of String)
    Do Until sr.EndOfStream
    ares.Add(sr.ReadLine())
    Loop
    Return ares.ToArray()
    End Using
    Catch ex As IOException
    Dim hh As New System.Collections.ArrayList(1)
    hh.Add("Invalid Input File " & ex.Message)
    ' CompanyNameBrandedCustomValidationException is not, of course, the real
    ' name of the exception in question because, as the name implies, it
    ' contains the company's real name.
    ' And yes, its constructor does require an ArrayList. No, I don't quite
    ' know why. Chalk another one up to general incompetence or just garden-
    ' variety peculiarity.
    Throw New CompanyNameBrandedCustomValidationException(hh)
    End Try

     ' Here is the original miserable code, commented out (the way I left it
     ' there for possible "future use"...).
     '  Dim fs As FileStream = Nothing
     '  Dim fs1 As FileStream = Nothing
     '  Dim sr As StreamReader = Nothing
     '  Dim sr1 As StreamReader = Nothing
     '  Try
     '    fs = File.OpenRead(filelocation)
     '    fs1 = File.OpenRead(filelocation)
     '    sr = New StreamReader(fs)
     '    sr1 = New StreamReader(fs1)
     '  Catch Ex As Exception
     '    Dim hh As New System.Collections.ArrayList(1)
     '    hh.Add("Invalid Input File " & Ex.Message)
     '    Throw New CompanyName
    
    The Weird and The Wonderful csharp question data-structures lounge

  • BitC Architect Going to Microsoft to Work on Midori
    N Nathan Tuggy

    I feel kind of sad. I'd hoped, to tell the truth, to (eventually) be able to switch to Coyotos from Windows. So much for that dream, eh? :sigh: I noticed part of the announcement earlier on the main Coyotos mailing list (notifying all and sundry that Coyotos was basically dead), but I didn't see the BitC one (which went into more detail) until I came here. At least Midori will be good, now. ;)

    The Lounge

  • Code that makes you go "hmmmm"
    N Nathan Tuggy

    There's just one thing that puzzles me about VB6: why are all the OTHER VB6 programmers so bad? I don't use VB6 anymore (when I saw .NET, I never looked back), but I was never this bad -- I wasn't even this bad when I was writing programs in QBASIC! I mean, seriously! So what's with all the amazingly awful VB programmers? It must be a curse.

    The Weird and The Wonderful testing beta-testing question

  • Thanks for the missing warning
    N Nathan Tuggy

    This makes sense, of course, but I have always thought that it would be really cool to have a "smart" = operator that, depending on context, is either comparison or assignment; a dedicated := assignment operator for when you're returning the result of an assignment; and a dedicated == operator for when you really want to compare. That way, you won't get bit, but you can have C's power if you need it. I'm not sure why no languages I've seen have this.

    Clever Code game-dev help

  • Finding a record by its primary key
    N Nathan Tuggy

    Sad: I have to maintain code like this.

    The Weird and The Wonderful database sql-server sysadmin business help

  • Finding a record by its primary key
    N Nathan Tuggy

    Sad: I have to maintain

    The Weird and The Wonderful database sql-server sysadmin business help

  • Someone knows how fast this code can kill your application? [modified]
    N Nathan Tuggy

    That's one reason I hate camel casing. Pascal casing or Hungarian notation is my thing.

    The Weird and The Wonderful help debugging question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups