What's the best programming tip you can advise someone ?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

What's the best programming tip you can advise someone ?

Post by Roland_Yonaba »

Here is a list of various programming tips, from experts.
They share what has helped them become better programmers.
Link : Pearson's InformIT

Any thoughts ? What's according (to you), the best programming tip(s) you know ?
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: What's the best programming tip you can advise someone ?

Post by Inny »

Best programming tip? To be blunt, it's probably RTFM. In the places where there's bad documentation, you have a legitimate gripe about something not working, but in most cases a lot of hard effort went into producing the manuals, and it's a complete waste of time for everyone involved if you don't read them first before asking questions.

A more useful way of expressing that advice, in a less neck-beard way, is to say that every programming language, toolchain, framework, and library are build around a set of idioms that represent expectations of the people who made them. For instance, the entire Python community has a "pythonic way" that things should be done. To understand these tools and use them properly, you have to immerse yourself into it and learn it's ways. The best and first place to start is always documentation. If there are example available, totally learn and absorb them.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: What's the best programming tip you can advise someone ?

Post by bartbes »

I'm going to steal the DRY acronym and make it
Don't Restrict Yourself

This can be interpret in loads of ways, but I'll focus on one, don't use one language or one library/toolkit/framework/engine, I think that I have become a better programmer simply by looking at other languages, seeing how they work, and writing some trivial (or non-trivial) applications in them. The further you go from what you know, the more you will learn. By this I don't mean you should be coding in brainfuck at the end of your tour, I only mean you should've experienced what it's like. It'll teach you ways of doing things you haven't even heard of, it'll show you how good/beautiful a language can be, but it'll also show you the bad, and in the end, no matter what language you end up with (here's hoping you at least end up doing lua, using love), you'll be better for it. Worst case scenario, you'll learn what you hate, average case, you'll learn what you love, best case, you'll learn both.

EDIT: I'll add another interpretation:

Don't restrict yourself in what you code either, just code what you want to code (and what you must).
This means, that like most experienced people here, you'll end up with an impressive collection of ideas, (partially-written) programs and other projects that failed and/or were never published, but it always makes you more experienced. You'll find boundaries (that you'll break later), and surprise yourself when you do stuff you didn't think you could do beforehand. You'll be in way over your head, until you realize you're better now.
User avatar
ivan
Party member
Posts: 1918
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: What's the best programming tip you can advise someone ?

Post by ivan »

Any thoughts ? What's according (to you), the best programming tip(s) you know ?
This is a very broad question.
I would say, learn to read and understand other people's code. That's a good starting point.
Secondly, I would suggest being very pragmatic: never add features to your code that you'll 'probably need' later on. Chances are you won't.
It's often a good idea to decouple your code into different domains: code that handles input goes here, game logic goes elsewhere, etc. A good test for this is: how hard would it be to make your game run without any graphics at all or without any player input?
Try to make your code A LITTLE simpler and more understandable each time you go back to edit something.
And don't throw rocks and don't shoot guns. And come home safe, cause we miss ya.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: What's the best programming tip you can advise someone ?

Post by Lafolie »

My favourite piece of advice, though perhaps specific to Löve, is much shorter:

"Read the wiki!"
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: What's the best programming tip you can advise someone ?

Post by kikito »

My advice is:

Code: Select all

while true do
  learnNewThing()
end
When I write def I mean function.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: What's the best programming tip you can advise someone ?

Post by Roland_Yonaba »

kikito wrote:My advice is:

Code: Select all

while true do
  learnNewThing()
end
lol. What occurs when the loop break ?
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: What's the best programming tip you can advise someone ?

Post by Lafolie »

Roland_Yonaba wrote:
kikito wrote:My advice is:

Code: Select all

while true do
  learnNewThing()
end
lol. What occurs when the loop break ?
Death, presumably. Or the universe ceases to exist. Or true is a cake (which is questionable in itself...) ;)
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: What's the best programming tip you can advise someone ?

Post by Robin »

So I guess the lesson here is: good programmers don't die.

Immortality as well as omniscience? I'm game.
Help us help you: attach a .love.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: What's the best programming tip you can advise someone ?

Post by Roland_Yonaba »

Hmm...If I had to believe this, I'll rather say :
If one wants to code better, work late..!

Image
Post Reply

Who is online

Users browsing this forum: dusoft and 3 guests