There has been lots of research to find the most common words in the English language that uses Frequency analysis.
I was wondering if it would be possible to write a program that could do Frequency analysis on computer code so that people could start learning to code by using the most commonly used handlers, keywords, variables, etc
If a program could be created for reading Livecode stacks and open source code on git hub could be analysed for Frequency analysis and then a general service list could be written for live code stacks.
This could even be used for creating flashcards with the code on the front and the dictionary explanation on the back so that memorising the Livecode dictionary could be even easier.
The wikipeadia shows an example of what I mean.
wikipedia Most_common_words_in_English
wikipedia General_Service_List
Learning to read code
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Learning to read code
That's a tough one...
Code is contextualised, so it depends on what app you are writing, not necessarily just code...
For example, if I am writing a database app, different code will be used than if I were writing an image manipulation app. Some overlap will happen with "on mouseDown" commands, but if you know English, you know what they do... it's pretty straightforwards.
The rest is often conceptual, not linguistic. For example, everyone uses containers to track data, but you never say "create a container", you just do it. For example, "put the name of me into tName" creates a container called tName, but you never say 'create the container'. And what name you use is a coder-to-coder preference.
Consequently, coding is often learned contextually as you create an app that does something. learning what everything does along the way.
However, I find this methodology slow and often good only for the thing at hand, so when I want to do something new (which I always do), I have to hunt through a load of stuff, hack up other people's code, get frustrated and ask an expert.
I think it would be a better way forwards to learn common concepts, and code that achieves those concepts, but explain the code line-by-line so that the words make sense in context.
Don't forget that "line" comes up in two different contexts (line of code and line drawing), and frequency analysis would bias towards such multi-contextualised words...
Good luck with it.
XdM
Code is contextualised, so it depends on what app you are writing, not necessarily just code...
For example, if I am writing a database app, different code will be used than if I were writing an image manipulation app. Some overlap will happen with "on mouseDown" commands, but if you know English, you know what they do... it's pretty straightforwards.
The rest is often conceptual, not linguistic. For example, everyone uses containers to track data, but you never say "create a container", you just do it. For example, "put the name of me into tName" creates a container called tName, but you never say 'create the container'. And what name you use is a coder-to-coder preference.
Consequently, coding is often learned contextually as you create an app that does something. learning what everything does along the way.
However, I find this methodology slow and often good only for the thing at hand, so when I want to do something new (which I always do), I have to hunt through a load of stuff, hack up other people's code, get frustrated and ask an expert.
I think it would be a better way forwards to learn common concepts, and code that achieves those concepts, but explain the code line-by-line so that the words make sense in context.
Don't forget that "line" comes up in two different contexts (line of code and line drawing), and frequency analysis would bias towards such multi-contextualised words...
Good luck with it.
XdM
Re: Learning to read code
I think that is an understatement heh.
I also tend to think that is why most IDE autocomplete functions work the way they do, something like this In the MS VS IDE for sure they include the brief explanation. I can't remember if the Java (Oracle) IDE did or not.
I think something like that would be far more helpful as your learning to program, as it tells you right away if your looking at a function, command, property etc. *and* gives you a brief refresher on what your thinking about using does.
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Learning to read code
Hi.
Intersting question. But as others have said, code does not lend itself easily to straight lexicographic analysis.
Far more effective is being mentored through simple tasks, such as found in the many lessons available. I have taught newbies how to use LC, and always done so by guiding them through the construction of very simple apps. After getting used to stack structure and message stuff, they only needed perhaps two dozen native words to build a working stack. Afterwards, they were able to work much more independently.
I always say that any small, even embarrassingly trivial-seeming stack will NOT involve trivial programming. Most of the real learning anyway is to be found in perfecting and augmenting the core construct. That process never ends.
Craig
Intersting question. But as others have said, code does not lend itself easily to straight lexicographic analysis.
Far more effective is being mentored through simple tasks, such as found in the many lessons available. I have taught newbies how to use LC, and always done so by guiding them through the construction of very simple apps. After getting used to stack structure and message stuff, they only needed perhaps two dozen native words to build a working stack. Afterwards, they were able to work much more independently.
I always say that any small, even embarrassingly trivial-seeming stack will NOT involve trivial programming. Most of the real learning anyway is to be found in perfecting and augmenting the core construct. That process never ends.
Craig