Egyptian Brackets

Definition - What does Egyptian Brackets mean?

“Egyptian brackets” is an IT slang term for situations where programmers include a curly bracket that contains a function at the end of a code line after the function name, arguments, conditional statements or anything else that precedes the actual function code. The second curly bracket is located on its own line of code, underneath the last line of code contained in the function. This results in the first bracket being situated above and to the right of the second bracket, which in a general sense mimics the construction of a conventional Egyptian hieroglyphic showing a dancer. For this reason, this code layout convention is called “Egyptian brackets.”

Techopedia explains Egyptian Brackets

Egyptian brackets are also called K&R C style, named for programmers Brian Kernighan and Dennis Ritchie who supposedly pioneered this style in the 1970s. The use of Egyptian brackets goes to the heart of how coders determine how to structure function code. One might think that the more common convention would be to include both curly brackets on one line, with the code in the middle. However, it is far more common for programmers to include each curly bracket on a separate line, so that both brackets sit at the far left of the screen. Critics call this poor layout and point to the overuse of code lines, but others contend that having the brackets on the left and on their own lines makes code more readable and enhances its aesthetic.

Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.