Steve L. Williams

Greenhorn
+ Follow
since May 20, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Steve L. Williams

Wow, never seen a thread last so long.

Anyway, here is my 2 cents

The naming policy is illogical and actually contributes to an unfriendly atmosphere. Let me explain.


Only real sounding names are required. Not real names. Therefore, there are many people not posting with their real names, yet the forum is generally very pleasant. Other forums don't have an anal-retentive naming policy, yet are just as friendly and helpful, if not more so. Programmers Heaven is a great example of that. They don't have a naming policy to speak of, and no moderators either. In my 2 years or so on their java and c/c++ boards, I haven't seen much in the way of bad behavior.

Since the stated purpose of the naming policy is to keep a nice forum nice, but yet has nothing to do with it, it is illogical. The regulars are nice, and that promotes niceness. Not some silly naming policy. The reason suns forums can be very unfriendly is that it isn't moderated very well and is heavily populated by regulars who are, um, not nice.

The reason it is ironically unfriendly is simple. Someone is in dire need of help, they find the ranch, quickly register, post their question. Next thing they know they are getting told to change their name, sometimes by wanna-be moderators, without getting an answer to their dilemma. This help makes JavaRanch more unfriendly.

It seems that the only logical reason for this policy is to give moderators something to do other then move the occasional post to a more proper(and sometimes less populated) board.
[ August 21, 2006: Message edited by: Steve L. Williams ]
15 years ago
GC is easy to define in just about any non-ethereal context since it is well implemented, and thus defined, in many languages. The job of the GC is its definition.

If you subscribe to the notion that things we do and use everyday have no definition, so doesn't exist, then I suppose it would be difficult.
[ July 20, 2006: Message edited by: Steve L. Williams ]
15 years ago
Whether the code itself is native has nothing to do with platform independance. That is just marketing hype from Sun.

The GC is not dependant on the OS, but the particular JVM. If you want to say each JVM is a platform(reasonable) then yes it is. But it is not dependant on the underlying OS.

"It is generally a bad idea to attempt to manipulate the garbage collection in the first place."

Then what does it matter if it is platform dependant. Why would the app running in the JVM care anyway?
15 years ago
It is nice you claim that your often odd theories are proved mathematically. Problem is, I have yet to see you prove anything, just claim that it is proved.
15 years ago
Garbage collection may and probably does behave differently on different JVM implementations. That does not mean that it is platform dependent. Regardless of what language is used to write it(likely C, which is a platform independant language), GC is not dependant on the underlying OS.

You can have two different GC implementations on the same OS. It is dependant on the specific JVM not OS.
15 years ago
In Java no, but in C, yes it can. So there is such thing as global variables. Something to be avoided but they still have their place, as does the much hated(and rightfully so)goto statement. It all depends on the situation.

I suppose I should note that at the moment I have no idea what particular part of HFJ you are referencing here. Care to provide a quote? K&B are more than willing to make corrections if they're necessary.



page 282 at the top is large black letters: "Static final variables are constants", and goes on with an example of PI from the Math class. Guess what, it can be called all over my program if I wish it! It must be bad programming then. It also calls them that elsewhere.

By the way, what possible relevance is your opinion that Kathy is 'hot'. I hope she smacked you for being sexist.

[ changed code tag to quote tag because... well... it's a quote. QED - Jim ]
[ May 25, 2006: Message edited by: Jim Yingst ]
15 years ago
How is it worse then passing needed objects all over the place, just because they contain needed constants.

There is a reason many java API classes have public static final variables.

Have an interface may not be the best way to go about it, but it is hardly crippling.
[ May 25, 2006: Message edited by: Steve L. Williams ]
15 years ago
Thank you Jim, Jaime, and Ilja for your help. I will look at other options. I don't think that what I am doing will tightly couple my code. Those variables are only used in cases where it really doesn't matter what they are, and changing it will require no additional code changes and little testing. Mainly they are used as codes to send to the client or to specify certain attributes.

For example, MAXSIZE sets how many commections to the server are allowed at one time. The server keeps track of how many connections and compares it to MAXSIZE and behaves accordingly. If MAXSIZE get changed, so what? The server won't really care or behave differently.

[Tony]: Static "final variables" are not constants - you haven't read this: http://jqa.tmorris.net/GetQAndA.action?qids=13&showAnswers=true

Do I really need to provide a reference to point out why "final variable" is oxymoronic? Even so, I'd use an authoritative linguist (such thing?) if I were to do just that. I would not use Head First as any kind of authority, since most of the contentious (read: not well known) issues are portrayed in a false or overly-simplistic manner in that book - which leads to these unfortunate circumstances where an innocent person has been misled.


Like I said it is a oxymoron, but the meaning is still quite clear. static final int myval=5 is a constant. It completely adheres to the rigourous definition of constant. Let us say that you are correct, what possible bad thing can happen by acting like that variable is constant? Nothing.

Again, trying to prove a point by referencing yourself is very academically dishonest.

The world is flat and here is proof: www.mysite.com/theworldreallyisflat.html.

Who cares that it is completely opposite of conventional wisdom, I know better then anyone else.

Sorry I will take the word of Ms. Sierra and Mr. Bates over you.

[ changed code tag to boldface quote so the line isn't hideously overlong - Jim ]
[ May 21, 2006: Message edited by: Jim Yingst ]
15 years ago
According to everything I have read static final variables are constants. Perhaps I misread I got severely annoyed when he tried to make his point by self-referencing.

I looked at his approach, but the variables values are not known at compile time, is this still going to work?
[ May 20, 2006: Message edited by: Steve L. Williams ]
15 years ago
No offense, but I will take the word of the JLS and Head Start Java, over a single poster who can't reference an authorative source. I am not flaming, it just takes more to convince me.

Yes, constant variable is an oxymoron but is a term that is in use not just for Java, and is widely and easily understood.

Anyway, is my approach(minus the final modifier) a good way to store program-wide variables.
[ May 20, 2006: Message edited by: Steve L. Williams ]
15 years ago
Actually I am using them as program wide variables, not just in the class. Is this the way to go about it?

I guess it doesn't have to be final since the variables are unique to this program. Are there security issues with having these variables public and not final? This is going to be a server app.
15 years ago
I want to be able to set up static variables for my program to use, and are also final.

The values for the variables are read at the start of runtime from a file.

The problem I am having is that I get compile errors saying that my final variables might not have been initialized. Here is an example of what I am trying to do.





This is obviously wrong, but I do not see how. final variables in Java can never change its value, but it doesn't have to have a value assigned when it is declared.

Any help is appreciated!
15 years ago