C to C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ZakHurst

    #1

    C to C#

    I know we are lagging behind but with limited resources
    and time we are looking at how we can convert some of C
    applications to C# without re-writing from scratch.

    We want to be in position as quickly as possible where we
    can start re-writing areas in C#

  • Mr.Tickle

    #2
    Re: C to C#

    why convert in the first place? Just to be cool? bad reason


    "ZakHurst" <Steve.hurst@in stem-lss.co.uk> wrote in message
    news:030e01c380 7e$9a8d9330$a30 1280a@phx.gbl.. .[color=blue]
    > I know we are lagging behind but with limited resources
    > and time we are looking at how we can convert some of C
    > applications to C# without re-writing from scratch.
    >
    > We want to be in position as quickly as possible where we
    > can start re-writing areas in C#
    >[/color]


    Comment

    • Mr.Tickle

      #3
      Re: C to C#

      static methods for functions :D

      delegates for callbacks

      package into a class, oh and no header files



      "ZakHurst" <Steve.hurst@in stem-lss.co.uk> wrote in message
      news:030e01c380 7e$9a8d9330$a30 1280a@phx.gbl.. .[color=blue]
      > I know we are lagging behind but with limited resources
      > and time we are looking at how we can convert some of C
      > applications to C# without re-writing from scratch.
      >
      > We want to be in position as quickly as possible where we
      > can start re-writing areas in C#
      >[/color]


      Comment

      • Chris LaJoie

        #4
        Re: C to C#

        Converting from C to C# would most likely be a complete rewrite. C# is
        actually more like VB than it is like C/C++. Other than the syntax, C#
        really doesn't have anything in common with C.

        Chris LaJoie

        "ZakHurst" <Steve.hurst@in stem-lss.co.uk> wrote in message
        news:030e01c380 7e$9a8d9330$a30 1280a@phx.gbl.. .[color=blue]
        > I know we are lagging behind but with limited resources
        > and time we are looking at how we can convert some of C
        > applications to C# without re-writing from scratch.
        >
        > We want to be in position as quickly as possible where we
        > can start re-writing areas in C#
        >[/color]


        Comment

        • Jason Smith

          #5
          Re: C to C#

          Another alternative is to port your C to managed C++ (essentially a superset
          of C). Microsoft recently released a demo of - was it Quake??? - ported
          from unmanaged code into managed code, proving how good their C++ port to
          ..NET is.

          Once you have the C code firmly in place in .NET, it should be a relatively
          minor effort to selectively rewrite parts or add new functionality using C#.
          Over time, your code base will become more and more C#-based, and your code
          will work from day one.

          "ZakHurst" <Steve.hurst@in stem-lss.co.uk> wrote in message
          news:030e01c380 7e$9a8d9330$a30 1280a@phx.gbl.. .[color=blue]
          > I know we are lagging behind but with limited resources
          > and time we are looking at how we can convert some of C
          > applications to C# without re-writing from scratch.
          >
          > We want to be in position as quickly as possible where we
          > can start re-writing areas in C#
          >[/color]


          Comment

          • Frank Rizzo

            #6
            Re: C to C#

            ZakHurst wrote:
            [color=blue]
            > I know we are lagging behind but with limited resources
            > and time we are looking at how we can convert some of C
            > applications to C# without re-writing from scratch.
            >
            > We want to be in position as quickly as possible where we
            > can start re-writing areas in C#[/color]

            That smells like a rewrite. C is based on pointers. C# supports
            pointers but in unsafe mode which kind of defeats the purpose of .NET
            framework.

            Comment

            • David Smith

              #7
              Re: C to C#

              I think what will pain you the most in this endeavor is the standard
              libraries vs the .net framework. Just about everything done in C is done
              via the libraries, that is to say C's core language is very minimal.
              Everything from printing to the console, to string manipulation (both very
              common in C) will have to be rewritten from scratch to use the .net
              framework methods.

              I prefer one of the earlier suggestions of converting to C++, which will
              lead you into a later step towards managed C++ (.net C++). If you need to
              convert quickly, that would probably be the best suggestion.

              "ZakHurst" <Steve.hurst@in stem-lss.co.uk> wrote in message
              news:030e01c380 7e$9a8d9330$a30 1280a@phx.gbl.. .[color=blue]
              > I know we are lagging behind but with limited resources
              > and time we are looking at how we can convert some of C
              > applications to C# without re-writing from scratch.
              >
              > We want to be in position as quickly as possible where we
              > can start re-writing areas in C#
              >[/color]


              Comment

              • Michael Culley

                #8
                Re: C to C#

                "Frank Rizzo" <nospam@nospam. com> wrote in message news:#tnoC6KgDH A.2248@TK2MSFTN GP09.phx.gbl...[color=blue]
                > That smells like a rewrite. C is based on pointers. C# supports
                > pointers but in unsafe mode which kind of defeats the purpose of .NET
                > framework.[/color]

                C# really does support pointers in managed code. Passing in an object reference or value type reference into a function is passing
                in a pointer. Not that I think this will help avoid a rewrite :-)

                --
                Michael Culley

                [color=blue]
                > ZakHurst wrote:
                >[color=green]
                > > I know we are lagging behind but with limited resources
                > > and time we are looking at how we can convert some of C
                > > applications to C# without re-writing from scratch.
                > >
                > > We want to be in position as quickly as possible where we
                > > can start re-writing areas in C#[/color]
                >[/color]
                [color=blue]
                >[/color]


                Comment

                • Jason Smith

                  #9
                  Re: C to C#

                  C++ supports pointers in managed code, and there is nothing stopping you
                  from building the application from the bottom up, a little at a time, using
                  C# and calling the new code from C. That way, your C code doesn't change
                  all that much, most new development can be done in C#, and you are not faced
                  with a long rewrite cycle before your next release (this will ease the mind
                  of management - trust me).

                  "Michael Culley" <mculley@NOSPAM optushome.com.a u> wrote in message
                  news:u94HDXLgDH A.620@TK2MSFTNG P11.phx.gbl...[color=blue]
                  > "Frank Rizzo" <nospam@nospam. com> wrote in message[/color]
                  news:#tnoC6KgDH A.2248@TK2MSFTN GP09.phx.gbl...[color=blue][color=green]
                  > > That smells like a rewrite. C is based on pointers. C# supports
                  > > pointers but in unsafe mode which kind of defeats the purpose of .NET
                  > > framework.[/color]
                  >
                  > C# really does support pointers in managed code. Passing in an object[/color]
                  reference or value type reference into a function is passing[color=blue]
                  > in a pointer. Not that I think this will help avoid a rewrite :[/color]


                  Comment

                  Working...