American vision

New with Machine Learning algorithms.

The original article was published at:

A Tour of Machine Learning Algorithms by 

American vision

How did JavaScript and Node.js become popular for IoT development?

@Quora to How did JavaScript and Node.js become popular for IoT development? u  do not want waste PWR running while(true)  loop-> 4evr checks 4 values, u want system to tell u what happened & then u can react.

Answer by Johan Öbrink:

Two reasons:

Javascript is a fundamentally event driven language

IoT is fundamentally event driven. In that sense, JS is a perfect match. You do not want to spend precious battery power on running a while(true) loop that constantly checks for values and spawns conditional events. Instead you want the system to tell you when and what happened and then you can react to that.

Javascript is easy to get started with

This one should not be underestimated. We've had the possibility to build IoT stuff for ages now. It just hasn't been very easy for non experts. What's happening now is that this power is being put in the hands of everyone. This is through the standardisation of hardware, the reduction of cost and in the simplification of writing software. Getting started with JavaScript is a lot easier than getting started with C. So when it suddenly becomes possible to construct an "intelligent" fork using JS and some stuff from SparkFun, it's obvious that it's going to become popular.

How did JavaScript and Node.js become popular for IoT development?

American vision

What is a coder’s worst nightmare?

Answer on @Quora by @khashmeshab to What is a coder's worst nightmare?

Answer by Masoud Gheysari M:

This is not my nightmare, but something that happened to me in real life. When you read this, it will become YOUR nightmare from now on!

The situation:

  1. I'm a senior software developer working at a large software company,
  2. We write in PHP and use Zend IDE 4.0,
  3. The Ctrl key on my keyboard is kind of broken, sometimes it doesn't respond when pressed,
  4. I'm working on a large enterprise web application for a government project with an approaching deadline.

I got to work in the morning, turned on my computer and started working on a PHP file. I wrote thousands of lines of code, solved many unsolvable problems, and fixed many hard bugs. I had a super productive day. At the end of the day, I asked my boss and my project manager to see the result of my work. I, overflowed by Serotonin resulted from a good work day, presented everything on my computer while they were standing behind me and they got happy.

After they gave me the "nice job" look, I decided to save the file for the last time, commit the changes to our Visual SourceSafe server, and leave work. These all happened in 3 seconds:

  1. I tried to press Ctrl+S to save the file. But I mistakenly pressed Ctrl+A (select all) instead. The whole text of my file got selected.
  2. Once again I tried to press Ctrl+S. But since my Ctrl was semi-broken, this time I didn't press it hard enough and it didn't work. So, my whole thousands of lines of code got erased and got replaced by a single "s".
  3. I panicked. I pressed Ctrl+S once again, and this time it worked, and saved the new file contents (a single byte "s").

These all happened in 3 seconds. I tried to use Ctrl+Z to undo the last change. But as you may know, in early versions of Zend IDE, the undo function was implemented very badly. So it got me to the morning, when I started my work on the file.

There was no backup or SCM revision. I lost everything. I just wanted to cry, and cry, and cry… The good thing was that my boss and the project manager saw the completed work and witnessed the procedure of destroying my own work. I stood there for a few minutes shocked, and then I left work sad and depressed.

Needless to say, I got a new keyboard the next day! But I learned my lesson for life. Nowadays I always backup my work. I install Ditto (a very good open source clipboard manager program for Windows) and periodically "Ctrl+A, Ctrl+C" (copy all) my work into the clipboard just in case. I always use source control software (Git) and commit regularly.

Edit: some readers have suggested some ideas to prevent this problem, such as using Git, checkout in a Dropbox folder, use a better IDE, replacing my keyboard, etc. And they called me ignorant and unprofessional. So this is my answer:

  1. It was an unfortunate accident. It could happened even to Bill Gates, Steve Jobs, Linus Torvalds, Mark Zackerburg, etc. Even with the best keyboards, IDEs, source control software, etc. I mean if it's going to happen, then it's going to happen.
  2. This story belongs to 8-10 years ago. So no Git or Dropbox or advanced IDEs with features like auto backup, revisions, commits, etc. We even haven't had a stable internet connection inside the company. My monitor as a senior software developer was a 17" CRT monitor for God's sake!
  3. Zend IDE was the official IDE for the company. Visual SourceSafe was the official source control and Windows was the official OS. While personally I prefer using Eclipse (and Git and FreeBSD/Linux), I had no other choice than following the rules. Fortunately Zend IDE 5.0 was based on Eclipse.
  4. Replacing the keyboard is hard for me. I think more professional programmers understand me. Even a slight change in the keys placement, size, smoothness, … can highly reduce your typing performance and increase your use of backspace. So when my keyboard gets broken, I need to spend a lot of time to look for a good replacement.
  5. It's true that keyboards has two Ctrl keys and I could also use the Edit menu. But when you get used some patterns, you would use them without thinking. Also to press Ctrl+S, you use the nearest and easiest Ctrl key to S, in this case the left Ctrl. I don't think anybody use the right Ctrl or the Edit menu ever!
  6. The file I was working on that day was part of a huge proprietary PHP framework. The framework structure dictated how the files should be arranged. From time to time, we had no other way than putting thousands of lines of code in a single file.
  7. I'm a programmer for 20 years. I don't say that I'm too professional and nobody should ask my ways. But I probably have enough experience to know what I'm doing and is this a correct way to do something or not. This was an "accident". It had to happen.

Also: Thanks for the upvotes everybody. This is my highest voted answer to date. Keep upvoting and as soon at it gets to 1K, I'd edit this answer and add another story which I'm pretty sure you'd once again enjoy my bad luck! ;-) I'm pretty unlucky guy, so I can write a new story for each 1K upvotes!

What is a coder's worst nightmare?

American vision

If I want to learn data structures and algorithms, and properly at that, should I get started with CLRS right away? I’m totally a self-le…

Answer on @Quora by @thcormen to If I want to learn data structures and algorithms, and properly at that, should I g…

Answer by Thomas Cormen:

How's your math?  Are you good at understanding proofs?  CLRS is rigorous, and we prove correctness and running times for just about all algorithms in the book.  I often recommend my other book, Algorithms Unlocked, to start with.  AU has far less math than CLRS, but it focuses only on algorithms, not data structures.

If I want to learn data structures and algorithms, and properly at that, should I get started with CLRS right away? I'm totally a self-le…

American vision

How is Javascript used within the Spotify desktop application?

Answer on @Quora How is Javascript used within the Spotify desktop application? : JavaScript on top of C++ which handle files retrievals but JS handles GUI

Answer by Mattias Petter Johansson:

I would bet that the Spotify desktop client is among the top 25 most intricate uses of JavaScript in the world. The Spotify desktop client UI is completely built with JavaScript, resting on top of the same C++ core that the iOS and Android clients uses. The C++ core is responsible for things like playback, providing offline editing of playlists and local files, but rendering and interacting with the UI is handled by JavaScript. The communication between the C++ parts and JavaScript is done through a simple messaging interface simply called bridge. The UI itself is HTML/CSS, which is generated by Handlebars and LESS.

Spotify is internally divided into small (3-12 people) teams called squads. A feature is generally owned by a single squad, and during normal conditions the squad has all it needs to develop and maintain its feature. It's normal for a squad to have iOS, Android, web, and backend developers under its roof. The general idea is that every squad should have the ability to work on its feature pretty much on its own, minimizing the need for the squad to ask other parts of the organization for permission and/or help.

This organization structure, combined with the global-ish nature of JavaScript in the browser, has made us build the desktop client UI out of many small, self-contained web apps called Spotlets. They all run inside Chromium Embedded Framework, each app living within their own little iframe, which gives squads the ability to work with whatever frameworks they need, without the need to coordinate tooling and dependencies with other squads. While this approach has the disadvantage that we have many duplicate instances of different versions of libraries, increasing the size of the app, but it offers the massive advantage that introducing a library is a discussion between a few people instead of decision that involves ~100 people and their various needs. Not only would such a big discussion extremely time-consuming and hard, it would also force  us to use a least-common-denominator approach to picking libraries, instead of picking the ones specifically tailored to the problem domain of each squad. Considering the size of a single song compared to the size of a JavaScript library, this trade-off is a no-brainer for us.

The latest versions of all Spotlets are zipped and bundled with the desktop client binary on every release, assets and all. However, we can also live-deploy new versions of the apps into the running clients of users. This is very useful for emergency releases, but we can also release Spotlets to certain user groups, such as employees or designated testers only. We can even release apps that aren't originally bundled with the client, which is very handy during our hack weeks, allowing us to quickly get apps into the hands of non-techie decision makers in the company. After demoing your thing, you end off with "and now type this uri into the search field of your desktop client, to try it out with your own account!". This whole system was originally invented as part of the now-defunct Spotify Apps initiative, to support third-party developers adding functionality to the client.

While teams are autonomous, there is functionality that we all would like to share because we explicitly want it to work the exact same way in all apps. For instance, we have a CSS framework called GLUE. It was originally a fork of Twitter Bootstrap, but we've diverged heavily from that over time. Generic functionality such as some list and buttons, we also provide shared components for, but it's very easy for squads to just just templates, or just partially use functionality from the shared frameworks. It's important that squads are able to control their own reality and can pick the best solution for their problem domain, instead of having a company tool forced down their throats just because it's in-house.

We use npm extensively. We have our own internal npm repository where we publish internal modules, and we package the code together using a Browserify-like tool. npm has been magnificent for us. For the browser-specific testing, we use Mocha and PhantomJS.

If you like my writing, don't miss out on more of it – 
follow me on Quora and Twitter (

How is Javascript used within the Spotify desktop application?

American vision

Am I a mediocre software engineer? (see details)

Answer on @Quora by Eddie Offermann to Am I a mediocre software engineer? (see details)

Answer by Eddie Offermann:

If I received those questions, even modified to suit a language I code in a great deal (I do very little C#), I'd probably look blankly at them for a moment and excuse myself from the interview, knowing they were looking for a different person because if they were looking for *me* they'd be asking a different set of questions. I wouldn't ask these sorts of questions in an interview – they tell me almost nothing about what your actual abilities are as a software engineer. It's as if you were being hired as a copywriter and the interviewer started asking you about pluperfect tense verbs and relative clauses. It tells me if you know the language and the terms used to describe it, but little about how you'd actually write. A different interviewer would quite possibly see you very differently with a different set of questions.

What I'm saying is – you may or may not be a good software engineer. You obviously aren't conversational about some straightforward C# structures and terminology – but I don't even find that to be unusual. A lot of us can't talk for crap and it has little or nothing to do with our ability as engineers. This company, however, may really need you to be quite verbal and very conversationally familiar about technical aspects of C# and OOP in general, irrespective of your ability when you're actually writing.

Now, if you've genuinely done very little, you may not meet their expectations for this job – and with only two years of experience, you probably *are* mediocre. I think I'm great but at this point I'd better be – I've probably been programming since before you were born, as have many of the people you'll end up working alongside if you haven't already. When I'd been doing this for two years, I'm pretty sure I sucked.

If they're looking for someone with a lot more experience, there's nothing you can do but to keep working elsewhere. You had a bad interview. Learn from it, keep working, keep coding, keep getting better, and you'll have better interviews.

Am I a mediocre software engineer? (see details)

American vision

Am I a mediocre software engineer? (see details)

#Experienced? @Quora  Am I a mediocre software engineer? or the interviewer sucked lemmons(see details)

Answer by Clay Loveless:

As others have said, it might be worth considering his suggestion.

But here's what I can tell you: I went to college to study acting. I learned programming (hacking HTML and perl scripts in the mid-90s) on my own because I didn't want to go the typical starving actor route of waiting tables.

Oh yeah: I started getting "serious" about learning things like OOP when I was twenty-nine.

I had interviews like the one you're describing. I don't have a CS degree, and still have to look up words like "polymorphism." I still think "transmogrifier" every time I come across it.

Despite all these alleged shortcomings, I have started and sold two SaaS businesses, am now an advisor to several other SaaS businesses, and am working on a new one of my own.

I'm probably a mediocre coder too. But if you ship, and it works, and customers pay and are happy, who cares?

F that guy. Code on.

Am I a mediocre software engineer? (see details)

American vision

Is front-end development a dumb thing to learn?

Answer @Quora: Is front-end development a dumb thing to learn? Something to consider if u r aspiring 2b a developer

Answer by Rahul Dogra:

One of the major demands of a front-end developer is staying on top of design and code trends to always present the most relevant, inviting and engaging visual experience and interaction for users and in no ways it is a dumb thing to learn.A front-end designer is responsible for combining the strictly visual work of designers with the behind-the-scenes structure created by back-end developers. With an eye for aesthetics and an understanding of the nuts and bolts that make websites work, he (or she!) is responsible for coding the look of a site. Ultimately, the front-end developer is responsible for creating, testing and implementing the workings of all the visual and interactive elements of a website.

Check this for some understanding

Source : Life of a Front-End Web Developer [Infographic]

Is front-end development a dumb thing to learn?

American vision

How many (programming) languages does a coder really know?

Answer on @Quora by @ravisRealm to How many (programming) languages does a coder really know?

Answer by Raviteja Chirala:

I would say not to worry about how many languages you need to learn rather how analytical you should be.

I can share a valuable lesson I have learned from one of my ex-managers in my first year of professional world. He has been working in the same company for like 20+ years and as a manager for 15 years almost. At some point we were evaluating some framework(product) and I was asked to compare some of the algorithms they had to what we have. I was a little hesitant earlier because I had never really written anything in C++ after my school.

After wasting couple of days with that, I walked to my boss and told him that may be I can't do it because this language is out of my scope. He gave his usual traditional smile and told me,

"Once you're an Engineer, you're an engineer. And if you're an engineer you should be able to write in whatever language is required for the specific task. It takes some time to understand the syntax and specifications but logic should not change. I am sure you can do. Just do it"

I don't know if you interpreted it correctly the way I did but that has changed the way I see and the way I work. Even though he manage a huge chunk of products and multiple teams he still writes code. He fixes issues in backend, front end, computation and what not. I have never complained again. I did Java, R and I am doing Python now. It's what is required for my team and what's best for our product. I am basically an Engineer who writes code no matter what language. So my advise is learn any language of your interest and be more analytical in what you do.

PS : Thank you for all the upvotes and feedback guys.

How many (programming) languages does a coder really know?

American vision

What kind of programming language do we need in the future?

Answer by Robert Love:

We need a successor to C++ that provides a modern, safe, powerful language without the complexity of C++ or the overhead of Java. This successor needs to treat concurrency and parallel programming as first-class features of the language. The language must be designed to write the system software of the 21st century. Finally, the language needs to have modern sensibilities around memory management.

Sounds a lot like Go.

What kind of programming language do we need in the future?