Qbasicnews.com

Full Version: C#
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
So has anyone played around with this lately? I think there was a thread a while ago on this (maybe a year or two back) but anyway i've just finished writing my first C# app, so I'll give my opinion on it.

First:
GUI Designer
This is done MUCH nicer then in VC++, the controls are hundreds of times easier to manage, and changing settings and modifying stuff is easy, I'll have to say that the GUI is way better then VC++ which in turn is much better then the JAVA GUI(im not to fond of this one). Now theres one gripe i have, and that would be the lack of control. In VC++ i can catch low level sub calls, and its very easy to go directly into the win32 api and modify certain settings. In C# you can do that same thing, except it seems to be discouraged and its abit harder to find documentation on this side of things.

The Language.
Its basically java, but a litle looser. Im not going to go to into this, but theres some nice things that they have here unlike in java, such as not needing to have a possible catch every single bloody thrown errror, and less compiler strictness. Its not bad, and certainly easy to work with.

Built in Functions
I didnt have to use a single library that wasnt already built into C#. XML handling, controls, string manipulation, nearly everything your everyday windows app will need is built in and pretty damn solid.

Speed
Okay i developed this app on a 2.8GHZ P4. So its not exaclt a low end system, but the code ran fine, the garbage collector does its job (clearing linked lists is rather intereting, head = null frees up the linked list), i do miss having total control but i guess its worth it as i dont have to spend time manging memory (although i wouldnt be suprised if i ridicoulously abused it for this app)

Stability
Ill have to give it a good rating here, this is the first time (maybe im just getting better at programming) that ive managed to write code for half an hour to an hour, basically a wholel lot of code, hit compile, and everything just worked ™. That was pretty impressive and ive never had that before, in fact i never had to fix up that code at all even after bug testing, it came out solid.

Well im old fashioned so im not going to jump right off my current C++ mfc app, but i will say that the next time i do a windows app, ill probably use C#, the saved delopment time is rather impressive and its nearly impossible to screw things up(i dont feel like arguing with this, see stability, i know you can crash things if you want to, that doesnt bother me, it is however very solid, and i can re-write vast portions of code and everything will still function fine. i like that).

For the record i was using .net 1.1, in 2003, i havent gotten around to .net 2, but i hear it has some nice new features.


Anyway stay tuned for sometime in the next 2-3 months for my updated take on java, i'm going to write a game in it to test out these new opengl features that have been hyped up so much......
GUI Designer:
er, yay? What's it with people and GUIs? What's wrong with a good nice terminal script? Plus, why'd you capitalize JAVA? I don't think it stands for anything. =p

The Language.:
"OKAY!! We made a language. It's a lot like Java. Okay let's call it C#."

Built in Functions:
Doesn't that mean... big runtime?

Speed:
er... that's nice. >>

Stability:
What's that have to do with the language? Your "stability" rating seems directed at your ability to code =p


Hrm... Windows apps... hrmm.... wait a minute! I don't use windows. I can't possibly give it a good rating!
WhiteTiger:
then why did you post? :rotfl:

anyway, I took a look at C# a little while back. definetely looked good, and my father is taking a course in it in march. i'll just borrow his book and read up on it more Big Grin

and yeah, the GUI is awesome! :bounce:
Im not reviewing the language per se. Im simply re-iterating my experince with it. And i found it fairly decnet. I'm a bit old fashioned so it took me a long time to move from basic, to c, to c++.

However it makes sense that in a few years langauges like C# are going to be the most used.

In any case if you missed the point of the post, i found that the amount of work it took me to write this program was greatly reduced, and signifacntly easier. The stability may be i some way related to how i code, but i have never been able to code that many lines of code in C or C++ without some leak, or some stupid mistake cropping up. Take this for example:

Code:
for(int i = 0; i < somenumber; i++;)
{
  function[i] = new Func();
}
function[i].call;

The code had a lot more loops though so i couldnt immidietly see that i had placed the call outside the loop, but youd figure that the code shouldnt compile in any case since logically, "i" should no longer be in scope... however it did compile and it took quite a while to find. C# will bitch at you before you can even compile that your being stupid. Although sometimes the C# compiler warnings and errors can be incredibly annoying or poterntially unnessccary, they do lead ot more solid code .


In fact Tim Sweeney wrote an article very recently that more or less said that in the next few years C++ will be dead and a new language will take over (he basically reccommended haskell). The new langauge would fix things like array overruns and the like.

Anyway ill respong to your comments, althought there doesnt seem to be much thought behind any of them

Quote:er, yay? What's it with people and GUIs? What's wrong with a good nice terminal script? Plus, why'd you capitalize JAVA? I don't think it stands for anything. =p
So you browse the intenret with lynx, you use linux entirely through the command line and youd like to use paint with the keyboard?

As far as i know most users like thier utilities to look nice and be easy to use. Creating such interfaces can be a real pain in some languages but in C# it was incredibly easy.

Quote:Doesn't that mean... big runtime?
If im correct in undesrtanding, new windows xp systems already ships with some form of .net, and vista will include it. There is no need to distribute the runtime with the application in any case. Also these functions are not all loaded into memory, only the ones you use.

As for stability, i went over it a bit more above, C# is a lot more strict the C++ with ways that you can "shoot yourself" so to say, not quite as strict as Java, but there are many extra checks and your program will not even compile. Also C# built in functions that you dont have to waste time re-inventing the wheel all work perfectly and are far more solid then if i were to spend the same amount of time writing them myself.

Quote:Hrm... Windows apps... hrmm.... wait a minute! I don't use windows. I can't possibly give it a good rating!
Well by your logic, you cant possibly give it a rating at all.

In any case if you feel the need to try C# you can try it on linux through mono i think.
yeah right haskell as the next big thing... i want you to give haskell a try. it is not suited for business type applications. it's wonderfull for scientific areas though.

and save runtime environments that will detect buffer overflows, out of bounds conditions etc. are nothing new. even the qb interpreter had that. also take a look at java maybe...

the example you gave concerning the scope of i outside the loop indicates that you where using vc6, it is a well known bug and no other serious compiler ( including the newer ms c++ compilers ) will let that go through.
Quote:the example you gave concerning the scope of i outside the loop indicates that you where using vc6, it is a well known bug and no other serious compiler ( including the newer ms c++ compilers ) will let that go through.
Actually i wasnt using vc 6. Nice try though. Im using VS.net([edit] i also have the service pack[/edit]


Quote:yeah right haskell as the next big thing... i want you to give haskell a try. it is not suited for business type applications. it's wonderfull for scientific areas though.
I didnt recommned haskell, he(Time Sweeney) did. And not even the language itself, just the ideas that were implemented.

Quote:and save runtime environments that will detect buffer overflows, out of bounds conditions etc. are nothing new. even the qb interpreter had that. also take a look at java maybe...
Did you actually read the post? Perhaps i should quote myself again, so you can take the time to read it this time.....
Quote:Anyway stay tuned for sometime in the next 2-3 months for my updated take on java
There were quite a few java references in my original post.
Right on the sandbox thing, although it is nothing new, it works fine. Also its got some advantages over java, for example it doesnt have to load up a seperate instance of the runtime for each .net app (have they fixed this in Java 5???)
i was wrong on the scoping issue, i just tested it in vc2003 and i received no warnings. another indication that m$ is still not capable of producing an ansi c compliant compiler. so i'm sorry. you will get warned by gcc and others though ( have only tested it with gcc 4.0.2 )

haskell is from the functional programming paradigmn. the ideas implemented like pattern matching, the recursive nature of the paradigmn itself and the like can hardly be implemented in a language like say c++ or java. it's a completely different paradigmn.

and yes i did read your post and you are basically just stating the obvious ( garbage collector does it's job *duh quelle surprise*, runtime library of c# has anything *duh like java which microsoft ripped* ) besides giving totally improper arguments like:

Quote:Stability
Ill have to give it a good rating here, this is the first time (maybe im just getting better at programming) that ive managed to write code for half an hour to an hour, basically a wholel lot of code, hit compile, and everything just worked ™. That was pretty impressive and ive never had that before, in fact i never had to fix up that code at all even after bug testing, it came out solid.

this has not a single bit to do with the stability, it is not even losely related to stability, it just indicates wheter you are a good or not so good programmer.

also
Quote:The Language.
Its basically java, but a litle looser. Im not going to go to into this, but theres some nice things that they have here unlike in java, such as not needing to have a possible catch every single bloody thrown errror, and less compiler strictness. Its not bad, and certainly easy to work with.

well i guess it's obvious why you don't go into the really interesting stuff... also proper exception handling is part of good coding practices. java was less strict about catching exceptions than it is now in 1.5 and the reason is that an exception HAS to get handled unless you like hacking your way through.

Quote: the saved delopment time is rather impressive and its nearly impossible to screw things up(i dont feel like arguing with this, see stability, i know you can crash things if you want to, that doesnt bother me, it is however very solid, and i can re-write vast portions of code and everything will still function fine. i like that).

and this is quiet funny too. you basically advocate buggy code. the compiler will do the trick and make your code work as you like. that's utter bs and will not happen. this mentality is the reason why software engineering is still not real engineering as to many people think they can get away with hacks and don't have to have proper designs, tests and most of all nearly bugfree code.

this comment might come off as a bit offensive, so did your last reply. i don't like being told that i did not read your post. i did, very closely and i decided to not comment on the bs you posted in your first post. but seeing on how you react i felt like i had to.
Quote: you will get warned by gcc and others though ( have only tested it with gcc 4.0.2 )
That would make sense since it shouldnt work. I wonder if msvc has -wall -w compiler options, and if those would pick it up.

Quote:this has not a single bit to do with the stability, it is not even losely related to stability, it just indicates wheter you are a good or not so good programmer.
Eh, i wasnt sure where to throw it so i put it under the heading stability, if you like you can change to "random thoughts here" if you like. I should hope the platfrom itself is stable and doesnt crash though Wink

Quote:well i guess it's obvious why you don't go into the really interesting stuff... also proper exception handling is part of good coding practices. java was less strict about catching exceptions than it is now in 1.5 and the reason is that an exception HAS to get handled unless you like hacking your way through.
The reason i dont like catching every error is that there is quite a few, and since I wont pretend i was intimately familiar with java at the time i had no idea what exceptions i wanted to catch. In the end all i did was put everthing in try and catch all exception. its a horrid work around i know, but i would much rather only deal with exceptions that i need to.

C# basically automatically "throws" it out of the calls and displays the exception in a messagebox. (If i remember the java method for that is adding throwable at the end of the class, i think i horribly abused this too).

Quote:and this is quiet funny too. you basically advocate buggy code. the compiler will do the trick and make your code work as you like. that's utter bs and will not happen. this mentality is the reason why software engineering is still not real engineering as to many people think they can get away with hacks and don't have to have proper designs, tests and most of all nearly bugfree code.
Its how i felt. Im a C++ programmer, im used to having to keep track of memory, and the like. When i started using C# i started getting well, lazy. And in my defense here, the compiler did do the job and generate bug free code (theres no way i would be able to get away with anything like this in C++).

Now i'm not advocating buggy code. What im basically stating (and i think you got anyway) is that you can be a bit looser around C#. Less things will break, more things will just work™. Life will be easier.


Quote:this comment might come off as a bit offensive, so did your last reply. i don't like being told that i did not read your post.
Gues Im a bit argumentive today, i apologize for that. In any case for the record Ussually when i discuss this I take the C++ stand and bash both C#/Java just to see what kind of debate i can stir out of it and see if i can get some interesting info.

Im not really sold on C# yet, but if i were writing a windows app tommorow I'd most likely lean towards C#. In fact im beginning to think that MS crippled the VC++ side of things since many controls native to C# (datagrid, etc) are suspicously absent from VC++.
yeah garbage collection makes life a lot easier, doesn't keep you from problems like destruction order etc. which you can influence a bit by directly invoking the gc manually but you are still not in full charge. also, garbage collection is a very expensive operation and even though the algos used nowadays have improved a lot over the years it still can't hold a candle to manual memory managment.

i also wonder, if you come from a c++ side you should be familiar with boost and it's smart pointers which make the pain of memory managment in c++ go away too.

i guess we both got a bit to heated over it, no hard feelings from my side :p
Quote:i was wrong on the scoping issue, i just tested it in vc2003 and i received no warnings. another indication that m$ is still not capable of producing an ansi c compliant compiler.
Its not entirely Microsoft's fault, before the C++ standard was properly established the scope semantics were a little more loose, see here.

Even in C#, Java and other languages which allow declarations to be placed anywhere in the code, I generally still place them all at the beginning of functions (ANSI C styles). While it can make code a little more readable, there are no real optomisation benefits for using local scopes.
Pages: 1 2