Let's burn some firecrackers here!!
How does that affect people's
programming?
After reading several
postings, and some articles I found that nobody is actually telling
us what the point of all of this is. In my opinion, I think that the big
companies (IBM, Sun, Microsoft, etc) want popularity, and thus, money,
because in the end, this is what it is all about.
What they want is to
bring us (the programmers) to use one language or another. The
difference between using, Java, C#, or any other OO language is totally
up to us, we are good programmers, (GA Tech Rocks!), we have the
criteria to decide which language best accomplishes our clients' needs.
Issues such as syntax are irrelevant, nowadays syntax, documentation,
APIs with programs like Eclipse or JBuilder are very easy to handle. So,
I hope that you don't use a language just because of the syntax, or
because it is easier to find documentation. The performance of the
program is what is important, based on what platform you are going to
run your product, or the purpose of it. Again, it is up to us, we are
the professionals.
It is a sure thing that
as languages evolve, we (the programmers) will know what we want and
what we will need (we design the tools that make our lives easier).
Competence is good for
us; we want the big corporations, to come up with better languages as
this generates more jobs.
In the end, it does not
matter what language we use, the important thing is that what we do that
is reliable. We, as the programmers need to know what platform is best
for a better result and a better product for our clients.
The idea of OO
programming has already been invented, and Microsoft, Sun, etc. are just
the ones to keep it up.
How do Java differs from C#?
Well, since both languages are C based, the don't differed too much one
from another. The syntax is actually pretty similar. For example, the
methods basically are no different. In both languages methods take
parameters and have a return type. When calling a method, java compiler
checks that there is a method that matches the signature, otherwise it
will generate a compiler error. In java we cannot create a method that
allows us to take a variable number of ints as parameters. In other
words, we cannot create a method that takes sometimes 2 ints as a
parameter, an other times 3 ints.
Now, if a
programmer wants to take a variable number of ints, he can define a
method signature that takes an array of integers and then construct the
array when calling the method. In java, this will take some code to do
it, but in C# this is not an issue.
Properties in C#
construct that formalizes the getter and setters seen in Java classes.
The java thing of having a method that takes a parameter to set
and other to get that returns in C# is simplified. Behind the scenes, C#
actually compiles the properties to two methods in the .NET intermedia
language framework named get_Property and set_Property. These methods
cannot be called directly from C#, but other languages using the MSIL
should be able to access these getters/setters.
Access modifiers
restrict the ability for only certain code to change a field. The one
that java programmers is used to are private, protected, public, etc..
In C# there are some more, for example Protected internal, this item can
be accessed from the entire assembly, or within objects which derive
from this class.
Source Files in
java each class needs to exist in a like name file, with the .java
extension. In C# does not have any restrictions when it comes to
defining classes, even when they are in different namespaces, any part
of a C# program may exist in the same .cs file.