Friday, May 26, 2006

A Function of Life

The reason I started this blog, was to document my exploration into LISP. It's basically a programming language, and is the second oldest programming language after FORTRAN, if I am not mistaken.

Now, I want to state, I am still quite a beginner, but eager to learn, and implement something useful with LISP. So, if there's anything wrong, or you disagree with what I wrote, I am willing to listen.

LISP stands for List Processing. Here are some code samples on how LISP looks like:

(+ 1 2 3)
(* (+ 1 2) (/ 10 20))

Now, from what I have read so far, the essence of LISP is functions. There's a blur distinction between what is a data, and what is a function. A function could be a data that can be passed to a higher level of function.

So, in this way, you could build bigger applications, by writing functions, upon functions. Now, this is not something new. You can write functions in other programming languages, and do the same thing. But what makes LISP different is that functions are treated as data too.

And just by looking at this perspective, you could relate on how the real life is modelled. A high rise building, a car, a society can be broken down into it's sub components, which does something.

That activity can be at the lowest level, or intermediate level. But all those components has to contribute, or does it function in order to support that entity.

I haven't really tackled on how to write programs for LISP. Should I think of all programs as lists? or should I think of them as functions, build from the lowest until the highest level.

So, when you take a walk next time...just think about it. The complexity we have around us, are build upon functions right from the atom, to items that we could see, and wonder.

Saturday, May 13, 2006

Real programmers




Now, we got tons of people into programming, but what really constitute a real programmer? Now I choose the word real to differentiate between mass mediocre ones, and the great ones.

I dare say, real programmers are the ones who understood what is meant by computing. What that word really means. It's not just hammering out some codes on your IDE, and getting some program to work. Yes, of course, for a living, you have little choice but to keep on hammering up some codes, so the rest of the non geek world will pay you, so you could get your next XBox 360.

Now, in college, there was two subjects that was most dreaded by students.First, Theory of Computation, and second Compiler Design. I was initially, as a freshman, figuring in my head, wow...these two subjects must be the killer subjects. It would be hard to score good grades.

But after going through it, in fact, I found the real essence of computing, and how computing machines work, thanks to our father of modern computer, Alan Turing. Basically, computers are good problem solvers by repetitively solving chunks of problems. He had the foresight of inventing a machine that could solve scientific calculations. Now how he figured out that, is by thinking, "could we break down calculations into discrete problems that could be feed into the machine to be solved?".

Another thing that opened up my mind, was when I was studying compiler design. Although I could just finished 2 out of 7 phases of creating my own compiler, but that is enough to make me realise, the beauty of grammars (used to define how to parsed language syntax), and recursion.
In fact, our natural languages like english, has their own grammar (which we all learnt since young). And through this grammar, is how we construct complex sentences.

So back to the real programmer issue. I won't consider a programmer knows his stuff, until he understood turing machines and compiler design. It's not that it's necessary to know, but knowing this brings you to a higher level, where you could see things more clearly.

http://www.turing.org.uk/turing/

Wednesday, May 10, 2006

ASP.NET Love Hate Relationship




Anyone who has done pure scripting server side e.g. PHP ASP, must have gone pretty bonkers when seeing asp.net code for the first time. I was. It was initially thrilling jumping into asp.net, as you would believe all the great things it will bring.

But then when you look at the code, you can't really make head or tail, or figure out where to start?

Now, coming from a traditional web programming school of thought, you always think top to bottom. Yep, that's how the script runs, from the first line on top, and then just all the way down. If anything goes wrong, you know which line to fix. You also know how to add more "if else" just to make sure some path of logic is executed. But in asp.net, it's just not there.

You have to think events and triggers for those. And how to handle them.

And the worst of it, form inputs, are being replaced by proprietery asp.net tags.

I even went to the point of searching "hate dot net" to justify my feelings. And mind you, I had 2 years doing ASP and some vb dll com programming.

But it had to be overcome, because the benefits are just there. You no longer need to deploy dlls the hard way, just dump them into /bin folder. And there's tons of other benefits as well.

One more thing I need to say. I am not really a fan of drag and drop programming. Yes, I know all of you guys might have seen those MVPs (Microsoft Valued Professionals) doing some presentation hype, and trying to convince you, how easy it seems. hahaha...yes, IDEs does make your life better, but does that mean, anyone can just open the IDE, drag and drop some controls and voila, you have a web app?

Coming from the pre asp.net era, we have to hack javascripts, form inputs and much more just to do form validation, form posting, ajax and some DHTML effects. Yet if I were to advised which language should you start first before jumping into web programming, it would be either asp or php. Because this way, you learn the intricacies of how the lower level work. Once you got a solid foundation of how this layer work, asp.net will be a breeze. And better still, you could hack into certain asp.net controls to make it work for you.

And I heard from a guy who is managing a team of developers, mentioned, his top developer still don't really like dot net for projects. Why? Just because you don't have full control on all the logic on your pages. To do really cool stuff with your own forms, you just have to have certain parts of the page logic. ASP.net controls makes it harder, hence why all the hacks are needed on the controls.

ASP.net could really make faster apps, but that doesn't make it a better app. How good the app is, still depends on the programmer.