Monthly Archives: February 2014

Reader Mail – 02/16/2014 To 02/22/2014

fosamax commented on Will GCW Zero Deliver Their Kickstarter Handhelds?.
So things started to move again lately. Shipping resumed and I got a tracking number so I may see the GCW Zero quite soon. I hope I will like it anyway.

I'm still using a Xperia Mini Pro as my main phone. It's a great little device with a physical keyboard. The CPU is the same as in the Xperia Play so it's quite capable but it's only single core. It's quite enough for a bit of GBA on the go (games like advance wars play well with a physical keyboard).

MP commented on FSK Benchmark Test - C/C++ vs. Javascript vs. PHP.
Okay, Java is done. Here's the code.

It fared better than I expected. Runtime is 2.5 seconds. For comparison we have:

C++: 0.56 secs

Java: 2.5 secs

Python: 42.5 secs

So Java is only 5x slower than C++. Thoughts?

5x slower? That really is pretty bad. I've had people swear to me Java was at worst 10%-20% slower than C/C++. They were lying and/or stupid, as I suspected.

Of course, that isn't tuned Java, but I doubt you could tune it enough to overcome the 5x deficit.

So the winner for languages other than C/C++ is Javascript? With only 2.5x-3x slower than C/C++?

I'm really souring on these higher-level languages now that I performed this benchmark test. I always knew it was a little slower, but 5x-40x slower is not acceptable.

Some people will say that for I/O bound operations it doesn't matter as much. Number-crunching is my specialty, so it certainly matters for the stuff I typically write.


I put your code in the ftp directory (in case you ever take it down from your site).

MP commented on FSK Benchmark Test - C/C++ vs. Javascript vs. PHP.

My comment didn't come through quite right. I tried to italicize the "only" -- as in Java is "only" 5x slower. I did look into profiling the Java code, but I was less than impressed with JVisualVM, and it didn't prove useful.

Thank you for putting the source with the other examples. If you can, I think you should run all of the samples on the same machine to get better numbers for comparison.

I'm kind of thinking I should put together a C# implementation to compare with .Net. I'd expect it to be on par with Java (possibly slightly better -- IIRC it's better about native types than Java, but I haven't kept up with details like that in a while).

Your score for C++ is close to mine, so I'm confident in the others. I've had bad experiences with Java messing up other things, so I'm not that eager to install the Java SDK on my PC.

5x worse is pretty bad, considering how many people told me Java was "the same" performance as C/C++.

I wonder how older languages would fare, like FOTRAN, COBOL, and Pascal? Those were also written relatively close to the metal, so I think they'd do well.

MP commented on Whatsapp And Mark Zuckerberg Steal $19B From Facebook Shareholders.
The only reason this is dumber than Google's Nest buy is the price. There is no way the app is worth $19B. The only time I've heard of it was when a coworker figured out WhatsApp was killing his Galaxy S3 battery.

I've noticed that on Android. Something that runs in the background can really drain your battery, even if your phone is locked and the screen is off.

If a program runs in the background with frequent updates and push notifications, it can drain your battery AND your data.

What I do now is reboot my phone whenever I'm done, which flushes things that would otherwise be running in the background.

[Apparently the newest version of Android PREVENTS APPS FROM WRITING TO THE EXTERNAL SD CARD. That seems to be another effort by Google to force people to use cloud storage like Google Drive.]

MP commented on Whatsapp And Mark Zuckerberg Steal $19B From Facebook Shareholders.

The external storage issue is more complicated, and I don't know how I feel about it. There are reasonable arguments for why blob of storage should be available for any program (I use different audio players, etc.), and also reasonable security arguments for why programs should be separated.

I'm just bummed at how limited the external storage market has gotten. All the phone vendors except Samsung seem to have given up on them, and then make you pay an extra 100-200 dollars for a measly additional 16 to 32 GB. Meanwhile I picked up a 64GB MicroSD card for my Galaxy Lite (a $150 non-subsidized phone). My only requirement for a phone was 1) external storage available, and 2) removable battery. How hard is this for manufacturers to figure out?

Saurabh commented on Whatsapp And Mark Zuckerberg Steal $19B From Facebook Shareholders.

Whatsapp is quite popular in India. And not because bunch of indians were paid to use it. Majority of the mobile users in India use prepaid and before Whatsapp we used to pay for unlimited SMS plans every month. Due to the surge of cheaper Android handsets, as well as cheap data plans, most of the users now prefer Whatsapp over traditional SMS (also because it support longer messages, images and videos). That being said this buyout is quite ridiculous if facebook thinks it will help users turn to use facebook messenger. Whole point of prefering Whatsapp over facebook was that you don't have to fill lots of details about yourself before using it, your phone no is your username and your contacts are your friend list.

That's the reason to limit the external storage. Why let people use a removable SD card, when you can charge them $100-$200 more for an extra 16G-32G of internal storage? That's been a huge profit center for Apple, charging people a lot more for a little extra storage.

You should be allowed to give an app unlimited access to external storage, if you want. It's your phone! Almost every app I use writes to external storage! (text editor, emulators)

I'm considering switching to T-Mobile. The phone isn't subsidized, but it's more than offset by the cheaper monthly cost. Plus, if I keep my phone more than 2 years, it winds up cheaper.

I miss the physical keyboard on my Droid 3. I didn't get the Droid 4 because it didn't have a removable battery. Do you realize how many times I had to take out my phone's battery to reset it due to an Android OS bug?

I would try something other than Android or iPhone, if there were a viable alternative. Maybe ubuntu phone will be good, but I'm skeptical.

American Idol Cruelty To Contestants

My mother was watching American Idol on Wednesday, and I noticed that it was particularly cruel to the eliminated contestants.

I already commented that American Idol uses Auto-Tune. I’m able to hear the difference now. I noticed it when I thought that the rejected contestants sounded better than the accepted ones.

Most current pop songs on the radio are auto-tuned, so audiences are conditioned to believe that an auto-tuned voice is good and a regular voice is bad. So, when American Idol’s producers favor a contestant, they auto-tune them, and when they disfavor a contestant they don’t auto-tune them. It’s reinforced when the judges sharply criticize the non-auto-tuned performance.

Without auto-tune, the people who are the best singers are overweight, like Pavarotti. With Auto-Tune, singing ability is irrelevant and stars can be picked solely based on appearance. Also, since the star has no real talent other than the marketing hype, they can be discarded and replaced in every few years when they realize they’re being exploited.

There are several places where American Idol is cruel to contestants. The audition phase is cruel to some of the non-picked contestants that the judges ridicule. Why would someone who’s such a bad singer audition for American Idol? The answer is that many of them are decent signers, but they look bad when they’re not auto-tuned and the judges ridicule them.

On Wednesday’s show they did something particularly cruel. They had 20 contestants waiting, only 15 of which would get a chance to sing. The other 5 were already eliminated, but the judges made them sit there and wait.

That was cruel. The audience gets to see the people excited when they’re picked to sing. However, it’s really cruel to the people who were stuck sitting there waiting all night, when the judges had already decided they were eliminated.

Whatsapp And Mark Zuckerberg Steal $19B From Facebook Shareholders

Facebook bought Whatsapp for $19B in cash and stock ($16B buyout and $3B in incentives for the founders to stay with Facebook post-merger). Seriously, that is not a joke. I thought the headline was a joke when I saw it. It’s for real.

Allegedly, it’s a valuation of $40 per user, similar to other deals.

Has anyone here ever heard of Whatsapp before the deal was announced?

Allegedly, most of Whatsapp’s users are in other countries, especially India. Allegedly, that’s the reason Whatsapp sold for so much money, even though most people in the USA never heard about it.

The deal is obviously stupid. This is going to end up like almost all mergers, where they mismanage the acquisition and in a few years all the users leave for a competing product. (One notable exception is YouTube, which is subsidized by Google’s other revenue. One reason a serious YouTube competitor hasn’t emerged is the huge cost of storing and streaming videos.)

Whatsapp has usefulness for at most a couple more years, even if it would be managed well. In a couple years all phones will have a built-in app that does messaging as well or better.

Also, the valuation of $40 per user doesn’t make sense when most of the users are outside the USA, especially in 2nd and 3rd world countries. Facebook makes money from advertising, and advertising to US users is much more valuable to 3rd world users.

Mark Zuckerberg and his backers have special super-voting shares in Facebook, which gives them control of the company even though it’s public. That prevents an “activist investor” from buying up Facebook shares and trying to prevent them from wasting money. Besides, Facebook makes most of its profit off hype and not a legitimate revenue stream, making it unattractive for a typical leveraged buyout. With special super-voting shares, it’s easy for insiders to squander shareholder money on frivolous buyouts.

Given that most of the users are in India, there’s an obvious conspiracy theory. Pay a bunch of people in India $1-$5 each to install the app, then flip it to Facebook for billions. Easy money! (There is one indirect legitimate benefit. Some cell phone plans charge less for data than for text messages, making it a legitimate savings if you use an app instead of text messages. However, most US smartphone plans include unlimited text messaging now. The cost to the cell phone company per text message is negligible. Any data plan benefit to using an app instead of text message is temporary at best, as data plans and text messaging plans improve.)

The founders and backers of Whatsapp swear they didn’t pay for user acquisition. If you believe that, they’ve got an overpriced startup to sell you.

There’s another conspiracy. Allegedly, the same group of insiders control Facebook and Whatsapp. The buyout enables a $19B wealth transfer from Facebook shareholders to Whatsapp’s shareholders and founders. It’s the usual trading favors game. Whatsapp’s backers get a lot of free money, in exchange for unspecified favors later. Facebook is nearing the end of its pump-and-dump lifespan, so milk the shareholders while you can.

The $19B isn’t free money. The cost is dilution for the current Facebook shareholders. The share price of Facebook will tank as insiders dump their overpriced shares on unsuspecting suckers.

Even when the Whatsapp buyout inevitably flops, there will be vague excuses and no accountability.

There’s another theory I heard. Whatsapp owns some patents, presumably the usual type of junk software patent that should never been issued in the first place. Allegedly, Facebook is buying Whatsapp for these patents, either defensively or so they can sue others in the future. Most software patents are things that would be obvious to any software expert in the area, but what counts is the ability to manipulate the legal system. Patents are legal extortion. Facebook might be buying the right to engage in legal extortion in the future, or prevent from being the victim of legal extortion.

This is such an obviously stupid deal that I thought the headline was a joke. It is possible that people in other countries were paid to install and use the app, inflating the numbers. It certainly would cost much less than $19B to buy a bunch of users. The deal is a huge wealth transfer from Facebook shareholders to Whatsapp shareholders. If you were dumb enough to invest in Facebook, you deserve to get robbed.

Reader Mail – 02/02/2014 To 02/08/2014

hgaverin commented on node.js Is VB6 - Does node.js Suck?.
He tells his mentality by bragging about using "[whatever].net". I remind you that .net languages are JIT compile based. Just In Time, compile based means that the raw code is ALWAYS available in UNCOMPILED format for ANYONE to edit or steal. He mentions C++ and VB6, two old languages that are fully able to compile into stand alone executables; and two old languages that are very (read “VERY”) easily multi-threading. C++ is radically powerful. VB6 was designed for Rapid Application Development which can expedite a business’ adapability efforts to changing market environments. Both are fully able to be compiled into stand alone executables, with NO raw code available to ANYONE except the development team. He should have stopped there. But, no, he went on to brag that he was now into coding in ".net" . Then he cursed the users of other languages that he (openly and clearly) pre-stated to not understand sufficiently for a valid boolean response. For him to say that he does not follow the latest trend, and then to brag about using any language that is .net is a reversal of logic. He also went on a rant about mult-threading: If you know how, it can be fairly easy in many languages. He seems to find the tendency of node.js to be single threaded and thus a challenge maybe. Ask someone else for help and adjust it to multi-threading. Industry does not run on crying and whimpering, but rather on self-drive to find solutions, implementing those solutions, and moving on.

I mangaged to read quite a lot of the responses, eventually skipping over the original author's because they approach null, and I thank you others for some insight into other languages. I like C++. I like javascript (and many of its spun off variations).

It is often the programmer (or programmer wannabe) that creates much of the problems in many (probably not all) programming activities. If you have a problem with a language, maybe another language will fit you better. Do not hate someone else that is less or more than you in skill. Do not despise some else that has not acquired your hours of (maybe) experience.

In the past I have cried because of difficulties. Therefore I cannot fault the author for crying about node.js . I can say that he should now try something else. Get a handkerchief, blow your nose, write your own library base to help yourself in your programming endeavors, and move on.

snuprs commented on Design Patterns Suck!.
Another hilarious thing about design patterns is that they encourage developers to repeat themselves.

Whenever you have a recurring "pattern" in your code, you're supposed to factor that out into a method or subroutine or whatever.

But in the case of "design" patterns, they encourage you to do the same thing over and over. It's cut and paste for the ADD generation.

It's fricking hilarious.

I'd like to see someone take the algorithm from this post and do a Java version. I expect it to have performance close to the Javascript version.
fosamax commented on Will GCW Zero Deliver Their Kickstarter Handhelds?.
Lately, the GCW Zero KS turned out to be a SCAM, at least for european backers, since no update was made for more than one month and there are still a lot of Zero to be sent.

So the answer to your question is GCW will not deliver their kickstarter handheld. Period.

Or prove me wrong.

Really? I thought they got their act together and were finally shipping them? Do you have a link/source?

I'm really interested in things like iControlpad, Pandora, GCW Zero. I'm never going to fund any of them through pre-orders or Kickstarter. There's too much risk. I'm only ordering from stock, if I ever do.

fosamax commented on Will GCW Zero Deliver Their Kickstarter Handhelds?.

Just take a look at latest KS comments.

I'm still hoping to be proven wrong but lately things seems to turn out pretty bad.

No updates. No replies to email from the available contacts. No way to get faulty devices fixed. The last sign of life from Justin Barwick is the GCW Zero facebook profile.

Maybe shipments are still on the way but why on earth that lack of communication ?

I totally agree with you that ordering from stock is the way to go. I was even able to get a refurbished pandora since the success of GCW Zero KS campaign.

I paid less for it than for the Zero I'm still waiting for.

I'm sticking with my Android phone as my sole handheld, for now. I'd like to see a viable competitor to Android/iPhone, especially one with a nice physical keyboard. It's going to be awhile still before that happens.

My Samsung Galaxy S4 has no physical keyboard. The physical keyboard was a nice feature that I miss from my Droid 3. The touchscreen typing isn't the same. I might have bought an iControlPad2 from stock, if that didn't turn out to also be a scam.


It does seem shady that stores like iThic have the ability to "order from stock" but the KS backers didn't get their units yet. The advantage of cheating preoders is that units sold on iThic generate $160 new revenue, but fulfilling preorders is just a waste of money. That's very shady. I don't see how any store can be selling GCW Zeros before all the Kickstarter units shipped.

PureWicked.AU commented on Will GCW Zero Deliver Their Kickstarter Handhelds?.

where do I start, I too ordered an SE, a KS and 100 units before KS started to resell here in Australia for here and the NZ market, not all has gone according to plan for me as many of you may be very well aware, after much jumping up and down I finally got half of my 100 units to resell, though I too would love to finally see my KS+SE units with T'shirts etc.. then I could wear them and people could ask me about the GCW Zero, I am still waiting on 48 units and 2 bonus pledge package things, I have lost many customers due to the time frame and of course the fact that later orders than me (ThinkGeek in particular) sold units to my customers though I was meant to have exclusive rights to the Australian, NZ market... so yes I'm pretty pissed off, if any Aussie's are after any please let me know..

Yes, there are two ways you lose from the delay, if you were planning to resell GCW Zeros as a business.

Loss #1 - Customers can buy their GCW Zero somewhere else. The GCW Zero team is selling units before shipping to you, undercutting your sales and stealing potential customers.

Loss #2 - Moore's Law - If the GCW Zero hardware was cool and current when it was designed, by now it's almost obsolete. A 2 year delay means the hardware is half as good compared to newer stuff. The longer the delay, the more attractive it is to stick with your Android phone or one of the newer Android handhelds with current hardware. For example, the current Open Pandora specs are very lame compared to what you can get from an Android device.

A fool and his money are soon parted. You got played.

My takeaway is "Don't back hardware projects on Kickstarter or via pre-orders. Wait until you can order from stock." There is some cool stuff that potentially could be funded, but it seems that scammers are dominating the preorder market. This is 3 scams I know about now, Pandora (not Kickstarter, but direct preorders got cheated), iControlPad2, and GCW Zero.


This looks promising, a GPD G5A.


Another amusing link for GCW Zero. They're trying to raise money on fundable now.

MP commented on FSK Benchmark Test - C/C++ vs. Javascript vs. PHP.
Last entry for Python. After doing some cursory profiling (using built-in cProfile) I made things more pythonic and made some minor performance tweaks (like using xrange instead of range, which is advised in Python 2.7 but not needed in 3.0) I reduced runtime from 60 to 40 sec.

I remain shocked at the Javascript performance.

What's a link to the updated version?

What I really want is a Java version, especially after all the hate on this post. I'm probably not doing it myself, because I don't want the Java SDK and runtime polluting my PC. I expect it to be comparable to the Javascript version. Many people swear that the Java version would run almost as fast as the C/C++ version, but I doubt it.

MP commented on FSK Benchmark Test - C/C++ vs. Javascript vs. PHP.

The profiled result is here.

I'll take a crack at the Java implementation. It shouldn't be too different from the C++ code, and I have the Java environment for Android tinkering. No promises on when it'll be done, but I too would like to see the comparison.

Since everything is compute + branch bound, I expect Java to suck. I guess the question is how much.

JJ commented on Another Argument Against noSQL.
'' People “prefer” MongoDB because they’re too stupid to set up a relational database and configure it correctly. '

I use SQL, I also use MongoDB.

Momma says I'm not not stupid like the post said I am.


Works for both far as I see it.

Then again, I'm not exactly splitting the atom at work either.

Momma says 'shut up'.

A brilliant argument. You totally convinced me that I'm wrong.

I see this comment thread is going to go like the node.js and Ruby on Rails posts.

It certainly is possible to use MongoDB and noSQL correctly. If you're using noSQL when you don't have many customers or much data, you're almost definitely doing it wrong.

Another Argument Against noSQL

I had an amusing phone interview. I asked what database they were using, and he said MongoDB and mySQL. I asked why MongoDB is better than mySQL. The clueless interviewer replied (paraphrasing) “Setting up a relational database schema is too hard! It’s easier to use a key-value store where you can just stick in arbitrary JSON objects.”

That’s amusing, and what I already suspected. People “prefer” MongoDB because they’re too stupid to set up a relational database and configure it correctly. NoSQL is most attractive to clueless twits. If your data has any kind of nontrivial complexity, such as needing joins, a relational database is better.

(Also, if you want a key-value store, you can have textblobs of JSON in a real database. However, it’s been a mess every time I saw it.)

The interviewer was also complaining about one of his “idiot coworkers” who preferred to do everything in C. He also gave me a technical test. I’m undecided whether I should do it, refuse, or never answer. I do want to meet the guy who likes to do everything in C. After having seen several different “modern”/inefficient languages, I’m thinking of just sticking with C/C++, and writing good libraries for whatever common tasks I have.

Businesses like Google, Facebook, and Twitter need their own custom database, which is some type of noSQL, due to their large volume of data. Your stupid startup isn’t Google. Stick with a real database, and when you get lots of users, then work on improvements (either optimizing your database or switching to noSQL for bottlenecks). People pick noSQL because they want to be “cool like the big boys”, without thinking if it’s appropriate.

Speaking of interviews, I had another amusing conversation.

Twit: What are your rates?
FSK: $X/hr
Twit: What are you getting paid now?
(I know it probably was a mistake to answer.)
FSK: $Y at one job, $Y+epsilon at my other job.
Twit: Oh, so then, if I offer you $Y+epsilon/2, then you’ll be happy!
FSK: Why would I switch jobs for an epsilon/2 pay increase? Do you think I’m an idiot?
[Also, given that I know he's going to be difficult to work with, there's no reason for me to compromise on rates. For $X, I'd be more willing to put up with his nonsense. Actually, $X is probably too low, given that I know he's going to be very annoying.]

Reader Mail – 01/26/2014 To 02/01/2014

Alexandre commented on Only Idiots Use Java For High Frequency Trading.
The only idiots I know are those who say things that doesn't know about. I have a Java implementation algo engine that has the same latency than a C++ implementation. It's much easier to built. It's using Java Real Time, there is no GC pauses for your information. People who says things like "C++ guys are smarter..." are the real idiots. Let them be idiots...

Alexandre commented on Only Idiots Use Java For High Frequency Trading.

Neither Java nor C++. The big players are using FPGA for developing HFT; other parts of system could be done with Java or C++, it depends. A lot of people doesn't know about Java Real Time. It could be used to build very low latency systems. The latency could be as low as with C++.

Anonymous commented on Don't Sign An NDA Before A Programming Job Interview.
Funny, a "major" real estate company asked me to sign an NDA for the interview. I declined. There was also a code assignment after an initial phone call (but before the NDA), not overly difficult and thus not a big deal.

Out of principle I don't want to be under an NDA, i.e. in a position where I cannot speak or act freely. Also the NDA covered confidential information that maybe wasn't even divulged during the interview. So basically, if I signed the NDA and ever used or talked about something that they considered their confidential information then they could pursue me in court. Doesn't that basically turn into a non-compete then? Adding further insult, the main HQ of the company is located in another state so if they were to pursue me in court, I'd have to appear in that (distant) state.

Don't sign NDA's for interviews.

MP commented on FSK Benchmark Test - C/C++ vs. Javascript vs. PHP.
I wrote a Python implementation at home. Here on a Core 2 Quad 2.4GHz I get a cpp time of about 470 ms per run, and in Python about 60s per run, or over 120x slower. I don't have profiling tools for Python, and haven't done any testing for correctness.

My python code is here. I kept as much of the original style as I could. I think your shuffle algorithm isn't robust in its randomness, but I kept the same algorithm (shouldn't affect timing anyway).

This should give you another data point at least.

Really? 60 seconds for one hand on Python? That's pretty awful. I'm glad I didn't waste time learning Python, especially with the 2.0 vs 3.0 fiasco.

Testing for correctness is easy. Compare the output to the CPP version! You can set the hand manually instead of letting it deal for you.

Actually, my shuffling algorithm is the correct one. Assuming the rng is fair (it isn't though), it will produce every possible hand with equal probability.

I did not do

for (i is 1 to n)

Swap i with random position between 1 and n

I did

for (i is 1 to n)

Swap i with random position between i and n

Mine is correct.

MP commented on FSK Benchmark Test - C/C++ vs. Javascript vs. PHP.

Re: shuffle algorithm--yes, I read your code wrong, my mistake. Using the % operator on a rand() result can add bias as well.

Re: Python, my version I tested on is ActivePython It should work in 3+ (though I could have used the // operator in 3+). Since I'm unclear on what typically exists in server environments, I left it at 2.7.

You may want to run my code on your platform to get more useful timing numbers.

That is correct, %n on rand is slightly wrong. If I wanted to be perfect, I should exclude the result when rand returns between MAXINT and floor(MAXINT/n)*n. It is a negligible error.

There are other issues with using rand(), such as the fact that it will repeat eventually. There are 52! possible ways to shuffle a deck, but rand() repeats before 52! hands are dealt. It is good enough if your goal is to deal sample practice hands.

60 seconds was convincing enough to me. 470ms per hand for the C++ version is close to the result on my PC, about 10% faster. I thought Python would do a lot better.

What I am convinced is that nothing beats C/C++ (other than raw assembly). I've heard people swear up and down that other languages are faster, but I haven't seen it in practice.

The other interesting test would be Java or .NET. I expect those would be worse than C/C++ also, but I'm not going to put the time in to try it.

MP commented on FSK Benchmark Test - C/C++ vs. Javascript vs. PHP.

If the process were I/O bound or had high overhead in malloc/free then I'd think .Net might have a shot. I didn't fully convert everything to "Pythonic" style -- getting rid of all globals, for instance, which might optimize better -- but I don't see much more gain.

It really seems to be a compute-bounded case, which is where C++ shines. Even techniques like JIT wouldn't be expected to help because you're processing random values, so the predictive branching can't get better each time you run through a loop.

I'd really be shocked to see anything beat well-written C++ in performance. The advantage of the other languages is primarily development time. I can crank out a Python script to convert data, etc. much faster than C++.

I believe that's why Rails works for many people--if your business model fits Rails precisely. I genuinely like the Ruby language, but community support seems to favor Python, which is why I adopted it as my primary scripting language (after Perl in the late 90s and Ruby in the mid-2000s).

As far as using rand() goes, yes the cycle is limited, but it's reasonable to test as proof of concept. If I were to write my own rand() function again I'd use a standard AES256 approach (crypto hashes are excellent pseudo-random # generators) rather than the old Mersenne twister implementation I used in a simulated annealing project from a few years back.

I find it pretty amazing that chrome js seems to be the best approach after C++. Kinda stunning.

If you want to write your own RNG, a better way is to take the XOR of your custom RNG with a standard RNG. If you XOR two independent RNGs, the result should be no less random than either of them. I thought about taking the XOR of several simple linear congruential random number generators with different periods, leading to a RNG with a VERY LONG period. I was looking for 256 bit and 1024 bit random number generators, but couldn't find anything decent.

Another advantage of writing your own RNG is in certain types of games, if you want to remember the state of the RNG.

My specialty is software that does calculations, which is why I still like C/C++ better than other languages. After doing lots of Javascript and PHP, I'm starting to appreciate strongly typed languages now that I did a little C/C++ again. The compiler errors in C/C++ are so much better than those in Firebug and PHP. For example, C/C++ will give an 'unused local variable' warning, which doesn't happen in Javascript and PHP.

The main reason is that, in C/C++, each arithmetic operation (usually) translates to 1 assembly instruction. For those other weakly typed languages, the interpreter does a lot of extra operations verifying the type of the object. Some older languages like FORTRAN and COBOL might outperform the 'modern' languages, because they were also designed closer to assembly.

I also don't buy that 'modern' languages lead to faster productivity. At one of my current jobs, they're using Javascript and angular.js. It takes them a couple weeks to implement one UI screen (and there's 3 people!), whereas I know it'd take me 3 days per screen using my choice of tools. Even worse, those twits can't implement anything without breaking something else. I guess Test Driven Development (TDD) is necessary if you're incompetent. The site is slow to load and crashes all the time. It's another doomed startup, mediocre execution of a mediocre idea.

Rails is useful if you're cranking out a toy demo of a stupid startup website idea. If you're writing something complicated, which is my specialty, Rails is more of a handicap than a help. A lot of these 'modern' fancy frameworks are useless if you try to implement something that isn't covered by the framework. At the same job, they're using D3. It's taking them longer for them to figure out how to make D3 behave the way they want and figuring out the correct D3 inputs, than it would take for them to just open a canvas object and draw on it directly. Seriously, it isn't that hard to open a canvas object, draw some axes, text, and your chart. Using a 3rd party library is another layer of indirection that makes the website slower.

It is surprising that Javascript/V8 crushed PHP and Python.

commented on Reader Mail - 12/29/2013 To 01/04/2014.
Hello FSK, what is happening with you? It's been a while since you last posted.

Yeah, I know. They took away the local train on the subway, so now I don't get a seat. It took away my blogging time.

I should get back to it, been too lazy.