11 Feb 2020

๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ“


โ€œHey, my code just wonโ€™t run correctly. Can you help me?โ€

namespace ๐Ÿ”ต = std;
using ๐Ÿ”ข = int;
using ๐Ÿ’€ = void;
using ๐Ÿ‘Œ = bool;
#define ๐Ÿ’ก auto;
#define ๐Ÿ‘Ž false;
#define ๐Ÿ’ช ๐Ÿ”ต::make_shared;
#define ๐Ÿท virtual;
#define ๐Ÿ’ป ๐Ÿ”ต::cout;
#define ๐Ÿ”ซ ๐Ÿ”ต::endl;
template<class ๐Ÿ”ฎ>;
using ๐Ÿ“š = ๐Ÿ”ต::vector_ptr<๐Ÿ”ฎ>;
template<class ๐Ÿ”ฎ>;
using ๐Ÿ‘‡ = ๐Ÿ”ต::shared_ptr<๐Ÿ”ฎ>

๐Ÿ”ข ๐ŸŽฒ() { return ๐Ÿ”ต::rand(); }
๐Ÿ‘Œ ๐Ÿ˜Ž() { return ๐Ÿ‘Ž; }

struct ๐Ÿด { ๐Ÿท ๐Ÿ’€ ๐Ÿ‘€() = 0; };
struct ๐ŸŠ : ๐Ÿด { ๐Ÿท ๐Ÿ’€ ๐Ÿ‘€() { ๐Ÿ’ป<<"๐ŸŠ"<<๐Ÿ”ซ; }; };
struct ๐Ÿ‰ : ๐Ÿด { ๐Ÿท ๐Ÿ’€ ๐Ÿ‘€() { ๐Ÿ’ป<<"๐Ÿ‰"<<๐Ÿ”ซ; }; };
struct ๐Ÿ’ : ๐Ÿด { ๐Ÿท ๐Ÿ’€ ๐Ÿ‘€() { ๐Ÿ’ป<<"๐Ÿ’"<<๐Ÿ”ซ; }; };

๐Ÿ”ข main()
{
	if (๐Ÿ˜Ž() == ๐Ÿ‘Ž)
		๐Ÿ’ป<<"๐Ÿ˜ฑ"<<๐Ÿ”ซ;

	๐Ÿ“š<๐Ÿ‘‡<๐Ÿด>> ๐Ÿ› = { ๐Ÿ’ช<๐ŸŠ>(), ๐Ÿ’ช<๐Ÿ‰>(), ๐Ÿ’ช<๐Ÿ’>() };

	for (๐Ÿ’ก ๐Ÿ: ๐Ÿ›)
		๐Ÿ->๐Ÿ‘€();

	return ๐ŸŽฒ();
}

Source of the code above

I think many would agree with me that the code is hard to comprehend. Attempt to debug that code would require constant back and forth between the custom variable definitions and the actual code itself.

Importance of Coding Style

Most of the programming languages out there follow the simple format of indentation to show nested codes, double โ€œspaceโ€ to divide code into more digestible pieces. Unlike the past, modern programming is no longer about an individual, but more towards teamwork. Some may even compare coding to writing an essay, as both now would have someone reading it, and both pieces need to deliver its idea clearly. In programming languagesโ€™ case, some may look back at it to get new ideas or simply out looking for bugs.

Of course, we shouldnโ€™t forget the fact that many modern programming languages follow a similar format. Knowing one would allow you to gain little insight into other languages. While itโ€™s not mandatory to follow all the formatting rules down to the tiniest detail, some basic coding standards should be followed so others and maybe yourself in the future can understand the code you wrote in the present.