Jump to content

Is C# a good programming language to learn?

ConnorJ
On 1/31/2020 at 4:17 PM, Dat Guy said:

I love how this quickly derived into a personal thing here. Pythoneers are weird.

 

Python was ABC initially. Guess why the name.

 I’m out here.

And I love how, rather than admitting that your positions are indefensible and that you have no idea on how to respond after everything you said has been debunked, you chicken out without even quoting me and just have to hypocritically add that ad-hom you accused me of using. Very mature my dude, maybe next time spread your misinformation somewhere else - perhaps on a meme subreddit, which is where you seem to get most of your "facts".

On 1/31/2020 at 5:26 PM, Mira Yurizaki said:

C# is useful for Windows based ecosystems, but outside of that I haven't really seen a use for it.

If .net core becomes more widespread it could become a decent alternative to Java, after all that's what Microsoft was going after when they initially released C# and on Windows platforms it kind of worked.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

if you can programm very well in one language you are able to learn almost any languages 

 

i feel like c# is very close to java (or vice versa) and java is one of the most used languages so the switch should be really easy for you if you ever want to use java

 

beside c++ & c with their pointers and allocating memory and freeing the memory all languages ive needed to use while studying CS i was able to pick up very quickly because you just have to check the syntax and maybe a few google queries and you should be up and running in no time

 

Link to comment
Share on other sites

Link to post
Share on other sites

30 minutes ago, KNG_HOLDY said:

beside c++ & c with their pointers and allocating memory and freeing the memory all languages ive needed to use while studying CS i was able to pick up very quickly because you just have to check the syntax and maybe a few google queries and you should be up and running in no time

Just to be clear, you can manually:

  • Allocate memory
  • Deallocate memory
  • Do pointer arithmetic

In bone stock C# if you want to for some reason.

In fact, the .NET Framework does some of this, for example, in Array.Copy

public static unsafe void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
        {
            if (sourceArray != null && destinationArray != null)
            {
                MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray);
                if (pMT == RuntimeHelpers.GetMethodTable(destinationArray) &&
                    !pMT->IsMultiDimensionalArray &&
                    length >= 0 && sourceIndex >= 0 && destinationIndex >= 0 &&
                    (uint)(sourceIndex + length) <= (nuint)sourceArray.LongLength &&
                    (uint)(destinationIndex + length) <= (nuint)destinationArray.LongLength)
                {
                    nuint elementSize = (nuint)pMT->ComponentSize;
                    nuint byteCount = (uint)length * elementSize;
                    ref byte src = ref Unsafe.AddByteOffset(ref Unsafe.As<RawArrayData>(sourceArray).Data, (uint)sourceIndex * elementSize);
                    ref byte dst = ref Unsafe.AddByteOffset(ref Unsafe.As<RawArrayData>(destinationArray).Data, (uint)destinationIndex * elementSize);
 
                    if (pMT->ContainsGCPointers)
                        Buffer.BulkMoveWithWriteBarrier(ref dst, ref src, byteCount);
                    else
                        Buffer.Memmove(ref dst, ref src, byteCount);
 
                    // GC.KeepAlive(sourceArray) not required. pMT kept alive via sourceArray
                    return;
                }
            }
 
            // Less common
            Copy(sourceArray!, sourceIndex, destinationArray!, destinationIndex, length, reliable: false);
        }


 

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, straight_stewie said:

Just to be clear, you can manually:

  • Allocate memory
  • Deallocate memory
  • Do pointer arithmetic

In bone stock C# if you want to for some reason.

In fact, the .NET Framework does some of this, for example, in Array.Copy


public static unsafe void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
        {
            if (sourceArray != null && destinationArray != null)
            {
                MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray);
                if (pMT == RuntimeHelpers.GetMethodTable(destinationArray) &&
                    !pMT->IsMultiDimensionalArray &&
                    length >= 0 && sourceIndex >= 0 && destinationIndex >= 0 &&
                    (uint)(sourceIndex + length) <= (nuint)sourceArray.LongLength &&
                    (uint)(destinationIndex + length) <= (nuint)destinationArray.LongLength)
                {
                    nuint elementSize = (nuint)pMT->ComponentSize;
                    nuint byteCount = (uint)length * elementSize;
                    ref byte src = ref Unsafe.AddByteOffset(ref Unsafe.As<RawArrayData>(sourceArray).Data, (uint)sourceIndex * elementSize);
                    ref byte dst = ref Unsafe.AddByteOffset(ref Unsafe.As<RawArrayData>(destinationArray).Data, (uint)destinationIndex * elementSize);
 
                    if (pMT->ContainsGCPointers)
                        Buffer.BulkMoveWithWriteBarrier(ref dst, ref src, byteCount);
                    else
                        Buffer.Memmove(ref dst, ref src, byteCount);
 
                    // GC.KeepAlive(sourceArray) not required. pMT kept alive via sourceArray
                    return;
                }
            }
 
            // Less common
            Copy(sourceArray!, sourceIndex, destinationArray!, destinationIndex, length, reliable: false);
        }


 

ah i didnt knew that :) didnt dive that deep into c#

just to clearify my point was that you dont have to use pointers/memory-allocation with most languages and in c/c++ you kinda have to

Link to comment
Share on other sites

Link to post
Share on other sites

14 hours ago, KNG_HOLDY said:

ah i didnt knew that :) didnt dive that deep into c#

just to clearify my point was that you dont have to use pointers/memory-allocation with most languages and in c/c++ you kinda have to

For C, you can pretty much code your own garbage collector, as a library function call, into your application if you want to avoid manual memory management. I think c++ already has some features like this with smart pointers and whatnots. The thing about c is that it is low level. Even memory allocation like malloc is nothing but just a function call from the standard library, not a feature of the language itself. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×