I agree with espen180. However, remember that when you are not dealing with -ane, but instead of -ene or -yne, make the -ene or -yne the lowest number possible in the chain
For example:
C=C-C-C-C
There are two ways to count the chain, from left to right or from right to left. Therefore, the answer is either pent-1-ene or pent-4-ene. The most correct name of this chain would be pent-1-ene because 1 is the lowest number of the -ene.
Overall, my chemistry teacher told me that the following is the priority of naming alkanes, alkenes, alkynes and benzenes.
If there are two chains off of the parent chain that have the same number of carbons, name those chains with the lowest numbers possible. Next, when dealing with chains off of the parent chain (eg. methyl, butyl, pentyl), name those chains in alphabetical order. However, when there is a benzene off of the parent chain, try to have the benzene as the lowest number. Finally, if there the substance is an alkene or alkyne, name the -ene or -yne as the lowest number.
I hope this helps your understanding of naming rules.