• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 01:07
CEST 07:07
KST 14:07
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12TL.net Map Contest #22 - Voting & Ladder Map Selection7Code S Season 2 (2026) - RO8 Preview8[ASL21] Finals Preview: Two Legacies21
Community News
ZeroSpace at Steam NextFest - Last free demo16Weekly Cups (June 8-14): Clem and Solar double, PTR tested0RSL: S6 Finals played at BlizzCon 202611Douyu Cup 2026: $20,000 Legends Event (June 26-28)10[BSL22] Non-Korean Championship from 13 to 28 June4
StarCraft 2
General
StarCraft II 5.0.16 PTR Patch Notes may 26th Daily SC2 Player Grid - feedback wanted J188 – Nhà Cái Cá Cược Trực Tuyến Đẳng Cấp Châu Á Code S Season 2 (2026) - RO8 Preview TL Poll: How do you feel about the 5.0.16 PTR balance changes?
Tourneys
GSL CK #4 20-21th June Sparkling Tuna Cup - Weekly Open Tournament Master Swan Open (Global Bronze-Master 2) Crank Gathers Season 4: BW vs SC2 Team League Douyu Cup 2026: $20,000 Legends Event (June 26-28)
Strategy
[G] Having the right mentality to improve
Custom Maps
Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
Mutation # 530 One For All The PondCast: SC2 News & Results Mutation # 529 Opportunities Unleashed Mutation # 528 Infection Detected
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Battle cruiser feet vs Carrier fleet Fact based Zerg Upgrade Tier List vespene.gg — BW replays in browser Data needed
Tourneys
CSLAN 4 is Coming! [Megathread] Daily Proleagues Small VOD Thread 2.0 The Casual Games of the Week Thread
Strategy
Simple Questions, Simple Answers Relatively freeroll strategies Creating a full chart of Zerg builds Why doesn't anyone use restoration?
Other Games
General Games
Path of Exile ZeroSpace at Steam NextFest - Last free demo Stormgate/Frost Giant Megathread Nintendo Switch Thread ZeroSpace Megathread
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
Vanilla Mini Mafia {D-2} Late to making 20.06.2026 memorable [p]94718
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread [H]Internet/Gaming Cafe Tips and Tricks The Games Industry And ATVI UK Politics Mega-thread
Fan Clubs
The HerO Fan Club! The herO Fan Club!
Media & Entertainment
Movie Discussion! [Req][Books] Good Fantasy/SciFi books [TV/BOOK] *SPOILERS* Game of Thrones Discussion
Sports
2024 - 2026 Football Thread McBoner: A hockey love story TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion Cricket [SPORT]
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Facing Challenges in Mobile App Development
TL Community
The Automated Ban List
Blogs
How To Predict Tilt in Espor…
TrAiDoS
An Exploration of th…
waywardstrategy
I'm an arrogant trash talke…
FlaShFTW
Gauntlet SC2: A Retrospectiv…
Ctone23
Why RTS gamers make better f…
gosubay
Customize Sidebar...

Website Feedback

Closed Threads



Active: 8408 users

Programming Best Practices?

Blogs > Phyre
Post a Reply
Phyre
Profile Blog Joined December 2006
United States1288 Posts
September 14 2008 04:57 GMT
#1
So I know there are a decent number of experienced programmers here on TL so I figured this would be a good place to ask. I'm relatively inexperienced in programming despite being a graduated CS major and looking to improve. One thing that I find I'm sorely lacking in is an understanding of "best practices." I tried googling around a bit but nothing I found seemed terribly reputable. Is there a site or forum that most coders trust as a good source? Like the TL.net of the coding community?

Also, if anyone is well versed in Actionscript3 and is willing to answer a few questions that would be great too. Had to pick it up recently and I've run into a few snags here and there. C++ is my preferred language but you learn what the job requires.

"Oh no, I got you with your pants... on your face... That's not how you wear pants." - Nintu, catching 1 hatch lurks.
CommanderFluffy
Profile Joined June 2008
Taiwan1059 Posts
September 14 2008 05:00 GMT
#2
read as: "Progaming Best Practices?"

expected some drills in BW or something

i start my programing classes this year in college so i cant help you on your search. sorry
Pain is temporary, but glory is forever.
EtherealDeath
Profile Blog Joined July 2007
United States8366 Posts
September 14 2008 05:03 GMT
#3
Practice #1: When making a programming language, plz use brackets not tabs. It's the one thing about Python that pisses me off. (Not the map Python)
haduken
Profile Blog Joined April 2003
Australia8267 Posts
September 14 2008 05:09 GMT
#4
I dunno. I'm pretty much the same as you.
I think a good practice is to keep things simple and commented but that's pretty much a given if you program.

There are quite a few code optimisation, algorithm blah blah things that you do but they contradict eachother sometimes so it's really a philosophical choice at times.

Personally i hate programmers that write their code and treate it like a fucking poetry by make shits unneccary complicated to look cool but maybe it's because i'm not on their level yet.
Rillanon.au
il0seonpurpose
Profile Blog Joined January 2007
Korea (South)5638 Posts
September 14 2008 05:11 GMT
#5
Ok you had me confused, I read progaming best practices, and then I kept reading then you said cs major and I was like counter strike major?? then I kept reading and was like, ohh computer science.

orca
Profile Joined January 2003
Israel469 Posts
September 14 2008 05:16 GMT
#6
i like the school of thought that says: write your code so that it doesn't need comments to see What/How it works. you only need to comment WHY.

kinda off topic, but i recommend you do things like Google Code jam (I'm doing some problems from there right now actually.)

http://code.google.com/codejam/contest/
Post edited for grammar.
Phyre
Profile Blog Joined December 2006
United States1288 Posts
September 14 2008 05:27 GMT
#7
If I were to be more specific about what I'm tackling right now, I'm trying to figure out how I want to structure my classes and such to fit an OOP design style. I'm finding it difficult to figure out what should go where, etc.
"Oh no, I got you with your pants... on your face... That's not how you wear pants." - Nintu, catching 1 hatch lurks.
haduken
Profile Blog Joined April 2003
Australia8267 Posts
September 14 2008 06:35 GMT
#8
Keep it simple.
I sometimes find that OO gurus design their codes way tooo abstract to make any use of the advantage of OO.
Stir clear of OO methodologies that are specific to one language. such as multiple inheritance under C++ (Could be wrong here, can't remember exactly)

If your design is good then another programmer will pick it up and say hey i can do this! instead of saying hey this guy is leeeet.
or maybe that's your purpose.

Rillanon.au
Mastermind
Profile Blog Joined April 2008
Canada7096 Posts
September 14 2008 08:10 GMT
#9
Name all of your classes, functions, and variables so that anyone reading your code immediately knows what the point of that class/function/variable is for. It is fine to have variables like n,i,x, etc. for controlling loops and what not, but for other things try to name them so it is obvious what they are for.
Its important to just be really consistent in your code. Structure all your functions and classes in a very consistent format. Make sure all your tabs and braces are always done the same way.
Commenting is good, but pointless comments just get in the way. Explain things that may not be easy to figure out, and dont comment anything else.
Im surprised you didnt learn a lot of things specific to OOP in college. Im not really sure what to say there. Just look for a good online reference for that, or buy a quality book if you really want to learn a lot about it.
MasterOfChaos
Profile Blog Joined April 2007
Germany2896 Posts
September 14 2008 09:09 GMT
#10
You are the exact opposite of me I have no formal education but a bit of practice.
If you can get "Code Complete" from a library you should read it, I think it is more or less what you want.
And don't overcomplicate things(Which in my experience if common CS students which mainly worked with Java). Often the simple solution is faster to write, easier to understand and if the need should arise it can still be refactored into something more complex.
And practice, practice practice.
For example I like writing small games.

Commenting is good, but pointless comments just get in the way.

In most cases you just have to commentate the plugin interfaces not the implementation itself. Often if you feel the need to commentate code it is better to split it into several well named helperfunctions. But of cause if there are certain traps/unusual things you do a comment is usefull.

Assertions are usefull, so you can make the things your code relies on explicit instead of implicit and they are automatically checked which helps with debugging.
LiquipediaOne eye to kill. Two eyes to live.
VIB
Profile Blog Joined November 2007
Brazil3567 Posts
September 14 2008 09:23 GMT
#11
There are lots of talk about codings standards in wikipedia. Btw wikipedia is a great source of general programming information. Always look there before google when you needs something related to it.

These should help you:
http://en.wikipedia.org/wiki/Code_conventions
http://en.wikipedia.org/wiki/Programming_style
http://en.wikipedia.org/wiki/Indent_style
Great people talk about ideas. Average people talk about things. Small people talk about other people.
Scorch
Profile Blog Joined March 2008
Austria3371 Posts
September 14 2008 09:24 GMT
#12
Code:
Keep your stuff readable! Use meaningful variable names. Write comments on what's happening if a step is not immediately obvious, but not too many comments either. Try your best to make it so that you (or also someone else!) can revisit your code at a later time, understand it and change stuff with minimum effort.

Environment:
I'd strongly suggest using a good IDE like Eclipse which helps you greatly by auto-generating getter and setter methods, auto-completion, debugging, syntax-highlighting etc. Use a dual monitor system if possible so you can have Firefox, documentation or what-have-you open at all times and look things up without having to switch around.

Health:
Increase the font size to 14 or so to reduce the stress on your eyes. Invest in a good chair if you sit in front of the computer all day. Take a break from time to time, go out on the balcony or out the door for a couple of minutes to relax your eyes and take a breath of fresh air, and drink a glass of water.
Please log in or register to reply.
Live Events Refresh
Next event in 5h 53m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nina 93
StarCraft: Brood War
Mind 197
NaDa 43
Icarus 5
Dota 2
LuMiX0
League of Legends
JimRising 702
Counter-Strike
summit1g11333
Other Games
WinterStarcraft699
ViBE191
RuFF_SC2109
Organizations
Dota 2
PGL Dota 2 - Secondary Stream3561
Other Games
gamesdonequick1108
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• Berry_CruncH221
• practicex 22
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 27
• Diggity6
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1523
• Stunt374
Upcoming Events
WardiTV Spring Champion…
5h 53m
GSL
6h 53m
Maru vs Reynor
Lambo vs Solar
IPSL
10h 53m
Hawk vs Julia
Patches Events
11h 53m
BSL22 NKC (BSL vs China)
13h 53m
Dewalt vs Messiah
Bonyth vs Mihu
TerrOr vs XuanXuan
eOnzErG vs Messiah
Jaystar vs Mihu
Dewalt vs XuanXuan
Bonyth vs TerrOr
Replay Cast
18h 53m
WardiTV Weekly
1d 5h
Monday Night Weeklies
1d 10h
Sparkling Tuna Cup
2 days
The PondCast
3 days
[ Show More ]
Douyu Cup 2020
3 days
Oliveira vs Trap
Jieshi vs XY
soO vs FanTaSy
TY vs Coffee
Douyu Cup 2020
4 days
Neeb vs Impact
MacSed vs Cyan
Scarlett vs Kelazhur
INnoVation vs Dear
Douyu Cup 2020
5 days
Maestros of the Game
6 days
herO vs Classic
Maru vs Serral
BSL22 NKC (BSL vs China)
6 days
Douyu Cup 2020
6 days
Liquipedia Results

Completed

Proleague 2026-06-19
uThermal 2v2 2026 Main Event
Heroes Pulsing #2

Ongoing

IPSL Spring 2026
Acropolis #4
CSCL: Masked Kings S4
YSL S3
BSL 22 Non-Korean Championship
CSL Season 21: Qualifier 1
SCTL 2026 Spring
Maestros of the Game 2
WardiTV Spring 2026
Murky Cup 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026

Upcoming

CSL Season 21: Qualifier 2
CSL 2026 Summer (S21)
CSLAN 4
Blizzard Classic Cup 2026
Kung Fu Cup 2026 Grand Finals
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
HSC XXIX
Douyu Cup 2026
BCC 2026
Light HT
Heroes Pulsing #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.