I was taking a crap about ten minutes ago and was reading a C Programming book, midway thru I figured out why you would want to pass a reference to a function(pointer) versus just passing a value(variable). This distinction is lost in most higher level languages that use garbage collection, because they dont have pointers.
For the longest time I was looking at a C++ Programming book trying to understand pointers, and just was not getting it. The basic mechanics I got, but the need for pointers(outside of passing arrays to functions) I just did not get, neither did I get the whole thing with the passing by reference versus value.
SIDE BAR: For the non programmers out there the difference is that when you pass something to a function by value, a copy is made to the stack(could possibly be a issue if it runs you out of memory). The original value is unchanged, you can do what you want inside the function but will not change the value that you passed into the function.
Passing by reference gets you alittle closer to the memory and you are dealing with the memory locations and you can actually change the values that way, it is also the only way to pass an array to a function.
I dont know if it was just explained better in the C book or what but I am finally starting to get the whole passing by reference versus passing by value and that was really holding me up on the whole C/C++ understanding thing. I really want to get a good hold on C because I want to start experimenting with creating python libraries in C for linked lists and different data structures(I want to grok B-trees and more advanced trees in the first part of this year).
NonEuclidian DevBlog
Development and Technology Blog
Friday, January 11, 2008
Tuesday, October 16, 2007
Django and Python
I have been shopping around for a MVC framework to do rapid development for web applications in python, and have come across Django. Django is a modular and extensible web development framework for python that uses sqlObject, automatic admin interface, a simple templating system, and simple URL design.
I will be developing a web-based medical billing database for a relative(with his considerable help of course), and Django seemed like a gift from the heavens. With the object model being implemented as it is with Django, creating the data structure will be really simple.
I will be using this blog to post about the development process from the eyes of a newcomer to the field.
I will be developing a web-based medical billing database for a relative(with his considerable help of course), and Django seemed like a gift from the heavens. With the object model being implemented as it is with Django, creating the data structure will be really simple.
I will be using this blog to post about the development process from the eyes of a newcomer to the field.
Subscribe to:
Posts (Atom)