beanz Magazine

Code Golf

sterlic on Flickr

Problems software programmers can do to practice their skills, from beginner to advanced.

Learning to code is only one of several key steps to become a good coder. Learning how to debug or fix code is another key step. A less obvious skill is the ability to code efficiently.

And efficiently doesn’t mean the basics: commenting your code when needed and reducing the number of steps and functions wherever possible. Efficient coding also includes spending time to find ways to do things with much less code than the average programmer might realize.

I recall seeing the PHP code files for pMachine, a content management system and blogging tool, when the code was refactored into object oriented code. The sparseness of the code was like looking at a cathedral. Every bit was simple, obvious, and tight with lots of clean white space. There were no tall heavy chunks of code. Opening every file showed the same clean and carefully thought out code.

The ability to achieve this effect in your code takes lots of time and hard work. Probably you also have to think in ways useful to coding, for example, in terms of cause and effect.

How do you learn to be an efficient coder?

What is Code Golf?

Code golf is a fun way to gain some insights into how to write truly efficient code. As with golf, where the fewer strokes you have the better your score, with code golf the less lines and characters of code in your program the better your score.

Code golf is a series of programming challenges that require coders to be efficient. You write a program to solve the challenge. You also see the results of other coders, learn from their efforts, and improve your skills. It’s a fun way to participate with a community of programmers.


Become a subscriber and get access to the rest of this article. Plus all our magazine articles.

Stories also include numerous links to help parents, kids, and teachers learn more. Get access today at just $15 per year!

Subscribe Today!

Also In The April 2015 Issue

October 2015 Issue: Internet of Things (IoT)

The Internet of Things (IoT) connects dumb devices like refrigerators to the internet and uses software to connect them to our daily lives.

There are many operating systems for internet of things devices, from existing software used to control electronic boards to efforts by Google and Apple.

Disney Infinity 3.0, Rocket League, and Super Mario Maker are three fun video games to consider for the 2015 holiday season

You can learn a little software programming and have lots of fun with any number of coding apps available for your phone or tablet computer.

Operating system software is a key part of all computers. But what are they and how do they work?

Learning how to make kittens with JavaScript is a great way to learn how to use the free Chrome web browser to practice and learn JavaScript.

Working through a book can help parents learn programming with their kids or kids learn on their own.

Board games and card games are some of the best ways to learn about programming. You don't need a computer. Play as a family or group.

These robots also can be programmed to move around rooms, one way for kids to learn programming.

Six women were hired to use their math skills to program the ENIAC computer. They called themselves The First Programmers Club.

Nicky is a Linguistics major who learned coding skills to further her research. She's also finished a PhD, won a few big awards, and co-founded Grok Learning.

Two women created an innovative online service to teach teenage girls how to code by using video.

The new Rust programming language is designed to solve problems with operating systems and fix issues with C and other languages.

Data can become alive and pose questions as well as reveal answers to questions we have.

Links from the bottom of all the articles in this issue, collected in one place for you to print, share, or bookmark.

DRY is an acronym for Don't Repeat Yourself. It's a critical programming concept and skill to learn.

Interesting news stories about computer science, software programming, and technology for August and September 2015.

CoderDojo is a free after school club for kids ages 7-17 where kids, parents, mentors, and others play with technology and learn to code.