Eerongal he/him Posted August 1, 2011 Posted August 1, 2011 so this is off topic, but since we're talking programming here, i figured i'd post it here. But i learned something outrageously cool about both C# and vb.net today. apparently they both have a feature called "LINQ" that lets you query your variables and objects in memory as if they were records in a database. It's significantly more efficient than looping around an array/collection of objects and testing for a certain condition. so for example, if we had a collection of objects called "objStuff" we could do a for...each loop like this for each e as Entity in objStuff if e.variable = true then {l33t codez} end if next but instead, we could use linq and do this: query = from object as Entity in objStuff where object.variable = true select object for each e as Entity in query {l33t codez} next
Joe ST he/him Posted August 1, 2011 Posted August 1, 2011 indeed linq is supposed to be pretty. Though I've done plenty of C#/.NET development, I've never really gotten into it. Though my excuse is I'm writing code for hardware guys, who know C better than anything. Though linq is very much more readable I guess...
Eerongal he/him Posted August 1, 2011 Posted August 1, 2011 indeed linq is supposed to be pretty. Though I've done plenty of C#/.NET development, I've never really gotten into it. Though my excuse is I'm writing code for hardware guys, who know C better than anything. Though linq is very much more readable I guess... yeah, ive done quite a bit of stuff with c#, and i never even knew it existed. I just happened upon the MSDN entry for it, and it basically blew my mind so of course i immediately set about modifying code that was using for..each loops to use it to see how much quicker the code ran, and after doing so, you can certainly color me impressed.
Chaos he/him Posted August 3, 2011 Posted August 3, 2011 so this is off topic, but since we're talking programming here, i figured i'd post it here. But i learned something outrageously cool about both C# and vb.net today. apparently they both have a feature called "LINQ" that lets you query your variables and objects in memory as if they were records in a database. It's significantly more efficient than looping around an array/collection of objects and testing for a certain condition. so for example, if we had a collection of objects called "objStuff" we could do a for...each loop like this for each e as Entity in objStuff if e.variable = true then {l33t codez} end if next but instead, we could use linq and do this: query = from object as Entity in objStuff where object.variable = true select object for each e as Entity in query {l33t codez} next I'm late to the party here, but I did quite a bit of VB and C (no C# though), and that is a ridiculously cool trick.
Joe ST he/him Posted August 3, 2011 Posted August 3, 2011 for you guys preening over linq, you should check out the languages Scheme or Haskel/Erlang, those are some sweet-chull languages lol Joe
Eerongal he/him Posted August 3, 2011 Posted August 3, 2011 for you guys preening over linq, you should check out the languages Scheme or Haskel/Erlang, those are some sweet-chull languages lol Joe scheme....that's based off lisp, isnt it? i've heard of haskell, but never even looked into it, so i know nothing of it. also: lolcode and Brainstorm (sorry about the language, but thats its actual name )
Joe ST he/him Posted August 3, 2011 Posted August 3, 2011 scheme....that's based off lisp, isnt it? i've heard of haskell, but never even looked into it, so i know nothing of it. also: lolcode and Brainstorm (sorry about the language, but thats its actual name ) aye Scheme/Lisp are very similar, and those two mock-languages are awesome 99 Bottles of beer showcases what code looks like in different languages, eg perl
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now