coder . cl » rants http://coder.cl web developer & system programmer Sat, 03 Nov 2012 12:37:47 +0000 en hourly 1 http://wordpress.org/?v=3.4.2 filtering companies http://coder.cl/2012/10/filtering-companies/ http://coder.cl/2012/10/filtering-companies/#comments Tue, 30 Oct 2012 11:27:35 +0000 Daniel Molina Wegener http://coder.cl/?p=2928 As you know, I use a well defined set of questions to filter where should I work. If the company does not pass the test, I usually ignore that job offering. For example if I ask “what is your current distributed version control system?” and their answer is “SVN”, they got banned immediately — you know what I mean. The set of questions is pretty simple, and since you are usually interviewed by someone who is hiring or filtering the candidacies, you can do the same asking questions. For example, I am not interested in the company name; it can be Microsoft, but if they tell me “we are using visual source safe”, I do not handle that job offering. For me what is doing and what is using a company is important, because that will tell you how good are they doing their job.

The set of questions is not fixed and depends on the company, and everything is asked on the interview, telling me what is used language and which framework, is not enough. I put special emphasis in the architecure and programming techniques, like the used paradigms. If they are using Ruby, I expect a multi-paradigm approach, not only object oriented. The same applies to other languages. If they tell me “we are using MVC”, I can assume that their architecture and application is small, and it is not integrated with third party applications, because it does not require an n-tier architecture.

The same applies to embedded systems. If they tell me “we are doing iOS applications”, I will ask how do they handle the development. For example, my favorite DVCS is Darcs, and then comes GIT, and finally Mercurial, in that order. Should I handle a development which is using Subversion? I just start thinking on how hard will be doing branch merges, and I got tired immediately. The same applies to the knowledge that shows the interviewer. Should I handle a job where everything that I speak is not understood? I think not. Usually if, they do not understand every technical term that I use, it will lead me to a team that is not applying technical knowledge correctly, and they are not handling technical requirements correctly. So, I expect accurate answers to my questions.

Asking questions is a good approach to identify the scope of the company, how do they handle the development and how do they work. Feel free to ask. You can avoid several headaches if you ask the proper questions, and you will see how good are they doing their job if you ask them early. If your questions are technical, just expect the right answer, not an answer that half fits the question. Technical questions are accurate, expect the same answer. Do not leave anything in doubt, they should answer almost everything that you are asking.


© Daniel Molina Wegener for coder . cl, 2012. | Permalink | No comment | Add to del.icio.us
Post tags:

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)

]]>
http://coder.cl/2012/10/filtering-companies/feed/ 0
programming at fifty http://coder.cl/2012/10/programming-at-fifty/ http://coder.cl/2012/10/programming-at-fifty/#comments Sun, 28 Oct 2012 13:32:50 +0000 Daniel Molina Wegener http://coder.cl/?p=2914 There are three very objective posts about programming at fifty, probably with controversial opinions about being a programmer at fifty. Each post with some truth behind it, but in my opinion the solution to keep working as a programmer at fifty in a safe environment is to be more selective in the type of job that you choose. In the first post, I get the idea that you will be working — if you are working on the consumer applications market — in an ocean of APIs, and the fact that you can’t ever lose the hunger to know more, and almost every task as programmer depend on the involved market. Job filtering is an option, a real option. I currently do not handle any kind of project, and I use very consistent filters.

James Hauge uses the phrase oceans of APIs that’s true. Most architectures are very different, and you need to keep learning about them, and their changes to keep working on them. Mainly on the consumer applications market, even if they are web applications or desktop applications, you need to learn different frameworks, design techniques and the proper architectural patterns to reach a good design. Almost all programming interfaces are subject of changes, except those with a traditional approach, like system level calls and standard libraries, but the problem is not entirely the set of changes, the problem is how each company handles the set of changes.

It’s about skimming great oceans of APIs that you could spend years studying and learning, but the market will have moved on by then and that’s no fun anyway, so you cut and paste from examples and manage to get by without a full picture of the architecture supporting your app. [James Hauge, “Do You Really Want to be Doing This When You're 50?”, Programming in the
Twenty-First Century
]

If you will be working with a set of interfaces which are new for you and your company, you must be sure that the company will bring you enough time to study that API, otherwise the company should send you to any good course covering that set of interfaces. If not, if you will be working with a tight schedule, I can guess that you will be using your own time to reach a good performance and meet the schedule. I think that it is the main problem of the consumer application market. Each company must face competitive rates and schedules to gain customers.

If you want to be a programmer at 55 still you can’t ever lose the hunger to know more, know better and know simpler. Once you lose that edge the technology steamroller keeps on coming closer and closer until you wind up flat doing something else for a living. [Andrew Wulf, “Yes I Still Want To Be Doing This at 56”, The Codist Programmer Think]

You are continuously learning. You have a bunch of interfaces to learn, but also you must learn new programming techniques and algorithms, like Map Reduce, with functional basis, or work with Big Data approaches, NoSQL databases, and you must keep learning and reading. So, programming for me is the continuous process of learning and applying your theoretical and practical knowledge.

Ravi Mohan describes two types of programmers. The programmer type A who seeks solutions for difficult problems, and the programmer type B who seeks solutions for not so hard but stick in a bunch of APIs that must learn. Where programming at fifty usually means that you will be on the group A, solving hard problems with longer schedules, but the market is reduced, and you must have some expertise to work on it. That expertise is not gained with previous job positions on you have several options to reach those job positions, like creating your own side projects or delivering some FOSS product.

The programming language really matters. Mainly because almost every programming language is currently being focused in a multi-paradigm approach and using mixed programming techniques from some programming language paradigms to solve programming problems, like how is faced the parallel programming using higher order functions, now called asynchronous I/O. That is why I have learnt programming languages which have a traditional scope, like C, C Plus Plus, Lisp, Haskell, Python and Java, because they are grouping almost every programming style and paradigm, and they help me to understand deep aspects of any other programming language and framework.

Further reading:

  1. James Hauge, “Do You Really Want to be Doing This When You’re 50?”.
  2. Andrew Wulf, “Yes I Still Want To Be Doing This at 56”.
  3. Ravi Mohan, “On the “Do you want to be a programmer at fifty?” thing.”.

© Daniel Molina Wegener for coder . cl, 2012. | Permalink | No comment | Add to del.icio.us
Post tags:

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)

]]>
http://coder.cl/2012/10/programming-at-fifty/feed/ 0
programming requires thinking http://coder.cl/2012/10/programming-requires-thinking/ http://coder.cl/2012/10/programming-requires-thinking/#comments Fri, 19 Oct 2012 11:58:01 +0000 Daniel Molina Wegener http://coder.cl/?p=2887 Programming requires thinking. You must place instructions correctly, with a logical order, and you must prove that your program will produce the right behaviour. Even doing tests, your programs can fail, so you can use code hardening or similar techniques to avoid errors. The inclusion of a program verification is engaging, but it is limited to prove a limited set of features, even if that verification is made formally, you will need to make remarkably different types of tests to check the program correctness. So, the main problem with programming is reaching correctness, and how do you need to be concentrated to avoid programming mistakes, like passing null pointers to some function, because a program can compile, but cannot work.

You have programming paradigms, or programming models, where you have different forms to face a programming problem. Where not all problems can be solved using computers, because you have several complexity levels, and also you have several algorithmic complexity levels. You have some people stating that you cannot solve every programming problem using only one paradigm, and probably you should use different paradigms to solve different problems, and you have each paradigm exponent stating that using his beloved programming paradigm is better than using other paradigms, and even language exponents will tell you that their programming language is better than others.

What does the actually happens is the fact that the market leads almost every tendency on programming language usage. If you aim to work on a company with enterprise features, you should expect that the company will use a programming language with enterprise level support. Then you have enterprises using Java and NET, with few of them using JVM driven languages like Scala, or some languages like F#. And then you have companies using programming languages where you do not need to think too much — as they think that happens — like Visual Basic NET, because is cheaper to train programmers in a language which aims to be easy to use, rather than training experts in a programming language that is hard to learn. Tell me if I lie, “every corporate environment exposed to the internet has at least one bug appearing each time that you operate that environment”. Does actually works that working scheme of using programming languages that aim to be easy to use, productive and easy to learn?. Personally I do not see any difference. Everyone can learn programming, but not everyone should program, and the problem is not specifically the experience. I know programmers with more than ten years of experience doing the same mistakes for many years.

Programming requires to be concentrated, to have a pretty clear idea of what happens in the code, not specifically with one line of code, you must have the perspective of the current block, its algorithmic context and its environmental context. So, when you are programming you are using almost every feature of your memory. If you have not developed any aspect of your memory, probably is more feasible that your code will be more buggy. Logical thinking is required too, not forgetting that how is applied that thinking, the current block of code, its algorithmic context and its environmental context. Can you create a new thread in a web server?

I have worked with almost every programming paradigm, with languages like Java, C/C++, Haskell, Lisp, Python, Scala, JavaScript and Coffee Script among a large list of programming languages and domain specific languages. On each one, I never knew a skilled programmer that is not concentrated in his work, without distractions. A skilled programmer keeps his mind on the code, no matter its environment. Probably is harder to get concentrate on certain environments, but I never knew a programmer that cannot put his attention to the code. I must recognize that working as freelancer have enhanced my skills, I have almost no distractions, and I am currently more concentrated in my work. The quality of my code has increased; I was able to study new languages like Haskell, Scala, Coffee Script among others and I have learned their theoretical basis. Nobody is doing annoying interruptions of my work, and it is certainly flowing. Just imagine how productive I am without annoying interruptions.

I am doing it well. I have the top points on each job related social network, where the top is 5.0 I have 4.99, where the top is 10.0 I have 9.89, with more than 10 jobs on each one, with extremely gratifying recommendations, and I have worked with highly interdisciplinary teams, delivering exceptionally high quality products. I am doing a terrific job, and I will continue doing it because I have the ability to program and the ability to learn.


© Daniel Molina Wegener for coder . cl, 2012. | Permalink | No comment | Add to del.icio.us
Post tags:

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)

]]>
http://coder.cl/2012/10/programming-requires-thinking/feed/ 0
side projects http://coder.cl/2012/10/side-projects/ http://coder.cl/2012/10/side-projects/#comments Fri, 12 Oct 2012 13:56:38 +0000 Daniel Molina Wegener http://coder.cl/?p=2865 As a software developer, who has a side project — open source or not — is a software developer that can make products. If the developer can identify a community need, and produce a product, there is no problem for that developer to understand a specification and meet the desired specification. Also, the developer will be able to satisfy the correct solution and will be able to meet any observations about the requirements and the source code.

Failed or not, the developer with a side project are not a mere programmer that works coding and supplying solutions for a company. He is probably a skilled programmer that wants to cover some needs on his environment, and he will probably have excellent communication skills and will be able to work on teams of programmers. If their side projects are open source projects, they will be receptive to any review of his code. He should be able to write pretty clear documentation about his product, if not an acceptable document about how it works. Not necessary a successful project, but a project by his own initiative is just means that he wants to contribute.

So as a developer with his own side projects, he should be able to communicate with his customers, to supply the proper solution, and he will be able to solve their problems. That is what does means. No matter the project type that does he handle, on his development area, he will be skilled enough to develop his environment as a programmer. As a freelancer, I must be receptive to the requirements of my customers, and I am doing it well. I am skilled communicating and delivering software pieces highly appreciated by them.

Start considering a filter once you try to get new projects. I do not handle any project that I receive. Usually I filter projects using some questions and restrictions to certain technologies, because I know that they will meet my skills, and I have at one’s fingertips that they will not be an obstacle. The main used filter the technical skills level of the project manager that wants to hire me. There are some pseudo-technical project managers that have no idea about programming and the required effort to build a product.

Another trick is to handle projects paid with hourly rates rather than fixed price projects. Hourly rates are almost the best option that I can handle. Fixed price projects are a problem, even if the requirements are pretty clear, they are always wanting changes, if they are not so good negotiating, they will accept any new changes without charging the proper bid, devaluing the project cost and your work. With hourly rates you really get what have your worked, and if you are a really skilled developer, that will not be a problem for your customer, instead to be a problem they will like that they will have the same requirements in less time that they think. So, if you are not skilled negotiating requirement changes, do not contact me…


© Daniel Molina Wegener for coder . cl, 2012. | Permalink | No comment | Add to del.icio.us
Post tags:

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)

]]>
http://coder.cl/2012/10/side-projects/feed/ 0
the problem with web development http://coder.cl/2012/10/the-problem-with-web-development/ http://coder.cl/2012/10/the-problem-with-web-development/#comments Sat, 06 Oct 2012 15:17:57 +0000 Daniel Molina Wegener http://coder.cl/?p=2858 If you are a programmer, you are probably working on web development. Almost every application that is being launched to the market is a web based application or a mobile application with a background web platform supporting it. From that point, almost every job option related to software development is strongly linked to web development, and I think that the web development market is a little bit messy, mainly due to the lack of technical knowledge of people that are hiring developers. Just naming the required technology enough times to make your resume to pass the filter in the job position is a good start point to getting hired. Is that enough to meet the job requirements?. On software development experience is not so required, and seems to be strongly required by some companies hiring developers.

Then you have people naming the required technology as many times and many years that position requires, but do they really have the required skills and required knowledge?. I have seen some resumes filled with technology names and languages names arguing strong experience with them, but nothing related to concepts, and the same applies to job positions. So you have hiring announces with the same message pattern everywhere: “we need people experienced with technology-name-here. Also, those announces are avoiding people that can make a real difference with their current programmers, because they have pretty clear programming concepts and they will be able to learn that required technology as fast as they have passed the hiring process — even if they are not experienced with the required technology.

The theoretical background of the programmer matters. With the proper knowledge, the programmer should be able to learn any programming language that is being used on the market. A good programmer should be able to jump from Python to Java and backward, without any course, just few books related to the used technology. I have several resumes, because I am a skilled programmer that can handle several programming languages, so I have a resume for the Enterprise Java market, another for Embedded Systems market, and so on. If I place every language that I know in one resume, the required technology for that job position will not be named enough to make it pass the filter in the hiring process.

No matter from where comes the programmer, his breath in programming practices is what makes him a good programmer. Someone with a strong lack of interest on programming will not be as good as someone with real interest in programming. All is about programming, is the main task on software development. Someone without programming knowledge cannot build a good software design, because it will lack consistency related to the technology and environment. Also, will not be able to manage a project because he lacks the proper technical knowledge to cover a good design and programming practices, and programming is about continuous learning because everything is changing constantly, but the basis has been the same from the elder stages of software development.

So, I agree with the idea of proving how good a programmer is. Which method do I use to test a programmer? I ask for open source projects because I want to see his source code. If he does not have an open source project, he should have a side project, and he should be able to show me some library file with something impressive. Once I see his source code and resume, I start evaluating his theoretical knowledge through a conversation, just to check the clarity on some programming concepts — I am not interested on how many years of experience does he have, but I want to check that he will meet the requirements — and then I will start doing a live programming test. So he can show me his screen through Skype, TeamViewer or another similar application and will let me know how good is solving programming problems, having a conversation about the programming solution and check the applied concepts. Experience is not required, but deep programming practices are a must.


© Daniel Molina Wegener for coder . cl, 2012. | Permalink | No comment | Add to del.icio.us
Post tags:

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)

]]>
http://coder.cl/2012/10/the-problem-with-web-development/feed/ 0
type safety is not security http://coder.cl/2012/10/type-safety-is-not-security/ http://coder.cl/2012/10/type-safety-is-not-security/#comments Tue, 02 Oct 2012 11:58:17 +0000 Daniel Molina Wegener http://coder.cl/?p=2840 Standar ML is defined as safe using the following definition «ML is safe, in that a program that passes the type-checker cannot dump core, access private fields of abstract data types, mistake integers for pointers, or otherwise “go wrong.”». A type-checker verifies that each term used in the programming language should have the correct type once it is used. For example if a function is defined to receive an integer type, once it is called, an integer term should be used, otherwise the compiler may throw an error and the execution “goes wrong”. If the type-checking algorithm accepts the program, then it is well-typed. When a programming language has a type-checking algorithm on its compiler, we call it statically-typed. Dynamic typing does not have a type checker on its compiler, you can write the same function, it will not have any sentence defining an input type, and it will be able to receive a string when an integer is required.

Static typing have its basis on the “Semantic Soundness Theorem”. This theorem states that an environment p is on the domain of the type environment Γ, where each variable x in p respects the environment Γ. Then, if an expression e has the type τ in the environment Γ and the environment p respects Γ, the expression e in p has the type τ. In other words — if you have experience with Haskell or Standard ML — once you create a function of type τ, the function as expression should have the type τ. Seen from another perspective, if you define a function prototype in C as double f (double x), the type-checker will not allow another type than double.

There are two types of soundness, where we have weak and strong soundness. On weak soundness we can do some tasks like type casts, with strong soundness we cannot. On Java we can type cast returning values to another type, and the compiler will allow that. On other languages, like Haskell, type casting is implemented using its type system, but we cannot type cast variables using expression built in the compiler, because the type system uses strong soundness and does not have type casting operators, and each compile time error has a type, on Java each non related type — which is being type casted — does not have its own type. On strong soundness each variable and expression is strictly bound to a type within an error with the wrong type.

Java is not type-safe because it allows a very powerful way of organizing the type-space at run-time (through user-extensible class loaders ). This power can be utilized to write a program that exposes some flawed design decisions in the Java Virtual Machine. Specifically, one can produce a class A and an associated ersatz class A’ which can “spoof” A: its name N is the same as A, but it defines members (fields and methods) arbitrarily differently from A. A “bridge ” class B can be defined which delivers to a class D (for which the name N is associated with A’) an instance of A. D can then operate on this instance as if it is an instance of A’, thus violating type-safety. [Vijay Saraswat, “Java is not type-safe”].

We can have type safety implemented on the compiler using a type checker in compile-time, like Java does. Seems that it is not entirely safe on run-time, due to the research quote above. But seems that languages like Haskell are type-safe languages in compile-time too. But can you ask yourself what is the scope of type-checkers and its type-safety?. For me type-safety aims to be the correctness prover for each program. Like Agda and Haskell does, “a proof is a program; the formula it proves is a type for the program”. So, safety is not strictly bound to security, and it just defines the correctness of the program, not its environment.

I wanted to see how great Haskell’s static typing is, so I ran darcs under an LD_PRELOAD library that had a hacked open() call. [Zed Shaw, Twitter Quote].

Type safety just brings correctness, not security. Correctness provides security — in example a string cannot be used as integer — but not provides a full security layer, and we can define that type safety brings security in terms of correctness, and not its environment. Once a program is compiled, we cannot control its environment. With some very reduced set of examples, like Plesk. For example on not so early stage as web developer, I had a problem with Apache in the compiled version inside Plesk, giving me a core dump due to some Unicode characters on a configuration file, so I have tried to use the well known Linux strace(1), I have noticed that Plesk binaries were not allowed to run with the processor debug flags enabled. That is a way to control the environment, but I certainly cannot imagine a run-time enabled type-checker. What should be verified? Each variable?, Each function parameter?.

Although verification of type safety is not mandatory to run managed code, type safety plays a crucial role in assembly isolation and security enforcement. When code is type safe, the common language runtime can completely isolate assemblies from each other. This isolation helps ensure that assemblies cannot adversely affect each other and it increases application reliability. [Microsoft .NET Framework 4.5, “Type Safety and Security”].

I cannot expect that type-safety will bring me security. It only brings correctness in some manner, and the provided security only defined in terms of program correctness, rather than environmental. That is the common approach and I agree with it, we cannot expect that each program in our operating system keeps checking its environment and searching for flaws, that is a little bit weird and paranoid.


© Daniel Molina Wegener for coder . cl, 2012. | Permalink | One comment | Add to del.icio.us
Post tags:

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)

]]>
http://coder.cl/2012/10/type-safety-is-not-security/feed/ 1
everything is about programming http://coder.cl/2012/08/everything-is-about-programming/ http://coder.cl/2012/08/everything-is-about-programming/#comments Sat, 04 Aug 2012 15:28:00 +0000 Daniel Molina Wegener http://coder.cl/?p=2651 There are some myths about programming and development methodologies. Among several of those myths, the one that makes laugh a lot is that one that claims that “you do not need skilled programmers to build successful software”. I really cannot imagine a team of non skilled programmers doing a successful application. Most myths are claiming that “the used methodology and management is more important than having good programmers”. Then CMMI, Agile, and several points of view about developing applications and systems are applied daily in software development. But more than the methodology itself, the fact that communications and skilled programmers are making great teams, cannot be denied.

Actually I work on a company where we are using several parallel and distributed algorithms to process data related to telephonic applications, and another company have hired me to build an Industrial Control System. On both we are using almost all theoretical basis that I have, and they are required to understand how the software is being programmed. I am very glad to work on companies where both technical and theoretical knowledge is used.

I will cite an example again. On the past, I have worked on a company using a web server to distribute data. A new foreign programmer have been integrated into the team. One of his first tasks was to build an algorithm to delete the cache on a Berkeley DB set of files. His implementation was a plain request to the web server, and once the request have arrived to the server, his algorithm was launching several threads to clean-up the set of files. Due to the Linux threading model, each thread was a copy of the original process, very similar to a fork(2) call and the memory of the web server was consumed quickly with several requests, with the obvious behaviour of launching the OOM Killer, interrupting the common server function. The CEO then call me to repair that algorithm. We were using Gearman as job queue, and I have re-programmed the threading server response as Gearman job, and enhanced that algorithm reducing its processing time from 22 minutes to 4 minutes. To work as programmer on any kind of system — I do not mean a content management system, where all calls are almost plain — you need to have a deep knowledge of the platform where are you working, mainly if you will start using distributed and parallel processing. Here the lack of knowledge about the Linux threading model and how the web server was working, have caused a big problem on the overall process. And we were using Agile methodologies, and that programmer was not a good programmer. Finally we have lost one night of data processing, I was busy on that process one day, and my schedule for other important tasks was delayed, including several milestones.

So, all those methodology facts about not so good programmers doing successful software are just lies, due to my experience as programmer. Are mere marketing tricks. Also, the lack of a proper knowledge means that you cannot communicate requirements, solution specifications and similar daily tasks required to build really successful software.


© Daniel Molina Wegener for coder . cl, 2012. | Permalink | No comment | Add to del.icio.us
Post tags:

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)

]]>
http://coder.cl/2012/08/everything-is-about-programming/feed/ 0
finding good programmers http://coder.cl/2012/07/finding-good-programmers/ http://coder.cl/2012/07/finding-good-programmers/#comments Sun, 01 Jul 2012 23:00:26 +0000 Daniel Molina Wegener http://coder.cl/?p=2559 Finding good programmers or programmers above the average is a little bit hard. Most programming schools are only doing a review on the two main branches of programming paradigms, using the most frequently used branch called imperative programming which is mainly focused in object oriented programming. Is that enough?, I am not finding guilty and I am not interested on that subject, because I have learnt functional programming and procedural programming mainly using books, both technical and theoretical, among other stuff like reading code — mainly learning from FOSS projects and its source code. My interests have been saving me for years as developer, because I am always improving my skills and there is always something new to learn about.

I am always seeking new books and knowledge, so I am frequently reading books, blogs, magazines and related stuff. My interests are deep, and for me is usual to deal with technical documentation and similar stuff, even the approach is entirely theoretical I do not have problems understanding that kind of writing. A recent example is ProView, an open source Industrial Control System framework which is being documented only with reference manuals and some tutorials spread along the Internet. But I have learnt its internals and the project where I am working is using almost all features of that framework, including custom device classes, I/O classes, graphical components and device components. There are not online courses, training and similar stuff, only few European organizations are providing training for that system.

For someone like me, finding jobs is something ridiculous in some instances. Many jobs are requesting certifications and similar accreditation. I have learnt assembly language, C, C++, Haskell, Promela, among other stuff without any training help, just reading and practising programming. Who needs certifications with that capacity?. If you are not interested in your career and your profession, you will never reach a good level. If any accreditation is required in your current job, and your company needs more programmers, just keep finding people that needs training courses to learn, I am not interested in your job offering. I can bet that your certificated programmers cannot think on building a list searching algorithm without looping instructions (for, while, do-while) and using only recursion.

Despite the frustration of dealing with that kind of job positions in past years working as Web Developer, for both the Enterprise and small companies, I think that starting this blog and releasing some source code as FOSS developer has served me to release myself of many prejudgements. You can see my LinkedIn profile, my FOSS projects and the stuff that I speak on this blog, if that is not enough to get conscious about my ability as programmer, I think that you are wasting your time. I have a very strong basis on programming due to my interest and I can learn almost anything only reading.


© Daniel Molina Wegener for coder . cl, 2012. | Permalink | No comment | Add to del.icio.us
Post tags:

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)

]]>
http://coder.cl/2012/07/finding-good-programmers/feed/ 0
is programming for everyone? http://coder.cl/2012/06/is-programming-for-everyone/ http://coder.cl/2012/06/is-programming-for-everyone/#comments Thu, 14 Jun 2012 14:23:31 +0000 Daniel Molina Wegener http://coder.cl/?p=2532 This seems to be a huge discussion. There have been a long time companies trying to create the ultimate programming language that can be used by almost anyone, with many fails thought. The closest attempt to success, is just to keep people more interested on how to make better applications and make them to try other programming languages harder to write, also keep their interested in more complex topics. Seems that there are two forces, one trying to keep people interested in deep knowledge about programming with a good theoretical background and other one to keep people ignorant, just trying to make their life easier, but not at all, mainly once they face complex problems.

I have seen the following comment about certain technology in a mailing list.

[…] allow to better focus on the business logic of the system, rather than of worrying about the code itself […]

I really cannot imagine someone does good programming without care about the code. Humanity still require too much research on both natural language processing, linguistics and algorithms to reach that greedy goal of having a programming language that anyone can use. Mainly because systems are becoming more complex and distributed along the time. Still the classic P = NP is not solved, so we are solving many complex problems using parallel computing and distributed computing. So, you should start caring about what is being used, as we see many systems that were used only the corporate environment — like message queues and job queues — in applications that are common in our life. You may say that Facebook uses PHP, but do you know that they are only using PHP as their code base and it is really a variant of PHP?. They do not use the Zend Engine, they are using HipHop PHP.

How many web sites are written in PHP being cracked per day? Every five seconds a site gets cracked. I can guess that most of them are written in PHP, but they are open source applications like WordPress, Joomla and similar ones, which are subject to malicious attacks due to poorly programmed extensions and wrong configurations. Do you think that you must not take care about the code?. Another example is the fact that there are is a common error that is present everywhere — where the type system is not strong-static — that is the null reference.

I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn’t resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years. [Hoare, Tony (2009-03-09). «Null References: The Billion Dollar Mistake»]

On the standard PHP implementation a null reference can lead to a single run time error or exception. Do you know what happens on C and C++ code with null references? Can you imagine what can happen to your application if you pass a null reference in HipHop PHP? Do you think that you must not take care about the code?. Some tools that can help are static analyzers, on Java you have various open source static analyzers, like FindBugs, PMD and CheckStyle. On C and C++, also you have various tools doing that job, like Splint, Frama-C among other ones like PVS-Studio. They can help you to avoid the null reference problem among other problems which are present on that kind of code. At the other side, Haskell with its strong-static type system do not have the null reference problem, because there are not null references in the language itself, you can use null references only declaring them using the Maybe Monad, which brings real type safety, avoiding some programming mistakes.

But not everything is related to how are the instructions placed in the code or logic errors. There are also design errors and mistakes. Someone with the wrong theoretical basis who must implement a workflow and does not have any idea about automata theory, will use if statements instead of dynamic programming and state machines, bringing messy, duplicate and very nested code. So, theoretical background is required to implement a good design.


© Daniel Molina Wegener for coder . cl, 2012. | Permalink | No comment | Add to del.icio.us
Post tags:

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)

]]>
http://coder.cl/2012/06/is-programming-for-everyone/feed/ 0
typing is not a problem http://coder.cl/2012/06/typing-is-not-a-problem/ http://coder.cl/2012/06/typing-is-not-a-problem/#comments Sun, 10 Jun 2012 17:05:16 +0000 Daniel Molina Wegener http://coder.cl/?p=2526 Typing is not a problem. We have many programming languages which are using dynamic typing. Dynamic typing is not so good as you can think. It allows you to do much stuff, where you can evaluate some expressions like (int)"1" + 1 = 2, without type errors. The problem with that kind of flexibility is the fact that there is no standard on boolean evaluations, leading to logic errors, and obviously to program failures. Even in some type-safe programming languages, they allow some stuff like that, there is C++98 and further versions allowing a wide variety of type casts, where any mistake on the casted values can generate logic errors and failures.

I prefer to see static typing and strong-static typing as a good feature, mainly strong-static typing. It avoids many programming errors. Please imagine a common example. We have a legacy system made on top of PHP, and we are migrating that system to Python, or even Node, you can find logic errors during the migration, so it is not so easy as you are thinking. The application which is subject of the migration is consuming a typed service, where one element received from the service is a string, but PHP has an automatic conversion to numeric types, but not Python, and even Node. Please run the following examples and see the result.

<?php // PHP code...
// comes a from the service as string
$a = "1.0";
// another element comes as integer
$b = 1;
// the application logic is adding both elements
$c = $a + $b;
// finally the result is 2
echo "{$c}\n";
 ?>

Then we migrate that logic using literals to Python and we get an exception with a dynamic type that is not so dynamic as you think. Just think what happens on logic evaluation level and the amount of logic errors that you can reach with such differences.

# Python code...
# comes a from the service as string
a = "1.0"
# another element comes as integer
b = 1
# TypeError: cannot concatenate 'str' and 'int' objects
c = a + b
# no result due to the exception
print(c)

In Node is not so different. Rather than getting the addition of 1.0 and 1, we get a string concatenation and not more numeric operations on that kind of strings. The amount of differences between dynamic type systems is huge, just try to make a boolean evaluation of empty lists or arrays in different dynamic type systems, some languages are evaluating empty lists as true and others are evaluating empty lists as false. Just take a look on this messy jungle of boolean evaluations in PHP. At least Python has a formal approach to its boolean evaluation and expression evaluation on its Language Reference on the Chapter 5. Expressions.

// Node.js / JavaScript code..
// comes a from the service as string
var a = "1.0";
// another element comes as integer
var b = 1;
// string concatenation rather than addition
var c = a + b;
// finally the result is "1.01"
console.log(c)

So, the messy world of expression evaluation in dynamic languages is not so fun as you think, there are huge differences between languages, there is no standard way on evaluating expressions, leading to type safety errors and logic errors that can generate various programming mistakes. I still prefer strong-static typing to build applications.

Also, you will probably find some interesting facts. If you are a category theorist, you will probably find that with the JavaScript approach on types you cannot apply some abstractions like Monads, so JQuery is not a Monad because it is bound directly to a type, and JavaScript cannot bind types. And even you cannot apply some typed lambda calculus combinators in JavaScript due to its dynamic type system, some times disallowing some β-reductions requiring explicit type conversion despite it has a dynamically typed system because you cannot get the desired type conversion, forcing the usage of K combinators and similar ones on its dynamic type system.

But even with static typing you can get logic errors. Just track the amount of errors that your favorite financial company has on its web system built on top of their cool Java technologies or NET technologies. That is why I prefer languages like Haskell, their strong-static typing system are really type-safe, bringing a better final result. Programming Haskell is slower than programming JavaScript, but it is real type-safety is meet.

-- Haskell code...
module Main (main) where

main :: IO ()
main = let a = "1.0"
           b = 1
           c = fromIntegral b + (read a :: Float)
           -- the result is the desired 2.0 as Float
           in print c

© Daniel Molina Wegener for coder . cl, 2012. | Permalink | No comment | Add to del.icio.us
Post tags:

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)

]]>
http://coder.cl/2012/06/typing-is-not-a-problem/feed/ 0