Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C#

Name: Anonymous 2007-02-14 12:16

What do you think about C#? Does anybody here have any experience with it?

Since I read Slashdot, I got the impression that it was a demon language Microsoft created to choke the entire universe in a sticky net of DRM and fail, but recently I've been looking at it and it actually looks pretty nice.

While Perl, PHP, Python, and Ruby all have no specification, C# has been standardized by Ecma International and ISO/IEC.

Name: Anonymous 2007-02-21 12:28 ID:M/hAHc6x

Here's a C# question for you.

Does the langauge have syntactic sugar for enumeration of enums? That is, can you write something like:


enum Longcat { Long, Loong, Looong, Looong, ... }

foreach ( cat in Longcat )

Name: Anonymous 2007-02-21 16:15 ID:Heaven

>>41
I can't think of any situation where you would to enumerate an enum. Can you provide a real world example of where this would be applicable?

Name: Anonymous 2007-02-21 17:19 ID:blk9c52F

>>41

No.  And why would you want to?

Name: Anonymous 2007-02-21 17:27 ID:h4kF5Vc9

>>41
LOL PWND!!!

Name: Anonymous 2007-02-21 17:29 ID:Heaven

>>42
>>43


enum someEnum { enum1, enum2, enum3 }

status = getStatus()

foreach(e in someEnum)
    if status == e
        do something
        break

Name: Anonymous 2007-02-21 18:04 ID:blk9c52F

<code>
switch(status)
{
  case someEnum.enum1:
    doSomethingOnEnum1();
    break;
  case someEnum.enum2:
    doSomethingOnEnum2();
    break;
  case someEnum.enum3:
    doSomethingOnEnum3();
    break;
  default:
    ImAnIdiotAndDidntCheckMyBounds();
    break;
}
</code>

Name: Anonymous 2007-02-21 18:06 ID:blk9c52F

Btw, >>45, what you wrote there doesn't make sense.  It's essentially equivalent to:

if(status >= enum1 && status <= enum3)
  do something

Name: Anonymous 2007-02-21 18:16 ID:Zx47X9vR

Beautiful, simple and elegant:

{'Long': Function1,
 'Loong': Function2,
 'Looong': Function3,
}[status]()

Name: Anonymous 2007-02-21 21:20 ID:M/hAHc6x

Found it.    foreach( Longcat cat in Enum.GetValues( typeof( Longcat ) ) )

Name: Anonymous 2007-02-22 15:34 ID:Pzg9FQNH

>>49
there's still no reason you would ever do this

Name: Anonymous 2007-02-22 16:14 ID:Heaven

>>50
Of course, it's just to stick it to >>41 who claimed it wasn't possible.

Name: Anonymous 2007-02-26 17:38 ID:C25Sp8v5

>>48
What language is that? I thought it was JavaScript, but Firefox wouldn't allow it without some parenthesis.

({'Long': function(){ alert(1); },
 'Loong': function(){ alert(2); },
 'Looong': function(){ alert(3); },
})[status]()

Name: Anonymous 2007-02-26 18:36 ID:fHRBghiu

>>52
Python

Name: Anonymous 2007-03-24 16:33 ID:ka8Ea3i4

Why should I like any language more than C#?

Name: Anonymous 2007-03-24 20:20 ID:53FxT1/J

>>54
Because C# is not too good.

Name: Anonymous 2007-03-26 21:15 ID:C25Sp8v5

Why is C# not too good?

Name: Anonymous 2007-03-26 21:17 ID:0tlIiDvz

>>56
because its MS Java

Name: Anonymous 2007-03-26 22:40 ID:fsCtKthM

>>56
"out" is a keyword. So is "var". Have fun writing compilers.

Name: Dschingis Khan 2007-03-27 1:35 ID:Y0WD9vb+

>>20
Actually, he's right.  That IS how human language works.  Try reading something without punctuation coherently (check your spam box.  Or /b/, for that matter).
>>34
I can tell someone's never done AI work.  What's more, it works fairly well as a high-level, portable language for general
application programming.

C# has some interesting ideas, but it's not a place to start, nor is it a place to finish.  So yeah, it's a lot like Java, only even fewer people use it (or take it seriously).

Name: Anonymous 2007-03-27 11:06 ID:tuZU6y0C

>>56
Because it doesn't properly support functional programming.

Name: Anonymous 2007-03-27 15:29 ID:Heaven

>>60
That's why MS created F#.

Name: Anonymous 2007-06-21 13:33 ID:XfmRuTgc

wtf is this ID shit?

Name: Anonymous 2007-06-21 13:46 ID:Heaven

I can tell someone's never done AI work.  What's more, it works fairly well as a high-level, portable language for general
application programming.
ok, name one useful application written in common lisp.
and i have done AI work. actual useful AI work (in perl), not the mental masturbation you kids do with lisp.

Name: Anonymous 2007-06-21 13:49 ID:uDTBOywh

Heaven:
EXPERT PROGRAMMER

Name: Anonymous 2007-06-21 14:22 ID:9yDjdQad

>>1
While Perl, PHP, Python, and Ruby all have no specification, C# has been standardized by Ecma International and ISO/IEC.
Lol, somebody has been reading propaganda here. The fact Microsoft paid people who work at ISO/IEC and ECMA and Guido, Larry Wall and the others are poor doesn't mean anything. But contrary to what you think, these languages are standardized as well. For example, Python is standardized by the Python Software Foundation. There's a standard reference describing how any interpreter of Python should behave with all detail.

Being standardized by a famous group is one of the stupidest reasons to ever choose a language.

C# is just Java with less fail and a more or less fixed platform. Dynamic languages such as Python or Ruby feature things C# can only dream of, are truly portable, and are 5 to 8 times more productive when we're talking about real work getting done. They are also more expressive, and more comfortable and fun to use.

>>59
Actually, he's right.  That IS how human language works.  Try reading something without punctuation coherently (check your spam box.  Or /b/, for that matter).
If you wrote no periods but used EOLs instead, it'd be almost as readable, only longer. Since in programming you don't do a; b; c; d; e;, there's no advantage of using statement terminators; EOLs are there anyways.

>>63
Ask Amazon.com or Google; vital parts of their systems are written in Common Lisp.

Name: Anonymous 2007-06-21 20:57 ID:f6XsBdSc

>>63

Reddit was originally written in Common Lisp (but later switched to Python).

Naughty Dog used an internal variant of Lisp to program the Jak and Daxter series. (I know, you asked for examples of Common Lisp usage, but I'm pulling these from the top of my head.)

Emacs is mostly its own variant of Lisp, with a C core for performance. (See above parenthetical.)

Others (mostly scientific, it appears):
http://en.wikipedia.org/wiki/Common_lisp#Applications

Name: Anonymous 2007-06-21 21:46 ID:UvPhwPQH

>>64
NOT!

Name: Anonymous 2007-06-21 23:09 ID:lnJodCaW

The language itself is like a mix of C++ and Java.

But anything needing .NET = fail.

Name: Anonymous 2007-06-21 23:16 ID:vvs79nZg

no. the language itselfs does not need .net. it's just a language. it's the implementations that require .net.

Name: Anonymous 2007-06-21 23:41 ID:Heaven

>>66
i wonder why reddit switched to python? probably because you can't do anything useful in common lisp.
games are not useful.
emacs is not useful.
scientific applications that suck so bad i end up writing my own instead are not useful.

Name: Chris Hanssen 2007-06-22 3:02 ID:994x7LZg

>>70
NO! You are not call me an python I am not any snake, ok? I has rights you know that? Even on the internets it is unfair that I should be calling an pedophile and fuckin admins are banned you REAL soon, ok? Then you wont be all cock hosey and fuckin real hard and mad and shit becoz you are gone from the sight and band forever.

Name: Anonymous 2007-06-22 4:19 ID:Y7i5+FtD

C# is Java plus some nice syntactic sugar.  Plus, you get a much better interface to Win32 stuff vs C++ if that's your thing.  Other than that, nothing to see here, move along.

Name: Anonymous 2007-06-22 12:39 ID:rMUfKWKX

>>70
>i wonder why reddit switched to python?

No need to wonder. http://blog.reddit.com/2005/12/on-lisp.html

>games are not useful.

Meh. It was just an example.

>emacs is not useful.

I beg to differ, as do many others.

"Emacs is undoubtedly the most powerful programmer's editor in existence."
-- Eric S. Raymond

"If you are a professional writer—i.e., if someone else is getting paid to worry about how your words are formatted and printed—emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish."
-- Neal Stephenson

>scientific applications that suck so bad i end up writing my own instead are not useful.

I don't know about that. Maxima is pretty fuckin' cool.

Name: Anonymous 2007-06-22 17:11 ID:Heaven

>>73
apparently you, eric s. raymond, and neal stephenson have never used nvi.
i've never used maxima, maybe i'll try it if i ever need to solve a problem that i can't solve with perl in less than 10 seconds.

Name: Anonymous 2007-06-22 17:23 ID:wCMBqwO+

>>74
Write a sentient program

Name: Anonymous 2007-06-22 17:38 ID:Heaven

>>75
i wrote an emo program once, does that count?

Name: Anonymous 2007-06-22 17:56 ID:rMUfKWKX

>>74
nvi? Isn't that what Gentoo has until you install a text editor?

Name: Anonymous 2007-06-23 14:42 ID:kEUyZ/3x

I like vi, but it's just a text editor.
Emacs it's a fucking OS.

Name: Anonymous 2007-06-23 15:51 ID:6slfeWJr

>>77
No Gentoo comes with nano.

Name: Anonymous 2007-06-23 15:54 ID:uo7WScO2

>>76

fag = new Emo;
while(fag.alive)
{
fag.cut(self);
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List