News for hackers. Stuff that matters.
Re:قلب: a non-ASCII programming language written in Arabic by probably_wrong on Friday October 25, 2019 @04:10AM (#21352859)
> it never caught on, even in Francophone countries

I started programming at least 4 years before I started learning English. In my experience, not knowing what "if" means doesn't change anything because I never thought of code as prose. Whether it's called "if", "si", or "wenn", all that changes in my head is "what's the magic word that I have to insert before I can branch my code?".

This, I believe, it's why localized programming languages never catch on: because it solves a problem I don't have while bringing a new problem I do have, namely, not being able to find support for my niche programming language.

Variable names and comments? Sure, those are definitely prose. But I doubt anyone suffered too much when Python chose "elif" instead of "else if" (other than developers trying to remember whether a particular script should use "else if", "elsif", "elif", or "|").

Re:قلب: a non-ASCII programming language written in Arabic by babuskov on Friday October 25, 2019 @04:16AM (#21352890)
Agreed. I started to program in BASIC some 7 years before I started to learn English. I had no idea what PRINT or LET meant and was able to program without any problems.

Hm, even today, I have not idea why "for" is used for loops (?) and I'm using it without any problems.

Re:قلب: a non-ASCII programming language written in Arabic by Scarblac on Friday October 25, 2019 @05:12AM (#21353173)
When I was 10, the Dutch language manual for the Commodore 64 explained the pronunciation of "input#", but not that of just "input". So I (unfamiliar with foreign languages) thought that "input" was pronounced as we would in Dutch, while "input#" sounded like what I now know is English.

A class mate said his father said they were both pronounced as in English.

We had a fight over this in the playground, and I beat him. So I was right. "input" on the Commodore 64 is pronounced like in Dutch.

Re:قلب: a non-ASCII programming language written in Arabic by 317070 on Friday October 25, 2019 @06:41AM (#21353604)
My brain is parsing how a Dutch input would sound different in Dutch? "in de put" vs "input" sounds the same, no? What is different?
Re:قلب: a non-ASCII programming language written in Arabic by Scarblac on Friday October 25, 2019 @07:49AM (#21354018)
That's how I pronounced it. English input sounds more like Dutch "inpoet", the manual said input# was pronounced "inpoet-nummer".

(edit: long live the Internet, it's on page 135 of the manual here: https://docplayer.nl/11208014-Gebruikershandleiding-nederlan... . Nostalgia).

Re:قلب: a non-ASCII programming language written in Arabic by ward on Friday October 25, 2019 @07:47AM (#21354009)
There is definitely a difference. If you don't hear it, you might be saying one of them incorrectly? Wiktionary has audio files for input (English) and put (Dutch) if you need a comparison. In IPA the difference is ʊ vs ʏ. In terms of describing it to a Dutch person I would say the English u is somewhere between the Dutch u and the Dutch oe sounds.
Re:قلب: a non-ASCII programming language written in Arabic by Vinnl on Friday October 25, 2019 @07:53AM (#21354049)
In-poot vs in-puht, roughly.
Re:قلب: a non-ASCII programming language written in Arabic by dkersten on Friday October 25, 2019 @04:55AM (#21353093)
I always translate “for” in my head to: for each item x in...

In python is pretty direct: “for x in a” translates for for every x in the collection a, do this code...

In C it’s a bit more abstract: “for (i=0; i<10; ++i)” for every i in the range starting at i=0, while it’s less than 10, incrementing... Basically the body establishes a set or collection and the for loop executed the loop body “for” every item in the collection.

Modern languages often use foreach or some other slightly more descriptive name.

Re:قلب: a non-ASCII programming language written in Arabic by Fordec on Friday October 25, 2019 @04:46AM (#21353044)
Originally it was a Anglicization of "für" in German first used in a programming language called Superplan which was then picked up upon by FORTRAN and then it just stuck
Re:قلب: a non-ASCII programming language written in Arabic by dukoid on Friday October 25, 2019 @05:58AM (#21353382)
https://en.wikipedia.org/wiki/Heinz_Rutishauser

I don't think it's much more intuitive in German than in English, probably goes back to the "for each" quantor.

Re:قلب: a non-ASCII programming language written in Arabic by bhaak on Friday October 25, 2019 @06:37AM (#21353579)
The for loop is the most unintuitive variant of the possible looping constructs. The others (while do/do while/endless loop) are much more straightforward. We could easily have ended up with another version.

I always read it as inspired by "for values of" which at least in German is a common phrase heard in mathematical courses.

Re:قلب: a non-ASCII programming language written in Arabic by eru on Friday October 25, 2019 @05:49AM (#21353342)
Well, that doesn't really solve the mystery. The German "für" doesn't have any closer connection with loops than English "for".
Re:قلب: a non-ASCII programming language written in Arabic by kuschku on Friday October 25, 2019 @06:30AM (#21353545)
e.g. in Sums or Products, with

$$ Σ_(i=0)^(20) x² $$

you'd actually pronounce that as "summe für i = 0 bis 20 von x²", which is a good argument for where it might be from.

Re:قلب: a non-ASCII programming language written in Arabic by eru on Saturday October 26, 2019 @09:11AM (#21363440)
Yes, though isn't that the same when pronouncing math in English? (So it's a good explanation, but doing the detour via German doesn't give us any extra enlightenment?)
Re:قلب: a non-ASCII programming language written in Arabic by kuschku on Saturday October 26, 2019 @09:47AM (#21363635)
Well I don't know how it's pronounced in English, so I didn't know that, good to know though:)
Re:قلب: a non-ASCII programming language written in Arabic by pletnes on Friday October 25, 2019 @06:20AM (#21353497)
Fortran has «do» loops, no «for» loops (to my knowledge). do i = 1, N ...
Re:قلب: a non-ASCII programming language written in Arabic by jdnenej on Friday October 25, 2019 @04:20AM (#21352915)
Native English speaker and I also don't really get what "for" was meant to mean. At this point it's probably just something that everyone has memorised and part of history.
Re:قلب: a non-ASCII programming language written in Arabic by yodsanklai on Friday October 25, 2019 @04:44AM (#21353032)
I'm not a native speaker, but "perform this task, for i in {1,2,3}" seems to make sense as a prose. At least it does in French, when translated literally.
Re:قلب: a non-ASCII programming language written in Arabic by ozzmotik on Friday October 25, 2019 @05:18AM (#21353203)
personally as a native speaker it has alwaus made sense to me in the sense of saying "for these given constraints, loop while they are maintained" for the arithmetic style for loop, and "for each of these elements" for the more iterator based style.
Re:قلب: a non-ASCII programming language written in Arabic by jdnenej on Friday October 25, 2019 @05:53AM (#21353360)
In python it makes sense but when you have `for(let i=0; I<length; I++)` it makes less sense
Re:قلب: a non-ASCII programming language written in Arabic by wongarsu on Friday October 25, 2019 @07:38AM (#21353958)
"for all i smaller than length, starting at 0". It doesn't really map perfectly because in math you usually don't care about the order, so a for loop actually contains more information than the statement it's trying to mimic.
Re:قلب: a non-ASCII programming language written in Arabic by krzrak on Friday October 25, 2019 @04:52AM (#21353076)
The same in Polish.
Re:قلب: a non-ASCII programming language written in Arabic by trophycase on Friday October 25, 2019 @03:33PM (#21358458)
Huh? It's pretty common even in basic college math courses to use language like "for every p in Q". It's not like programming invented this usage.
Re:قلب: a non-ASCII programming language written in Arabic by Izkata on Friday October 25, 2019 @08:58AM (#21354488)
Also native English: For me it's always made sense only with the loop body, as "for these do that"

Or more straightforwardly, in a way that can be applied to other English constructs, "do that for this group"

It's the same "for" in my head in both those versions.

Re:قلب: a non-ASCII programming language written in Arabic by jhiesey on Friday October 25, 2019 @05:08AM (#21353157)
I would guess it comes from calling the universal quantifier ”for all” in logic
Re:قلب: a non-ASCII programming language written in Arabic by quickthrower2 on Friday October 25, 2019 @05:47AM (#21353325)
You have high hopes!
Re:قلب: a non-ASCII programming language written in Arabic by tempguy9999 on Friday October 25, 2019 @04:43AM (#21353022)
Hmm, never thought about it either. I'd guess a contraction of "for each value..."
Re:قلب: a non-ASCII programming language written in Arabic by tuesdayrain on Friday October 25, 2019 @04:49AM (#21353061)
Could it really be anything else? I always assumed that was the obvious intention there. Never crossed my mind that it could mean anything too different.
Re:قلب: a non-ASCII programming language written in Arabic by nindalf on Friday October 25, 2019 @04:41AM (#21353008)
My high school teacher had a very legit explanation for the meaning of “for” in that context. But I can’t remember it now. Nowadays I write it because it’s expected, not because there’s a hidden deeper meaning.
Re:قلب: a non-ASCII programming language written in Arabic by ewoodrich on Friday October 25, 2019 @04:55AM (#21353095)
A long time ago I did some VBA work without any real understanding of the underlying language and even though I had no idea that "Sub" or "Dim" was supposed mean "Subroutine" or "Dimension" my brain just approximately mapped it to "function" and "var" without ever needing to spend time trying to decode the "English" meaning.
Re:قلب: a non-ASCII programming language written in Arabic by mafro on Friday October 25, 2019 @05:03AM (#21353131)
Oh so that's what Dim meant :D
Re:قلب: a non-ASCII programming language written in Arabic by WalterBright on Friday October 25, 2019 @05:29AM (#21353251)
Yes, it's only like 20 keywords to learn.

I wish people who come up with all these inscrutable icons would realize that.

Re:قلب: a non-ASCII programming language written in Arabic by eru on Friday October 25, 2019 @05:48AM (#21353332)
Why is learning 20 inscrutable icons harder?
Re:قلب: a non-ASCII programming language written in Arabic by WalterBright on Friday October 25, 2019 @03:07PM (#21358196)
1. cannot look up an icon in a dictionary

2. cannot google an icon

3. icons are not standardized - companies copyright their icons and sue anyone else who uses them

4. icons do not have a sort order

5. cannot type an icon into a text editor /word processor

6. fonts don't support icons

Re:قلب: a non-ASCII programming language written in Arabic by babuskov on Friday October 25, 2019 @11:07AM (#21355740)
It's hard to reason and talk about something until you name it. With named keywords, you already have a name for it, even if you say it different than the English pronunciation.

Unless the script is so foreign to you (ex. Latin vs Arabic) that the keywords look like inscrutable symbols anyway.

Re:قلب: a non-ASCII programming language written in Arabic by Izkata on Friday October 25, 2019 @07:02PM (#21360081)
For a perfect example, try learning APL without having any background or reference names for its symbols: http://xahlee.info/comp/unicode_APL_symbols.html
Re:قلب: a non-ASCII programming language written in Arabic by darkwater on Friday October 25, 2019 @06:05AM (#21353428)
Because they are tiny and can be unreadable at perfectly normal font sizes.
Re:قلب: a non-ASCII programming language written in Arabic by jdironman on Friday October 25, 2019 @05:58AM (#21353386)
You're wording is interesting and has me thinking. Why think of these words individually, with their individual characters, as a burden of the English lexicon, and instead think of the words as an image in their entirety. So thats it's almost programming by picture.
Re:قلب: a non-ASCII programming language written in Arabic by ultraism on Friday October 25, 2019 @03:52PM (#21358607)
Could a localization be implemented in a header file with #defines to turn the localized keyword to the real one?
Re:قلب: a non-ASCII programming language written in Arabic by jamil7 on Friday October 25, 2019 @06:36AM (#21353573)
Very good point. While non-english programming languages haven't caught on I have experienced German documentation, comments and variable names in a codebase.
Re:قلب: a non-ASCII programming language written in Arabic by azernik on Friday October 25, 2019 @06:45AM (#21353644)
One of the more well-known examples, and one that made me double-take when I saw it - from PHP 3 onwards, when a pair of Israelis rewrote the parser, a common and confusing syntax error was "unexpected T_PAAMAYIM_NEKUDOTAYIM". Which is Hebrew for T_DOUBLE_COLON.

In PHP 5.4, they helped the situation somewhat by changing the error message to "unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM)" - I suspect national pride was involved in their refusal to completely remove the internal token name from the error message.

Re:قلب: a non-ASCII programming language written in Arabic by pyrale on Friday October 25, 2019 @05:19PM (#21359343)
This choice is also good for search optimization.
Re:قلب: a non-ASCII programming language written in Arabic by pradn on Friday October 25, 2019 @10:34AM (#21355335)
This rings true, but I imagine the difference is higher if you can't read the Latin script or if your keyboard doesn't have Latin characters.