• Scragar (unregistered)

    Got to give them credit, I would struggle to overcomplicate things this much, but they make it look effortless.

  • LongTimeLurker (unregistered)

    nit: since iID0 is the frist offender, that makes lucky 14 not lucky 13 items in the array-that-is-not-an-array.

  • (nodebb)

    To my knowledge, that was the Chinese coding paradigm about 10 years ago or so (wasn't paying attention to gossip afterwards). And I think they did this in shifts, with a quota of LoC per shift per crew.

  • (nodebb)

    All that stuff is over 20 years out of date. Rather impressive how garbage like this survives. ArrayList, DataTable... oh man, I remember those .net1.0 days. Millennials just started to be allowed to have drinks in the US after running around with their guns for 20 years :-).

  • (nodebb)

    I am more scared at the use of ArrayList. Mostly because I used to use it myself waaay back int he day. It was added with .NET Framework 1.0 as a way to have a linked list, and since 1.0 had no generics, it was equivalent to List<object> with all the casting and boxing nightmares that entailed. Generics were added in 2.0 including List<T> which immediately made ArrayList obsolete. Though I was self taught and didn't realize this until much later, unfortunately, and kept using ArrayList.

  • Baleine (unregistered)

    And of course, there is a mix of french and english language used in the code. Of course!

    I hate my developing compatriots :-(

  • (nodebb)

    Isn't there a 'for switch loop' hidden in there? (I mean - I too am assuming there's a loop somewhere so that incrementing iCompt does actually perform something useful).

  • ScottTheAccountant (unregistered)

    They mostly get paid by the LOC.

    Mostly.

  • mihi (unregistered)

    Not worked that much with .NET 1.0, but I assume an ArrayList is not a linked list but a list backed by a dynamically growing array (doubling its size when it's full or similar)?

  • Kotarak (unregistered) in reply to Allexxann

    Well, you get what you measure.

  • (nodebb) in reply to mihi

    .net does not use linked lists because those are super inefficient. ArrayList used during the .net 1.x days an dynamic array reserved on the heap that grew with the power of two. So basically if you put in one item, it allocated an array with for two objects and if you tried to add a 3rd, it allocated an array with 4, copied everything from the first array and then threw the small one away. Now with .net 2.0 it became clear this is very inefficient, because a lot of copying will go on on average - so they changed the progression to primes (3,7,11,...). I actually don't know if they ever changed ArrayList at all - maybe it's still the same in .net framework, maybe even .net core.

    Now the major different is generic specialization of value types at compile time. Java has type erasure, which is PR speak for using basically what .net had with ArrayList plus syntactical sugar pretending to be specialized with automatic boxing/unboxing and DPGO deabstraction. In .net a List<byte> actually allocates a real byte array and all operations are not longer v-calls but get deabstracted at compile time making the code, compilation and DPGO way more efficient and therefore performant for zero cost. Reference types don't get the same treatment, which is a huge discussion in the community to make them at least available with attributes, but from an internal perspective that actually makes sense cause a pointer is in the end a pointer, so ref type specialization would be overkill with little benefit and tons of meta data overhead generated.

  • Mike5 (unregistered)

    My Eyes! The goggles do nothing!

  • Klimax (unregistered)

    Pretty sure there is no other access to iCompt… AAH, ye all who think iCompt servers any purpose… (most likely it was intended by somebody else for array index access or something, but original craploper was too dumb to use it)

  • Klimax (unregistered)

    Pretty sure there is no other access to iCompt… AAH, ye all who think iCompt servers any purpose… (most likely it was intended by somebody else for array index access or something, but original craploper was too dumb to use it)

  • Craig (unregistered) in reply to MaxiTB

    .NET does provide linked lists if you ask for them (I believe LinkedList(Of T)).

Leave a comment on “Lucky Thirteen”

Log In or post as a guest

Replying to comment #687612:

« Return to Article