Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: April 17, 2024, 10:43 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Starting to learn C#
#1
Starting to learn C#
Hey, guys!

I've recently started to learn C#. I had to do it on the university. So, my first program in C# is a Tic-Tac-Toe game, which you can see here.

Overall, I'd say I don't see what people mean when they say JavaScript sucks. C# seems about as confusing.
Why the hell does "pictureBox.createGraphics()" work on Windows, but fail silently on Linux? It took me hours to figure out what's going on. Why do multi-dimensional arrays have different syntax than in other programming languages? I mean, in other languages, the syntax makes it obvious that a 2-dimensional array is an array of arrays. C#... I don't know what's going on there, but it's definitely confusing and takes time to get used to. Why does the receiver of the "click" event have to receive "System.EventArgs" and then cast it to "System.Windows.Forms.MouseEventArgs" to receive the coordinates of the click? Why not receive "System.Windows.Forms.MouseEventArgs" in the first place? Why the hell do you need to declare a "Random" object to use a random generator? Why the hell does a single call to "pictureBox.Refresh()" appear to sometimes generate one "paint" event, and sometimes two or more of them? It took me hours to figure out what's going on (and I am still not sure, but I have found a fix).

I am not saying I'd know to make a language better than C#, but I don't see how it can be said to be much better than JS.
Reply
#2
RE: Starting to learn C#
C and C++ , they give you the versatility you want and even allow some asm if you need to go there.
Reply
#3
RE: Starting to learn C#
I've heard of "C" and even "C ++", but have never heard of "C #".
Reply
#4
RE: Starting to learn C#
(January 21, 2020 at 2:04 pm)FlatAssembler Wrote:


Another thing, fanboys preferences aside you will know to use the proper language for the target application. When I was 9 my dad offered me a commodore 64k, whooping 64 Kb of RAM, no disk except for tapes, the same you could hear music. I made a sprite bouncing on the screen edges. A lot of GOTOs etc. Ah fond memories.

Imho C# is more business and database oriented. C/C++ gives tou more power into the hardware, including graphics, but you need more care about memory managements. Segfaults and leakage are a buggy problem to solve if you don't plan right.
Reply
#5
RE: Starting to learn C#
(January 21, 2020 at 2:09 pm)LastPoet Wrote: C and C++ , they give you the versatility you want and even allow some asm if you need to go there.

Most of the C and C++ compiler indeed allow including assembly code into C++, but Assembly language compilers used by C and C++ compilers tend to be made with speed in mind, rather than being user-friendly. GNU Assembler (that GCC and CLANG use), if you ask me, really sucks. It takes hours to make an already-working 100-lines-long program, that compiles with FlatAssembler, compile with GNU Assembler, if you are not familiar with its caveats. Here is an example of that.
In my opinion, FlatAssembler is by far the best assembly language compiler. It also comes with its own IDE on Windows, and it's incredibly easy to use. And the error messages it outputs are a hell lot more helpful than the error messages that GNU Assembler outputs. Microsoft Assembler is also usable, but it's not nearly as good as FlatAssembler is. FlatAssembler comes with a Turing-complete and an incredibly easy to use preprocessor, it's often possible to precalculate the results using the preprocessor and only output them in Assembly.
Reply
#6
RE: Starting to learn C#
(January 21, 2020 at 2:15 pm)Brian37 Wrote: I've heard of "C" and even "C ++", but have never heard of "C #".

It's pretty common.  Do this

[Image: cm-hero-750.jpg]

And strum all six strings.

Boru
‘But it does me no injury for my neighbour to say there are twenty gods or no gods. It neither picks my pocket nor breaks my leg.’ - Thomas Jefferson
Reply
#7
RE: Starting to learn C#
That's Cm.  For C# call setBarre.Fret.Form(4,A);
Reply
#8
RE: Starting to learn C#
Do you have some suggestions on how to improve my code in C#? Like I've said, that is my very first program in it. But it could also be the last one.
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  How to learn VHDL? FlatAssembler 4 423 May 29, 2020 at 11:35 am
Last Post: FlatAssembler
  Finally Starting to Break Down... Rev. Rye 16 3657 August 18, 2013 at 9:08 pm
Last Post: Rev. Rye



Users browsing this thread: 1 Guest(s)