LANGUAGES & FRAMEWORKS(语言和框架)

来源:互联网 发布:mac 安装软件如何卸载 编辑:程序博客网 时间:2024/05/24 01:37

Over many years, JavaScript has grown to become probably the most widely used programming language in the world. Nevertheless, the language itself has a few problems that many have attempted to address by using libraries or even by implementing their own languages that run on top of JavaScript (of which we’ve mentioned both CoffeeScript and ClojureScript before). ECMAScript 6, the new version of JavaScript, addresses many of the concerns of the older versions currently in use. Although browser support is scarce, support from mature transpilers like Babel allows you to write ECMAScript 6 and have it supported in older browsers. For new projects, we strongly suggest starting with ECMAScript 6 from day one.

在过去这些年,JavaScript不断成长,现在几乎成为这个世界上最被广泛使用的编程语言。然而,这个语言他自身存在的一些问题导致很多人通过使用库,甚至在JS之上实现自己的语言(就像我们之前提到的CoffeeScript和ClojureScript)来解决JavaScript自身的问题。ECMAScript6,JavaScript的新版本解决了很多现在使用的老版本的问题。尽量浏览器的支持还不足,但是像Babel这样的编译工具的支持使得我们可以编写ECMAScript6并且让它支持老的浏览器。对于新的项目,我们强烈建议从项目一开始就使用ECMAScript6。

A year after its public debut, Swift is now our default choice for development in the Apple ecosystem. With the recent release of Swift 2, the language approaches a level of maturity that provides the stability and performance required for most projects. Swift still has issues, especially around tool support, refactoring and testing. However, we feel that these are not substantial enough to warrant avoiding Swift. At the same time, porting large, existing Objective-C codebases is unlikely to pay off. The announcement that Swift will become open source software is a further positive sign. We are hopeful that this will not just be another dumping of internally developed code into a public repository, because Apple has clearly stated that community contributions are encouraged and will be accepted.

在首次公开亮相一年之后,现在Swift是我们在开发苹果生态系统时的默认选择。随着最近发布的Swift2,语言层面达到了一定的成熟度,并且其稳定性和性能能够满足大多数的项目的需求。Swift仍然有一些问题,特别是在工具的支持、重构和测试方面。然而,我们觉得这些都不足以让我们避免使用Swift。同时,移植大的、现存的Objective-C代码库不大像是个划算的选择。宣布Swift将要开源是另一个很好的信号。我们希望这不仅仅是另一个只是把内部的代码丢到公共仓库上的例子,因为苹果已经明确表示,社区贡献是被鼓励和被接受的。

Most templating frameworks like Mustache or FreeMarker mix code with markup in a single file to implement complex, dynamic content. Enlive is a Clojure-based templating framework that completely separates programming language from HTML markup and employs CSS selectors to find and replace parts of the document. Enlive demonstrates the power of functional programming to implement complex behavior through a series of simple, composable functions acting on a common abstraction. Our teams working in Clojure have found it to be a very useful and straightforward tool.

Mustache或FreeMarker等模板框架都把代码和标记混杂在同一个文件中以实现复杂的动态内容。Enlive是基于Clojure的模板框架,她彻底分离程序代码和HTML标记,用CSS选择器查找并替换文档片段。Enlive展示了函数式编程的威力,用一组简单的、可组合的函数作用于通用的抽象结构来实现复杂行为。我们使用Clojure的团队认为Enlive是个既实用又直接的工具。

We have a number of reservations about the use of HTML5 WebSockets. By allowing the server to initiate actions on the browser, WebSockets departs from the connectionless, request/response model that underpins the World Wide Web today. Security is another big risk with WebSockets. For example, the standard does not impose any cross-origin request policy. However, we do recognize that in certain monitoring or alerting applications, WebSockets can be very useful. If you need to build a .NET WebSockets server, SignalR conveniently implements much of the additional code you need for a robust production application. This includes some recommended security practices such as validating connection tokens and activating SSL when encryption is needed. Although ThoughtWorks teams have been very happy with SignalR, there are still fundamental issues with WebSockets that you should consider before diving in.

我们对于HTML5的WebSockets技术仍然有很多疑虑。无状态,请求/应答模型是支持现今互联网的基础,但是WebSockets允许服务器端来初始化浏览器端行为,这种方式已经和这个模型背道而驰。安全性是WebSockets另一个隐患,例如在WebSockets标准中,对于跨域没有任何的限制策略。不管怎样,我们认为在一些监控、报警应用程序中,WebSockets可以大显身手。如果你需要构建一个基于.Net的WebSockets服务器,SignalR实现了构建健壮、实时应用的大部分代码。这包括一些推荐的安全实践,例如对于连接令牌(Connection Token)的验证、按需激活SSL加密等。尽管ThoughtWorks团队对于SignalR非常满意,但是我们建议在你选择之前还是需要慎重考虑WebSockets所带来的根本性问题。

Spring Boot allows easy setup of standalone Springbased applications. It’s ideal for pulling up new microservices and easy to deploy. It also makes data access less of a pain, thanks to the Hibernate mappings with much less boilerplate code. We like that Spring Boot simplifies Java services built with Spring but have learned to be cautious of the many dependencies. Spring still lurks just beneath the surface. If you’re writing microservices with Java, you might also consider using DropWizard or a microframework like Spark to get the benefits of Spring Boot without the enormous weight of Spring.

使用Spring Boot可以轻松设架设独立的基于Spring的应用,它非常适合搭建新的微服务并且易于部署。通过更少的样板代码,它降低了数据访问时Hibernate映射所带来的痛苦。Spring Boot简化了基于Spring的服务,这是我们所喜欢的,然而同时,我们也知道一定要对依赖保持谨慎。毕竟,潜伏在表面之下的依然是Spring。如果你在使用Java写微服务,你也可以考虑使用DropWizard或者像是Spart这样的微框架,一方面能够得到Spring Boot的好处,另一方面又不会像Spring那么重型。

While we still have some reservations about CQRS as a general pattern, the approach can work very well in specific places. In those specific situations, however, a lot of work is left to the developer to properly execute CQRS. Axon is a framework that can help with this on the JVM, and we’ve used it with some success. Although it certainly can’t be considered a perfect solution right now, it continues to evolve and may make much more sense than trying to write everything from scratch.

把CQRS作为一个一般模式我们仍然有些顾虑,尽管如此,这个方案在特定的情况下非常适用。但是在这些情况下要正确地使用CQRS,开发者仍然有很多工作需要去做。构建于JVM平台的Axon框架可以很大程度地解决这个问题,借助于它,我们已经在一些项目上取得了成功。尽管目前看来,Axon框架并不是一个非常完美的技术方案,但是它正在持续演进。相比于从头开始构建所有东西,有时使用Axon会显得更有意义。

Following many other programming languages, one of the language geeks’ absolute favourites, Haskell, is now also available on the JVM in the form of Frege. This brings a purely functional programming language onto the platform, allowing for easy interoperability with other JVM languages and libraries.

和许多其他编程语言一样,极客们最喜爱的编程语言之一,Haskell,现在也以Frege的形式出现在JVM平台。它把纯粹的函数式编程语言引入该平台,并支持和其他JVM语言和库的简单互操作性。

HyperResource is a Ruby framework for building a RESTful API client. The framework accepts JSON in HAL format and dynamically generates a model object complete with hypermedia links. Although the framework is still in its infancy, we like that it embraces Richardson level 3 REST for better service discoverability and self-documenting protocols.

HyperResource是一个构建Restful API客户端的Ruby框架,它接受HAL格式的JSON响应,动态地生成包含超链接(hypermedia links)的对象模型,我们推荐它的原因在于它在Richardson REST成熟度模型中处于第三层,具有更好的服务发现性(discoverability)和协议的自描述性(self-documenting)。

Material UI provides reusable components for use in React applications that implement Google’s Material Design language. Filling a similar space to Twitter Bootstrap, it gets you up and running quickly but doesn’t have the same drawbacks as your application grows. Elemental UI is worth investigating as an alternative.

Material UI为实现了谷歌的Material Design语言的React应用程序提供了可复用的组件。它填补了一个类似于Twitter Bootstrap的一个空白区域,它既能让你的程序快速的跑起来,又不会随着应用程序的增长暴露出同样的缺点。除此之外,Elemental UI也是值得研究的替代选择。

OkHttp is a Java HTTP connection library from Square that provides a fluent interface for creating connections, as well as support for the faster HTTP/2 protocol.Even when using HTTP/1.1, OkHttp can provide performance improvements via connection pooling and transparent gzip compression. Supporting both blocking synchronous and nonblocking asynchronous calls, it can also be used as a drop-in replacement for the widely used Apache HttpClient.

OkHttp是来自Square的一个Java Http连接库,他支持更快的HTTP/2协议并且提供流畅的连接创建接口。即便是用HTTP/1.1, OkHttp也能通过连接池和透明gzip压缩提高性能。支持同步阻塞调用以及异步非阻塞调用。可作为Apache HttpClient的直接替代品。

Yet another entrant into the cross-platform mobile development world, Facebook’s React Native brings the React.js programming model to iOS and Android developers. React Native programs are written in JavaScript, but unlike a hybrid framework such as Ionic, React Native gives developers access to native UI components on the target platform. This is an approach we’ve seen before (e.g., Calatrava), but React Native has already inspired a substantial developer community and builds on the momentum generated by React.js. This framework could play a significant role in the future of mobile app development.

作为跨平台移动开发世界里的新成员,Fackbook的React Native 将React.js的开发模型引入给了IOS和安卓的开发者。React Native程序使用JavaScript语言开发,但是并不像其他的混合式开发框架一样(例如lonic),React Native给予了开发者在目标平台调用原生UI组件的能力。这种方式我们也在其他框架看到过(例如Calatrava),但是React Native已经就着React.js的势头,激活了巨大的开发者社区。这种架构将会在未来的移动应用开发领域扮演一个非常重要的角色。

Building systems using microservices requires us to think more deeply about failure isolation and testing. TLA+ is a formal specification language that can be useful in both these scenarios. For failure isolation, TLA+ can be used to identify invariants in your system that can be monitored directly. An invariant can be the ratio of number of requests to one service to the number of requests to a second service, for example. Any change in this ratio would lead to an alert. TLA+ is also being used to identify subtle design flaws in distributed systems. Amazon, for example, used modelchecking based on a formal specification written in TLA+ to identify subtle bugs in Dynamo DB before it was released to the public. For most systems, the investment required to create the formal specification and then perform model checking is probably too great; however, for critical systems - complex ones, or those with many users - we think it’s very valuable to have another tool in our toolbox.

基于微服务架构的系统要求我们更深刻地思考如何处理故障隔离和测试。TLA+是一种正式的语言规范,可以被用在这两种场景中。针对故障隔离,TLA+可以识别系统的不变量,从而直接进行监控。比如,一个系统的不变量可以是不同服务间的请求数量比例,那么超过这个比例就会发出警报。TLA+还可以识别分布式系统中细微的设计缺陷,比如,亚马逊用TLA+编写了模型检测的规范,从而能够在Dynamo DB发布到产品环境之前识别那些细微的缺陷。对于绝大多数系统来说,去编写规范然后进行模型检查的投资成本可能过大。而对于那些非常复杂的关键系统,或者有一定数量级用户的系统,我们认为TLA+是非常有价值的,值得去学习。

Traveling Ruby makes it possible to distribute portable, ready-to-run, platform-agnostic Ruby binaries without the need to install an interpreter, packages or additional gems. It decouples running Ruby applications from the development environment they run in.

Traveling Ruby使得发布可移植的、开箱即用的、平台无关的Ruby二进制文件变成可能,并且它不需要安装解释器、包或者是额外的gem。他解除了Ruby应用执行环境与其开发环境之间的耦合。

0 0
原创粉丝点击