Hmm, another class, same as above, just the keyword "final" changed to "public". That's more advanced now. No doubt.
Zizzencs
@Zizzencs
Best posts made by Zizzencs
Latest posts made by Zizzencs
-
RE: Useful classes
-
Useful classes
I think I've found the most useful class. Ever. And it's on our SVN server. Yay.
import java.io.Serializable;
final class Address implements Serializable
{
String value;
public Address(String value)
{
this.value = value;
}
public String getValue()
{
return value;
}
public void setValue(String value)
{
this.value = value;
}
public String toString()
{
return value;
}
} -
Using functions is great
<font style="font-family: Courier New;" size="2">Today I reviewed the code maintained by our PHP programmers. I did notice that there are not so many function definitions in the code. Actually I found only 3 functions in some code written by a precious employee. All other repeating part of the code was copypaste. (e.g. connecting a database).
I told the programmers that this is not acceptable and they should use functions and create a common function library for everyday usage. They ended up with something like this in every PHP file:
<?php
dosomething();
function dosomething() {
// code
}</font> -
RE: Why XML is great
One rule that can be followed is that in an XML file there sould be no redundancy. Yesterday I thought it was obvious. Today I think it should be taught :/
-
Why XML is great
Using XML is great - especially when the user is at least a bit skilled in orgainzing data. Now look at this:
<people>
<person_short name="player1" value="Aladar" number="1"/>
<person_long name="player1" value="Aladar Bela" number="1"/>
<person_short name="player2" value="Cecil" number="2"/>
<person_long name="player2" value="Cecil Dezso" number="2"/>
</people>
This is why I love programming so much. -
Really true
Yesterday I had to push a button. Sounds easy, right? Well, it isn't if you have to do it from PHP on a website with heavy two phase authenctication. In this case the source code of the button and the surroundings always help, don't they? Let's look at this little example:
if (true) {
// lots of code
} else {
// another lots of code
}
Isn't it just wonderful to debug a 20k PHP file like that?