The MIT sci-Tech Review, published this week, says programming languages shape the way users think. It can also reflect the strategy of startups in the tech industry and why they have the ability to transform themselves.
The following is the full article:
As a development language for Twitter, Hulu and many contemporary internet services, Ruby is a great concern. And when the Japanese computer scientist Pine Line macro decided to design the language, he borrowed from Samoere Drani (Samuel R. Delany) 1966 Science Fiction "BABEL-17" concept. The core of the novel is a man-made language called "BABEL-17", which can obviously improve the user's thinking level. "BABEL-17 is an accurate analytical language that allows you to be proficient in any technology. The protagonist of the novel once said so. Through Ruby, we want to achieve a similar goal: change and optimize the way programmers think.
This is a very ambitious goal, but the idea of a loose-line macro has become mainstream. Software developers often believe that programming languages are enough to reverse their way of thinking, to change the way they solve problems, and even to change their understanding of which problems they should solve. That's how they estimate the size of a company, a product, and a competitor: "What language do you use?" ”
An examination of the programming language will help outsiders understand why these software companies are so powerful, have such high value, and how their products and services fit into our lives. The internal decisions of these enterprises, even in what language, whether it be ruby, PHP or C, will have an impact on all of us. If you want to know why Facebook looks and uses it today, and what it's going to be like in the future, you need to get to know the programming language PHP that Mark Zuckerberg uses.
Among programmers, PHP is perhaps the least respected programming language. Because of the many flaws, the well-known technology blog Eevee that PHP is "a piece of bad design", and the developers willing to use PHP is very amateur. Jeff Atwood, co-founder of the programming quiz site Stack Overflow, said: "It's strange that smart engineering people are going to go to Facebook." They develop PHP code in a Windows XP environment. They are hackers, but here the ' hacker ' is a derogatory. "It's called" The Clumsy Beast "," the epidemic ", and the" haunted House "that attracts mystery enthusiasts.
A successful programming language has a holistic philosophy, or a set of logically self-consistent guidelines to organize vocabulary and grammar (i.e., instructions provided to programmers). But PHP is not. Rasmus Leirdorf, the designer of the language, Rasmus Lerdorf once admitted that he was just mixing a lot of things together. "I don't know how to stop it all. "I have absolutely no idea how to write a programming language, and I'm just constantly adding new logical steps in the process," he said in an interview in 2003. ”
One example that programmers like to talk about is the PHP function "mysql_escape_string". This function removes the malicious input request from the message before it is sent to the database. (Examples of malicious input include the e-mail address of a form requesting a user on a Web site, and the password of a hacker inserting a code-stealing site.) After discovering a vulnerability in the function, a new version called "Mysql_real_escape_string" was created, but the old version was not replaced. So the current situation is like being in the cockpit and emitting two buttons with similar functions: One of the buttons is for lowering the landing gear and the other for safely lowering the landing gear. This is not only counterintuitive, it can even cause disaster.
Although many people do not like PHP, PHP is still a large part of the foundation of the site. A study shows that as many as 39% of all domains in the current Internet are based on PHP technology. Facebook, Wikipedia, and the leading publishing platform WordPress are using PHP to develop. This is because, despite many flaws, PHP is almost perfect for beginners. The name of PHP is originally the abbreviation for "Personal homepage". With this language, programmers can easily add dynamic content, such as dates and user names, to static HTML pages. The rise of PHP has driven the leap from web development to Web application development, and developers don't even have to be professionals.
Olly Livny Ori Livneh, the Wikimedia Foundation's lead software engineer for Wikipedia projects, says PHP's easy-to-get features are the key to Wikipedia's success. But he points out: "I've always hated PHP." "Due to the reliance on PHP, Wikipedia has developed a design loophole after the expansion of the user size." (It is for this reason that Wikipedia has not supported mobile devices until 2008.) It was not until 2013 that the site provided a user-friendly editing interface. However, based on PHP, some people who are unfamiliar with software programming can also develop new features. For example, using the PHP language, Wikipedia displays hieroglyphs on the Egyptian Antiquities article and can play music on the page.
Google is unable to use the PHP language because the current Google needs to do a very good job of doing a quick and accurate search. As a result, Google's search engine uses more powerful languages, such as Java and C + +. Compared to Google, Facebook is a center of small-scale experimentation, a hodgepodge of buttons, message flows and gizmos. In this case, PHP will be able to implement functionality more quickly.
You can even imagine how Zuckerberg, the Harvard dorm, chose Facebook's development style at a decisive moment. He needs to make the site live at minimal cost. Network development speed, user preferences are fickle, the only way to seize the opportunity is to become the forerunner of the market. It doesn't matter whether it's a hodgepodge of dishes or a delicate pasta. He first needs to complete the site so that users can use it. He is not thinking about the beauty of the code, but how to get friends aboard the Thefacebook website to evaluate the girls they are familiar with.
Today, Facebook has a market capitalisation of more than $200 billion, and the company's office wall has the slogan: "It's more important to get things done than perfect" and "fast action to break the deadlock". These bold slogans are designed to ensure that employees conform to the company's "hacker" culture. This also accurately reflects the value of PHP. Fast action, breaking the deadlock, is exactly what PHP is, and it represents the way PHP programmers think about problems. You can even say this: PHP itself creates and maintains the culture of Facebook.
Secret weapon: more powerful language
If you want to find another idea that is diametrically opposed to PHP, and look at the other extreme, then the financial trading company Jane Street Capital is in the lower Manhattan headquarters of New York worth a look. The company, with 400 employees, is currently dealing with about 2% of the daily securities traded in the United States.
When I met Jane Street Capital Technical director Jalons Minsky (Yaron Minsky), he was sitting at his desk, next to a Enigma cipher, one of the few remaining weapons of the World War II era. I thought it was the coolest secret weapon in his room, but then I found myself making a mistake. Minsky spoke of a programming language called OCaml. As a PhD in computer science, Minsky persuaded his boss in 10 to rewrite the company's entire trading system using OCaml.
Until now, few people have used OCaml in practical applications. The language was designed by a French research institute, and the original purpose was to optimize the computer system that automatically proves the mathematical theorem. Minsky was exposed to the language at his graduate level. In his view, the language could replace the Excel spreadsheet used in the Jane Street Capital trading system.
The most important feature of the OCaml is the "Input inspection system". This is similar to Microsoft Word's grammar checking feature, which can be marked with a green wavy line underneath the code that the system considers to be wrong, and then prohibit such code from running. The process developed with this system is highly reliable, which is important when the software being developed needs to deal with $30 billion of transactions per day.
Minsky said that by capturing the vulnerability, OCaml's input inspection system allowed Jane Street Capital programmers to focus on bigger problems. And if the company can further ocaml the inspection function, then it will cultivate a habit, so that programmers can not think about the wrong ideas.
In addition, in order for the input Check tool to function, programmers need to add complex annotations to the code. This is like saying that word's grammar checker requires you to annotate all the sentences. Writing code with limited input is a bit of a hassle, even frustrating. Worse, OCaml involves very abstract mathematics compared to other programming languages, making it difficult for most programmers.
However, the accuracy of the language is very appealing to some people and gives Jane Street capital an unusual recruiting advantage. While some software developers have joined Facebook and Wikipedia without regard to PHP's flaws, Minsky said the OCaml language and his book, "The OCaml of the real world", helped to attract talented programmers. Attractiveness is not just about language, it's about people who use it. At Jane Street Capital, employees go to chess at rest time. This culture of intellectual competition seems to be closely related to the use of OCaml language.
Google also seems to be trying to achieve the same goal with its self-designed high-performance language go. To make Web services more elegant and efficient, it is beneficial to develop more advanced software for the servers behind large network services. In addition, it is an attraction for programmers who like new things and like to challenge them.
The right time: after growth
Facebook suffered a crisis at the end of 2010. PHP is not a language that emphasizes the performance of code, but there was a need for Facebook at the time. Facebook is growing fast, so if you don't make some big changes, the company will fail.
Completely changing the programming language is not one of the options. The code that Facebook has written in PHP has reached millions of lines, and there are thousands of engineering experts working on the development, and the resulting product has accumulated hundreds of millions of users. As a result, many of Facebook's senior engineers set up a small team. They are trying to invent a way for Facebook to deliver its services normally without having to abandon its "native language".
Part of the solution is to develop a compiler that translates Facebook's PHP code into faster-running C + + code. And the other part is a feat in computer language engineering: Continue to bring a PHP-style culture to Facebook programmers, while allowing them to write code that is more reliable.
This "rescue team" designed a variant of the PHP language, namely hack. The hack is a PHP language with an optional input check system. You can quickly write code-confusing PHP programs as usual, or you can follow system requirements by adding comments to let the system check the correctness of your code. This input check tool is developed entirely using OCaml, which is no coincidence. Facebook wants programmers to use familiar language to write code quickly, but they don't want them to get things wrong. (last year, Zuckerberg unveiled a new Facebook project slogan: "Act quickly in order to ensure that the infrastructure is stable." ”)
At the same time, Twitter is making a similar transition. The development of Twitter was originally based on the Ruby on Rails. This is a popular network programming framework developed in Ruby language, and draws on many ideas from PHP. However, Twitter also saw a spike in the number of users. If a user has hundreds of thousands of followers, then when he publishes the message, the hundreds of thousands of user's timeline needs to be refreshed accordingly. In the past, some popular Twitter messages often overwhelmed the system, causing Twitter engineers to suspend service and fix the problem. Twitter has also been "notorious" for its attendant frequent outages.
Twitter then solved the problem by rewriting a large portion of the service's code in the Scala language. Unsurprisingly, like OCaml, Scala is a language designed by academic institutions, with a powerful input inspection system that emphasizes the accuracy and performance of the code, and thus sacrifices the programmer's personal programming freedom and entertainment.
After finding the revenue model, startups will mature. Similarly, they can also use the power of programming languages to manipulate corporate culture. Guido Van Locem, a programming language designer, Guido van Rossum, who has been with Google for 7 years, has now joined Dropbox. When software companies reach a certain size, he says, the only way to avoid confusion is to use programming languages that have more requirements for programmers. "Your speed may be slowed down because you need to repeat 3 times to express the same thing. "he said.
As a result, many startups want to wait as long as possible to make changes. They may lose some of their early-stage cattle, and it is not conducive to small teams to quickly develop new features. However, such a language will help programmers across the company understand each other's code, bringing a more stable product. If you want your product to be a part of people's daily lives, this stability is essential.
The ability to take different strategies depending on the situation is driving the development of software startups to some extent. The development of software relies on the popularization of computers, and these companies have a unique way to reinvent themselves. With change and development, what they can do is not only to adjust the organizational structure, but also to make some deeper changes, that is, to change their own culture and way of thinking.