Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Root this one doesn't access database. Just checking some conditions in 2 levels tree. (No, there will not be 3d level)
-
You can use your lambda expressions inside those any calls and remove those where calls. It would make it more readable (at least for me). I also tend to use class initials instead of x or xx (p for project and t for task for example) but that's more how I like tk write it.
-
@dozingncoding RIGHT !
WHY, WHY I always forget about them ?
Here.
Oups missed 1
It's like a reflex for me to start with Where. Probaly EF4 PTSD -
@NoToJavaScript
Don't worry, I'm used to it. It happens to a lot of people, with both Any and First or FirstOrDefault ;) -
Voxera115855y@dozingncoding true, removed 3 surplus where just today and replaced with first and firstordefault.
Its quite common to use where().first() unfortunately. -
@AleCx04 In this case I really hope you don’t work with C# !
I understand the idea of being the sole master of the code and knowing every bit. In my early ages I went to assembler and had fun!
But do you really want to write 20 lines of code when it can be one? Sure, maybe it will not be the perfect implementation. But, if it is a critical part, you would’ve tested it anyway. For most part, it just works. Just write “whatever” and you get results. Again, if it is too slow, you start to break it down and see “slow” parts. And sometimes fix these parts manually. But it is pretty rare. -
@NoToJavaScript barking at the wrong tree here my man. I have worked with C# a lot and plan on doingit again soon . And I should correct myself. I like my linq(yours too btw, it is really readable amd good) but working with some of the weird shit I have seen in the wild makes me prefer people would much rather just take the 20 lines instead of their mess of half assed linq.
-
Owenvii7165y@AleCx04 Truth
Its like ternaries, if you start having too many of them, I would rather you just stop trying to look savvy and just take the longer approach of splitting it up into several lines. -
Voxera115855y@AleCx04 true, linq as a concept is very good, but like most powerful concepts it can be abused or twisted beyond usable if the implementer does not grasp the basic idea of it.
Is it too much LinQ for others devs to get ?
Personally, I don't think so.
question