I have finally joined the 21st century and downloaded the Eclipse SDK for Java development. Oooh, luxury. I don't know why I stuck with xemacs for so long!
Also: after worrying about Java generics since Java 5.0 came out, I finally bit the bullet and set to teaching myself how to use them. Result: I had it figured out within about five minutes. Easy!
Non-generic java:
Generic java:
On another note: have been exposed to the dreaded C#, which Microsoft likes to describes as an updated version of C/C++, with a few influences from Visual Basic and Java. Let's take a look at a HelloWorld program in C#:
Enough about me. How are you?
Also: after worrying about Java generics since Java 5.0 came out, I finally bit the bullet and set to teaching myself how to use them. Result: I had it figured out within about five minutes. Easy!
Non-generic java:
ArrayList a = new ArrayList();
a.add( "the" );
a.add( "quick" );
a.add( "brown" );
a.add( "fox" );
Iterator i = a.iterator();
while( i.hasNext() )
System.out.println( "Length of string is " + ((String) i.next()).length() );Which is, for one thing, ugly. (LISPs!) More significantly, it can lead to type conversion errors at runtime, when you'd much prefer to see them at compile time.Generic java:
ArrayList<String> a = new ArrayList<String>();
a.add( "the" );
a.add( "quick" );
a.add( "brown" );
a.add( "fox" );
Iterator<String> i = a.iterator();
while( i.hasNext() )
System.out.println( "Length of string is " + i.next().length() );Which is easy enough to understand — just read ArrayList<String> as "an ArrayList of type String". Iterator<String> means "an Iterator over type String", and so forth.On another note: have been exposed to the dreaded C#, which Microsoft likes to describes as an updated version of C/C++, with a few influences from Visual Basic and Java. Let's take a look at a HelloWorld program in C#:
public class HelloWorld {
public static void Main( string[] args ) {
System.Console.WriteLine( "Hello, world" );
}
}Hmmm... not fooling anyone there, Billy. It's Java through-and-through, with a few syntactic differences (for example, upper-case method names) just to piss off existing Java programmers. Teh annoy.Enough about me. How are you?
Tags:
From:
no subject
@foo;
push(@foo, "the", "quick", "brown", "fox");
foreach (@foo) {
print "Length of word $_ is ", length($_);
};
From:
no subject
From:
no subject
No/incomplete documentation, no comments, having to go into the barebones code to find out what things did, ugly coding... And we had to use it to complete our assessments - that or write all the code out ourselves in our own classes...
From:
no subject
From:
no subject
You can argue 'til the cows come home about whether static type checking is a good or a bad thing. I think that the world's big enough for both static and dynamic languages, and myself use both. (Specifically, python):Typically, I'd use python for scripting and for quick 'n dirty work, but Java when I want to build a more robust application.
From:
no subject
I don't remember much Java, not having had much to do with it since 2001. I could try to relearn, but there's Java and J2EE and Generics, and I don't even know if the language has proper high-order functions yet, and every time I look at the language I flash back to first year.
I know VBA, which equates to knowing a more-featured set of VB6. Trying to learn the dotNet version of said language is thus Not A Good Thing because I'll mix things up at work.
Apart from VBA, the languages I do know are scripting (Perl, Javascript, PHP - though I'll only admit to that grudgingly) or specialised (SQL, SAS, Mathematica). The others (C and C++ mostly) I don't know well enough for work purposes.
I want another job. In order to get it, I'm going to need more than a scripting language. Nobody's hiring Perl devs, and even if they were I'd be up shit creek for not using it since Uni. I'm going to need a decent, modern language — VBA is almost dead outside of financial institutions — and at present I can probably give $ORK an excuse for learning C#. Once I do, it goes down as part of my job and I get to add it to the list of things I use at work. Which means employers are going to look and see it and I can get out of SAS fairy godmother hell.
I'd go for either Java or C# TBH, but I can likely get training in C#.
From:
no subject
Eclipse is massive and contains tons of groovy features.
It will aid you massively in writing high quality code quicker than you could without it.
And yeah, generics make java code much simpler and more readable.
I suggest that you read about the new enums next.
Java has been crying out for them since its inception.... for at least 8 years. and they too have their place in the competent programmers toolbox.
C ya.
From:
no subject
Also: new for-each loop! Hurrah! Far less nonsense with iterators.
From:
no subject
C# is almost identical to pre-5.0 Java, and so there's not much to choose between one or the other. I'd suggest learning C#, since the class libraries are more Microsoft-ish, so you should find your VB experience more applicable.
That said, with Java 5.0 the language is suddenly about twice as a) powerful and b) complicated. So perhaps give Java a try after you've got your head round C#.
(Personally, I seem to be growing into that sort of programmer who can alternate between a dozen or so programming languages without much difficulty. I take a perverse sort of pride in that, even though I'm quite obviously turning into the proverbial Jack-of-all-trades.)
From:
no subject
print "000"+1;
1
print "1" + "2";
3
print "".0+2;
2
$a="001";$a++;print $a;
002
I like the erlang/strongtalk method: The language is dynamic, but you can define types for functions/methods and they are checked with type inference.
From:
no subject
using System;
sealed class HelloWorld
{
[STAThread]
static Main()
{
Console.WriteLine( "Hello, world" );
}
}
From:
no subject
List<String> a = new List<String>();
a.Add( "the" );
a.Add( "quick" );
a.Add( "brown" );
a.Add( "fox" );
foreach (string s in a)
{
Console.WriteLine( "Length of string is " + s.Length )
}