• Welcome to Valhalla Legends Archive.
 

Icons.bni

Started by Camel, August 20, 2007, 12:49 PM

Previous topic - Next topic

Hdx

i'm at 1024x768 which is the best res for working int he dark IMO.
And this is bullshit, 88 warnings my ass. Figure out how to reproduce the warnings through command line and I'll fix them, untill ten, shush.
Eclipse is jsut being gay.
And I don't like using IDEs. not my style.
I prefer writing the code myself, not following prompts from a dammen IDE (at times hats pretty much what java does, you can write entire function by doing nothing but hitting the direction arrows)
we're on the 2nd page now so it should be good, just dont start quoting long code again. If you do use the quote tag.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Camel

#16
I know what you mean; I maintain makefiles for my automated build process, so I'm not hell-bent on the IDE. It's just much easier to actually write code in it, because of the context-assistant, the jitter, the error quick-fixes, etc. Writing java code without Eclipse takes longer, and is just more of a pain.

I suppose you don't miss what you've never had, though.

Or maybe the more appropriate phrase is that you can't teach an old dog new tricks.

Or perhaps just, "you're f#&king stubborn."

You don't have to try it, and if you try it you don't have to like it, but you do have to try it before you can say you don't like it.

In any event, did you even read any of the warnings that were posted? They're all trivial changes, so you might as well make them. Mostly unused variables.

Hdx

#17
Ya, I just read them, I didnt see that you edited your post.
I'm not stubborn, I can be taught new tricks, And I have used eclipse/other IDEs before. I just think it's better to have raw access to the file without all the frills of an IDE.
If you're a competent programmer you'll know how to fix errors without an IDE holding your hand.
Anyways, get me the command line eclipse is running so i can reproduce these warnings (warnings != errors btw)
And it's right, it's jsut bitching because of the way I documented parts of my code. (For example look at my Packet ID list)

the main problem is getting the command like to be as bitchy as your IDE, because to be honest, I don't thin java is the one bitching,  think it's eclipse. (One more reason I don't like it, its to picky)
Also the fact that when I'm coding, I don't have a GUI, I shut everything off except terminal.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Camel

#18
Whatever man, I'll take the jitter over trial and error any day. I can write a huge object model and know it compiles just because the jitter's been following me each step of the way. Eclipse even closes your braces and parenthesise for you - and I know that sounds like having an assistant to wipe your ass for you, but the next time you have to write ten thousand lines of repetitive code, you'll wish you had it.

The argument that IDEs are a crutch for weak developers just isn't valid. I'm going to go way out on a limb and guess that you got that impression because your only experience with Java development is your own personal work and in school. If that's the case, you should be aware that you're surrounded by people who are just learning (read: idiots), and who are looking for any crutches they can find.

At my company, there are approximately 30 Java developers, and they've been developing in Java since before pertinent IDEs were around. I personally have been using Java since NetBeans was the greatest one, and I absolutely hated it, so I always took the approach you're taking now by doing everything at the command line - although I used make files cause they're sexy. When Eclipse came out with a jitter, they all adopted it in its first version. I didn't get my hands on Eclipse until a generation or two after that, but I fell in love with it as soon as I did.

It's true that the responsibility of the IDE is to make the developer's job easier, but why does that have to be a bad thing? That's like saying cars are bad because they make one's commute easier. Sure they break down every once in a while, but you're already a mechanic so who cares?

My $0.02

[edit] Who cares what the source of the messages is? Are you trying to argue that unused variables are good?

[edit2] I forgot to mention the debugger interface. Ever tried to debug a java program with jdb? Bleh!

[edit3] Did I mention built in CVS integration? SVN with a plugin. Very convenient.

Hdx

#19
No i'm not arguing that unused variables are good.
But, it's actually an optimization of the compiler that nops out unused variables. So having them has no effect on the compiled program.
But meh it's just laziness on my end.

As for my only experience with java being personal and school, this is not entirely true.
Last year a group of us (read: 8) worked on a project for a company out teacher worked for (so yes can be considered school, but we got paid $500 each, so I'd call it work)
(it was just some user tracking/database management system for some local company, I can't remember the details)
But that experience taught me a few things.
CVS is nice for team projects
IDEs are nice for rapid bug fixes in a team
IDEs do most of the work for you
I suck at organization/structures
and finally IDEs make programmers stupid. (Seriously, People didn't know how to compile the code themselves, or commit it to CVS with anything but eclipse)

I'm not trying to say ides are bad, on the contrary, I can see how people like them they are really useful (Read: Eclipse's built-in bnetdocs is the pwnzorz)
But it's just my personal style to shy away from them unless i'm in a team project. (Nobody has expressed real interest in deving on JBLS or I would make the dev more easily accessible to users)

BTW, I went and fixed all the things that are causing the last warnings you showed. even though I can't see them on my end cuz I don't use an IDE but anyways. most of the crap was jsut laziness on my end. I'm actually dedicating 3.3 to optimization, and cleaning, cuz i'm bored.

~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Camel

Quote from: HdxBut, it's actually an optimization of the compiler that nops out unused variables. So having them has no effect on the compiled program.
But meh it's just laziness on my end.
You won't see me arguing for manual optimization over the compiler, but come on! Leaving stuff like that in is just asking for trouble. Besides, the intent of the warning message is to remind you that you created that variable for a reason, but never remembered to use it. It's another trick you can use to speed development if you don't have enough RAM available to your brain.

Quote from: HdxAs for my only experience with java being personal and school, this is not entirely true.
Last year a group of us (read: 8) worked on a project for a company out teacher worked for (so yes can be considered school, but we got paid $500 each, so I'd call it work)
(it was just some user tracking/database management system for some local company, I can't remember the details)
But that experience taught me a few things.
CVS is nice for team projects
IDEs are nice for rapid bug fixes in a team
IDEs do most of the work for you
I suck at organization/structures
and finally IDEs make programmers stupid. (Seriously, People didn't know how to compile the code themselves, or commit it to CVS with anything but eclipse)
That is a prime example of the situation I just described. I think you'd be hard pressed to find a senior Java developer, or even a competant Java programmer who isn't, at the very least, familiar with the command line tools.

Just out of curiosity though, if you suck at organization and structures, why'd you choose an OO language? Your Java code reminds me of a C daemon more than a Java server.

Quote from: HdxI'm not trying to say ides are bad, on the contrary, I can see how people like them they are really useful (Read: Eclipse's built-in bnetdocs is the pwnzorz)
But it's just my personal style to shy away from them unless i'm in a team project. (Nobody has expressed real interest in deving on JBLS or I would make the dev more easily accessible to users)

I distinctly remember offering to port lockdown and being shunned.



While the discussion's open, and this would probably be better suited in the Java Programming forum, but here goes anyways:

One of the philosophies I hold very highly is that objects have single, simple, one-liner responsibilities. I've heard people argue that this is stupid because Objects have lots of overhead, and if you create lots of them, you'll use lots of memory. My response to that is get over it, or stop using Java.

Objects are instances of classes - you might be surprised how many Java developers in the field don't know that. Semantics.

I don't see the use of any design patterns in your code. It looks like everything was just randomly thrown together the way an inexperienced programmer would do it. Don't get me wrong, I'm not bashing your code, I simply don't see where the design came from. To help you understand exactly what I mean, I'll briefly explain the object model for my bot:


Core package: A collection of classes with the joint responsibility of establishing and maintaining a battle.net connection
Connection - abstract representation of a connection of unknown type to battle.net - could be BNCS, BNFTP [not actually BNFTP, but that's a discussion for another day], or CHAT
BNCSConnection - name should say it all
ChatQueue - a simple chat queue. Some day, I'll make it a priority queue

Bot package: A collection of plugins designed to to act as robots and human interfaces
EventHandler - interface for plugging in to the core of the bot. Defines every battle.net event (user joins the channel, user emotes, a user on your friend list was promoted, etc)

Extensions of the EventHandler include (but are not limited to):
TriviaEventHandler - provides trivia for hours of fun
GUIEventHandler - provides a GUI to the user
ConsoleEventHandler - provides a CLI

A variation on the EventHandler interface is the RealmEventHandler - it has all of the MCP events. I won't go in to detail here.


At run-time, the bot reads the settings file, and builds a Connection based on the settings provided. Based on the user's input, it will decide which plugins to enable (CLI, GUI, Trivia, etc). For every plugin to be loaded, it will create an instance of the plugin, and link it in with the connection.

Now the object model is assembled in memory, here's how it actually works: Every time the Connection generates an event, it broadcasts it to all of its EventHandlers. See below:

By the way, I know I'm not blocking on the semaphore properly in addEventHandler(), but it doesn't matter because that method is only called from initialization code.
public abstract class Connection extends Thread implements EventHandler {
protected ConnectionSettings cs;
protected ChatQueue cq;
protected LinkedList<EventHandler> eventHandlers = new LinkedList<EventHandler>();

private int eh_semaphore = 0;

private void waitForEHSemaphore() {
while(eh_semaphore > 0) {
try {Thread.sleep(10);} catch (InterruptedException e) {e.printStackTrace();}
Thread.yield();
}
}

public void addEventHandler(EventHandler e) {
waitForEHSemaphore();

eventHandlers.add(e);
e.initialize(this);
}

public synchronized void recieveEmote(BNetUser user, String text) {
eh_semaphore++;
Iterator<EventHandler> it = eventHandlers.iterator();
while(it.hasNext())
it.next().recieveEmote(user, text);
eh_semaphore--;
}
}



Okay, so a page and a half isn't terribly brief, but I'm sure you get the point.

Hdx

Meh, I'm trying to understand what having specialized handelers like that are suppost to be used for in a single static query->response system like JBLS... Somethin like that would only bee needed for a system with multiple responses to a static query.
I think I have everything pretty well sandboxed in, cept a few parse classes where I tack everything not the same switch, but I'm planning on fixing that in my 3.2/3 release.
As for choosing Java.. Its just something that fell into my lap and never left. Meh.
(Ugh I Have to go finish registering for school today -.-)
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Camel

Wasn't exactly my point. That is one example of a design pattern I use. If you don't already know, a design pattern is most loosely defined as a solution to a problem. A better definition in my opinion is that it is a good solution to a common problem. Things like singletons (although tabu), factories/abstract factories, adapter, bridge, decorator are all examples of design patterns. Wikipedia has a long list of them, and I would definitely consider studying every single one of them to be a pre-requite to becoming an expert OO developer. I might even argue that it's the single most important thing you can learn about OOD.