What Makes Rails a Framework Worth Learning in 2017?

What makes Rails a framework worth learning in 2017? originally appeared on Quora: the place to gain and share knowledge, empowering people to learn from others and better understand the world.

Answer by David Heinemeier Hansson, Creator of Ruby on Rails, Founder & CTO at Basecamp, on Quora:

The same reasons why it was a framework worth learning in 2004. The more things change, the more they stay the same. While we’ve seen a lot a progress in the JavaScript world, we’ve also seen a regression to the complexity-laden world that Rails offered refuge from in the early days.

Back then the complexity merchant of choice was J2EE, but the complaints are uncannily similar to those leveled against JavaScript today. That people spent hours, if not days, just setting up the skeletons. The basic build configurations. Assembling and cherry-picking from lots of little libraries and frameworks to put together their own snowflake house variety.

The core premise of Rails remains in many ways as controversial today as it was when it premiered. That by formalizing conventions, eliminating valueless choices, and offering a full-stack framework that provides great defaults for anyone who wants to create a complete application, we can make dramatic strides of productivity.

It’s somewhat surprising to me that despite the astounding success of Rails, that there hasn’t been more competition for this proposition. The vast majority of activity today is for yet another option on the a la carte menu. Yet another build system, yet another view library, yet another ORM. Very little activity in integrated solutions.

I guess the answer is that the foundational proposition of Rails continues to cut against the psychological grain of most programmers. That by reducing choices and accepting community conventions and answers to most of the basic questions in web development, you end up better off. Less unique, less tailored, but in ways that just don’t matter anyway.

Anyway, that’s the big ideological appeal of Rails. I’ve elaborated further on convention over configuration, the a la carte/omakase conflict, the appeal of integrated systems, and other core values of the Rails community in The Rails Doctrine.

After reading that, you’ll probably have a pretty good idea as whether Rails is something for you or not. If you can’t recognize any of the struggles outlined in that document, or you just don’t like the solutions presented to those struggles, the particulars of Rails technology probably doesn’t matter much. If that document resonates, or at least piques your interest, read on.

On top of these ideological choices, we’ve built an incredibly pragmatic and multi-paradigm web framework. When people hear “web framework”, they sometimes think, “oh, that’s just some stuff to generate HTML, right?”. And in that definition, some might see it as though Rails competes against something like React. And I suppose it does, but in a very remote way that isn’t very useful to thinking about whether Rails is right for you or not.

As I talked about above, Rails has an incredibly ambitious mission. In the full-stack goal lies a pursuit to deal with just about every piece of code needed to connect databases and no-sql stores to a business domain model written in Ruby to a set of controllers that expose that model via REST and then, yes, finally to HTML. But that last step is a small minority of the code and focus of Rails.

So if you think that client-side MVC, React, Angular, or whatever is The Future, then you’re still squarely in the target audience for using Rails. Because the bits you use to design your HTML/JavaScript-based UI still needs to connect to a back-end domain model that saves stuff to the databases, computes things, enqueues jobs for later processing, sends out emails, triggers push notifications, and all the other stuff that real apps need to do.

And that’s where the meat of Rails sits. In what happens once that POST or PUT or GET is triggered. Now, as I said, Rails is full-stack by default. So of course we also include answers for how to generate and update HTML. We have some phenomenally productive answers in Turbolinks and SJR, but even if that path doesn’t appeal, everything that leads up to generating that JSON is still stuff we’ll have in common.

Anyway. That’s a very long pitch for two basic tenets of Rails appeal in 2017: 1) We have a unique ideological foundation that’s still controversial today and offers the same benefits against the mainstream choices as it did thirteen years ago, 2) We have a pragmatic, full-stack answer that could be formulated based on that ideology that still offers amazing productivity from the second you run the rails new command.

Oh, and on top of all that, I’ve saved the cherry for last. You get to use Ruby, which, even in a world that has rediscovered the benefits of functional programming and immutability, remains the most extraordinarily beautiful and luxurious language I’ve yet to encounter. Just look at some code. I dare you not to fall in love.

This questionoriginally appeared on Quora. the place to gain and share knowledge, empowering people to learn from others and better understand the world. You can follow Quora on Twitter, Facebook, and Google+. More questions:

— This feed and its contents are the property of The Huffington Post, and use is subject to our terms. It may be used for personal consumption, but may not be distributed on a website.


January 30, 2017

Leave a Comment

Ideology and Environmental Protection

With the phrase “climate change” disappearing from U.S. federal government websites and increased talk of regulatory overreach, it is obvious that protecting the environment will continue to be a fault line in American political ideology. While there are plenty of examples of environmental regulations being administered with rigidity and inflexibility, there are far more examples of accommodation and a process that provides plenty of time for businesses and localities to comply with environmental standards. The typical pace of regulation implementation in America is measured in decades, not days. For example, the hazardous waste regulations required in the 1976 Resource Conservation and Recovery Act, and the 1984 amendments to that bill, were not finalized until the 1990s. The Federal Water Pollution Control Act was enacted in 1972 and here in Manhattan we were still dumping raw sewage into the Hudson River until the North River wastewater treatment plant opened in 1984. Developing, issuing and implementing environmental regulations is a long process of give and take. Climate activists may call for immediate reductions in carbon emissions, but I don’t see anyone unplugging their smart phones. The transition to renewable energy will take time.

The gradual and incremental approach to environmental protection has worked. America’s air and water are cleaner today than they were in the 1970s and our population and economy have grown substantially since then. If there really was a trade-off between environmental protection and economic growth, the progress we’ve made since the 1980s could not have happened. The idea that American environmental regulation ignores practical concerns and the views of business interests is complete nonsense. But the idea that enforceable national standards are not needed is foolish and dangerous. America’s air and water are relatively clean because business has been convinced to take regulations seriously and develop and pay for the installation of the best available pollution control technology. If you doubt this is true go to Delhi or Beijing and try to take a deep breath. Their air quality provides a graphic example of the impact of unenforced environmental standards.

Nevertheless, a liberal-conservative divide has developed in American environmental policy. This is most clearly seen in climate change, where the discussion has degenerated into an argument between climate believers and climate deniers. Facts are not values; one does not need to believe in facts. We don’t believe in gravity, we experience it. But climate policy has taken on a weird spiritual dimension. We don’t see the same quasi-religious discussion around air and water pollution. I guess that’s because the facts of polluted air and water are local and can often be seen and smelled. Climate change is a more gradual and global phenomenon and human induced change is taking place alongside of natural climate change. The planet is getting warmer, but some “believe” it has nothing to do with people and their machines, that perhaps it’s all natural. It takes scientific literacy and often model-based analysis to understand climate change.

The complexity of climate change and the aggressive lobbying of the fossil fuel business has worked to discredit the largely settled science of human-induced climate change. We have seen this anti-science push before, in the decades-long battle over the health effects of tobacco. The tobacco industry spent many years and many dollars fighting scientific reality, but, of course, the health effects of cigarettes proved inescapable. Climate impacts are also real, becoming apparent and will also eventually need to be acknowledged. In an interesting article about climate and agriculture in the American Midwest, Hiroko Tabuchi of the New York Times reports on the growth of climate and environmental awareness among Midwestern farmers. As Tabuchi reports:

“Doug Palen, a fourth-generation grain farmer on Kansas’ wind-swept plains, is in the business of understanding the climate. Since 2012, he has choked through the harshest drought to hit the Great Plains in a century, punctuated by freakish snowstorms and suffocating gales of dust. His planting season starts earlier in the spring and pushes deeper into winter. To adapt, he has embraced an environmentally conscious way of farming that guards against soil erosion and conserves precious water…he is a climate change realist. Just don’t expect him to utter the words “climate change.” …Here in north-central Kansas, America’s breadbasket and conservative heartland, the economic realities of agriculture make climate change a critical business issue. At the same time, politics and social pressure make frank discussion complicated….So while climate change is part of daily conversation, it gets disguised as something else.”

Tabuchi also notes that renewable energy is not discussed as a way to mitigate climate change, but as an inexpensive form of locally generated power.

This is an indication that the path to a renewable resource-based economy and to climate change mitigation and adaptation will not be the direct cause and effect path preferred by many climate scientists and environmental activists. Instead we will see the meandering incremental and pragmatic approach typical of America’s policy response to other issues. Two steps forward and one step back seems to be the American Way. We are seeing it in health care; we’ve seen it on other environmental issues; we see it in issues of racial and gender equity.

The political center gets redefined by social, economic and physical realities. Business doesn’t like being told what to do, and we seem to have an aversion to regulation, but support for clean air, clean water and productive soil is widespread and ultimately prevails against ideological bias. In the strange political environment of the Trump era, I worry that this delicate balance between business and environment will be upset if business stops believing that regulations will be enforced. It is the settled law of the land that greenhouse gases are air pollutants that must be regulated under the Clean Air Act. The Supreme Court has already made that decision. The EPA under George W. Bush was slow to promulgate greenhouse gas regulations and the Obama administration didn’t get around to it until their second term. The current rule is being reviewed by the courts, and even if it is thrown out, the Trump EPA will be required to issue another rule.

The American legal process, with few exceptions, moves slowly and deliberately. As we learned this past weekend with its partial stay of the Trump Administration’s immigration executive order, the courts are better at stopping the abuse of power than at requiring action. Once a greenhouse gas regulation is in place, the long process of negotiating reductions can finally begin. Getting power plants to reduce greenhouse gas emissions will often require a difficult and delicate process. Gradual compliance schedules will be used to ensure that power supplies are not interrupted. Local stakeholders will be consulted; some will sue to be sure their voice is heard. That is how the process works.

Initially, a Trump EPA may have difficulty meeting its responsibilities to issue and enforce regulations. EPA’s resources will be reduced, and political support will be lacking. Talented people will give up and leave the federal government. We saw this during the first two years of Ronald Reagan’s presidency. I am counting on the reality of a lethal environment to stimulate a non-ideological, broad based response to anti-environmental policy. The question in 2017 will be: Has environmental policy become so ideological, that like the crowd size at the inaugural, our rulers make up their own facts? If they do, progress will slow down, although I still doubt that the fundamental rules of American environmental protection will be abandoned. I believe that in a federal system, state and local governments will hear directly from their constituents and have the resources and power to respond to community needs. States will also sue the federal government to compel federal action.

Climate change is already affecting Midwest agriculture. Lead in drinking water harmed the health of children in Flint. Americans coming back from China understand the difference between their air and ours. We experience these realities and environmental policy responds. Ideology will shape the nature and speed of response, but the environmental problem is real and cannot be ignored.

— This feed and its contents are the property of The Huffington Post, and use is subject to our terms. It may be used for personal consumption, but may not be distributed on a website.


January 30, 2017

Leave a Comment