English

Correct!

  
I want cookies.  
Cookies, I want.  
  

Wrong!

  
I cookies want.  
Want I, cookies.  
  

Ask 100 native english speakers and 100 will tell you which sentences are correct and which are wrong. Ask 100 native english speakers why? A lot less will be able to answer, the ones who can will probably mumble something about a rule. Ask them why that’s the rule, but not the same in Chinese? Very few will have the expertise to answer.

In order of priority:

  1. Cookies!
  2. Not sounding like a fool.
  3. Deep understanding of linguistic concepts.

This is programming.

:)

But programming languages are generally American, not British, so don’t have a clue what they’re talking about anyway!

http://www.addedbytes.com/blog/if-php-were-british/

so far, what i often find most difficult when learning a new language is all the shortcuts

i mean all the abstract smart moves, like in English for example we go from “he is” to “he’s” or “I would” to “I’d”

personally i find it more fruitful to simply ignore these higher abstractions until i feel enough comfortable with the lower abstractions

so in Lua, if i want to print something three times, i see nothing wrong in writing

  
print("hello")  
print("hello")  
print("hello")   
  

as a beginner, it’s my impression that many of the more seasoned coders i see on the net (who provide Lua snippets or examples on the web) seek to compress any snippet of code into something that may be called “beautiful code”

in this example, such coder would probably suggest that this is a much better approach:

  
for i = 1, 3 do  
 print("hello")  
end  
  

my argument with that is that although it’s less lines of code and more “beautiful” in the abstracted way, from my learning point of view it may abstract away too much from my overall understanding and smash the “creativity space” that exists for each of the print statements

for example, suppose i wanted to change the “hello” in each statement:

  
print("hello")  
print("hello again")  
print("hello once more")  
  

this seems more plausible to me from a beginner’s perspective than to create a function or class to handle all such matters

but let’s see how long i’ll have that attitude… :)

The thing to keep in mind is that programming examples or pretty much useless, and generally full of typos and stupid ideas.

I agree there’s no point in looping a print(“Hello”) 3 times.

But how about printing 3 things that you don’t ahead of time? Like the first 3 notes from an XRNS on pattern 6, track 3, column 2? And what do you do if there are no notes? Or just 2 notes? Or if there is no column 2? Or no pattern 6? Etc.

Programming is using building blocks to express future unknowns.

Like english, when you have a conversation with someone you don’t just recite something from memory. You use words and constructs to deal with an interactive situation that was unknown to you before.

Cheers.

Or what if you wanted to change from printing “hello world” from 3 time to 20 time. Then change you mine and actually want to do it 17 time. A lot easy to change one number on the screen than make sure you have copy and pasted the same line the right amount of times! Also means it can be a variable which can be set by the user.

yeah, it’s probably better to have a function with a for-loop if the number of hello prints are unknown, or are known to be variable

if i know that in advance, then i’ll choose to have the more abstract solution rather than the more concrete one

however, it’s often more fruitful for me to go from concrete to more abstract (by demand or by necessity) than to start on the abstract level as a kind of “default” level