Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Marl3x28523yDevRant probably isn't the best site for a beginner programmer, you will only find hatred in here :P But welcome, wish you luck
But dev is fun
Learn to deal with frustration from day 1. Single most important thing for developers and it'll ripple through your whole life.
First : Learn and understand LinQ.
After that, anything can be done with LinQ in C#. (Doesn't mean it SHOULD be done with LinQ)
It's THE BEST perfromance you'll get.
But you need to UNDERSTAND how it woks, when your list are enumeratred and how.
LinQ will be faster 90% of the time that manual sorting / filtering implementation.
Why ?Because they already use "Insert search" and not bubble sort that juniors do.
Why ? Because they will enumerate your colection as rarelly as possible.
But you needto understand that 'colextion:.Where (xxx).toList().where (""") will enumerate your collection multiple times.
BUT again, i'm confident, a badly wrote 1 line LinQ will perform better than custom sort/filtering done by any juniot dev.
@MadMadMadMrMim Just to show you a practical example.
I have a collection of 100.000 objects (111.000 to be preceise).
This is not a "lkearning exercise" it's a real life example.
But each object is a real class, wghich implements IComparable. I have no idea how they implement it (yes I do, I wrote them, but for the pupose of demo, let's say I don't know).
When I do CXollection.OrderBy(myIc0omparerProperty / method). It takes 14 milli seconds. For frikking 100k+ objects.
Can I do it better manually ? yes I can. I can go to 5 ms. But, is it worth it ? 14 ms vs 5 ms ? 1 line of code vs 1000+ lines class ?
Meanwhile try joins
And also try comparison of anonymous types after a select vs populating hard coded result types
And while you’re at it how bout a sub query style set of conditions with an exists call
TheEnd6703yPersonally, I really enjoy C# and the .Net framework and think it’s a good place to start. As a lot of folks on this thread have wisely mentioned or alluded to: It’s easy to let Dev/IT work consume a good portion of your personal life, but it can always be a rewarding career. Gotta be ready to take the good with the bad. For example, I’ll be working my 4th out of 5 planned Friday night implementations this week...does not make the family happy, but that’s the way the dates fell.