web developer & system programmer

coder . cl

ramblings and thoughts on programming...

practice makes perfect

published: 28-08-2011 / updated: 28-08-2011
posted in: algorithms, development, programming, tips
by Daniel Molina Wegener

As developer, someone that is passionate for his work, will tend to learn new stuff without being directed to do that. Also, a passionate developer probably will develop a software solution using its own initiative, publishing a Free/Open Source Software solution or simply a Proprietary Product that will be available for download on its site or something similar to Android Market. “Practice Makes Perfect”, it can lead a developer from being a junior developer to a senior developer in a short period. The more interest they have, the more they get induced to build better code and better solutions, increasing his knowledge and leaving behind common programming mistakes. Usually an interested developer visits programming forums and mailing lists, has a Blog discussing programming topics — which indicates that he can write and communicate better than average developers — and has better initiatives using its creativity to solve problems.

understanding oauth

published: 20-04-2011 / updated: 20-04-2011
posted in: algorithms, development, programming, projects, tips
by Daniel Molina Wegener

“An open protocol to allow secure API authorization in a simple and standard method from desktop and web applications”. The basis of OAuth protocol, is to allow applications to share its user resources or data among third party applications without sharing the user credentials. It is done using authentication tokens, allowing certain applications to expose its API to other desktop applications and web based applications. The protocol was created with the purpose to solve the problem of enabling delegated access to protected resources.

using dependency injection on gui

published: 11-04-2010 / updated: 11-04-2010
posted in: algorithms, development, projects, tips
by Daniel Molina Wegener

Many people know the Model View Controller architectural pattern. Another interesting pattern is Presentation Abstraction Control architectural pattern. We can implement it using Dependency Injection or similar Inversion of Control patterns. So, when we are modeling solutions, we many times leave the control or business logic on the Controller. This will guide us to a very coupled platform. Remember that any well designed architecture claims for cohesion instead of coupling its components. On this article I will try to analyze the use of IoC on the PAC pattern, so we can have more maintainable software components, mainly on n-tier architectures.

source code optimization in c

published: 31-12-2009 / updated: 31-12-2009
posted in: algorithms, c, development, programming, tips
by Daniel Molina Wegener

"…premature optimization is the root of all evil".
— Donald Knuth

I agree with the fact that we must do our source code level optimizations when we have finshed the construction stage or it is almost complete. I was searching articles and papers about optimizing C source code to be applied on my programs and libraries. I’ve collected some of those optimizations. But you must not confuse algorithm optimization, source code optimization and compiler optimization, since the first one refers to algorithm design and the second one just refers to the algorithm implementation, and both are sharing just few common approaches to formal reductions.

java mutexes

published: 14-12-2009 / updated: 14-12-2009
posted in: algorithms, c, development, java, programming, tips
by Daniel Molina Wegener

Java synchronization is usually made through the synchronized keyword. Synchronized allow users to create a mutex around certain variable, class or method, where a mutex allows concurrent access to it. By concurrent access we should understand access from multiple threads. If an operation is atomic, there one and only one process or thread executing it. Then, mutex based operations are atomic.