Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  Shortcuts in OOP  (Read 5729 times)
0 Members and 1 Guest are viewing this topic.
Offline Breakfast

Senior Member




for great justice!


« Reply #30 - Posted 2005-02-28 11:11:16 »

Is that the class that begins "/*" and ends with "*/" ?
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #31 - Posted 2005-02-28 15:49:39 »

LOL Grin
No, it's a generated one. It emulates all possible MOVE commands in an 68k cpu, and there's LOTS of them.

Offline Raghar

Junior Member




Ue ni taete 'ru hitomi ni kono mi wa dou utsuru


« Reply #32 - Posted 2005-02-28 21:52:21 »

Quote
But if your javadocs were in external files and for whatever reason you just had the source code files, no matter how well written the code was it would be a good deal harder to interact with it.

I believe there should be two types of comments, one for programmers that would like to do something weird these shouldn't be in JavaDocs, and the other type for general use.
to erikd. Hand generated are better.  ~_^
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tom
« Reply #33 - Posted 2005-02-28 23:45:49 »

Quote

I believe there should be two types of comments, one for programmers that would like to do something weird these shouldn't be in JavaDocs, and the other type for general use.

I believe there is such a convention. The comments describing the inner workings of the functions is positioned right after the function declaration:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
/**
* Gets the x component.
* @return the x component.
*/

public float getX() {
   /*
   Describes what the weird code does.
   */

   return (somethingWeird);
}

Offline Breakfast

Senior Member




for great justice!


« Reply #34 - Posted 2005-03-01 17:46:32 »

Quite. An extra layer for documentation sounds like more complication for no perceptible gain. Kind of a backward's occam's razor, if that makes sense.
Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #35 - Posted 2005-03-09 06:11:31 »

I've asked a teacher during my labs if this is acceptable:

a.getA().getB().getC().

She said 'yes'.

Of course I worded the question as:
"Does it break any OOP or UML 2 rules if I get a reference object in another class with a getter and get another object from that class?"

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #36 - Posted 2005-03-09 07:27:26 »

It would be classed as breaking the law of demeter ( http://c2.com/cgi/wiki?LawOfDemeter ) but frankly I always thought that rule was junk anyway, you can always work around it but you end up with some hideous code.

Personally I like the XP style method of code the simplest thing possible and refactoring it when I need to, instead of the whole "big design upfront" method where things tend to get overcomplicated.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Raghar

Junior Member




Ue ni taete 'ru hitomi ni kono mi wa dou utsuru


« Reply #37 - Posted 2005-03-10 18:03:31 »

jf1.getContentPane().add(something);
is a simpliest exameple of such usage.

Of course if it would go to extremes programmers could use
Something s = .......getSomething(Object);
s.doWork();
s.check();
or
private Something getSomething(Object something1, Object somethingElse)
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #38 - Posted 2005-03-10 19:32:46 »

Quote
I've asked a teacher during my labs if this is acceptable:


The answer is really "only if your IDE has a one-click function to unroll it for you" because in real development you very often have to unroll those things later on when you're maintaining / updating / adding new features. Tongue

Most IDE's do this these days (yes?) so it's not a problem.

malloc will be first against the wall when the revolution comes...
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #39 - Posted 2005-03-10 19:34:21 »

Quote


Just few words. Image processing library.


So ... what?

Quote

It looks more like Java.math than normal class. If I'd add spiders inside (they are better in different class) it might be over 3800 lines.


I have no idea what spiders are, and I've no idea what you're saying here. Are you trying to defend a 4k line class?

malloc will be first against the wall when the revolution comes...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #40 - Posted 2005-03-10 19:35:57 »

Quote

I believe there should be two types of comments, one for programmers that would like to do something weird these shouldn't be in JavaDocs, and the other type for general use.
to erikd. Hand generated are better.  ~_^


Right. It's called a "manual" and open source might actually be mostly usable (rahter than mostly unusable, with a few gems) if more open source "programmers" knew about these amazing artifacts and how to write them.

/me ducks and runs for cover

malloc will be first against the wall when the revolution comes...
Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #41 - Posted 2005-03-10 20:37:18 »

How would I unroll that in Eclipse?

Quote


The answer is really "only if your IDE has a one-click function to unroll it for you" because in real development you very often have to unroll those things later on when you're maintaining / updating / adding new features. Tongue

Most IDE's do this these days (yes?) so it's not a problem.


Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline Raghar

Junior Member




Ue ni taete 'ru hitomi ni kono mi wa dou utsuru


« Reply #42 - Posted 2005-03-11 16:40:34 »

Quote

So ... what?
I have no idea what spiders are, and I've no idea what you're saying here. Are you trying to defend a 4k line class?

There are several areas that requires a nasty large code, and complex one on top of that. These are some algorithms from image processing, handling interactions between 1 mill+ entities,  handling and analysis of a geographic data, and sometimes also the smart AI.

For example:
I seen a 1000 line implementation of DCT. (My implementation of DCT isn't as large, but it needs 2000 operations per load.) There are much more code intensive algorithms however.



Spiders is name for... Let's suppose you'd have these data: "1324", and you need to convert that into this "1234". You'd select one of methods that is called spider.


Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #43 - Posted 2005-03-12 01:25:20 »

Quote
Spiders is name for... Let's suppose you'd have these data: "1324", and you need to convert that into this "1234". You'd select one of methods that is called spider.

That almost entirely fails to explain in the slightest way what you mean by a 'spider'.  Smiley

All I got out of it was a spider is a method that manipulates data.  Hmm.. I think all of my methods are spiders.

kul_th_las
Guest
« Reply #44 - Posted 2005-03-22 18:30:46 »

I often use this style, espcially when using a special algorithm, or encoding/decoding custom file formats. This way I can use/read/write the code on the left, and quick read down the right column to see what it does.

It works great in practice, because when you're in the code, and you know what it does, your eyes don't have to dodge around extraneous documentation just to find/fix bugs. And yet, when you go back to a custom algorithm after a year of not looking at it, you can get a quick understanding of both the overview and details of the method in question.





This is actually an out-of-date image. For those of you who actually read the code, you'll notice that the IOException is not documented, and that the @throws comment is not entirely accurate. And that's exactly what code reviews are for!
Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (25 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (13 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (44 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!