News for hackers. Stuff that matters.
Re:Building OS X Apps with JavaScript by frik on Sunday September 28, 2014 @01:29PM (#8380321)
> the technologies I use don't have those paradigms.

Your language most certainly has a syntax for bitwise operators. If you want to optimize (speed up) your code, knowledge like that would help you.

Node/Javascript: https://developer.mozilla.org/en/docs/Web/JavaScript/Referen...

PHP: http://php.net/manual/en/language.operators.bitwise.php

Python: https://wiki.python.org/moin/BitwiseOperators

Ruby: http://calleerlandsson.com/2014/02/06/rubys-bitwise-operator...

Visual Basic: http://msdn.microsoft.com/en-us/library/wz3k228a.aspx

A linked list is a kind of (abstract) data structure (http://en.wikipedia.org/wiki/Linked_list). If you come in touch with a static typed language (C, C++, C#, Java) such knowledge is essential. In languages like JavaScript and PHP you usually just use an object or an array. You can think of an linked list as an array of objects.

Re:Building OS X Apps with JavaScript by protonfish on Sunday September 28, 2014 @03:21PM (#8380659)
Most of the optimizing I do has to do with DOM manipulation and replacing slow generic library functions with native and/or custom-written ones. I've got a lot of low-hanging fruit to pick before I get to things like bitwise operators. Most optimizations I've seen are very language-specific and it can be hard to guess what is faster. Which is why profiling and a tool like http://jsperf.com/ are critical.

By the way, from what I've read bitwise operators aren't very efficient in JavaScript because of the overhead of conversion from generic duck-typing to binary.

Re:Building OS X Apps with JavaScript by petercooper on Monday September 29, 2014 @04:20AM (#8382055)
You probably already know this, but your last sentence also has one minor advantage, in that you can use an otherwise pointless bitwise operation to strip off decimals, e.g. 100.919 | 0 .. => 100
Re:Building OS X Apps with JavaScript by collyw on Monday September 29, 2014 @12:15AM (#8381679)
I actually fond the most efficient solution to a problem recently (generating massive numbers of DNA sequence combinations, and checking for the number of mismatches between them) came from using MySQL and bitwsie operators. I tried Python, it was at least an order of magnitude slower. I tried Java, but that ran out of memory surprisingly quickly. I might try it in C at some stage but that will involve a fair bit more time.