IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1822.39 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-08-31
[09:57]<zgzzcygnv>yes
[09:57]<zgzzcygnv>god i hate people that think that C# is just C on .NET
[09:57]<vufvuzn>AnarkiNet: exactly what makes it crappy?
[09:58]<zgzzcygnv>vulture we just explained it
[09:58]<zgzzcygnv>[2006-08-30 23:57:14] <AnarkiNet> "OMG_A_CONST" is crappy syntax seen in other languages
[09:58]<zgzzcygnv>[2006-08-30 23:57:21] <AnarkiNet> like C, PHP, and probably lots of others
[09:58]<zgzzcygnv>[2006-08-30 23:57:32] <Kunnis> And insted of GetCode... use properties.
[09:58]<zgzzcygnv>thats why
[09:58]<kuggys>int Code { get { return 6; } set { mycode = value; } } (value is a keyword in C#)
[09:58]<vufvuzn>AnarkiNet: you state that it _is_ ugly, you don't explain why.
[09:58]<zgzzcygnv>fuck off you nitpicking cockwad
[09:58]<zgzzcygnv>i just explained it
[09:58]<vufvuzn>ok, so you explain it's crappiness by stating that it's "ugly" - but give no justification for the latter.
[09:59]<zgzzcygnv>get back in the closet
[09:59]<ssfrsxns>AnarkiNet: why enums?
[09:59]<vufvuzn>any claims to aesthetics in namingconventions are strenuous at best..
[09:59]<zgzzcygnv>sslashes because thats how things are done in C#
[09:59]<kuggys>No, naming convetions are standard, and the help make it understand the langauge.
[10:00]<zgzzcygnv>why does EVERYONE have to question the help theyre given?
[10:00]<zgzzcygnv>"omg, justify why you gave me this help!"
[10:00]<vufvuzn>Kunnis: sure - that doesn't justify one convention being better/worse/uglier/crappier than another. It only justifies choosing a standard (any) & sticking to it.
[10:00]<zgzzcygnv>fuck off already and do what we say
[10:00]<kuggys>vulture Microsoft has published one.
[10:00]<vufvuzn>AnarkiNet: I wasn't given help. I question the help you give to others to ensure it's good help.
[10:00]<kuggys>We are supposed to follow it.
[10:01]<vufvuzn>Kunnis: Right - sticking to the conventions specified by the language/library you are using is a good idea.
[10:01]<zgzzcygnv>vulture stuff your ego back in
[10:01]<kuggys>vulture You're trolling.
[10:01]<zgzzcygnv>i wasnt talking to you
[10:01]<zgzzcygnv>you just jumped in and started trolling
[10:01]<vufvuzn>Kunnis: how do you figure?
[10:01]<trfysdrg>AnarkiNet: you're trolling too. Get a life.
[10:01]<zgzzcygnv>sure mr correct english
[10:01]<zgzzcygnv>oh wait
[10:02]<zgzzcygnv>who are you?
[10:02]<zgzzcygnv>you're nobody thats who
[10:02]<zgzzcygnv>now get back in line
[10:02]<sdnffdxdlld>lol
[10:02]<sdnffdxdlld>morning all
[10:02]<kuggys>AnarkiNet Don't feed the trolls.
[10:02]<zgzzcygnv>hiya smellyhippy
[10:02]<__srgaxj__>does someone know something about *.swm file format
[10:02]<__srgaxj__>?
[10:02]<trfysdrg>Anyway, Microsoft's philosophy is "Standards are great!! Let's make our own!!"
[10:02]<vufvuzn>Kunnis: I'm not saying that sticking to Microsoft's convention when writing C# isn't a good idea. In fact I believe it to be a great idea. What I'm questioning is AnarkiNet's assertion that that gives any global value to a given convention.
[10:02]<zgzzcygnv>google does
[10:02]<vufvuzn>g'day smellyhippy
[10:02]<zgzzcygnv>vulture using consts and naming them like THIS_IS_A_CONST is just *bad*
[10:02]<sdnffdxdlld>howdy :)
[10:02]<zgzzcygnv>programatically and asthetically
[10:03]<ssfrsxns>so, anyway, how would enums better acomplish this, thats my only question (besides the "look" of the code)
[10:03]<sdnffdxdlld>hehe and namin conventions/coding standards are mainly subjective
[10:03]<sdnffdxdlld>its like art ... everyone has thier preferences
[10:03]<kuggys>sslashes You also can strongly type everything as the enum...
[10:03]<trfysdrg>lol
[10:03]<zgzzcygnv>the enum is a type instead of just an int32
[10:04]<zgzzcygnv>which means someone can't pass 0923093 and cause problems
[10:04]<zgzzcygnv>and it means you don't have to check for out-of-bound values
[10:04]<vufvuzn>AnarkiNet: Why is it "bad"?
[10:04]<zgzzcygnv>vulture, SHUT THE FUCK UP
[10:04]<zgzzcygnv>we just told you
[10:04]<zgzzcygnv>Kunnis and i
[10:04]<kuggys>All your return values will be the enum, and you can use the enum to be able to naviage the code more easily.
[10:05]<sdnffdxdlld>enums are a much better option than magic numbers
[10:05]<ssfrsxns>Kunnis: AnarkiNet: i have never used enums before (*gasp*) could you give me an example with the code i posted?
[10:05]<vufvuzn>AnarkiNet: I don't understand your claim. Aesthetically I'm quite used to reading constants like that in other languages. Is there something other than just what you've grown accustomed to that makes it aesthetically flawed. And why is it bad from a programmatic standpoint? the identifier still functions perfectly fine..
[10:05]<zgzzcygnv>no they dont
[10:05]<zgzzcygnv>stop trolling
[10:05]<zgzzcygnv>oh fuck it
[10:05]<zgzzcygnv>* Added *!*n=vulture@c-24-16-21-76.hsd1.wa.comcast.net to ignore list
[10:05]<zgzzcygnv>go away
[10:06]<zgzzcygnv>god i hate shitheaded retards like vulture and Talisman
[10:06]<kuggys>enum Foo { A, B = 7, C = 12 }; then you can use Foo as a type. Setting a spacific value is optional. Default starts at 0, and incriments by 1
[10:07]<kuggys>You can cast Foo to int, and int to foo.
[10:08]<ssfrsxns>so... in my example... i would just wrap all the constants in an enum and call it good... (sorry if i am not getting this, but so far i do not really see the difference in the operation of the code i posted)
[10:09]<zgzzcygnv>it doesnt matter if you dont see the difference
[10:09]<zgzzcygnv>thats obvious
[10:09]<zgzzcygnv>you're a noob
[10:09]<zgzzcygnv>you'll learn why now, or later (the hard way)
[10:09]<zgzzcygnv>right now your code is completely unmaintainable
[10:10]<ssfrsxns>AnarkiNet: unmaintainable?
[10:10]<vufvuzn>sslashes: if you have a function that takes an int, you could accidently pass a value outside the range of ints you want to accept (your enum values) - if you accept an enumeration value, you can be (reasonably) sure it'll lie in the right range. You get compile time checking where you might otherwise have runtime checking (or no checking & unreliable failure)
[10:10]<zgzzcygnv>pff
[10:10]<zgzzcygnv>you're doomed
[10:10]<vufvuzn>it's not unmaintainable - lots of systems have dealt with int values instead of enums (Java didn't have enums until 1.5), but it's less than ideal.
[10:11]<vufvuzn>especially when enums are so readily available
[10:11]<ssfrsxns>vulture: i'll give it a look, thanks
[10:14]<pz2>js has no enums or constants, so we just use ints
[10:15]<kuggys>Here's a practicle example... System.File.Open(string, System.IO.FileMode) is what intellsense will say. Type System.IO.FileMode. in VS... and it'll give you a list of options.
[10:15]<pz2>it's also not strongly typed, so shit happens all the time :(
[10:16]<kuggys>Verses the win32 of just 'knowing' that the options start with FILE_WHATEVEr
[10:19]<kuggys>When you see FileMode.Open FileMode.OpenOrCreate FileMode.Create FileMode.Append.... you usually get a pretty decent idea.
[10:20]<kuggys>Then there's the intellsense on each of the enum values so you can decide which is right.
[10:27]<ssfrsxns>Kunnis: something like this: http://www.nomorepasting.com/paste.php?pasteID=67891 how would i then handle the GetString function with enums?
[10:46]<kuggys>As a side thought, is you can have a case statement without the hash table
[10:48]<kuggys>Have it a ready-only string
[10:49]<kuggys>public string CodeString { get { switch( code ) { case foo: return "Hello world" break; etc.. } }
[10:57]<hncvyc>this code is giving me a "use of unassigned local variable" error when i try to compile. it's complaining about the statements in finally{} -> http://www.nomorepasting.com/paste.php?pasteID=67892
[10:59]<kuggys>Yes, because an exception can be thrown at any time. they should be set to null.







