We are still actively working on the spam issue.

Programming concepts

From InstallGentoo Wiki
Revision as of 16:48, 30 January 2014 by Beer (talk | contribs) (Programming Paradigms)
Jump to: navigation, search
Cleanup.png
Cleanup.png
CLEANUP CANDIDATE
Relevant discussion may be found on the talk page. Reason: No reason specified.


You can learn to program, but without a good foundation of theory behind you to help you make smart decisions with your code, you're going to be a shitty programmer. Go take a look at the Computer Science page for some info.

There's something to be said about optimising your algorithm before optimising your code.

Crucial programmer skills

There are some skills that are considered vital to being a valuable programmer, and that if you wish to be one, you should definitely get to grips with. These consist of:

  • Version control systems:
    • Git (recommended, especially for open source stuff) and/or Mercurial
  • Repositories
    • Gitorious
    • GitHub
    • BitBucket
  • Document typesetting/preparation
    • LaTeX typesetting system
    • Markdown
  • Console text editors
  • Command line skill
  • Compiler use
    • GNU Compiler Collection (gcc)

Guides to get you on your way

Programming Paradigms

Different languages are sometimes written in completely different ways. By becoming familiar with multiple languages that use different paradigms, you become a more effective programmer as the mindset used behind one paradigm can usually improve your way of thinking in another.

[TODO: Add definitions for these sections ]

Imperative

  • C
  • Python

Functional

  • Lisp dialects (Common Lisp, Scheme, Clojure)
  • Haskell

Object Oriented

  • Java
  • C#
  • C++

Declarative

  • SQL
  • Prolog

Aspect Oriented

  •  ?

Competitive Programming

You are in the jungle. You have a pocket-knife. Someone asks you to kill a mountain lion.

Anyone but a programmer would be asking "WTF is a MOUNTAIN lion doing in a JUNGLE?!", but that's not what you have been trained to do as a programmer. You are here to solve problems, not to question them.

Years of training has taught you well. You use your knife to sharpen a stick. You cut vines to lash sharp stones on one end. Maybe you're from a top university, and you've learned to extract essential ingredients from plant and insect life around you to fashion a poison to tip your weapon with.

Convinced that you have an effective and efficient way to kill the lion, you set forth to accomplish your task. Maybe your stick is too short, or your poisons don't work. It's okay - you live to refine your method and try again another day.

Then someone figures out a way to fashion a low-grade explosive from harvesting chemicals in the jungle. Your method of fashioning a spear to kill the lion is now far from the best way to accomplish your task. Nevertheless, it's still a simple way, and will continue to be taught in schools. Every lion-killer will be taught how to build his tools from scratch.

That's "real-life" programming.

In competitive programming, you start out with the same resources (a pocket-knife), except you have 2 minutes to kill the lion.

As a beginner, you will stare at the lion and do nothing.

Soon, you learn that if you kill a squirrel, sometimes the judge thinks it's a lion and you're good to go.

A more experienced programmer just keeps stabbing the lion and hopes that the lion dies in time. Soon, you learn that there are certain spots on a lion that are damage immune. You learn to not even bother stabbing those spots. Sometimes, the lion doesn't expose those spots, so you get really good at killing squirrels.

And then, to be a great competitive programmer, you need to be able to do two things.

First, you must learn how to find the lion's critical point and kill it in one swift stroke.

Second, you must learn how to be so handy with your knife that you can fashion a sharp stick in 1 minute, and spend the next minute stabbing the lion to death.

But never ever will you be able to have enough time to fashion an explosive to take the lion out.

Material

Books

There are books that teach programming competition. They are a very good resource to learn computer Science

Compete

There are many pages to compete in online programming competitions. They often offer tutorials and many other more:

Training sites

If you want to train: