Ivo Georgiev's blog

Your favourite programming language

Great article explaining why you should learn MORE programming languages.

Why are so many developers so very emotional when it comes to their favourite programming language? 

I believe that the primary reason people feel the need to vehemently defend a particular language is that they are lazy. Of course, good programmers are always lazy (why else automate?), but this is a specific and very bad laziness - being too lazy to learn. If my favourite language is better than anything else, or maybe at least just as good as anything else, I don’t have to spend time and effort learning new languages.

My advice: start with the different paradigms. Once you get the main programming paradigms - imperative and declarative, and more specifically the following mainstream subsets: procedural, object-oriented, functional, you will have no trouble learning any language that exists in… like, 1 hour.


craftygrammarian asked: If I understand what you're saying, what if you took all of the operations done by each line, and made them into binary operations (i.e. x = 2y+3; ==> t=2*y;x=t+3, etc.), assigned each one relative weights, and then summed them? as in, for(i=0, i<n; i++){j++} is maybe weight(i=0)+weight(i<n)+weight(i++)+weight(j++). So your measure is somewhat absolute, irrespective of the value of n, but can be weighted to reflect that a[i] = $string.hash(); could be more complex of a call than i++;

Yes, that will work. However, even restricting yourself to basic imperative language structures that translate into binary commands, there is still more than one way to write an algorithm, and often they will result in different scores. 

However, it should work for the purposes of the question. The basic point that I had in mind was that an algorithm would run faster if it has more specializations, heuristics and conditions in general that assume something (but still allow for the algorithm to run OK if the assumption is wrong).

In the end, it boils down to: whether general purpose algorithms are smaller in terms of their complexity (which I assume to be true, although am not familiar with any theory that states so (I’m still in high school and never studied CS)), and, whether more specialized algorithms are faster.

Good examples of what I think to be “general-purpose algorithms” are brute force and evolutionary algorithms. Both can be, in fairly unmodified form, applied to a problem, almost without any purpose-specific modifications. They’re usually slow and simple. However, if a human designs an algorithm specifically for the purpose, it would be more complex in terms of it’s instruction set and it would execute faster.

Evolutionary/natural algorithms might at first, seem like an exception, since I have read about them being applied to problems which are difficult to solve with a specifically designed algorithm.



(Source: collegecupofjava)


A question to computer science students/computer scientists

Is there a law that links algorithm efficiency to (big O) to the complexity of the implementation?

I’ve been thinking, efficient algorithms are generally larger in implementation than simple ones (selection sort vs heapsort). If there was a more reliable way to measure the complexity of the implementation (the resulting program) than length (LoC) or any other existing method, this could have been tested.

EDIT: by a “reliable way to measure the complexity” I mean, in any language (language independent). Just to mathematically measure the amount of work that a program does.



adosia:

How I feel about my Java homework. Java


To people that develop mobile websites/web apps

Note that the “click” DOM event takes a lot to react on mobile devices. I have made some tests, it sometimes takes around 400ms which is practically tragic.

I stumbled upon this article http://floatlearning.com/2011/03/developing-better-phonegap-apps/ that might help you fix the 400ms click delay on mobile websites/web apps. If you implement this for desktop web apps that should also work on mobile devices, use a fallback to the click event since desktops don’t emulate touchstart/touchend.


Forget self-improvement

A very meaningful short article. Read it now.


One does not simply… delete a dalek

joshmbattles:

Via Dude,

Dear Java,

I don’t want to catch your exceptions. I’d rather have my program crash and burn with a segfault (1), but I’m not wrapping every piece of code in try-catch. Do or do not crash, there is no try.

(1) - not possible with automatic memory management but a great figure of speech.


Portability is for people who cannot write new programs”
-me, right now (with tongue in cheek)

– Linus Torvalds quoting himself
117
To Tumblr, Love PixelUnion