2 ms·
Good christ, why would you use primitive arrays in C# like that?! How would someone not know about the List class? It sounds like suffering from premature opt
by CydeWeys 8y ago
Good christ, why would you use primitive arrays in C# like that?! How would someone not know about the List class? It sounds like suffering from premature optimization, and then completely failing at knowing how to do the optimization part.
- LandR 8y agoThere are still some devs today that have years of experience that avoid List<T> because they don't understand generics. Yes, honestly. Or even better (worse), we have a database table that stores the state things. State can be one of a small collection of states, e.g. Foo, bar, Quax. It's enumerable. How do we store it in the database table? as an nvarchar Id = 1, State="Set State to Foo" So any query was having to do a string parse to get the state out by grabbing the string after "Set State to " Which was killing the database as the table has millions of rows and is used all the time. I have so many examples like this.
- CydeWeys 8y agoThe last time I ran into something this bad was ten years and two jobs ago when, in front-end JS, someone needed a lookup map, but instead of just using a JS object, he implemented an array where the even entities represented keys and the odd entities represented values, and for lookup he used a for loop over the even indices of the array to iterate through keys until he found a match. Yes, it was terrible. He came from IBM too. I haven't run into anything that bad since; even my interns know a lot better. I'd suggest that if this is a routine problem for you, you might want to go find a team or job that has better programmers.