Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (521)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Software development in todays world  (Read 4224 times)
0 Members and 1 Guest are viewing this topic.
Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Posted 2005-01-21 08:39:27 »

I posted my views in another forum so I will crosslink so you guys can read and comment on the opinions of myself and others.

The guys responding have varying opinions on what should occur. It would be nice of you guys to tell me your opinions on things such as "self commenting" code.

http://www.beyond3d.com/forum/viewtopic.php?t=19845

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

Jeff:
Unemployed. Wink
Offline Grazer

Junior Devvie




My other avatar is much more flattering.


« Reply #1 - Posted 2005-01-21 09:44:14 »

My opinion on self-commenting code: it's bollocks.
In fact, I believe it's one of the 7 excuses of highy lazy people.

Don't get me wrong, though.
I make my code as readable as possible, more so than almost anyone I know.  Cool
I keep my methods small (strive for < 1 screen).
I almost never use abbreviations for names.
I often use really long names that give the full meaning e.g. originalXScaleFactor as opposed to xScale1
I think hard about what I name my methods to make sure they read aloud and make sense (e.g. my logger has a "willLog" method, so you can write logger.willLog(level)).

But no matter how good my code reads, I always comment anything longer than a few lines.
The main reason is that you cannot read code.
You can look at the code, think about it in your head and "translate" it, per se, an then you know what it's doing.
But you always have to translate and this is a time-consuming process.
Comments, on the other hand, need no translation.
They tell you exactly what the code is doing, so you can know by reading one or two lines of English (very quick!).
Alternativey, you can translate ten lines of code in your head, which isn't fast at all, and also requires your brain to work harder.

If you write "readable" code, then comments aren't necessary.
However, they make maintenance and skimming a whole lot quicker, which makes the code "better", in the sense that it is much easier to understand.

Current Project: Easy Decal
Other Stuff: grlea online
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #2 - Posted 2005-01-21 09:45:30 »

Quote
I posted my views in another forum so I will crosslink so you guys can read and comment on the opinions of myself and others.


Hmm. You need to think a bit more about how to do this kind of thing before doing it. Either everyone has to register for an extra account elsewhere, or you get two conversations in parallel, which is REALLY confusing for the people that try to be in both Smiley. Only really works if the other forum is non-registration...

As to the rest, it doesn't seem to be covering anything contentious or deep or interesting yet; you should probably do some digging around the JGO forums because IIRC there were a couple of conversations that went much further.

Nice article on "the uses of final"; I liked that Smiley.

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 K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #3 - Posted 2005-01-21 10:10:34 »

I got it off the Javalobby newsletter.
It's extremely helpful and keeps me up to date.

My argument was really comparing people like John Carmack against everyone else.

People are lazy these days and don't follow any design patterns when writing code, except for John Carmack.
The reason John Carmack is well renowned is because he's a master coder.

What I'm trying to say is that John Carmack is such a good coder is because he follows a design pattern when developing ID's engines.

It's not just John Carmack either, other coders at ID software wrote Doom 3 as well. Check out the source.

ID coders have done an extremely well job at making code as readable as a picture story book.


Quote


Hmm. You need to think a bit more about how to do this kind of thing before doing it. Either everyone has to register for an extra account elsewhere, or you get two conversations in parallel, which is REALLY confusing for the people that try to be in both Smiley. Only really works if the other forum is non-registration...

As to the rest, it doesn't seem to be covering anything contentious or deep or interesting yet; you should probably do some digging around the JGO forums because IIRC there were a couple of conversations that went much further.

Nice article on "the uses of final"; I liked that Smiley.


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

Jeff:
Unemployed. Wink
Offline Vorax

Senior Devvie


Projects: 1


System shutting down in 5..4..3...


« Reply #4 - Posted 2005-01-21 11:42:23 »

I am a big advocate of design patterns as well.

In my day job (chief architect in a software company), I won't hire anyone that doesn't understand UML.   It is so much more efficient to communicate with patterns then vague descriptions.  The first question I ask during interviews is usually: "Have you used UML before?"

That said, all code should also be commented.  Design patterns convey the architecture of a solution, but not the true implementation details.  As they say...the devil is in the details.

BTW:  John Carmack is my hero Cheesy

Offline dsellars

Junior Devvie




Need to write more games


« Reply #5 - Posted 2005-01-21 11:45:34 »

Short of downloading the doom3 sdk.  Do you have any links to what his coding stlye is?  Or a description of his methodology?  googling for John Carmack gets quite a few results....

Cheers,
Dan.
Offline tom
« Reply #6 - Posted 2005-01-21 11:59:27 »

I worked with someone that declared all methods final to prevent accidentaly overiding methods. I didn't know this at start, and was a bit confused when I needed to extend one of his classes.

I've had a look at some of the Quake1 and Quake3 code. Don't know if there were and great design patterns or not, but the code didn't look that great.

Offline Spasi
« Reply #7 - Posted 2005-01-21 12:19:47 »

Quote
Don't know if there were and great design patterns or not, but the code didn't look that great.


Of course it didn't; he uses C/C++ Grin
Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #8 - Posted 2005-01-21 12:30:58 »

He/team have created a set of classes the represent objects.

He's library while large isn't anywhere near the size of Valve's HL2 library(download SDK to check it out).

The actual objects themselves are created during runtime when they are loaded into the parser and get parsed into the classes themselves.

All modifications to weapons, maps, etc... are done through scripts.

About JC's coding style, I have no idea. I just looked at the SDK and said, "Hmmm, Carmack's done a lot of work.". :lol:

Doesn't mean JC did all of that because AFAIK JC coded the engine and that code isn't available.
Technically the JC stuff I spew is for pure obsession and laughter.

I don't believe JC coded the game library at all, the tools on the other hand(called idLib under D3 SDK) is most likely JC's.

The only thing at the top of all the files is "// Copyright (C) 2004 Id Software, Inc.
//".

Makes it hard to say who had done what.
I'm pretty sure JC had some involvement in those tools, if not all of it could be his.

Quote
Short of downloading the doom3 sdk.  Do you have any links to what his coding stlye is?  Or a description of his methodology?  googling for John Carmack gets quite a few results....

Cheers,
Dan.


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

Jeff:
Unemployed. Wink
Offline Vorax

Senior Devvie


Projects: 1


System shutting down in 5..4..3...


« Reply #9 - Posted 2005-01-21 12:44:31 »

JC isn't my hero because of his design pattern use, but because he is a master programmer.   He's a one man army.

He started out much like the people on these forums.  Creating games while working another job.  He's old-school indy.  Now, he is also one of the most influential programmers in the world.  When he speaks on 3D and 3D hardware everyone from the retailers, manufacturers and stock markets listen.  He is a big part of the power we have for gaming today.  He was also one of the saviors of Open GL during M$'s bid to try and squish it in the 90's.

Our Java toys such as JOGL and LWJGL likely wouldn't exist today without him and some other elite programmers having fought to keep OGL alive.

All that, and he thought about using Java as the script language in Q3, but felt it was a bit to immature at the time...which it was.  Doom 3 scripting is a kind of mesh between C++/Java/entity scripting

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Spasi
« Reply #10 - Posted 2005-01-21 12:58:37 »

Quote
About JC's coding style, I have no idea. I just looked at the SDK and said, "Hmmm, Carmack's done a lot of work.". :lol:


Doom 3 was his *first* real C++ project. Given the outcome (engine/programming quality, not the game itself), you can assume a lot about his programming skills.

What interests me is to see how his move to object orientation is going to affect any future engine(s). A potential boost in production speed may also help Java prove its advantages.
Offline Chman

Junior Devvie




Nothing more that... Java games are cool !


« Reply #11 - Posted 2005-01-21 13:15:43 »

Quote
About JC's coding style, I have no idea. I just looked at the SDK and said, "Hmmm, Carmack's done a lot of work.". :lol:

I haven't seen any doom 3 sources, but I remember the Quake 2's and quake 3's ones... It was so ugly... Totally unreadable. A lot of functions that only call another function which calls another function and so on...

Dunno about you, but I hate this coding style...

Anyway JC is surely one of the (or the ?) best game programmer out there. He is a "team" himself...

Chman
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #12 - Posted 2005-01-21 15:55:48 »

JC is famous for being a poor programmer in terms of bad style and lack of planning, but producing great games and finding low-level tricks so that he gets the reuslts (which is what matters to make money).

That he has changed is a reflection more upon how right all of us OOP-touting, "design is essential", "plan before you code" advocates have always been than upon his abilities.

That he survived whilst not using the modern techniques that were available to him says a lot about his low-level skills and speed of coding.

But he's still famous for being crap. Took him many yeasr to learn how to write decent networking code, for instance.

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

Senior Devvie


Projects: 1


System shutting down in 5..4..3...


« Reply #13 - Posted 2005-01-22 00:55:58 »

Attacking my hero?  Shocked I must defend him!

Quote
But he's still famous for being crap.


He is famous because he is a master programmer, not a crap programmer.   Are you talking about the same John Carmack?

How many graphics algorithms do YOU have named after you?  "Carmack's Reverse" is the current best algo for real time shadows in games and  "Surface caching" (another Carmack creation) is the algo that made Quake possible at a time when it was generally considered impossible on the hardware of the day.

His algorithms aren't ugly, they are complex.  Know the code and you will know the difference.  His code is designed for speed, not pretty and is usually tackling many considerations at the same time.  That makes it very fast, but very complex.  He was the lone coder on the engines for much of it, so he didn't worry about comments, he didn't need them.  Fast code...I mean REALLY fast code is often not the prettiest stuff to read.  But it is often far more elegant then code that can be easily read by 6th graders.  


Quote
Took him many yeasr to learn how to write decent networking code, for instance.


Oh do you mean the stuff he built into those engines he sold that have been used by dozens of major game companies for most of the top real-time multiplayer titles created in the last 10 years which is still considered the standard and benchmark today and defined the algorithm for everyone else?  Oh  THAT bad networking code...   Cool

Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #14 - Posted 2005-01-22 02:22:58 »

Creating fast code is slowly becoming less relevant in todays world and it's not because computers will become faster.

JIT compilers will continue to improve beyond the efficiency of todays JIT compilers.

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

Jeff:
Unemployed. Wink
Offline sonicviz

Senior Newbie





« Reply #15 - Posted 2005-01-22 04:41:59 »

It's just good discipline to write readable, maintainable, flexible code that is also well commented.

END - OF - STORY.

Sooner or later you will get caught going back to some neat piece of work and wondering..."now did I do that for this reason or was it that?" , all because you were too *$&#ing lazy to spend the time to save some time writing a line or two to clarify your thinking:-)

God forbid (or allah, yawah etc etc ) that someone else may have  to work on it...

On Design Patterns, oop and other things the following are an interesting read (snipped from DevX mail - you may have to copy the links if they get cut by the forum):

THANKS, GANG! DEVELOPERS TALK FRANKLY ABOUT A DECADE OF "DESIGN PATTERNS" by Glen Kunene, Senior Editor A decade later, the Gang of Four's "Design Patterns" is still a top seller and a "must read" for students and professionals. To celebrate its success, we asked programming professionals to tell us how this seminal work has influenced them. Some of their answers surprised us.
http://nl.internet.com/ct.html?rtr=on&s=1,1ckp,1,j6ek,eax9,lqnj,m494

OOP IS MUCH BETTER IN THEORY THAN IN PRACTICE
by Richard Mansfield
Think object-orient programming (OOP) is the only way to go? You poor, misguided soul. Richard Mansfield contends that OOP is just the latest in a history of ideas that sound good in theory but are clumsy in practice.
http://nl.internet.com/ct.html?rtr=on&s=1,1ckp,1,8ekt,fuf,lqnj,m494
Offline Vorax

Senior Devvie


Projects: 1


System shutting down in 5..4..3...


« Reply #16 - Posted 2005-01-22 14:11:52 »

Richard Mansfield is a dinasaur.  He was a dinasaur 10 years ago, and 10 years ago people were saying the same thing about OOP.  

Some people just don't get it, plain and simple.

If he thinks the only successful application of OOP is reallly GUI's he is completely out of touch.

I have been doing OOP since around 1988 getting close to 20 years now and I have seen it succeed far more then I have seen it fail.  As I am sure most peple have.  

I am not an OOP zealot, it's a tool.  Programming paradigms are like different types of brushes in the hands of artists.  Most paradigms will work for most situations, it really up to the artist though.

If Mr. Mansfield still hasn't figured out how to use it in all this time (he has been spewing forth crap since the 80's)...then I think that says more about him then it does about OOP. Wink

Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #17 - Posted 2005-01-23 02:02:28 »

Quote
He is famous because he is a master programmer, not a crap programmer.   Are you talking about the same John Carmack?


I must agree with Blah^3.  The Quake game code is total rubbish, horribly disorganized.   I'm not sure how muchof it is Carmack's though.  He was mainly doing the engine.  Carmack is an OK programmer, perhaps with bad programming practices and style.  I think the media coverage that id gets in terms of a small team making it big, blow his abilities out of proportion.

He is primarily "heroic" because of timing.  He took a small team to great success because he came up with a 3D engine that performed very well for it's day.  Other people were doing similar things around the same time, but they didn't get the fame of id because they didn't release a massively popular product.  I was at university at the time and knew of a few student projects that were doing similar things with 3D. For example this.

Think of the number of people on this very forum that have coded their own 3D engines.

Quote
How many graphics algorithms do YOU have named after you?  "Carmack's Reverse" is the current best algo for real time shadows in games and  "Surface caching" (another Carmack creation) is the algo that made Quake possible at a time when it was generally considered impossible on the hardware of the day.


Others don't get the media coverage, that's all.

Quote
His algorithms aren't ugly, they are complex.

His code is ugly, the algorithms are obviously working ones.  Some are no doubt very clever.  Carmark is one of many clever programmers. But he's over-hyped.

Quote
Oh do you mean the stuff he built into those engines he sold that have been used by dozens of major game companies for most of the top real-time multiplayer titles created in the last 10 years which is still considered the standard and benchmark today and defined the algorithm for everyone else?  Oh  THAT bad networking code...   Cool


What makes you think it is any good?  Financial success does not equate to great code.  Microsoft is a perfect example of that Smiley.
It just has to work "well enough" to be licensed.  There are a lot more people that don't have the time to code it themselves.

Offline Raghar

Junior Devvie




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


« Reply #18 - Posted 2005-01-23 13:46:35 »

Quote
Creating fast code is slowly becoming less relevant in todays world and it's not because computers will become faster.

JIT compilers will continue to improve beyond the efficiency of todays JIT compilers.


Do something nasty to him. It's a great opinion that will not work. Top CPU speed will not rise as much, and fast/slow code difference would be just higher.


to rest of this disscusion:
Comments when writting the code? They are unimportant for code maintenance. I offten return to a finished code after half year when I don't remmember well all of its features. Then I'm writting a comments and do last version of a cleaning.

If you don't remmember details of your code, you are in same situation as a future code maintenainer.


Offline Grazer

Junior Devvie




My other avatar is much more flattering.


« Reply #19 - Posted 2005-01-23 18:30:11 »

Quote
If you don't remmember details of your code, you are in same situation as a future code maintenainer.

And it is that horrible experience that has cemented, for me, the importance of writing comments in my code.
Really, sometimes I come back after the weekend and don't know what a piece of code does. (*Strokes greying beard*)
Having comments saves me stacks of time trying to decipher code.

Current Project: Easy Decal
Other Stuff: grlea online
Offline sonicviz

Senior Newbie





« Reply #20 - Posted 2005-01-23 21:22:16 »

Quote

Having comments saves me stacks of time trying to decipher code.


and that is what it is all about...saving time.
Eclipse task tags and bookmarks are also great tools for this.

And don't forget the 10 rules (or so) of egoless programming:
http://www.carnatic.com/karmasaya/index.php?Ten%20Commandments%20of%20Egoless%20Programming
Offline sonicviz

Senior Newbie





« Reply #21 - Posted 2005-01-26 23:51:25 »

>>Richard Mansfield is a dinasaur.  He was a dinasaur 10 years ago, and 10 years ago people were saying the same thing about OOP.

as expected, it sure generated a response

http://www.devx.com/DevX/Article/27020

http://www.devx.com/DevX/Article/27019
Pages: [1]
  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.

xFryIx (57 views)
2014-11-13 12:34:49

digdugdiggy (35 views)
2014-11-12 21:11:50

digdugdiggy (29 views)
2014-11-12 21:10:15

digdugdiggy (23 views)
2014-11-12 21:09:33

kovacsa (46 views)
2014-11-07 19:57:14

TehJavaDev (50 views)
2014-11-03 22:04:50

BurntPizza (50 views)
2014-11-03 18:54:52

moogie (65 views)
2014-11-03 06:22:04

CopyableCougar4 (63 views)
2014-11-01 23:36:41

DarkCart (148 views)
2014-11-01 14:51:03
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

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