Friday 16 March 2012

The Holiest Five Elements Of Programming

Being a programmer is quite easy.
All ya gotta do is concentrate of Five, yes, Five holly elements of all.

parsing, structuring, sorting, searching, documenting

*parsing
This is how you make sense of all the jive coming through a pipe (a stream, a file or something else, it doesn't matter). It comes ordered one by one, and your main job is making sense of it (calling functions, and rearrange them bytes in the way you like)
This is how you would

*structuring:
This is how you would add ORDER where there is none.
Upon parsing the idea for structure should be in your mind and nothing else should disencourage you from making the leap of making order.
Basic types of structures:
**Linear.
yes. Some things fall in line.
**Non-Linear.
**Unordered.

Remember, Restructuring is another way of saying DESTROY and restructure!
Order out of chaos is the middle finger that you _MUST_ deal with.

*Sorting
Now that you're ackquanted with parsing and structuring, your next dreadful task is to sort'em'out!
Bubble sort them if you feel stUpid. Two for's for ya!
Quick sort them and tell em that you can do it! Remember, there is a tale of a Lion and a cage. Tell em bout that... Draw crazy doodles and show them that you can think, and politely tell 'em that you are simply a programmer nothing more and that your profession is a dying one and that all those mathematician have their freakish giant tools with which your dying trade is down. Yeah... sorting is hard from this point of view. And really it is. Search the damn machine

Dcoumenting...
AAarhrhrhr! That dreaded word.
DOCUMENT _WHY_ are you doin' the thing you're doin' ;)
Be a bueaurocratic bitch even if that takes time.
Documentation is FOR YA and is for silent communication with other's little things like you

*hic!* *hic!*

So... there you go... you ARE a programmer.
If you cannot afford a damn machine doodle liek a crazy idiot on the sand and use your mind to program. Another way to f*ck w/ your mind is creating idiotic

Remember, you ARE a little cog in that spirit crushin machine called humanity/scoal order and aaaaaal those wrods.
REmember, you STILL are the BEST self-repairing machine. IF you enter the realm of being overloaded with symbols, start meditating or some sh1t. Invent something in your mind, imagine space ships or something... You are _a_ programmer therefore a small imaginative being that should be ... hmm... yeah...
Good buy and much luck and lunches.. for ya

Have a beer or something :]

Thursday 8 March 2012

Models, Views, Controllers

The other view of this holly triple is the Django's Models, Templates and Views.

It depends on the way you're looking at them

1) If you're looking from the perspective of a user, then the correct way it would seem to be the MVC!
* The user sees a View in the form of a widget, and he/she knows that when he clicks...
* He/She would see a controller (either a message or something else)
* In the end He/She would simply see the model as He/She would see the error messages or would use another tool to check up on the database
Simple as that...

2) The programmers way though is from the inside. (from the perspective of the application)
* The model:
Again this is our first priority. The model usually comes first.
* The view:
Remember! This thingy is connecting an URL portion with a piece of code that would handle the url and would do all the necessary actions in order to produce some widgets for the poor user to play with. Therefore this would be Controller in the 1) scheme.
* The template:
As we are programmers, the main thing we do is to translate one language into another. In our case we take something as Python but with ending tags and translate it into language the web can understand as html + widgets
The main _clue_ is that the templating language IS with ending tags (may be because it is a bit easier to parse? may be...)

! The python interpreter makes pretty amazing things (decisions) with indentation and that is our next clue....
See you next time imaginary readers! Ta-Ta!