web developer & system programmer

coder . cl

ramblings and thoughts on programming...


learn programming seriously

published: 11-09-2012 / updated: 11-09-2012
posted in: development, programming, tips
by Daniel Molina Wegener

Programming is not a mere subject on the “purpose of programming is to create a set of instructions that computers use to perform specific operations or to exhibit desired behaviors”. Programming in fact is more than the simple understanding on how are placed those instructions on source code, there several concepts arranged on the source code, a statements like “avoid using continuations on your state machine” should be understood by the programmer. Also “externalize the closure as first order function” should be understood too. Those concepts if are not understood by the programmer, he will be speaking in terms of a novice programmer with a small set of programming courses and knowledge con computer science, so will be hard to communicate clear ideas about what are they programming.

scheduler using priority queues

published: 09-09-2012 / updated: 09-09-2012
posted in: c, c++, development, programming, projects, proview, tips
by Daniel Molina Wegener

As you know I am working on an Industrial Control System — ICS/DCS to be more specific — and this system requires a task schedule to activate some pumps with a very strict calendar, monitoring the amount of liquid that has been passed through the valve, and it should allow manual operations, interrupting the automatic operation of that node on the plant. This seems to be difficult to implement, as I wrote in past posts, we are using a priority queue that contains task requests, where every priority is entirely dynamic, and dependent on the state of the current state machine that is being executed according to the operation request.

how to hire good developers

published: 08-09-2012 / updated: 09-09-2012
posted in: development, programming, projects, tips
by Daniel Molina Wegener

I think that this is a not so hard to solve question. The main reason why a developer is a good developer is «his interest on programming». A good developer always has a great interest in programming, so probably he will write a blog on programming, he will have a Github or Sourceforge account with his own projects, or even he will be participating on some open source project or programming forum — like StackOverflow — where you can appreciate his activity. If not, he will have his own side projects and he will be able to show you some demo on his computer using some application like Skype or TeamViewer, and he will be able to show his capacity with that side project. Another option is to send you a sample source code file, where both of you must keep the secret. Finally on the interview, you can challenge him to solve a programming problem, where he must prove his capacity with some simple task, like using an algorithm to solve a very specific problem.

monoids in haskell

published: 06-09-2012 / updated: 06-09-2012
posted in: development, haskell, programming, tips
by Daniel Molina Wegener

A Monoid is a well known abstraction where you have an operation or function, a neutral element and a set that can be operated with that operation or function. Given that description, on Haskell you have an already defined Monoid class which is implemented on common types like Strings. The main monoidal String operation is the concatenation, using the (++) operation, so can have a clear example of the given description in the code that follows.

understanding the pac pattern

published: 02-09-2012 / updated: 02-09-2012
posted in: development, programming, projects, tips
by Daniel Molina Wegener

The Presentation-Abstraction-Control architectural pattern is widely used. I prefer this pattern over other patterns like Model-View-Controller, because it does not lack third party component integration and allows better decoupling of components. «The abstraction component retrieves and processes the data, the presentation component formats the visual and audio presentation of data, and the control component handles things such as the flow of control and communication between the other two components». As you see it has three main layers, as MVC does, but this pattern allows integration of third party components and it is not limited to database models. Think on such applications using third party APIs, where you are not using a Model, ideally you are designing an abstraction to that API to be integrated in your application. Here the PAC patter fits much better than MVC.

component atomicity

published: 31-08-2012 / updated: 01-09-2012
posted in: development, programming, projects, tips
by Daniel Molina Wegener

A component in an object oriented system is a modular part of the system, where it has required and provided interfaces. On any system design each component should preserve its atomicity, without overloading its functionalities. This means that every component should have a unique set of interfaces to provide and a unique set of interfaces to request from its environment, avoiding duplication and providing the proper reusability. Non atomic components are not so reusable as atomic ones, because they cannot be connected in other tasks. For example if you have an LDAP interface and you want to send SMS notifications to mobile numbers on the directory, you should not plug the SMS notification into the LDAP component, it should be another separate component.

implementing DSLs in haskell

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

Haskell is a purely functional language with a strong-static typing system. That does not means that you cannot build a compiler using Haskell, and you have a wide variety of compiler constructions libraries and tools. The one that I use in many cases is Parsec. Parsec is a monadic combinator based parser generator that can be modified in runtime, and you do not compile its specification, because it is written directly in Haskell using its set of combinators, providing a very dynamic behavior and allowing a wide variety of possible implementations. Recently on the blog www.programando.org, was launched a challenge to construct a DSL parser for L-System specifications.