• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:18
CEST 14:18
KST 21:18
  • 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
Code S Season 1 - RO8 Preview1[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10
Community News
Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event11Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced9
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
GSL Code S Season 1 (2026) Sparkling Tuna Cup - Weekly Open Tournament RSL Revival: Season 5 - Qualifiers and Main Event StarCraft Evolution League (SC Evo Biweekly) 2026 GSL Season 2 Qualifiers
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
(Spoiler) Asl ro8 D winner interview BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Do we have a pimpest plays list? AI Question
Tourneys
[ASL21] Ro8 Day 3 [ASL21] Ro8 Day 4 [Megathread] Daily Proleagues [ASL21] Ro8 Day 2
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Dawn of War IV Stormgate/Frost Giant Megathread OutLive 25 (RTS Game) Daigo vs Menard Best of 10 Nintendo Switch Thread
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
European Politico-economics QA Mega-thread US Politics Mega-thread Russo-Ukrainian War Thread 3D technology/software discussion Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Movie Stars In Video Games: …
TrAiDoS
ramps on octagon
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1419 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
GSL
09:30
2026 Season 1: Ro8 Group A
Classic vs RogueLIVE!
Maru vs TBD
IntoTheiNu 737
Ryung 422
CranKy Ducklings SOOP114
herO (SOOP)69
Rex51
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Ryung 422
herO (SOOP) 69
Rex 51
StarCraft: Brood War
Britney 51992
Calm 6456
BeSt 984
Horang2 909
EffOrt 680
Hyuk 500
Stork 344
Mini 290
actioN 220
Snow 195
[ Show more ]
Soma 191
Soulkey 190
ggaemo 187
Rush 175
Last 173
ZerO 123
Backho 116
Mind 97
hero 95
Hyun 85
Pusan 84
Larva 76
Mong 74
Dewaltoss 52
Killer 46
sorry 43
Shine 42
Aegong 37
Sacsri 35
sSak 34
Bale 26
soO 25
Barracks 24
Icarus 18
Noble 14
GoRush 13
IntoTheRainbow 10
Terrorterran 9
SilentControl 9
ajuk12(nOOB) 8
Dota 2
qojqva375
League of Legends
Reynor19
Counter-Strike
olofmeister2530
byalli483
x6flipin368
allub234
edward148
kRYSTAL_45
Super Smash Bros
Westballz18
Other Games
singsing1690
B2W.Neo562
Lowko269
monkeys_forever118
ArmadaUGS115
hiko85
ZerO(Twitch)12
Organizations
StarCraft: Brood War
UltimateBattle 812
Dota 2
PGL Dota 2 - Main Stream37
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• Noizen35
League of Legends
• Jankos1078
Other Games
• WagamamaTV179
Upcoming Events
GSL
21h 12m
SHIN vs Zoun
ByuN vs herO
OSC
22h 42m
OSC
1d
Replay Cast
1d 11h
Escore
1d 21h
The PondCast
1d 21h
WardiTV Invitational
1d 22h
Zoun vs Ryung
Lambo vs ShoWTimE
OSC
2 days
Replay Cast
2 days
CranKy Ducklings
2 days
[ Show More ]
RSL Revival
2 days
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
2 days
Krystianer vs TriGGeR
Cure vs Rogue
uThermal 2v2 Circuit
3 days
BSL
3 days
Replay Cast
3 days
Sparkling Tuna Cup
3 days
RSL Revival
3 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
3 days
BSL
4 days
GSL
4 days
Afreeca Starleague
4 days
Soma vs Leta
Monday Night Weeklies
5 days
CranKy Ducklings
5 days
Afreeca Starleague
5 days
Light vs Flash
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-05-05
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
YSL S3
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026

Upcoming

Escore Tournament S2: W6
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 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.