Thread: C#?

  1. #31
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    This discussion will get more heated when C# 4.0 introduces the "dynamic" type.

  2. #32
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    >>From my knowledge, it lacks such things as a lot of generic programming.
    >>C# has generics
    There are a lot of discussion about C++ templates VS C# generics. There is one on MS site also. Both have advantages/disadvantages. Generally templates can do a bit more than generics. But haven't use them excessively to understand how useful the "more" really is.
    Maybe someone can shed more light on this?

  3. #33
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    Well as far as I understand you don't have in C# a way to do a specific implementation of a template class like you would in C++. I haven't created too many generic/templated classes to tell you the whole thing.

  4. #34
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Quote Originally Posted by indigo0086 View Post
    Well as far as I understand you don't have in C# a way to do a specific implementation of a template class like you would in C++.
    You talk of it as if it's a good thing. Generic programming should be generic, not introducing tons of special cases.

    No because C++ does it at compile time. There is a byte-code interpreter, thus technically it's interpreted and compiled. At least that's what they tell us in CS
    Compilation is by definition a translation from one language into another. Whether those languages are C++ to machine code, C# to CIL or CIL to machine code is of no importance.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #35
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Magos View Post
    Compilation is by definition a translation from one language into another. Whether those languages are C++ to machine code, C# to CIL or CIL to machine code is of no importance.
    I think the main difference between an interpreted language and a compiled one is that the compiled language doesn't require the original source code to be run.

    We then have various types & levels of compilation - but it still is compiled if source file(s) gets converted into a file (or set of files) that can be used without having any access to the original source code.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #36
    Registered User
    Join Date
    Aug 2008
    Posts
    188
    wow guys...all that over semantics of words...

    anyways, C# 4 will definitely heat up discussions because it will cross the line between static and dynamic languages. although this has already been done previously with languages like Boo and IronPython for .NET, i think C# with microsoft's backing will make a big difference.

  7. #37
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    Here are the new features http://code.msdn.microsoft.com/csharpfuture
    The dynamic sure looks interesting. And finally you can put default values on parameters. I am still wondering why this wasn't able from the beginning.
    You had like 4-5 flags in a function and in order to avoid calling something with 20 arguments and mixing every time the flags, your only solution was to use oveloaded function wrappers to do your job, with a small cost of an extra function call. Finally, they saw their error.

  8. #38
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    yeah, default params are definitely needed, the strategy you had to implement was just annoying. Though allowing you to specify them out of order is kind of meh to me. I watched the PDC where you get a good illustration of what they are trying to do.

Popular pages Recent additions subscribe to a feed