An Idiot's Guide to C++ Templates - Part 1 - <AUTHOR> http://www.codeproject.com/Articles/257589/An-Idiots-Guide-to-Cplusplus-Templates-Part-1 <comment><USER3> In my (deliberately) limited C++ experience, I'm basically able to dream up how a program would work in a scripting language, translate all of the datatypes that I'm used to like growable arrays to STL equivalents (std::vector< ... > and std::map< ... > cover most of my use cases), and then after much verbosity and debugging, I get a magically fast program.

However the biggest frustration for me (aside from the verbosity) is that things work until they suddenly don't work, and then it isn't obvious why they don't work from the debugging stack you get back. They often don't work for good reason - but unless you're a C++ expert you don't know that reason.

For example suppose that I have a class that has reference members. Those are fields specified with & \- they are kind of like a pointer except that you can't change them, and you use . instead of ->. Because you can't change them, operator= is not generated for you. I didn't notice this until I tried to use one in an std::map< ... > and everything blew up.

However luckily confusing backtrace message plus google usually leads to a useful stack overflow answer, else I'd find this process much more painful.

My one remaining frustration is that I hate how the STL did iterators. In the STL, if you have a data_type< foo > template, you iterate over it with a data_type< foo >::iterator. So you get a std::vector< foo >::iterator, a std::set< foo >::iterator, a std::dequeue< foo >::iterator, etc.

This is great for the compiler, but as a programmer it is backwards. I don't care what kind of data structure this came from, I care what kind of data type I get out. I'd like to see those three examples produce an iterator< foo >. And then you can dream up things like the ability to take an iterator< foo > and a method on foo that will return a bar, to get an iterator< bar >. I am used to having map/grep/etc, and it would be nice to be able to translate list-oriented thinking into C++ with less verbose boilerplate.

<comment><USER4> > For example suppose that I have a class that has reference members. Those > are fields specified with & \- they are kind of like a pointer except that > you can't change them, and you use . instead of ->. Because you can't change > them, operator= is not generated for you. I didn't notice this until I tried > to use one in an std::map< ... > and everything blew up.

This is what std::reference_wrapper is for.

> I don't care what kind of data structure this came from

Fortunately, neither does the STL.

for_each(begin(foo_container), end(foo_container), some_foo_op);

Do you know what kind of container foo_container is? It doesn't matter. It can be a set, vector, list, or even a plain array.

> And then you can dream up things like the ability to take an iterator< foo > > and a method on foo that will return a bar, to get an iterator< bar >

You can do this with std::transform.

transform(begin(foo_container), end(foo_container), begin(bar_container), op_to_make_foo_into_bar);

edit: I see from your other response that what you actually want is streams or generators, not an iterator.

<comment><USER3> As I said, my C++ experience is limited.

Thank you for demonstrating a better way to do it. Hopefully I'll remember that the next time that I need it. (Which is likely to be several years from now.)

Also you're right that I would like streams and generators. But, to me, it is the same abstraction as iteration. See, for instance, how Python does it.

<comment><USER5> You should check out the boost iterator library. Depending on the application, you might be looking for either the function input iterator or the counting iterator.

<comment><USER3> I have avoided learning boost for the simple reason that on the rare occasions when I need C++, it has been apparent to me that I could easily spend longer trying to evaluate whether anything that is available would be a good fit for my problem, than it would take to be done.

Put another way, the effort of learning something needs to be amortized over all of the times that you'll likely use that knowledge. I use C++, rarely enough that I won't get much amortization. (And when I do use it, it is painful enough that I don't want to explore it just for personal enjoyment. Leading to my avoiding C++...)

</comment></comment></comment></comment></comment><comment><USER6> The article does not describe the primary issue with using templates: that using templates leads to hard-to-manage non-modular code. Templates have their uses, but a big problem is that any change in template code means recompile of any code that uses it. Additionally, the interface contract is not well defined. Adopting an interface/inheritance approach generally leads to much more maintainable code.

And yes, you can use namespaces and careful template programming to give some modularity to the code, but in the end, if one code line change in one template header, that is used by multiple other template headers, and in turn by multiple libraries, means you have to recompile thousands of files and dozens of libraries, this is a very big price to pay.

The article starts with function templates, which are tricky, with function overrides interfering with template instantiations. The article seems oblivious to this issue.

      "void PrintTwice(const TYPE& data)"

If you are going to make a function template that ought to work with primitive types accepts a primitive type, const& may not be that simple. You may want to write a separate template implementation (and choose between them using enable_if<> and type_traits), because you don't want to take a pointer/reference to an int if you don't have to.

"You should have noticed that I used typename, instead of class. No, it is not required to use typename keyword if a function returning something. For template programming, these two keywords are very much the same."

I have generally used <class X> rather than <typename X>, following a comment by David Abrahams to that effect on the boost list a long time ago. I think it has to do with the fact that typename does have multiple meanings inside the angle brackets.

      "int tSum = int();"

I think this code is problematic.

</comment><comment><USER7> For an old language as C++, templates have a way of staying new, exciting and hard at times.

I have respect for people who can explain the deep intricacies of the vastness of C++. Good article.

</comment><comment><USER8> I might have been just lucky but I have not yet seen a C++ programmer who passes a job interview yet is unable to comprehend the simple template syntax.

The opposition to templates that I have seen is not based on the ignorance of the basic template concepts. Quite the opposite - it's based on the partial knowledge of the advanced templates. Usually such people are cool with STL or STL-like home-brew collections but when they hear "metaprogramming" they immediately start having kittens :)

Essentially (class) templates are meta-functions over C++ types and templates themselves and the article describes only their basic application i.e. linear functions, over concrete types only and without any control structures. It's almost exactly as same as explaining Haskell without recursion and pattern matching.

</comment><comment><USER9> I like templates for code reduction. By using a template, I turned about 12 functions into 1 function once. Makes code maintainability much easier.

</comment><comment><USER10> _"It is also true that code size would increase, since there are now two function definitions...

...But, on a positive side, when you manually define N different overloads (say N=10), those N different overloads would be anyway be compiled,linked and packed in binary (the executable). However, with templates, only the required instantiations of function would get into final executable. With templates, the overloaded copies of function might be less than N, and it can be more than N - but exactly the number of required copies - no more no less!"_

There are times when every byte counts. Most of them were before the second Clinton administration. Odds are that with RAM at $20 a Gig, a few dozen bytes isn't the difference between your program being memory constrained or well tuned. Contemporary memory issues tend to be orders of magnitude larger.

<comment><USER3> _There are times when every byte counts. Most of them were before the second Clinton administration._

The CPU caches on a modern computer disagree with your snark. As [http://everythingisdata.wordpress.com/2009/10/17/numbers- eve...](http://everythingisdata.wordpress.com/2009/10/17/numbers-everyone- should-know/) shows, there is a huge performance benefit when you can stay inside of cache. (Note, those numbers are from Jeff Dean, who is widely lauded within Google for building the infrastructure that makes Google possible.)

Therefore when you're squeezing performance, precise control of memory layout matters a lot. That said, most of us don't need to worry about it. But when you do need to worry about it, there is absolutely no way to get it if you've already given up control.

I am averaging needing to worry about it about once every 5 years. So I need to care for perhaps 3% of my coding time. That percentage varies greatly by developer. Most developers that I know don't have the necessary skills to consider tackling issues at that level and so by definition can never take on projects for which they would care. Some developers work on stuff for which they need to care all of the time.

But even if you don't personally need that, it still is good to recognize that there are some who really do.

<comment><USER10> The Neil Conway blog begins:

       When you're designing a performance-sensitive
       computer system...

Neil then suggests two tools for achieving such designs, intuition based back of envelop calculations and microbenchmarking to identify bottlenecks.

Good intuition is the result of completing Norvig's ten year course. Identifying performance bottlenecks requires running code.

Neither is relevant during the "Template administration." Back of envelop calculations are about determining architecture, not the specific lines of text to be compiled. It's a look at efficient gross resource consumption, not tweeking handfuls of bytes. Tweeking, when it must occur - per your experience more than an order of magnitude less frequently than non-performance sensitive applications - is well after the "Template adminstration".

My criticism is literary. The article throws in byte sized boogie men. These are the sort of things that Google pays gurus to deal with. Not the sort of work for which they hire C++ programmers who need an idiot's guide to templates.

To a first approximation, memory isn't precious any more. Even when programming in C++. Writing as if it is, develops bad intuitions of the sort that lead to concern over templates during the Design phase.

I suspect that your first line of defense against running out of memory was not looking template construction, but compiler optimizations. Managing memory manually in C++ is hard enough without creating a mindset which encourages premature optimization.

<comment><USER3> My personal anecdote disagrees with you.

I do not make the decision to write performance critical code in C++ until I have an analysis of the problem which includes a prototype in a slower language. Therefore I do not start writing C++ templates until after I already have a specific problem, and a pretty detailed layout of how I want my data to be laid out in memory. The details of how my code gets laid out in memory I gladly leave to the compiler. But it is important for me to know that I can use templates and I _won't have to_ worry about it either.

 _I suspect that your first line of defense against running out of memory was not looking template construction, but compiler optimizations. Managing memory manually in C++ is hard enough without creating a mindset which encourages premature optimization._

Not true!

In the latest project that this came up in, one of the first templates that I wrote in C++ allows me to replace things that can go into a std::map with 4-byte objects that are simply indexes into a deduped vector. (This is on Linux, so I don't have to worry about dword alignment. Thus 4-byte objects only take 4 bytes.) Given that I have a very large number of these, often need to compare two to know if they are the same or different, and only seldom need to get at the actual value, this gives huge memory and performance benefits.

Of course doing this kind of thing for a general-purpose application would be horribly premature optimization. Which is why I only considered going to C++ after analyzing where the issues were in my first two Perl versions.

And I am an example showing that it isn't just C++ gurus who find themselves needing to write performance critical code in C++. In fact my desire to avoid premature optimization means that when I do need to write performance critical code in C++, I do not know the language very well because I use it so seldom!

<comment><USER10> The disagreeable anecdote shows that the scale upon which memory efficiency matters is significantly greater than that of the example where the issue is raised. It matters for "very large number[s]" not when a template is used to overload a function for numeric types - it matters when memory constraints appear on the back of the envelop...or in the profile.

What bothered me about that section of the article is related to your comment "I _won't have to_ worry about it either."

Templates are syntactic sugar. Cancer of the semicolon I can understand. But, why would one be fearful that a standard feature of C++ is grossly memory inefficient?

The answer I believe goes back to the time of expensive kilobytes - <USER2> allocating an array of 500 versus 200 was usually a big deal (whereas today it rarely is). CPU caches for performance driven applications are often larger than the total memory of systems from the time when C++ was designed. An idiot's guide should focus on draining the swamp and not seek to raise worries around the incubation of alligator eggs.

Even if that is the template for articles about the language.

<comment><USER3> _The disagreeable anecdote shows that the scale upon which memory efficiency matters is significantly greater than that of the example where the issue is raised. It matters for "very large number[s]" not when a template is used to overload a function for numeric types - it matters when memory constraints appear on the back of the envelop...or in the profile._

Wrong.

It is true that computers are fast enough that lack of performance will not be an issue unless the volume of work to be done is very, very large. However once you look at performance, you find that memory access patterns in the small matter a great deal.

For instance take a recent Intel Sandy Bridge CPU has, per core, 64KB L1 cache, 256 KB L2 cache, and 1 to 8 MB L3 cache. Half of each cache is available for code, the other half for data. If hyperthreading is turned on, these caches may be split by two concurrent processes. So if either the data accessed in, or the code for, a particular loop exceeds 32KB, you will experience a noticeable slowdown, and if possible you'd like to keep it under 16 KB. So it is better to do sequential access of large data structures, and avoid random access.

Note that is KB, not MB. Memory efficiency matters on very small data structures. You won't notice until you have a lot of data. But when you have to fix it, you have to think at multiple scales.

 _Templates are syntactic sugar. Cancer of the semicolon I can understand. But, why would one be fearful that a standard feature of C++ is grossly memory inefficient?_

There historically have been a lot of complaints floating around about how nice templated code blew up into monstrosities when compiled. Given that, rumor control does not seem unwarranted.</comment></comment></comment></comment></comment></comment>


Crossrail: how Europe's largest transport project stalled - <AUTHOR> https://www.ft.com/content/0d020876-ffc4-11e8-aebf-99e208d3e521 <comment><AUTHOR> Useful in light of the U.S. experience: [https://www.citylab.com/transportation/2018/01/why-its-so- ex...](https://www.citylab.com/transportation/2018/01/why-its-so-expensive-to- build-urban-rail-in-the-us/551408)</comment>


Ask HN: Why no love for PHP?  - <AUTHOR> I'm curious as to why I rarely see PHP articles on Hacker News.
Is it because PHP isn't considered a "serious" language, and is mostly the realm of "designers" and "script kiddies"?
Do the developers who visit this site all code in Ruby, Erlang or Objective-C? Are PHP developers a minority in this community?
I play with Ruby & Objective-C on my own time, but at work it's an all PHP shop. We primarily use the Zend Framework, and honestly it's pretty good (good enough for IBM...). With the recently announced build tools, and some of the classes we've developed on top of ZF, I can develop just as quickly in PHP as I can with RoR.
PHP is also fairly popular with successful startups. Larger sites like Digg, Flickr and Facebook are using at least some PHP to scale to fairly massive traffic; even Wufoo (a site which I feel represents what so many of us here are trying to achieve in essence) is written in PHP.
I will agree that PHP is a bit of a mess (backslashes for namespaces?), and that the internet is full of the wrong way to use it; however, there certainly are talented developers  writing quality software in PHP. Is there no interest in that here?
Apologies if this is a rehash of a tired topic; I poked around for a few minutes and didn't see anything relevant/recent. <comment><USER3> People who are really good at their jobs obsess about their tools- artists obsess over their paint, carpenters obsess over their power tools, cooks obsess over their knives.

PHP is like buying a chef's knife at Wal-Mart. You can create a 5 star dish with it, it cuts perfectly fine, but it doesn't inspire the same passion that a Shun knife does.

Most restaurants in fact, don't use fancy-knives, they use just regular knives and it works out just fine.

But, to draw the analogy back to programming, we're not regular restaurants. We're wannabe "rock-star" chefs- coding and "startup-ing" isn't just a job, it's part of our core ethos, so we obsess over all the tools we use, the text editor, the monitor, even the chair- because it makes the experience all that much better.

Most people do this about things they seriously care about. Runners debate intricacies of running shoes or the perfect in race meal. I've had debates with weight-lifters about weight-lifting gloves. Go over to a different forum, and you will hear arguments about the perfect size of a suit lapel.

The "Everyman" tools can always accomplish 100% of the job, but provide 90% of the experience. We spend an inordinate amount of time trying to get that last 10% out.

Is it probably unnecessary? Yeah. But people really bond over passions, and in arguing/debating that last 10%, you can really connect with people, which is why sites like Hacker News are fun and addictive.

<comment><USER4> Great argument, nice analogy, makes a lot of sense, and I completely (and respectfully) disagree.

Your analogy reminds me of the greatest cook ever, my grandmother. She used _no_ technology whatsoever. All of her tools had been _her_ mother's which were probably manufactured in the 1800s. She chopped everything by hand in a wooden bowl. (If anyone else helped her with the chopping, everyone at dinner could tell.) She never used pencil or paper and measured nothing. She stood in line at the farmer's market, the butcher, or the grocery store and inspected every item. And absolutely nothing I have ever eaten since, in any restaurant or home, has been remotely close to hers. It was magnificent! And I miss it so much.

I'd like to think I have almost as much passion about my work. I use the most primitive tools, 24 x 80 green screen editor, no framework, no IDE, no debugger, and mostly pencil and paper. I savor every byte just as I imagine my grandmother savored every little detail of her cooking. I'm not trying to save time or be fast, I just aspire to creating Grandma-quality software. I only hope my software brings someone the same joy her food brought all of us.

I've used many different tools, including php. And I rarely care how fancy they are. Ironically, the simpler, the more joy I have found along the way.

<comment><USER3> I don't think your story is incompatible with my analogy, in fact I think it's totally in-line with my analogy.

Many hobbyists who have reached the utmost peak level in their art go totally primitive. Cooks grow their own food. Carpenters make hand-made furniture, people really serious about clothes go bespoke.

Just because we spend more time agonizing over things doesn't mean we have to spend more money on them. More "expensive" and "fancy" doesn't make them better- in cooking, look at the revival of cast-iron cookware and the people learning how to sharpening their own knives. The coffee snobs don't buy the most expensive starbucks brands- instead they go order fresh coffee beans, roast themselves, and then grind them. A person really into clothes doesn't get the latest Tom Ford/Armani suit- they instead get a bespoke suit from an English tailor, which is often far cheaper. There has been a movement away from $150 running to shoes to shoes like the vibram five-fingers to even barefoot!

Why do masters of the art do that? I think it's because of the idea that you can create something from nothing. This is very easy to do with computers (programming is the only profession where you can truly create something from nothing, limited only by your mind). You're not limited to someone else's vision when you do this- you can have everything exactly the way you want, the way you care about, the way that lets you exude your passion the most.

The guy who uses Ruby on Rails is no different from you, you just create your art in different ways. Using a green screen editor doesn't matter to them- they're not stirred up by it.

Instead, they get stirred up by using RoR. Maybe RoR solves a unique problem that they've been dealing with. Similarly, the guy tired of dealing with Java switches to Clojure and experiences the same light that you're experiencing- going simpler doesn't matter that too much to him.

There's no right or wrong answer in simplicity vs. complexity. Someone out there (Wozniak) is more of a purist than you and is writing everything in Assembly. The guy writing the latest and greatest web application is using Django because it's the simplest, most purest way to solve their problem- and when they get passionate enough about it that this is no longer the case, they'll go write their own.

You can get caught up in the tools and the techniques, but the one thing that really matters is that the examples I gave (and the example that you gave, which I love and will definitely remember) are of people expressing their passion. We may express it in different ways, but at least we're exuding it.

People that don't exude any passion drive me crazy.

<comment><USER4> Agreed. You have a nice way of putting these things.

I said "I disagree" when I meant "This just doesn't apply to me". Sorry.

</comment></comment></comment></comment><comment><USER5> There are lots of reasons.

* PHP attracts idiots. Partly that's because you don't need to know anything to make simple PHP. So, in the large pool of PHP programmers, there are a ton of idiots. And those idiots produce a lot of verbose code that gets used because it does something. Ruby, Python, Perl, etc. all put up a larger barrier because they don't just come with a session handler or whatnot built in. And that weeds out more of the idiots. Doesn't really have to do with PHP the language, but it is nonetheless significant.

* PHP has a bad type system that leads to errors. There, I said it. The fact that 0 == "string1" and 0 == "string2", but "string1" != "string2" is unacceptably bad.

* PHP has no namespaces. Yeah, they're planned for 5.3, but the implementation is just ugly. This makes it more likely to botch something in a larger project.

* Which leads me to my next point: include/require. In PHP, it's decently common to say require('some_file.php'); and just grab a huge hunk of code. Eww! That code could be doing anything - adding in variables, executing code, etc. While it's true that other languages can do that as well, that's generally not the case - other languages are more in favor of importing objects or functions. Partly it's a language thing, partly it's a culture thing.

* Magic! So, how does mysql_query() know which database to connect to when you don't pass in a database connection? I mean, I'm guessing they're either using a global or if it's in C a static external variable, but PHP is littered with this crap. It's not necessarily bad, but it's magical.

* Functions! So, PHP now has cool object oriented stuff. Still, it doesn't use it at all. I don't object to strlen($var) that much when compared to $var->len(), but there are other cases where it's just crappy. So, PHP has a function strpos() which will return the position of the first occurrence of a substring within a string. Quick! In what order do you put the variables? In this case, it's string to be searched, search string. What about preg_match()? Oh, there you put it in the reverse order! And really, when writing functions, there is no "proper" order, but if you're doing $string.preg_match('/^apple$/'), there's a clear order.

* Looking more at preg_match(). What does it return? It doesn't return a match, it returns a count of the matches it finds. If you want the matches, you need to pass in a variable that it will take a pointer to as an argument so that it can place the matches in there. Bleh! How would this be done in a nice OO-way? $var->preg_match('/^apple$/').count() would get you the count and otherwise you get the match returned. Easy in a way that requires less memorization of weirdness and doesn't feel so wrong. And crappy things like that are done throughout PHP where things are weird, but end up

* php.ini. Terrible idea. PHP allows you to change very important things install-wide, directory-wide, app-wide, ick-wide! It's not just magic quotes. It's more that you never quite know what you're deploying to in a bad way.

Finally, it's that PHP is an older-style language without the cool things that newer languages can do. PHP isn't bad per-se, but it isn't good either. The biggest thing it has going for it is that it's easy on shared hosting. With VPSs coming down in price to the point that they don't represent a huge premium over shared hosting, that's become less of an attraction. PHP is fine, but there's a decent amount to get annoyed with when creating a larger application.

<comment><USER6> I can't say I love PHP, but some of your criticisms are a little silly.

For example, about typing... your argument is that when you cast a string to an int, it returns 0. What would you have it return, null?

Typing is jank in a number of ways, but in most cases I See the logic in the original decision. To a noice, the idea that false == "false" (because "false" casts to 0) but true != "true" just seems broken. But what else would you have it do?

About namespaces, people are complaining that PHP should use the dot operator like every other language. PHP uses dot for concat, which eliminates the ambiguity of using + for both concat and addition that exists in other languages. Now, they're going to use a backslash for namespace resolution. And that does create operator ambiguity. So PHP trades one ambiguity (dot) for this other.

And what do you possibly mean by "older style language"? Do you mean functional features? As you probably know, lambad's and closures will be available in 5.3. I agree that Python (my language of choice) and even C# (my 2nd fave) seem cleaner. But of course they do. They're new. Java seemed clean in 1997, too.

And finally.. I do value consistency in userland code and in the runtime. And PHP is horribly inconsistent. A salvation army of a language. But that stopped actually affecting me about 8 years ago when I left behind VIM for a real IDE with intellisense.

<comment><USER7> _What would you have it return, null?_

I wouldn't have it return anything. I'd have it throw an exception (type error). Dynamic typing can be a Good Thing. Pretending types don't exist is probably a mistake.

PHP uses the backslash for escaping characters in strings and for line continuation. There's ambiguity being created any way you look at it.

Many languages much older than PHP seem much more modern. Scheme, Smalltalk, Haskell, Python and even Perl come to mind.

</comment></comment></comment><comment><USER8> PHP doesn't get mentioned, because it isn't interesting. I've done a lot of PHP work, and still do. But there's not a lot of NEW going on in the PHP world. Their latest earth shattering move is namespaces. The only interesting thing about PHP's namespace support is how awful it is.

Almost all of the cool concurrency, natural language, efficiency, functional programming, and what-have-you research and development, is going on outside of the PHP community. Those are topics that HN collectively finds interesting, so PHP gets left out.

That said, just because PHP itself isn't particularly interesting, doesn't mean people don't build interesting things using it, and doesn't mean you shouldn't use it.

<comment><USER9> _there's not a lot of NEW going on in the PHP world_

There was an article on slashdot yesterday about PHP6. Here's one from IBM:

[http://www.ibm.com/developerworks/opensource/library/os- php-...](http://www.ibm.com/developerworks/opensource/library/os-php-future/)

Not a whole lot of new, but something. I think PHP gets ignored sometimes because it _is_ an older language, not the new and trendy thing.

<comment><USER10> > * I think PHP gets ignored sometimes because it is an older language...*

For what it's worth, Python is four years older than PHP, and it still gets a good amount of attention on HN. Python just has more of the "inspiring language" atmosphere, while PHP has more of the "corporate, mundane" feel. And I'm an avid open source developer working on multiple PHP and Python projects...

<comment><USER9> All righty; I'll give you that. Try this logic: maybe because Yahoo! is all about PHP and Google is all about Python and Yahoo! is older than Google. :)

</comment></comment></comment></comment><comment><USER11> PHP has a few downsides, everything from poor naming conventions to security vulnerabilities. People around these parts are always looking for the cleanest solutions to their problems and the latest methods available. PHP's relative age and problems make it neither.

That said, I coded my first startup in PHP. It's dead simple to make a dynamic web page with PHP, but it's also dead simple to create a huge mess. In that sense, PHP reminds me of C. It's pretty simple to write an app in C, but there are 1,000 pitfalls.

Just like with C, there are definitely talented coders out there who can make PHP behave correctly. Sadly, they are a minority. Many of them move on to other languages and frameworks.

I've since moved on to Ruby (on Rails) as well as Python. Both languages offer simplicity and power. Rails, in spite of being the Dane Cook of frameworks, makes it extremely easy to create a web application.

<comment><USER12> I agree with more or less with what you said but a downside of PHP is not security vulnerabilities, that's really just a myth. I can't remember the last vulnerability which could be directly attributed to PHP as a language.

Sure, there are plenty of apps containing holes but those are not caused by PHP but by not coding correctly, eg not checking input making SQL injections possible etc.

Which might confirm what you said, it's easy to create a huge mess with PHP.

But then, it's easy to create a huge mess in any other language, too. It's probably even easier with Ruby due to its highly dynamic nature.

Languages are like tools, you have to know how to use it but you can't blame the tool if somebody misuses it.

Edit: Fixed typo.

<comment><USER13> Languages are like tools: buying a the best set you can afford is the best possible start to a project. PHP doesn't cause SQL injection flaws, but it doesn't make it any easier. How many escape functions are there ? Shall we count them ?

\</comment></comment></comment><comment>----

mysql_escape_string() - Escapes a string for use in a mysql_query

mysql_real_escape_string() - Escapes special characters in a string for use in a SQL statement

mysqli_real_escape_string() - Escapes special characters in a string for use in a SQL statement, taking into account the current charset of the connection

addslashes() - Quote string with slashes

stripslashes() - Un-quotes a quoted string

The magic_quotes_gpc directive

The magic_quotes_runtime directive

stripcslashes() - Un-quote string quoted with addcslashes

stripslashes() - Un-quotes a quoted string

addcslashes() - Quote string with slashes in a C style

htmlspecialchars() - Convert special characters to HTML entities

quotemeta() - Quote meta characters

get_magic_quotes_gpc() - Gets the current configuration setting of magic quotes gpc

\</comment><comment></comment><comment>----

I especially love the contrast between "mysql_escape_string" and "mysql_real_escape_string," since the first one is fake in a magical, side- effect-laden way.

<comment><USER14> I think this comment sums it up nicely: <http://blog.ianbicking.org/php- ghetto-comment-11.html>

It basically argues that in PHP there's often an easy, insecure way to do something and a verbose, secure way to do it. With regards to SQL injection, Java is the same way; prepared statements are much more verbose and annoying than string concatenation.

<comment><USER15> I regard string concatenation as very annoying in Java.

Actually, just about anything is annoying in Java. I guess I have been spoiled by more modern languages like... Smalltalk/80 or Lisp'56.

</comment></comment></comment><comment><USER16> _holds hand up_ I use PHP. Indeed I use PHP for most of my commercial web stuff (i.e. stuff I make at work & most of my startup ideas).

Mostly I'm a Python fan but for websites PHP is just 100% easier for me because I have a framework I know well (KohanaPHP) and years worth of snippets/experience to use in prototying sites. I bet I can code a simple site faster in PHP than Python.

As to why PHP isnt discussed much on here: well I will hazard a lot of people take the same approach. We love exciting stuff in Python, C and Ruby (well, not ao much ruby for me :P) but PHP is our grab-it-and-run language. If someone knocks on the door and says "make me XYZ website in 2 days" we will probably pull out the PHP.

Nothing exciting and new is really happening with PHP - it is doing what it is supposed to do: help us produce dynamic websites fairly quickly with little fuss. So we can get on with the _real_ job of hacking in Python (or Ruby or C or..... etc.) :D

I could be wrong :)

<comment><USER17> I agree with this statement. I've reached a stage where I could code a PHP- based website much quicker that in other languages. Admittedly it's what I started programming on (and has taught me a few bad things, but certainly kept my interest in programming).

I don't agree that there's nothing interesting going on though. I'd like to see some more innovative extensions (which might be because they are coded in C) but PHP Classes (<http://phpclasses.org>) is constantly producing PHP libraries and snippets for common tasks

<comment><USER18> God I hate phpclasses.org

The code is great, but the site is awful, just awful. Mirrors? What is this 1999? How much bandwidth can downloading ZIPPED php scripts use?

Oh yeah, and there's registration required and big, ugly, flashing banner ads.

If someone knows of a site with the same contents, please, please let me know :)

<comment><USER17> I can agree with that, the site does look like it's still in the 90s. It's a shame there isn't anything much similar (searching GitHub can turn up some gems though). It's an idea I toyed with once.

</comment></comment></comment></comment><comment><USER19> I abandoned PHP about two years back. 8 months ago, after going to a conference and hearing the folks at Flickr talk, specifically Cal Henderson ([http://www.krisjordan.com/2008/09/16/cal-henderson- scalable-...](http://www.krisjordan.com/2008/09/16/cal-henderson-scalable-web- architectures-common-patterns-and-approaches/)) I got re-energized to take another stab at making PHP pleasant to work with.

The results of my last push evolved into a PHP framework: Recess. (<http://www.recessframework.org>) It's got annotations for a declarative, meta-programming style. It's inherently RESTful (and more fine-grained content negotiation is coming soon). The Models/ORM are lazy so that you can chain together queries that evaluate at the last minute. Recess deploys just fine to commodity $5/mo servers and was designed to be lightweight and fast without giving up object-oriented design (a la Code Igniter).

What I feel gets lost in the "PHP is terrible" literature is a distinction between PHP as a programming language and PHP as a technology / platform. As a programming language, from an academic perspective, PHP is embarrassing. As a technology/platform it's incredibly well suited for web applications because that's exactly its intention. PHP's shared-nothing execution model, simple deployment, efficiency & performance make it a great technology for authoring web applications. Tooling has gotten much better too with Eclipse's PDT & XDebug.

If you're growing tired of PHP and looking for a platform/framework to develop on that is more productive and enjoyable try taking Recess for a spin. For me, at least, it's made PHP fun again: <http://www.recessframework.org/>

<comment><USER20> Every language must balance expressivity, performance and utility.

I think PHP strikes a good balance, and Recess definitely has the best performance I've seen out of any ActiveRecord ORM in PHP.

</comment></comment><comment><USER21> PHP is not a language that was designed to be a language. It was originally a set of scripts that slowly morphed into a kind-of language. Because of that, PHP lacks a lot of the language features (threads, namespaces, proper OO design from the ground up) that "serious" languages all have. Ruby was buit to be the best language Matz could think of. Erlang was built to be a great language for programming telecoms. None of the "serious" languages morphed out of some CGI scripts.

As I already mentioned, PHP is not an OO language. It is a language that has OO as a feature, but the core API is not OO. This creates a very awkward mix of OO and procedural code.

One of the most embarrassing things about PHP comes from its complete lack of naming and ordering conventions. Look at the array functions. <http://us.php.net/manual/en/ref.array.php> 47 of these functions start with array_, 25 of them are a mismatch of whole words and partial words that happen to do array functions. The reason PHP documentation is so good is out of necessity. Without fantastic documentation, PHP would be completely unusable due to this staggering oversight.

</comment><comment><USER22> I have often thought the same thing as PHP is a fantastic web development language, and it is very well developed. The documentation is very good, and as you mentioned there are useful code examples right in the documentation. The learning curve for PHP is very low, and there is library support for pretty much anything you want to do. Oh, and it is dead simple to deploy.

I think RoR is one large reason why PHP is looked down now. More specifically, there isn't a leading PHP framework that has a proven following or as well executed marketing plan. There are a lot of PHP frameworks, but none that capture the attention of the masses like RoR.

The other argument I hear is that the language is annoying to program in. This just doesn't not compute in my brain as PHP code looks perfectly normal to me. I think that some people just prefer certain syntax, and I have yet to come up with a reason that I understand.

As you have probably guessed I have been a PHP fan for years, but I recently started seriously using Ruby/Rails for some side projects. There are two reasons I am playing with this instead of cakePHP/KohanaPHP/Symfony/Zend

1\. There is a lot of literature about Ruby/RoR

2\. I found myself resisting Ruby/RoR, and I don't want to be the old guy that won't learn new technology

<comment><USER16> WHat would you recommend for getting into Ruby? I tried it once but their site is horrible and the "Hello World" example is really babyish and idiotic - <USER2> it put me off :)

I've never "got" RoR. Python makes sense to me as a killer all-purpose language just as PHP makes sense to me as a niche for-the-web language (I cant get these people that insist on running PHP standalone :o). But I never quite figured the rails niche.

<comment> JeremyChase<USER16>
I would highly recommend learning Ruby before trying RoR. The first time I tried to learn RoR I didn't know any Ruby. I had limited success because I had to battle the framework and the language.

You don't need to know everything about Ruby to start on RoR, but you should be able to write some basic programs.

There are a number of online resources for Ruby:

Unofficial and old, but has a lot of good info: <http://www.math.umd.edu/~dcarrera/ruby/0.3/>

<http://www.whytheluckystiff.net/ruby/pickaxe/>

<http://www.ruby-doc.org/docs/UsersGuide/rg/>

<http://qa.poignantguide.net/index.html>

For RoR guides online, I didn't find anything that I really liked. I ended up with Sitepoint's Simply Rails 2.0 and followed it. I didn't find any free guides/books that really helped me much. Once you get a basic understanding of MVC you can learn a lot of from <http://railscasts.com> though.

PS: Sorry to everyone for the RoR/Ruby hijack

EDIT: Wrote a sentence misleadingly, fixed it.

</comment></comment></comment><comment><USER23> Back in the day, PHP was exciting. It was free, it was powerful, it was easy to learn. Everyone coming out of college knew C anyway and it has a similar structure. You could suddenly give your circa 1999 web pages a page date in REAL TIME and you could respond to forms without nasty cgi-bin. Eureka!

Nobody gets excited about it anymore because it solved the problem it was aiming to solve a long, long time ago.

</comment><comment><USER24> I've been using PHP at work and on personal projects for years. It has a very low "barrier for entry", which is both good and bad. It's easy/cheap to hire entry level programmers to write simple PHP, but it's all too easy to let them jump into big projects too soon and write something that turns into a huge mess. Well written PHP code can be just as easy to read as Python/Ruby/etc., but PHP makes it far too easy to write something that is a horrible mess.

At work we are still mostly a PHP shop, but anything I write on my own now gets done in Python. PHP's complete lack of a coherent function naming scheme is enough reason alone to get away from it.

</comment><comment><USER25> I'd love to see more PHP on HN (I am here to learn, primarily, and PHP is what I do), but the problem seems to lie in there being a lack of quality PHP articles. Maybe I'm being unfair, but just lately I've been getting the impression that the more someone knows, the less likely they are to share.

<comment><AUTHOR> I follow the Zend Developer Zone (<http://devzone.zend.com/public/view>) and find that an interesting article pops up every now and then. I've added a few developer blogs to my feed reader from articles that I discovered there.

</comment></comment><comment><USER26> If you can develop as quickly in PHP as you can with RoR, then you are not using RoR to it's full potential.

<comment><USER27> That is quite true. Even when using frameworks, PHP code is more verbose.

Also PHP has a proliferation of frameworks, so you may come across different frameworks in different projects reducing your efficieny. Since Django and RoR dominate in python and ruby respectively, the issue doesn't arise as much

</comment></comment><comment><USER28> One of the things that I think is relevant to startups hiring is that ( _warning_ experience mixed with opinion ahead) there are lots and lots of PHP developers of wildly varying quality. This makes the initial stages of recruitment time consuming. By looking for people with skills or interest in Ruby, Python or Scala (or whatever is hot that month) you'll probably see less interest but, on average, the quality and enthusiasm will probably be greater. Which means it takes less time to hire (well, maybe), as well as getting the better people (hopefully).

<comment><USER7> PG made similar arguments in his 2004 essay "The Python Paradox" - <http://www.paulgraham.com/pypar.html>

I'm inclined to agree. If you know how to advertise within a language community then using a lesser-known language will make it easier to find good programmers. This is probably even true for the short-term contract gigs often posted to freelance sites since there won't be hundreds of low-quality responses to sort through.

</comment></comment><comment><USER18> I like to code in other languages more than PHP but for the startup, that's what we use.

We use PHP because at the end of the day startups are a job, and you've got to be creating value. I find that PHP gets the (web development) job done better than anything else.

Is programming in Ruby or Python more fun? Way more fun! But in the end, all that really matters is what happens when someone points their web browser to a URL. PHP was built for this use case and the whole LAMP stack solves this problem extremely well without needing any additional frameworks on top.

Also, as ugly and awkward as the C {}; syntax is, and as much as I hate not having certain features in PHP (i.e. chaining), I think there could be something special about that syntax that has understated benefits as evidenced by the sheer fact that the most widely used languages (C++,C,Java,PHP) all use it. Maybe it's just because that's what everybody knows and not because it's better. I'm not sure.

</comment><comment><USER29> When you know you could save pages of code with it, being without proper higher-order functions is beyond tedious.

</comment><comment><USER30> Coming from a Java background into a startup that was built using PHP, it's been my experience that PHP is difficult to scale. This is for two reasons:

1) PHP isn't long-lived. Every time a request comes in Apache launches the PHP processor/interpreter and runs through the entire script. This means you don't get a heap that you can use to cache things[0], you don't get the benefit of JIT compilation, and you don't get the benefit of pre-compilation[1].

2) PHP development always seems to be tied tightly to a database. At some point an extremely high-traffic app will need to scale beyond what a DB (even a sharded DB) can support. To do this you have to think in terms of asynchronous processing, out-of-process updates, aggressive caching, and more.

The second point isn't really an issue of PHP, but more an issue of the PHP ecosystem - however, it affects the way I perceive the language itself.

Places that use PHP for high traffic sites seem to use it to build the presentation layer, which seems to work for them, but the majority of the work is being done by back-ends written in some other language.

[0] Yes, you can use memcache, but it still means, at the very least, a cross- process hop and most likely a cross-network hop.

[1] Compiling to bytecode (for Java) is still better than no compilation. Also, you only take the hit of starting the JVM once, not on every request.

<comment><USER31> PHP doesn't scale? Facebook has > 200 million users. It's written in PHP.

<comment><USER32> The parent clearly talks about how PHP is used mostly for the presentation layer of that class of applications.

</comment></comment></comment><comment><USER33> Maybe I'm a pariah here, but I like PHP. Especially when I have teachers cramming C++ down my throat. But Ruby is a great language, too. I've had my fair share of fun with both.

I think the thing to remember is that as programmers we should be language agnostic. This is because we need to chose the right tool to get the job done. Granted, most times we can just choose our favorite language; however, there are times when, say, PHP would do better than Rails, or vice-versa.

</comment><comment><USER34> I've got nothing against PHP, it's just a matter of preference. There are a lot of fantastic apps built using PHP and I use them on a frequent basis. However, if I build something, it's Ruby all the way. I just find it much cleaner and pleasurable to develop with. Looking at PHP makes my eyes hurt now.

The great thing about PHP is that the difficult problems have mostly been worked out. Getting a PHP site up and running and scalable is standard stuff.

</comment><comment><AUTHOR> In the past I've purposefully avoided submitting articles to Hacker News if they were about PHP. I kind of just assumed that they would be downvoted just for being PHP. I wonder if I'm alone in that?

Edit: fixed a typo.

<comment><USER25> You can't downvote articles (only flag them)?

<comment><USER35> You can downmod after you've reached a certain karma threshold.

<comment><USER25> I was pretty sure this only applied to comments, not articles?

</comment></comment></comment></comment><comment><USER36> It reminds me of Perl. Perl literally gave me a headache last time I coded in it. (Incidentally, this is why I'm wary of Ruby as well.) Besides, I am totally satisfied with Python.

<comment><USER37> I don't see too much similarity between Perl and PHP. Perl has a the syntax of a loose cannon. PHP's syntax is very Java like.

* PHP doesn't have special variables that change things about the language like, the starting index of an array.

* Out of the box, Perl requires you to import modules to get functionality that PHP has with a simple function call.

* Perl has support for classes, but you feel like it's a hack every time you write one.

* PHP has classes, that give you the notion that they are part of the language (which they are of course, so are Perl's)

Until recently, I hadn't programmed in Perl in years, but I find that coming back to it again has given me a new outlook on it. You might wanna take another look. I still much prefer Python though.

<comment><USER38> Perl is also way faster than PHP, and has had nice things like closures since... well, for a long time now. Not that I'd want to use Perl these days, but language-wise, it's a bit more advanced than PHP is.

<comment><USER39> _way faster_ \-- sounds subjective to me. What references say this?

</comment></comment></comment></comment><comment><USER40> PHP offers little more than convenience. I use it myself because it's so easy to integrate with PHP and MySQL, and it's easy. I think it's a decent platform for a basic web-site, but further than that it doesn't offer anything truly unique or powerful.

</comment><comment><USER15> PHP was a hack conceived long ago, in a time where there were no complex (as in "more than one page") web applications and little to no demand for them. It has the readability of Perl and the structural elegance of 70's BASIC.

Need I say more?

<comment><USER15> Isn't it lovely when people can simply mod you down when they disagree with you instead of trying to debate?

<comment><USER41> Your comment wasn't worth responding to, because it was an obvious troll, designed to incite a strong emotional response from the reader. If you were intentionally trolling, you picked the wrong audience. If not, you should try to support your opinion with more facts and rational arguments.

<comment><USER15> I really thought it was an accurate and concise depiction on the history, limitations and overall characteristics of PHP.

</comment></comment></comment></comment><comment><USER42> I work as a full time web developer and am required to use PHP for everything server side. It's one of the worst languages I have ever used but I live in a LAMP world and everyone requires me to use it.

I have used Clojure and RoR in the past and really like them but unfortunately I can't use them in reality. I wrote about it in this post on my blog.

<http://www.codeinnovator.com/uncategorized/lisp-vs-php/>

You can certainly develop professionally with it. It's just not a whole lot of fun.

</comment><comment><USER43> php is my virtual machine. It runs everywhere (and cheaply), Anything is possible with it - it's just really ugly - thus code generation is your friend. This is something I hope to drive home with <http://lisphp.googlecode.com> (nearly r5 scheme) and LET (my smalltalk w/ macro expansion) which is used in <http://voltron.googlecode.com>.

</comment><comment><USER44> PHP is like that kid in school who got everything right but everyone hated. I'll be honest, I love PHP. I love it as much as I love Ruby, Python and any other _language_. For some reason communities have sort of ganged up on PHP and beat it to a pulp. The funny thing is, PHP, for the most part, outperforms them all in real world memory usage. Of course, that's probably because PHP is a _language_ and Rails, Django and such are _frameworks_. PHP was built for the web, and as such it does a good job serving up web content.

The problem is that uneducated neophyte developers are polluting the tutorial scene and elitist, higher level language developers are shutting them down. Why aren't we helping these people progress? Why are they hitting a glass ceiling of knowledge?

I know, I was one of them. I worked at a small PHP shop and the attitude was "make it work, ask questions later". We got the job done. It worked, and the customers didn't notice a thing wrong with it. The problem was that I stopped learning. There was nothing more to learn about PHP. Why? Because it was a language. It's finite.

I've seen numerous posts about how horrible PHP is, but really, is it? It's a language. PHP, unlike a framework, is what you make of it. There are no standards, no methodologies, no guidance. That's what PHP needs -- a framework. Just as Ruby and Python after it needed a framework. Not because it makes you a better programmer, but because it allows others to understand, maintain and manage your code. The language you use doesn't make you a better or worse developer, it's how you use it.

Tools are tools. Skill are skills. I think the biggest mistake we make is mistaking tools for skill. Some of the greatest programmers I know write ColdFusion and PHP, and some of the worst I know write Ruby and Python (and yes, PHP).

</comment><comment><USER45> I wrote a long post about this here a few weeks ago:

<http://news.ycombinator.com/item?id=579387>

Basic ideas -- missing language features, language features that don't work, improper OO, lacking modern abstractions (where's a good ORM?). Read the whole post for details.

</comment><comment><USER46> I use PHP every day at work. I find that the best way to program PHP is to pretend it is java and ignore (almost) all the other features. Many of the features of the language are very powerful and because they are so powerful, PHP has a tendency not to scale well.

If there are 200+ ways to do one thing you can guarantee that looking at someone else's code will always be an adventure. You CAN write good code in PHP, but it is flexible enough that bad programmers will be able to take it and do much worse things than they could with, say, java.

Call me old hat but I think type safety is an important aspect of scalable projects. If I could add one feature to PHP it would be enforced type safety.

</comment><comment><USER47> It's the MS Windows of programming. Everybody uses it, nobody brags about it.

</comment><comment><USER48> Personally, I enjoy working with PHP, but only because I work with a platform/framework on top of it. I would likely steer clear otherwise.

While PHP by itself can be a challenge to work with, various frameworks and platforms abstract those idiosyncrasies while providing a significant increase in out of the box features and functionality.

For instance, NOLOH (<http://www.noloh.com>) is one such platform. Others such as Yii and CodeIgniter, while not as robust in certain respects, do a good job of this too.

(Full-disclosure: I'm a co-founder of NOLOH)

</comment><comment><USER49> PHP is not a programming language. It's just an overblown template engine.

</comment><comment><USER42> I work as a full time web developer and am required to use PHP for everything server side. It's one of the worst languages I have ever used but I live in a LAMP world and everyone requires me to use it.

I have used Clojure and RoR in the past and really like them but unfortunately I can't use them in reality. I wrote about it in this post on my blog.

<http://www.codeinnovator.com/uncategorized/lisp-vs-php/>

You can certainly develop professionally with it. It's just not a whole lot of fun.

</comment><comment><USER50> I'm a big fan of PHP for myself. But I've seen enough of PHP script kiddies out there making nearly free (as in beer) websites/webapps. They become a mess in no time.

Mostly hacking phpnuke, joomla or some other messy portals. Hacked sites mostly never get any security updates or any kind. But employers having free work done are ok with this scheme so more and more script kiddies emerge.

Also there is not much thing going on PHP nowadays. Maybe PHP is at peek for it's purpose - doing web apps easy and quickly.

</comment><comment><USER51> The truth is that this is Hacker News. No matter how appropriate PHP may be as a tool for many web programming jobs, no one wants to admit to their cool 'Hacker' friends that they use it. Just like you won't hear many people talk about how they're using ASP.Net or C# for their startups. It's not that these are in some way inferior or bad; it's just that you don't get any hacker cred for using or talking about them.

<comment><USER44> I use .NET and VB.NET. I am not ashamed. :) Oh, and ColdFusion too. I'm proud to be a language agnostic developer. Immune from hype, smoke and mirrors. Hehe. Okay, maybe not as immune as I think.

</comment></comment><comment><USER52> I used it for years and still regret it.

</comment><comment><USER53> For all its flaws, PHP and Perl are the only web languages that let you build a web app in _whatever_ fashion you want.

This extreme flexibility coupled with mature libraries makes web app development ridiculously easy. For a complex application that starts at ground zero I would probably recommend Ruby or Python but really even that decision is 50-50. We've faced this crossroads 3 times in the last couple months and 2/3 we've gone with PHP over Python, and not just cos of familiarity.

For any existing app, it's probably already in PHP or something worse like ColdFusion, so migrating it to "good" PHP 5.x is usually the only logical step.

That said threading, namespaces, sickening magic and the whole haystack/needle needle/haystack game SUCK. But you can get everything done quick and everything will scale and if you need to change it you know you always can without tearing down a house of cards so ... I for one don't mind it, in fact I quite like PHP and the PHP ecosystem.

</comment><comment><USER54> I guess one of the most strongest reasons why PHP got popular was its default support on shared hosts. You could taste your first real web creating with PHP real quick.

</comment><comment><USER55> I earn money with PHP for 8 years now. I just love it. When you in love you don't give a flying f..ck about anything else.

</comment><comment><USER56> PHP is like a mobile phone that's a year old - it's perfectly good, but ain't what the cool kids are playing with.

<comment><USER57> Except every year the 'cool' phones come and go, and PHP is still around, kick ass and taking names.

<comment><USER58> And my Nokia 5120 still boots up like it's first day when I pull it out of the discarded gadget drawer.

<comment><USER59> Do you mean because it's never been used?

</comment></comment></comment></comment><comment><USER60> PHP is like Basic for web development

Everybody knows about it, but nobody talks about it.

</comment><comment><USER61> Just imagine a fake swiss knife made in china with a hundred of blades and tools, no one is good enough for its task.

</comment><comment><USER62> How is this a question?

</comment><comment><USER63> I don't care for PHP because it's interpreted vs compiled, debugging is a pain and it muddles view and application logic! Separation of concerns is one of the key principles of software engineering. Also, library support is much better in Java and it's generally a more mature language. I really want to write my logic separately and unit test it against mock objects and this is harder with PHP. My preferred stack is Java server talking to jquery front end.</comment>


Android malware can steal Google Authenticator 2FA codes - <AUTHOR> https://www.zdnet.com/article/android-malware-can-steal-google-authenticator-2fa-codes/ <comment><USER2> These type of attacks on Authenticator codes generators that don't have a PIN protection and other measures to mitigate against these type of attacks will be on the increase. I use SAASPASS Authenticator for my personal services and it has measures against this type of attacks.

From SAASPASS website on the SAASPASS Authenticator versus Google Authenticator:

SAASPASS encrypts all data, whereas Google Authenticator stores keys in plain/clear text; this is a problem especially with rooted devices and backup programs, where unencrypted data can be viewed easily

[https://saaspass.com/authenticator/](https://saaspass.com/authenticator/)

Full disclosure: We resell and integrate SAASPASS IAM to enterprises.</comment>


Aadhaar: Ushering in a Commercialized Era of Surveillance in India - <AUTHOR> https://www.eff.org/deeplinks/2017/05/aadhaar-ushering-commercialized-era-surveillance-india <comment><USER2> It took gas connection 6 months (or upto years) and now I get it in 3 fucking hours. Same for license and what not.

Sure there are problems to be fixed but lets fix basic problems first

<comment><USER3> Bro, just got aadhaar fingerprint auth rejected two days in a row. Don't think i'll get it to work anytime soon. Local states' aadhaar auth rejection seems to be 30% rejection rate. (For first 3 months of 2017).

</comment></comment><comment><USER4> Does the author mean, biometric details have been leaked? I think he last 3 paragraphs, it looks like she's kind of using the numbers leak (aadhar numbers are not meant to be private, like SSN in the US) and the biometrics leak interchangeably.

AFAIK, no biometric data has been leaked yet.

</comment><comment><USER5> The whole purpose of the project was to provide means of identification of people that didn't have any kind of document – passport, driving license, etc.

Identification of people is crucial in regions where some people receive subsidies as ensures it reaches the right people.

It's a shame this platform is being potentially used to violate citizen's privacy. Maybe a EU GDPR-esque regulation would balance the control on where private information is used back to the citizen.

<comment><USER6> > The whole purpose of the project was to provide means of identification of > people that didn't have any kind of document – passport, driving license, > etc.

That was just the guise under which it was launched. Aadhaar has been a poorly thought out and poorly implemented solution that's still looking for problems. Responses to RTI (Right to Information) queries have shown that 99.7% of people who enrolled for Aadhaar did so using existing identification documents. Only 0.3% enrolled without identity documents using the "introducer" system. [1]

[1]: [http://www.hindustantimes.com/india/very-few-indians- didn-t-...](http://www.hindustantimes.com/india/very-few-indians-didn-t-have- id-proof-before-aadhaar/story-0v4U95UH57i0O0snYE1EeN.html)

</comment></comment><comment><USER7> Yet the irony is - The govt. will never dare to link it with voter registration. And no one questions, as everyone knows why!

<comment><USER8> I hope they don't. Do you even realize what you are talking about! If they did that, it is easy to conceive a system that can determine whom you voted for (at a certain level of confidence). That kind of information can have potentially harmful consequences for many.

<comment><USER7> You don't need to link your vote to aadhaar. Vote can be anonymized, but polling booths can still check and identify voters using aadhaar and easily avoid duplicate votes & rigging.

<comment><USER9> If online verification is used, issues of no-connectivity/poor- connectivity/latency can cause problems. Polling units are sent to remote corners of the country.

Loading the polling unit with aadhar database can be one approach. Very few know (relative to the number of personnel involved in the polling process), as to which polling unit will go to which polling station. Trying to load constituency specific database into polling unit will increase the surface area of the people who have to know which unit goes where. Loading the aadhar database of full constituency into polling units might not be technically feasible.

</comment></comment></comment></comment><comment><USER10> Why don't they create a system like UIDAI Payments where you can generate different aliases that all link to your actual aadhaar profile with permission based access and access history features. Seems like an issue that can be remedied with technology IMO.

<comment><USER10> To clarify, instead of submitting his actual aadhar details, the user submits a generated token that can be used by the information-requesting party to pull details of the user from the aadhaar database. This transaction is logged and the user gets to see the details of the party who requested it.

</comment></comment><comment><USER11> This is on steps to provide Universal Basic Income on the long run. That which requires ID & bank account for every person to deposit cash.

<comment><USER12> This is actually one of the long term plans. Like another comment said it's very difficult to identify who's a citizen and who's not, so people are likely to give up some privacy for getting other benefits. In fact most people outside of the urban areas don't even give a f __k about privacy and are merely looking forward to getting food for the next meal. So in India the people 's priorities are very different than that in US/EU.

<comment><USER6> Firstly, Aadhaar is for residents of India, not just citizens. Anyone who has resided for more than half a year in the country can get it. Many places take the Aadhaar number or just a photocopy/print of the image as proof and provide other real identities. Even the passport office has started accepting Aadhaar, which makes it easier for resident, non-citizens to get an Indian passport and claim citizenship. This whole charade is going to hurt Indians of today and future generations for a long time.

<comment><USER12> It can be obtained by "legal" residents, although I don't think legal residents can get passports on the basis of their aadhar number. Aadhar fundamentally solves the problem of illegal residents and nefarious foreign agents getting valid credentials, but I do agree that there are a lot of corner cases where they have been able to obtain one. Another issue is that ration cards and subsidies accounts (including LPG subsidies in urban areas) can be duplicated - meaning that one person can (and do) open multiple accounts. Tying these to Aadhar will definitely reduce the abuse prevalent in the system.

<comment><USER6> > It can be obtained by "legal" residents, although I don't think legal > residents can get passports on the basis of their aadhar number. Aadhar > fundamentally solves the problem of illegal residents and nefarious foreign > agents getting valid credentials...

Please see the documentation accepted for proof of date of birth [1] and proof of address [2] to get an Indian passport. Both accept a valid Aadhaar number that can be verified. And an Aadhaar number can be obtained through an introducer without providing documents. Since the government has also claimed that there are fake PAN cards, fake drivers licenses, etc., an Aadhaar number can be obtained by providing those too. It's not as difficult to get a passport and claim citizenship as you think. Aadhaar, in a convoluted way, makes this a lot easier. It does not solve the problem in any way.

As for rations and subsidies, you can read the links tryprasannan has posted or visit Rethink Aadhaar [3] to understand how these claims are erroneous and how people are getting excluded.

[1]: [http://passportindia.gov.in/AppOnlineProject/popuponline/Att...](http://passportindia.gov.in/AppOnlineProject/popuponline/AttachmentAdvisorSub?subDocID=7002&minorFlag=1)

[2]: [http://passportindia.gov.in/AppOnlineProject/popuponline/Att...](http://passportindia.gov.in/AppOnlineProject/popuponline/AttachmentAdvisorSub?subDocID=7001&minorFlag=1)

[3]: [https://rethinkaadhaar.in/](https://rethinkaadhaar.in/)

</comment></comment></comment></comment></comment><comment><USER13> Indian left wing has been calling the current ruling party and the government "Fascist"[1] for a while now. So there is quite a bit of fear mongering regarding Adhar, as left suspects that govt. will eventually use this to crack down on the dissenting voices. But for those who don't share that opinion, this is part that needs attention, "The guidelines could have come earlier, and given large data leaks in the past may also be redundant. Nevertheless, it is reassuring to see practices for keeping information safe and the idea of positive informed consent being reinforced for government departments."ie, Though delayed, corrective measures are being taken.

1.[http://indianexpress.com/article/india/india-news- india/sita...](http://indianexpress.com/article/india/india-news- india/sitaram-yechury-bjp-government-fascist-authoritarian-modi-prakash-karat- cpm-3033385/)

<comment><USER14> It's real and existential threat, given Indian govt is lousy when it comes to data protection. Indeed all aadhaar data is floating in many corporations especially the one supporting current govt. No laws on its misuse and govt cannot be taken to court. Indeed by blaming and divisive politics current govt is very capable to divert attention from real issue and blame left and calls all those opposing it enemies.

<comment><USER15> You have no idea what you are talking about my biased friend.

<comment><USER6> Please dispute points with explanations or counterpoints instead of condescending dismissals. It looks like you are the one who does not have enough information to counter GPs stated points.

</comment></comment></comment></comment><comment><USER16> From the article:

> However, unlike countries where similar schemes have been implemented, > invasive bio-metric collection is being imposed as a condition for basic > entitlements in India

Remember: India has a unique set of challenges to overcome if it has to survive and prosper as a nation. It is surrounded by not-so-amenable neighbors and with cross-border infiltration at a constant strategy used against India ("death by thousand cuts").[1]

And almost 20 million Bangladeshis have illegally crossed over from the eastern border [2] [3] and (unfortunately, reportedly getting Aadhar cards through whatever means, which defeats the purpose if it is true), for a country of a billion odd people at risk with such high uncertainty profile - the requirement to identify at least their own citizens vs the intruders/ offenders becomes a strategic and security action from the government perspective.

I think we would be in wrong to compare the "right to privacy" in this scenario to that of the more developed nations that are pretty much geographically blessed/ isolated, population wise less dense, religiously homogenous and technologically advanced as such that they can track covertly vis-a-vis getting biometric details directly. In fact, the Supreme Court of India has observed that [4] "Supreme Court asks if right to privacy is absolute?"

[1] [https://www.pgurus.com/india-superpower-or-balkanized-war- zo...](https://www.pgurus.com/india-superpower-or-balkanized-war-zone/) [2] [https://en.wikipedia.org/wiki/Illegal_immigration_to_India#H...](https://en.wikipedia.org/wiki/Illegal_immigration_to_India#Higher_judiciary.27s_concerns_over_Bangaladeshi_illegal_immigrants) [3] [http://timesofindia.indiatimes.com/india/Two-crore- Banglades...](http://timesofindia.indiatimes.com/india/Two-crore-Bangladeshi- immigrants-illegally-staying-in-India-Centre-informs-Rajya- Sabha/articleshow/55457903.cms) [4] [http://www.thehindu.com/news/national/privacy-not- absolute-s...](http://www.thehindu.com/news/national/privacy-not-absolute- says-supreme-court/article19308529.ece)

<comment><USER17> I keep hearing that 20 million number in every thread about Indian migration, and I can never find anything to back it up.

<comment><USER16> Please refer to the ToI article I cited in the reference. This figure is not pulled out of thin air, but neither it is 100% accurate.

From ToI article: "The government, __citing inputs available with it __, told the Rajya Sabha on Wednesday that there were around 2 crore Bangladeshi immigrants staying illegally in India.

If you were to believe the government estimates, you have to believe it. Even if it's off by 50%, you still have 10 million of them.

P.S: In 2004 >> the estimate was 12 million, according to the article.

<comment><USER17> Starting with 12MM[1] in 2004, what you are effectively suggesting is that 1 in 15 Bangladeshis has left India in the last decade[2]. Come on: outside of Superpower 2030 memes, the grass isn't _that_ green in India, and I'd like to think that the first million or Bangaldeshis crossing over would have sent home word that migration wasn't actually worth it. Why go to India and be poor in Calcutta when you can go to the Middle East and make (even factoring in broker fees) 2-3 orders more money for your family?

I'm willing to acknowledge that there have been some cross border shenanigans in the last fifty years, but the statistics trotted out by the Centre are transparently politically motivated, i.e. lies. What is more, these are _stupid_ lies, relying on completely irrational behavior of potential migrants, who in my experience are some of the savviest agents in existence.

[1] 10 million of whom came over in 1971, making for an annual migration of ~50K between 1971 and 2004.

[2] By this measure, every family in Bangladesh would have someone who has left for India in the last decade. This is...not true?

<comment><USER16> > what you are effectively suggesting is that 1 in 15 Bangladeshis has left > India in the last decade

I am not suggesting anything. I am only answering to your questioning of the source of the numbers.

As for the your other points, you can hold counter or conspiracy theories. I was only answering to your source claim. You may want to repudiate this in public domain if you feel GoI is mis-estimating or ToI is misreporting.

</comment></comment></comment></comment></comment><comment><USER18> The pro: There have been significant fiscal benefits - fake personas have been completely eliminated in the welfare schemes that are aadhar linked, saving a lot for the taxpayers.

The con: Government has all your biometrics, and can technically mine data from connected services to build a very detailed profile of you (hypothetically).

IMO, both sides have valid points, and so it ends up being about which side the ruling government wants to fall towards.

<comment><USER19> Most (all?) savings claims by govt are at best projected numbers. For those interested in an analysis of the savings claim and some of the other myths propagated by govt, see the 3 part analysis by Anand ([https://twitter.com/iam_anandv](https://twitter.com/iam_anandv)) linked below

Part 1 - [https://www.medianama.com/2017/04/223-nandan-nilekani- aadhaa...](https://www.medianama.com/2017/04/223-nandan-nilekani-aadhaar/)

Part 2 - [http://www.medianama.com/2017/04/223-aadhaar-nandan- nilekani...](http://www.medianama.com/2017/04/223-aadhaar-nandan-nilekani/)

Part 3 - [https://www.medianama.com/2017/06/223-aadhaar-lpg- scheme/](https://www.medianama.com/2017/06/223-aadhaar-lpg-scheme/)</comment></comment>


Re: "Hey:" – An Analysis of the Obama/Romney Emails - <AUTHOR> http://www.klaviyo.com/blog/2012/11/06/re-hey-an-analysis-obamaromney-emails/

<comment> brown9-2 Along the same topic, Mother Jones had an article last month about the inside of the Obama campaign's tech operation (or at least as much as they felt comfortable revealing) that was pretty intriguing: [http://www.motherjones.com/politics/2012/10/harper-reed- obam...](http://www.motherjones.com/politics/2012/10/harper-reed-obama- campaign-microtargeting?src=longreads)

</comment><comment><USER2> (I just noticed OP is the author, so I'll put my comment here) [edit : correction, OP is the author's brother, sorry :]

I'm absolutely no mailing specialist, but here is my take :

Your study is quite interesting, but has it any value without you saying which mails your read when ?

Tracking if an email has been read or not is quite simple, providing the email is sent as HTML and the one who reads it is no privacy-nerd (noscript, ghostery, other ways to block external ressources, highly secure mailbox softwares, etc). What if you regularly "read" Obama's mails and not Romney's ones ?

If I were to manage this kind of mailing campain, I'd probably put on hold for a while email addresses who haven't read the last X mails. On the contrary, I would go on sending mails to people reading them. Etc.

Please tell us what you did "read" and when, and what you did not.

<comment><USER3> Don't most modern email clients block image (and other resource) downloads until the user specifically requests them or whitelists the sender?

<comment><USER4> I was testing out mailchimp the other day, and I could not for the life of me get the thing to recognize that I had read my test e-mails to my accounts, even though I had.

<comment><USER5> IIRC (been over a year since I used Mailchimp) they don't do analytics on test emails.

</comment></comment></comment></comment><comment><USER6> Can you please fix the first graph in the post? It's very hard to interpret 'gaps' in emails sent when you have Jul-12 and Sep-12 repeated.

</comment><comment><USER7> Does anyone know what firms the campaigns are using for the campaign emails, or is that not public knowledge?

<comment><USER8> You can check by inspecting the mailing headers.

The Obama campaign uses Blue State Digital to send emails. The Romney campaign uses ExactTarget.

<comment><USER9> That's pretty interesting to learn. Blue State Digital's allegiance is obvious. ExactTarget is based in Indiana, a red state.

(Though I'm sure their greatest allegiance is to green.)

</comment></comment></comment><comment><USER10> Page is down. Google Cache:

[http://webcache.googleusercontent.com/search?pws=0&q=cac...](http://webcache.googleusercontent.com/search?pws=0&q=cache%3Ahttp%3A%2F%2Fwww.klaviyo.com%2Fblog%2F2012%2F11%2F06%2Fre- hey-an-analysis-obamaromney-emails%2F)

<comment><USER11> I'm working to get it back up, but it looks like our host will keep us down for 30 minutes or an hour. Good sign that we need to invest in better hosting.

</comment></comment><comment><USER12> As the OP mentioned, ProPublica has also done an analysis of emails, which they asked readers to send to them: <http://projects.propublica.org/emails/>

It's hard to know how sophisticated the actual targeted emails are. The PP analysis likely didn't capture the whole universe of emails received (because it was mostly from their readership)...and the skeptical part of me wonders: how sophisticated are campaigns at this, really?

For one thing, a limiting factor is how much they are willing to spend to tailor a large variance of emails. I guess from the limited knowledge I have of campaign internals and campaign writers, knowing how to work a binary decision tree would be a rare skill. Of course they might have a program that abstracts this process, but you still have the core issue of writing an intelligible email that remains intelligible (and won't be an inadvertent embarrassment) across all variances.

Also, I wonder if open-rates have a stronger effect on the email format than any other kind of personal information, other than gender, age, geography, and donation history.

\--

I have no doubt that campaigns _think_ they are very sophisticated, especially compared to what they had in the last cycle four years ago. I'm talking about sophistication as it compares to what Facebook and Google have. That's an unfair bar here but c'mon, that's what we should be comparing against in the big picture.

<comment><USER13> My guess is that over a billion dollars can buy you some pretty damn sophisticated marketing. What email campaigns have more on the line than these?

<comment><USER14> Well, multi-billion dollar corporations like Google, for one.

</comment></comment></comment><comment><USER15> I get Bluehost's "The website you were trying to reach is temporarily unavailable."

<comment><USER16> [http://webcache.googleusercontent.com/search?client=opera...](http://webcache.googleusercontent.com/search?client=opera&q=cache:http://www.klaviyo.com/blog/2012/11/06/re- hey-an-analysis-obamaromney- emails/&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest)</comment></comment>


Doubling SVG Frame Rates at Khan Academy - <AUTHOR> http://www.princeton.edu/~crmarsh/svg-performance/?

<comment><USER2> On this particular example from the article:

[https://www.khanacademy.org/math/basic-geo/basic-geo- coordin...](https://www.khanacademy.org/math/basic-geo/basic-geo-coordinate- plane/basic-geo-shapes-on-a-plane/e/drawing-polygons)

I would definitely not recommend using individual <svg> nodes. Instead what I did was wrote some basic wrapper functions to decompose and re-compose the internal attributes of <path>. If you get a chance to read the spec you'll see that you get the option of assigning RELATIVE or ABSOLUTE coordinates, which makes it very easy to do a simple editor like what you've done within a single <svg> node.

<comment><AUTHOR> That's what we had originally, but you lose out on the ability to take advantage of GPU hardware acceleration (in current browsers, at least; there's no actual technical reason preventing GPU acceleration for SVG drawing that I know of).

<comment><USER2> I am probably assuming several things about how that would be implemented. I personally decided to abandon the idea of using Raphaeljs because it appeared to assume too many things about how I was going to be interacting with the SVG objects on the canvas.

I found that (for my purposes) working directly with the objects was a huge win in terms of performance.

</comment></comment></comment><comment><USER2> I recently ran into some performance-related issues in SVG, but have cleaned up substantially by using requestAnimationFrame()

[https://developer.mozilla.org/en- US/docs/Web/API/window.requ...](https://developer.mozilla.org/en- US/docs/Web/API/window.requestAnimationFrame)

It's not the "be all end all" solution, but helped my project enough to where performance issues were no longer noticeable.

</comment><comment><USER3> Just a question - why don't you use SVG SMIL animation? It's perfectly fluid, HW accelerated, has declarative animation transforms, allows easings, draws in its local coordinate space, you can add interactive JavaScript events etc.

[http://www.w3.org/TR/SVG/animate.html](http://www.w3.org/TR/SVG/animate.html)

<comment><USER4> SMIL is not perfectly fluid. SMIL is not inherently hardware accelerated. SMIL animations are slower than the same animations driven from JS in all major browsers except IE which doesn't support SMIL but does support JS. As the OP showed, JS animations are the way to go for SVG.

<comment><USER3> My experience says otherwise, SVG SMIL tends to be 10-20% faster with lower CPU load in recent browsers (Chrome/FF/Safari) than a JS-driven animation. YMMV though.

</comment></comment></comment><comment><USER5> Wow, performance for SVG is really bad.

<comment><USER6> It depends very much on the browser. Ironically, IE is leading in that area, actually, and Firefox lags behind the other two by a great margin. It often looks like FF thinks it needs a complete repaint where a little recompositing would suffice which means that something as simple as moving a tiny thing in a large, complex visualization can have abysmal performance.

It also seems that, depending on the browser, they have dug themselves in the same hole as before. Moving the polygon or one of its nodes around triggers a layout in at least Chrome and IE, exactly what they wrote were trying to get rid of. Maybe the demo does not yet show their new implementation; I saw way too many SVG elements, but no CSS transform on them.

</comment></comment><comment><USER7> If the author is reading this - you can change the way you import fonts to protocol-relevant and your site will be fully SSL-compatible using the Princeton certificate, e.g.

      <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans">

<comment><USER8> And if the author is reading this - as much as the Princeton domain makes for a nice web address, your site will be taken down COMPLETELY the October after you graduate. (Source: Princeton alum. I disagree with the policy, but even if it were changed it would be unlikely to change soon enough to be relevant to you.) I'd migrate your content off-site sooner rather than later and set up permanent redirects - as well as adding a comment with the new location here in case people find this post on HN! Great content, I just don't want it to be lost!</comment></comment>


Ask YC: Easter eggs for web apps? - <AUTHOR>

It seems pretty rare for web apps to have easter eggs. Why is that? It felt a lot more common in desktop development than on webapps.
Am I just overlooking them? Or do they change more often once someone finds them?
Are you putting easter eggs in any of your web apps/sites? <comment><USER2> Digg has a couple. If you view source and go to the bottom of the page you'll see:

 those constants spell out (of course) digg. Barely an easter egg, but thought I'd throw it in.

There's a key-sequence that mimics a cheat from some game that will expand the comments completely. You can search digg for it if you're curious.

I think that because websites do change more often than desktop environments, people don't look for easter eggs with the same passion. And maybe because the effort involved in building and distributing a website is so much less than building and distributing a desktop application, that makes it more ephemeral, and programmers less likely to put in the time to build elaborate hidden functionality.

The constants thing was there for over a year before anyone noticed it.

<comment><USER3> for the even more curious, the konami code on digg expands all comments on a page.

<comment><USER4> What's the konami code?

<comment><USER3> <http://en.wikipedia.org/wiki/Konami_Code>

</comment></comment></comment></comment><comment><USER5> I did it!

Open Firefox and go to <http://adsl2.ctc.cl/adsl2/>

See the Telefónica logo on the upper left? Click on the dot in the "i" on the logo to see the credits of the authors of the application.

<comment><USER6> It is nice to recognize the development team. Cual de ellos eres tu?

<comment><USER5> Denis Fuenzalida, the second on the list :-)

</comment></comment></comment><comment><USER7> It surprises me too! (Although I think it may have something to do with web applications still being in the adolescent phase where they're trying to prove themselves to the world.)

I built two easter eggs into YellowPages.ca and they survived for two years until I finally mentioned them to a business manager who I can tell you, did not find them amusing. You can still see the evidence though:

<http://yellowpages.ca/search/si/1/invaders/space>

What: invaders Where: space

They obviously don't see the marketing potential in "fun" searches.

</comment><comment><USER8> Perhaps because easter eggs are a symptom of stifled creativity, which isn't as much of a problem with startups?

<comment><USER9> I tend to think that Easter Eggs are a sign of creativity in and of themselves. In one of my unreleased desktop applications, we poured way more time into an Easter egg than we should have (and uncovered a very interesting way to DOS a mac). It's a fun creative outlet.

<comment><USER10> He meant that people put easter eggs into applications because they hated the corporate drone work and used the eggs as a form of rebellion. Web 2.0 was suppose to free us all from that sort of drudgery.

</comment></comment></comment><comment><USER3> because its a lot harder to hide them with web apps.

<comment><USER11> why? this is what I used: when an user searches for a given keyword in the search box (a very unlikely search but not impossible from time to time) the ester egg is activated (setting a cookie).

p.s. is it a problem of mine or hackernews is monkey asses slow?

</comment></comment><comment><USER12> view source on <http://mootools.net/> and you are treated to some artwork

<comment><USER13> Ditto on Vimeo.com and Tumblr.com</comment></comment>


Bit – open source distributed code component manager - <AUTHOR> https://github.com/teambit/bit <comment><USER2> git for lambda functions? hell ya!

<comment><USER3> create serverless functions with fission on top of kubernetes</comment></comment>


My story of transitioning from Mac to Linux - <AUTHOR> https://opensource.com/article/20/4/mac-to-linux <comment><USER2> I switched from Mac to Linux a while ago. I compare the experience to living at home vs living in a hotel [1]: In a hotel (on Mac), everything is designed and cared for. But there's always an external agenda so you can't bring your own furniture. When you live at home (on Linux), it's less seamless and you need to do the dishes. But it's truly yours.

1: [https://fman.io/blog/home-and-hotel/](https://fman.io/blog/home-and- hotel/)

<comment><USER3> Indeed; just like with a house, on Linux things are always breaking.

My best analogy: buying a car from Lexus and taking it in for service every few years vs. building a car in your garage from plans you found on the Internet.

<comment><USER4> Unless you're running arch linux is pretty stable these days. I can't even remember when I last had to fiddle with my debian install.

</comment></comment></comment><comment><USER5> > I moved from (insert robust os here) to (insert meme linux distro here).

No thanks.</comment>


Building a Startup Scene in Any City - T-A http://www.fastcolabs.com/3037054/the-recipe-for-building-a-startup-scene-in-your-city?utm_content=buffer9c4eb&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

<comment><AUTHOR> I never believed there was a formula for attracting hackers' attention until I saw it before my very eyes. If you're a developer in Sydney, there is a good chance you came to the Atlassian HQ for meetups. They give us space, beer and pizza.

I met nearly all my non-coworker tech buddies there. I ended up adopting Atlassian products, befriending Atlassian staff, and nowadays I tell all new tech acquaintances to meet me there.

Now that I think of it, this is the very exact formula they followed to establish their offices as a tech hub, whether they know it or not.

But they are not the only game in town. Fishburners runs a smooth but very ambitious coworking/incubation space, and General Assembly does tech education & training exceptionally well with some of the most talented people around.

It's almost impossible to launch a tech startup in Sydney without having a foot in one of those places. And in our case, all three.

<comment><USER2> Interesting! I live in Brisbane and while we do have the beginnings of a startup scene it's not quite as vibrant as that of Sydney or Melbourne (at least w.r.t. VC and presence of big software companies).

I'm going down there in December and possibly studying there next year, would you advise checking out Atlassian's meetup first?

<comment><AUTHOR> Change the location to Sydney and see what comes up:

[http://www.meetup.com/find/tech/](http://www.meetup.com/find/tech/)

I get: Big Data

CSS

R

Scala

Ruby on Rails

SalesForce

AWS

TDD

Wordpress

DevOps

Micro services

Startup Founders 101

Agile & Scrum

Product

Internet of Things

Golang

Docker

Health tech

Python

Women who code

Android

JVM

Meteor

BI

Mobile dev

All Things API

Node.ninjas

Cassandra

Online marketing

MongoDB

PHP

Puppet

Drupal

Mobile.NET

OpenStack

Web Analytics

Continuous Delivery

Linux

PHP

MongoDB

</comment></comment></comment><comment><USER3> "A few years later, Crowley got a call from the U.K. Prime Minister's office. It was early 2010, and London had found out they'd be hosting the 2012 Olympics. They decided to hold it in the O2 Arena in Shoreditch, an area that happened to have a tech coworking space and the beginnings of a community. They'd just started hosting nightly events but hadn't jumped on the hashtag train, though they knew that branding was needed. The Prime Minister created a task force, and they looked around the world to see which startup scenes were catching fire. That's when they noticed Silicon Beach."

This is a total load of utter shite.

</comment><comment><USER4> So this guy is single-handedly taking credit for establishing LA's tech scene aka Silicon Beach? I wonder what others in LA think.

We work with a lot of economic dev groups and a hashtag has never come up in the top 100 things of importance. Not sure how access to capital isn't part of the equation?

Nice simple and seemingly incomplete formula for building startup hubs. Prob does sell a lot of consulting however as frameworks like this make hard problems sound easy to solve which is always alluring.

</comment><comment><USER5> So how important is the presence of VC's in the area? From what I understand, VC's know that if they invest in 10 startups, only 1 of them would result in a high return but that would make up for the other nine ones. This way, 10 start ups got their shot. Now if all the potential investors in the area are highly risk-averse, and insist that they would only invest if you are already making a huge profit, then that kinda adversely affects that startup scene, no?

</comment><comment><USER6> I think the single best way you can build a tech community is to just focus on building a great company. So many people worry about an ecosystem but the only way to make that flourish without a constant influx of foreign capital is to build something sustainable.</comment>