Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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  
  Unmaintainable code...  (Read 6266 times)
0 Members and 1 Guest are viewing this topic.
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #30 - Posted 2003-12-28 15:15:36 »

Yeah... this nonsense is filed under Off Topic for a reason Smiley.

Besides, only My opinion matters  Grin

Offline Jeff

JGO Coder




Got any cats?


« Reply #31 - Posted 2003-12-28 17:15:23 »

Quote
Isn't this all opinion based? Just depends on how your mind works and what you find easy to work with?

Kev


Yes, to a degree its religious though I think there are good arguments that can be reasonably made.  (Such as, to humans used to natural language, whitespace is a delimiter not a token and thus it is hard to read in environments where it is treated as a token.)

BTW, Jeff's definition of religion:

"Relgion is an opinion or belief into which you invest emotion."

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline tortoise

Junior Devvie




<3 Shmups


« Reply #32 - Posted 2004-01-01 02:53:43 »

I really don't see it. Perl is basically C after it's had a few drinks. You can use it exactly like C, all if/else, do while, while, for, ++, etc contructs are there (except Perl lacks switch), in the exact same form. Add in regular expressions, a looser structure, and a lot of shortcuts and that's it. You can very easily ramp up to more advanced Perl, and until you're comfortable with it just use Perl as a looser C with some nice conveniences. Nobody is suggesting Perl in its monstrous entirety needs to be used in all scripts.

Quote

I am sure that I could "learn" perl and in time read it and understand it with relative ease.. but I would consider that a tremendous waste of time.


This Perl phobia (not just you, it's quite common) is like a child taking his cough medicine. It's not that bad!

Perl saved me immense time. So much so that Java or C or even Python would have literally been impossible, the number of things I had to implement in the time I had. There's a time and place for everything, and chances are CPAN's already done it for you Smiley

Quote

I believe that people with a mind for programming can understand most of C/C++, Java, BASIC, Pascal, Python, etc..  just by looking at code that has been written in it, without knowing ANY of those languages ahead of time.


1  
2  
3  
4  
5  
qsort []     = []
qsort (x:xs) = qsort elts_lt_x ++ [x] ++ qsort elts_greq_x
                 where
                   elts_lt_x   = [y | y <- xs, y < x]
                   elts_greq_x = [y | y <- xs, y >= x]


The Haskell community declares this quicksort program to be learnable from just looking at it, "You should be able to understand the program without any previous knowledge of either Haskell or quicksort." (from the official "Intro to Haskell", http://www.haskell.org/aboutHaskell.html). I really disagree. That program's also nothing, Haskell gets much more bizarre. It makes Perl seem like reading a children's book. Yet Haskell  is an excellent choice for certain situations. There's no such thing as a one size fits all language, they've all got their strengths. Including Perl. They've all got their weaknesses. Including Java.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #33 - Posted 2004-01-01 21:19:07 »

Quote
I really don't see it. Perl is basically C after it's had a few drinks..


Of everclear, maybe.  (Everclear == 199 proof alcohol).

The primary thing that makes PERL unreadable is the idea of "context".  A single variable has differnt values and meanings depending on where and how it is used.

You have to effectively run a light-weight PERL parser  in your head to understand the context and thus meaning of the code.

It was an interesting idea, and it can be very convenient to WRITE but it does make it hard to read.



Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #34 - Posted 2004-01-02 16:59:45 »

Quote
There's no such thing as a one size fits all language, they've all got their strengths. Including Perl. They've all got their weaknesses. Including Java.


Sure, I'm of the opinion that Perl's weaknesses GREATLY outweigh it's strengths.  I fully admit that there are a few things that CAN be expressed easily and neatly in Perl... though the reality is that every Perl program I've seen is a mess. Of course that made me stop looking at Perl so I haven't seen all that much. Smiley

So, after seeing how awful the code was that was produced by people that actually knew Perl it was clear that there was no point in learning it.. Why spend the effort so I know how to write ugly un-maintainable code? Smiley

I find your Haskel example easier to understand than Perl, but I fully admit it still sucks.  People may say that it fits certain problems very well...  so does Prolog and other languages that never get used in "real life".

Offline MGodehardt

Junior Devvie




why does the chicken cross the road?


« Reply #35 - Posted 2004-01-27 07:14:48 »

my favorite part is:

Quote

Inline Assembler: Sprinkle your code with bits of inline assembler just for fun. Almost no one understands assembler anymore. Even a few lines of it can stop a maintenance programmer cold.


Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #36 - Posted 2004-01-28 00:58:48 »

Can Java have inline assmebly?

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

Jeff:
Unemployed. Wink
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #37 - Posted 2004-01-28 05:02:00 »

well it could do a call to:
private native Object randomUnmaintainableCodeAcceptingAllArguments(Object data);

which was implemented in pure asm  Grin

Offline princec

« JGO Spiffy Duke »


Medals: 437
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #38 - Posted 2004-01-28 07:12:31 »

How about a class that stores its bytecode in a byte[] array, and creates its own classloader to load & resolve the embedded class, and then delegates all its private internal workings to the embedded class by using reflection?

Cas Smiley

Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #39 - Posted 2004-01-28 07:56:45 »

hmm, you upped the ante - that code should ofcourse embed somekind of quine to make it even more fun Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #40 - Posted 2004-01-29 15:52:14 »

Quote
How about a class that stores its bytecode in a byte[] array, and creates its own classloader to load & resolve the embedded class, and then delegates all its private internal workings to the embedded class by using reflection?

Cas Smiley


I think using reflection probably has to be outlawed in the Java Obfuscation Competition for the same reasons the pre-processor is outlawed  in the C contest.

It just makes it too easy Smiley

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline Raghar

Junior Devvie




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


« Reply #41 - Posted 2004-02-01 19:00:43 »

Quote
well it could do a call to:
private native Object randomUnmaintainableCodeAcceptingAllArguments(Object data);

which was implemented in pure asm  Grin


You have that code wrong.
It's
private native int calllllllAndBlastOutWindoze(ByteBuffer b);

Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #42 - Posted 2004-02-02 04:29:24 »

private native windowsPerformedAnillegalOperationAndMustBeShutDown(ByteBuffer _buffer)
{
  int nonsense = 0xFF11AE;
  System.out.println("BUFFER OVERFLOW EXCEPTION IN ADDRESS NONSENSE" + nonsense);
  System.exit(1);
}

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

Jeff:
Unemployed. Wink
Offline Raghar

Junior Devvie




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


« Reply #43 - Posted 2004-02-02 19:55:39 »

You can't implement native methods.
Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #44 - Posted 2004-02-03 09:00:34 »

Now you can. Grin

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

Jeff:
Unemployed. Wink
Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #45 - Posted 2004-02-03 09:01:04 »

Quote
Yeah... this nonsense is filed under Off Topic for a reason Smiley.

Besides, only My opinion matters  Grin


Seconded.

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

Jeff:
Unemployed. Wink
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #46 - Posted 2004-05-27 09:21:23 »

Java 1.5 beta enters the mix...

Someone at Sun apparently doesn't like the

1  
2  
3  
4  
5  
6  
if( something
|| something
&& something )
{
  ...
}


...because the stack traces for runtime errors collapse that multi-line if check into a single line before reporting the number. With a code numbering editor, you will be told that the runtime error is in the "if( something" line, even if it isn't.

Wink

I only noticed because I was getting:
Quote

NullPointerException

in the line
1  
if( myVariable != null


LOL!

[although, obviously, this is a bug with the 1.5 beta (line numbering for stack traces *has* to take into account EXACT source layout - including all blank lines as significant etc).]

malloc will be first against the wall when the revolution comes...
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.

Mr.CodeIt (20 views)
2014-12-23 03:34:11

rwatson462 (52 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (81 views)
2014-12-09 22:41:13

BurntPizza (110 views)
2014-12-08 04:46:31

JscottyBieshaar (78 views)
2014-12-05 12:39:02

SHC (89 views)
2014-12-03 16:27:13

CopyableCougar4 (93 views)
2014-11-29 21:32:03

toopeicgaming1999 (155 views)
2014-11-26 15:22:04

toopeicgaming1999 (148 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
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!