• Create Account

## Yiddish indentation

32 replies to this topic

### #1Waterlimon  Members

Posted 01 October 2013 - 06:40 AM

POPULAR

                int foo(float durr)
{
if (durr < 1.0f)
{
int resolt=0;
for (int i=0; i<10; ++i)
{
resolt += durr;
}
}
return resolt;
}


This is the best thing since hungarian notation!

As you can see it highlights the algorithms and hides the completely useless structural code.

No nobody has probably ever used this and i just made it up.

o3o

### #2Bacterius  Members

Posted 01 October 2013 - 07:20 AM

POPULAR

Woah, that is incredibly difficult to scan. I am tempted to write a script to align source code to "Yiddish" reverse indentation and run it on a teammate's projects folder.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

### #3mhagain  Members

Posted 01 October 2013 - 08:01 AM

This is one of my favourites, mainly because it's totally possible to see someone coming out with it as a valid reason for justifying an annoying indentation style.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.

### #4samoth  Members

Posted 01 October 2013 - 08:46 AM

Oi, I'm Yiddish! No, I'm kidding, but surprisingly I don't find it too hard to read at all.

Only downside I see is that you have to know how many scopes you'll have inside a function before you start writing it. Or, you must re-indent the whole function all the time. That'd be a nightmare to use with a revision control system, which typically diffs and highlights all changed lines.

Posted 01 October 2013 - 08:50 AM

Indentation schmindentation. *shrugs*

Edited by Paradigm Shifter, 01 October 2013 - 08:51 AM.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

### #6unbird  Members

Posted 01 October 2013 - 08:51 AM

It does look funny. But let's look at it from the other point of view. I wonder how easy it is for people used to right-to-left writing to read and write source code in "established" style, which is left-to-right and as far as I encountered mainly English (language keywords, identifiers). Could someone using right-to-left languages please comment on that ?

(To take it further: Imagine a world where all programming languages are written in Kanji or something )

Edited by unbird, 01 October 2013 - 08:57 AM.

Posted 01 October 2013 - 08:54 AM

POPULAR

?ykcirt etiuq ylbaborP

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

### #8l0calh05t  Members

Posted 01 October 2013 - 09:09 AM

It does look funny. But let's look at it from the other point of view. I wonder how easy it is for people used to right-to-left writing to read and write source code in "established" style, which is left-to-right and as far as I encountered mainly English (language keywords, identifiers). Could someone using right-to-left languages please comment on that ?

(To take it further: Imagine a world where all programming languages are written in Kanji or something )

I'd be interested in the answer to that as well. Especially considering that some languages are adding unicode support, which means that suddenly there might be changes in direction because an identifier is in a right to left script (which can then also affect punctuation characters surrounding it!). Yikes.

### #9samoth  Members

Posted 01 October 2013 - 09:20 AM

POPULAR

?ykcirt etiuq ylbaborP

˙ʞuıɥʇ ʇɥƃıɯ noʎ sɐ ʎʞɔıɹʇ sɐ ʇou

### #10unbird  Members

Posted 01 October 2013 - 09:35 AM

I'd be interested in the answer to that as well. Especially considering that some languages are adding unicode support, which means that suddenly there might be changes in direction because an identifier is in a right to left script (which can then also affect punctuation characters surrounding it!). Yikes.

Yikes indeed: Multicultural programming

foreach(var קוב in مكعبات)


Preemptive apology. I just used Google translate, so I hope I did not Insult anybody's mother here

### #11BGB  Members

Posted 01 October 2013 - 11:02 AM

I'd be interested in the answer to that as well. Especially considering that some languages are adding unicode support, which means that suddenly there might be changes in direction because an identifier is in a right to left script (which can then also affect punctuation characters surrounding it!). Yikes.

Yikes indeed: Multicultural programming

foreach(var קוב in مكعبات)

Preemptive apology. I just used Google translate, so I hope I did not Insult anybody's mother here

IME, at least in code I have seen, usually people seem to use ASCII characters for the code proper, but use non-ASCII characters mostly in comments and string literals, even with a lot of the common languages supporting non-ASCII identifier names.

otherwise, yeah, reminds me a few times in dealing with code written by a newbie, and trying to explain the merits of keeping things properly indented (not any specific style, just having the indentation of contained code being greater than that of surrounding code would be a start, stuff was generally indented by fairly random amounts, ...).

like, they couldn't find some bugs because their braces were messed up, which is something which is generally a lot more obvious if things use a sensible indentation style.

### #12l0calh05t  Members

Posted 01 October 2013 - 11:48 AM

I'd be interested in the answer to that as well. Especially considering that some languages are adding unicode support, which means that suddenly there might be changes in direction because an identifier is in a right to left script (which can then also affect punctuation characters surrounding it!). Yikes.

Yikes indeed: Multicultural programming

foreach(var קוב in مكعبات)

Preemptive apology. I just used Google translate, so I hope I did not Insult anybody's mother here

Also very fun:

int אלף = 0;

### #13unbird  Members

Posted 01 October 2013 - 12:57 PM

I first thought it was some cabbalistic pun, but now I get it. Yeah, try to write a parser which figures out reading direction dynamically

### #14l0calh05t  Members

Posted 01 October 2013 - 01:40 PM

If you are interested in the topic, this is one of the better (and simpler) explanations: http://www.iamcal.com/understanding-bidirectional-text/

And there's an xkcd comic about it http://xkcd.com/1137/

Edited by l0calh05t, 01 October 2013 - 01:54 PM.

### #15unbird  Members

Posted 01 October 2013 - 02:39 PM

*gosh*. I really feel embarrassed now about my ignorance of the complexity, so thanks for that link.

Still would be glad to hear some answers to my question: Nobody had any troubles learning programming because of clashing reading directions ?

### #16ByteTroll  Members

Posted 01 October 2013 - 08:04 PM

This + Hungarian notation...

"The code you write when you learn a new language is shit.
You either already know that and you are wise, or you don’t realize it for many years and you are an idiot. Either way, your learning code is objectively shit." - L. Spiro

"This is called programming. The art of typing shit into an editor/IDE is not programming, it's basically data entry. The part that makes a programmer a programmer is their problem solving skills." - Serapth

"The 'friend' relationship in c++ is the tightest coupling you can give two objects. Friends can reach out and touch your privates." - frob

### #17Hodgman  Moderators

Posted 01 October 2013 - 08:20 PM

POPULAR

Mandatory rant:
This is Hungarian notation:
int numWidgets;
uint rowOffset, colOffset;
float xPos, yPos;
long sizeBytes;
This is not Hungarian notation; this is a MS bastardisation known as "systems Hungarian":
int iWidgets;
uint uiRow, uiCol;
float fx, fy;
long dwSize;
Hungarian is good. MS Systems Hungarian is the one that is oft derided.

### #18TheChubu  Members

Posted 01 October 2013 - 08:50 PM

First, what Hodgman said (I'm a fan of xPos and yPos, and tmpSomething) , second, waiting for related link on xyz study that found that Yiddish notation is x% easier to read than Allman style in zyx cases.

Edited by TheChubu, 01 October 2013 - 08:51 PM.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

### #19JohnnyCode  Members

Posted 03 October 2013 - 12:36 PM

m_pCurrNode (a member variable of a class pointer datatype- current node), that is the notation I use in my hobby projects.   If you tell me name of any not local variable of my project to me, I will tell you everything about it.

### #20Servant of the Lord  Members

Posted 03 October 2013 - 02:18 PM

                int foo(float durr)
{
if (durr < 1.0f)
{
int resolt=0;
for (int i=0; i<10; ++i)
{
resolt += durr;
}
}
return resolt;
}


Oh, you must use the waterfall model of development!

Mandatory rant:
This is Hungarian notation:

int numWidgets;
uint rowOffset, colOffset;
float xPos, yPos;
long sizeBytes;
This is not Hungarian notation; this is a MS bastardisation known as "systems Hungarian":
int iWidgets;
uint uiRow, uiCol;
float fx, fy;
long dwSize;
Hungarian is good. MS Systems Hungarian is the one that is oft derided.

Oh good, you saved me the trouble of leaping to the real hungarian-notation's defense!

As an aside, both the original proper hungarian notation (also known as "Apps Hungarian") and the butchered version that stole the lime-light ("Systems Hungarian") were popularized at Microsoft - they deserve credit for both, not just the bad version.

Apps Hungarian, the good one, was used to good effect by the Microsoft application development team who worked on Microsoft Excel and Word.
Later, it spread and got confused in the Microsoft operating system development team, (hence, "Systems" Hungarian), where it later spread out via the API's documentation as the "good practice" that isn't.

At least, that's what I've heard.

Wikipedia says that the 'hungarian' part of the name comes from the skilled engineer who created it (while at Xerox) and promoted it in the application team when he worked at Microsoft.
It's perfectly fine to abbreviate my username to 'Servant' or 'SotL' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames -