Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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  
  Bad Habits  (Read 12933 times)
0 Members and 1 Guest are viewing this topic.
Offline bilznatch

JGO Coder

Medals: 11
Projects: 2
Exp: 4 years

I'm bad, I'm bad, I'm really... really bad T_T

« Posted 2013-12-02 06:42:46 »

I'm guilty of coding in a single class 90% of the time (I have other classes in my classes, not separated). My code isn't organized like anyone around here would normally organize, my packages are simply "game" and my classes are just the name of said game. (It's fine though, I'm bad, and I don't share my code with others, so I'm not leading anyone else to OOP hell.)

What poor coding habits are you guys guilty of?
Offline Jimmt
« League of Dukes »

JGO Kernel

Medals: 167
Projects: 5
Exp: 6 years

« Reply #1 - Posted 2013-12-02 06:49:16 »

I don't comment. Period.
Offline UprightPath
« Reply #2 - Posted 2013-12-02 07:09:47 »

Somewhat excessive attempts at code organization, even for private code. I spend more time working on that than anything else.

Always encapsulating data. Even when it leads to a lot of boiler plate style code. I only just broke the habit in a project I'm working on right now. I'm actually using public fields.

Prematurely optimizing code.

Commenting after I code.

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

JGO Kernel

Medals: 382
Projects: 11
Exp: 4 years

┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻

« Reply #3 - Posted 2013-12-02 08:00:48 »

Bad habits are only really bad habits if they hinder you or the program.

Laziness is fine and even positive as you get things done more efficiently, so I wouldn't say lack of commenting is bad unless you work in a team.

My #1 bad habit is scope creep.

Offline ctomni231

JGO Wizard

Medals: 99
Projects: 1
Exp: 7 years

Not a glitch. Just have a lil' pixelexia...

« Reply #4 - Posted 2013-12-02 08:03:00 »

Reading up on threads instead of actually programming. *runs*

Offline bilznatch

JGO Coder

Medals: 11
Projects: 2
Exp: 4 years

I'm bad, I'm bad, I'm really... really bad T_T

« Reply #5 - Posted 2013-12-02 08:10:44 »

I don't comment. Period.

If I have comments then it's just code that I don't want running. All dem //system.out.println() comments...
Offline trollwarrior1
« Reply #6 - Posted 2013-12-02 08:17:32 »

^+1 Cheesy:D
Offline delt0r

JGO Wizard

Medals: 143
Exp: 18 years

Computers can do that?

« Reply #7 - Posted 2013-12-02 09:06:25 »

Spending weeks planing the perfect code layout without writing a single line of code....

I have no special talents. I am only passionately curious.--Albert Einstein
Offline Opiop
« Reply #8 - Posted 2013-12-02 12:07:13 »

My worst habit is probably writing "test" code in a lot of my classes, cluttering them up and then never removing or refactoring the test code because it worked so well! My classes get very messy Sad
Offline ClickerMonkey

JGO Coder

Medals: 26
Exp: 10 years

Game Engineer

« Reply #9 - Posted 2013-12-02 13:22:43 »

After you write some code that does something special/important, always think if it will be instantly understandable if you look at it in 6 months... if it's complicated then I say comment it.

I use good variable names so you don't need to comment, but often I find some variables aren't name-able and when your variable names are too long It's hard to read (I like some equations on a single line okay? The readability of the equation is sometimes more important than the variable names - since the variable names don't always represent real-world things. I hope that makes sense.)

When I use short variable names in complex algorithms and equations, I always comment my code.

Of course, this goes out the window if you REALLY think you'll code the entire project in a few months.

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

JGO Knight

Medals: 36
Exp: 7-9 months

Damn maths.

« Reply #10 - Posted 2013-12-02 13:54:56 »

Every single line of code I type, I press crtl-a and ctrl-shift-f along with crtl-s to format and save it. They're the only hot-keys I use and I rarely copy and paste code. Also, when I don't like the design of something, I sometimes spend hours re-factoring it if there's a lot of code. With practice though I seem to be getting faster at refactoring, which I guess is a handy skill to learn.

Why are all OpenGL tutorials written in Brainf**k?
Offline Roquen

JGO Kernel

Medals: 517

« Reply #11 - Posted 2013-12-02 14:20:40 »

I like to be able to diagonally read code so short variable names rule.

My sin:  reading too much research on things that I don't need on that day.
Offline Troncoso

JGO Coder

Medals: 20

« Reply #12 - Posted 2013-12-02 14:24:43 »

My code always looks great. Formatting, naming conventions, commenting, etc. all comes very natural and I do it as I code. Though, I have a habit of spending too much time on the framework of new projects. I spend so much time trying to make development time quicker, that it kind of loses its point.
Offline bilznatch

JGO Coder

Medals: 11
Projects: 2
Exp: 4 years

I'm bad, I'm bad, I'm really... really bad T_T

« Reply #13 - Posted 2013-12-02 17:40:18 »

I like to be able to diagonally read code so short variable names rule.

My sin:  reading too much research on things that I don't need on that day.

I do this one as well. I've read all sorts of the LWJGL topics around here, and other places, and I refuse to touch it, or any direct openGL binding. It scares me too much.
Offline Phibedy

Senior Devvie

Medals: 9

« Reply #14 - Posted 2013-12-02 18:05:38 »

I encapsulate nearly everything and afterwards I implement that encapsulated "object" in a static way  Roll Eyes
If I only need one object   Clueless
public Class Dummy{ 
public static Dummy dummy;

While thinking about it, it might isn't that bad,
because it's easy to modify it. But maybe I just need it because even if I try to plan everything it will become different  Grin
Commenting is just for people who are afraid of thinking about their code again and again and again   Cool
Offline Simn
« Reply #15 - Posted 2013-12-02 18:43:49 »

I comment too much...   Tongue

- Simn
Offline actual

JGO Coder

Medals: 25

« Reply #16 - Posted 2013-12-02 18:59:45 »

I don't document my code at a high enough level. I document the nuts and bolts of classes and methods well enough, but I find myself coming back to code later thinking....why did I do it this way? Why is this an interface? What was I planning on using this class for?

I find myself much more productive when I document my intentions. Something like: "My Action class is part of a GOAP framework. The idea is that all other Actions will inherit from this class and then only need to implement the update, onSuccess, and onFailure methods. These actions should really only be used when a GameEntity needs to do something that takes more than one time step."

This kind of document doesn't really fit into javadoc and needs its own file.
Offline wessles
« Reply #17 - Posted 2013-12-02 20:58:07 »

I have horrible posture... Feels good now, but later it will be a (literal) pain in the back.

But in all seriousness, it is good to have better posture. It will help your back over time, and it's healthier! However, do not sit at 90* degrees!

Also, I have NEVER looked deeper into other programming languages!
Offline niroshido

Junior Devvie

Medals: 4
Exp: 4 years

« Reply #18 - Posted 2013-12-02 21:22:01 »

My bad habits are, starting a project writing a few basic classes usually as far as getters and setters, then get bogged down with trying to figure out how to tackle the game loop and then that it.

Its a terrible habit.

Oh actually i have another habit actually, i decide today will be the day i program, black out what the? how have i managed to login to a game and start playing well never mind i might as well continue playing until i am bored and thats really the story of my life, my life slowely evaporating due to a gaming addiction.
Offline Opiop
« Reply #19 - Posted 2013-12-03 01:24:17 »

I personally never game anymore, except for the occasional match of Battlefield bad company 2, BF3 and soon BF4! Something about the BF series really just does it for me like no other game can! But still, I game maybe 2 hours a week at max, its just not fun anymore when I know I have code to work on!
Offline wessles
« Reply #20 - Posted 2013-12-03 01:58:23 »

I game, but I am cursed with thinking about all the game rules, why they were made, possible different issues they had while making it, how long it took, who came up with the idea, what their budget was... etc. etc. etc.

But boy do I love MAKING games  Grin!
Offline Opiop
« Reply #21 - Posted 2013-12-03 02:01:02 »

I always love trying to figure out how the devs did this or that, and then I realize I'm being shot at and well... now I'm dead! But its still fun to think about the development process Smiley

I agree, making games is by far the coolest thing I've done in my life! ... Is that sad? Smiley
Offline Slyth2727
« Reply #22 - Posted 2013-12-03 02:07:49 »

I have a terrible habit of being lazy and just making variables public instead of private w/ getters and setters..
Offline Opiop
« Reply #23 - Posted 2013-12-03 02:09:26 »

I have a terrible habit of being lazy and just making variables public instead of private w/ getters and setters..
If you're using Eclipse, right click on your workspace, go down to source and hit generate getters and setters, and then select your variables you want to make them for! You can also let Eclipse automatically generate constructors for you, and I'm sure a plethora of other things for you!
Offline wessles
« Reply #24 - Posted 2013-12-03 02:16:15 »

I have my own code cleanup format that, quote:
Remove 'this' qualifier for non static field accesses
Remove 'this' qualifier for non static method accesses
Remove unnecessary blocks
Convert 'for' loops to enhanced 'for' loops
Remove unnecessary parentheses
Remove unused imports
Add missing '@Override' annotations
Add missing '@Override' annotations to implementations of interface methods
Remove unnecessary casts
Remove unnecessary '$NON-NLS$' tags
Add unimplemented methods
Organize imports
Format source code
Remove trailing white spaces on all lines
Correct indentation

That way, all that 'organization' crap comes last, and it is SOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO easy!

I love eclipse  Smiley
Offline kingroka123
« Reply #25 - Posted 2013-12-03 02:29:22 »

I don't comment as much as I should and I sometimes I forget to hit Ctrl+Shift+F persecutioncomplex
Offline Opiop
« Reply #26 - Posted 2013-12-03 03:12:42 »

I always save and then format every time I finish a function or a new line! It just is a good habit I got into I guess Wink
Offline kpars
« Reply #27 - Posted 2013-12-03 15:54:02 »

I CTRL+SHIFT+S and CTRL+SHIFT+F just like opiop, constantly. No matter what I'm doing. It's subconscious.

I also have a bad habit of using ridiculously short variable names.

So instead of having something like
, I end up using something like

It seems fine at first, but it comes to bite you in the ass later in development.

- Jev.
Offline Opiop
« Reply #28 - Posted 2013-12-03 23:09:06 »

I actually struggle sometimes to not name my variables something very long! But then I remember I'll have to type it out every time I want to use it, and because I'm lazy and my keyboard keys are kind of small, I use medium size variable names Smiley

Of course, space + c (or something like that, I csnt remember!) brings up a list of variables/functions whilst typing!
Offline wessles
« Reply #29 - Posted 2013-12-04 00:14:07 »

I love ctrl-space.
If I did not my productivity would slowly dwindle myproductivitywhich would be less than convenient for me...

EDIT: Subscripting is hard!
Pages: [1] 2
  ignore  |  Print  

DesertCoockie (21 views)
2018-05-13 18:23:11

nelsongames (69 views)
2018-04-24 18:15:36

nelsongames (66 views)
2018-04-24 18:14:32

ivj94 (750 views)
2018-03-24 14:47:39

ivj94 (80 views)
2018-03-24 14:46:31

ivj94 (604 views)
2018-03-24 14:43:53

Solater (96 views)
2018-03-17 05:04:08

nelsongames (169 views)
2018-03-05 17:56:34

Gornova (387 views)
2018-03-02 22:15:33

buddyBro (1047 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!