代码流星雨是什么形式_为什么要在2020年与流星合作

代码流星雨是什么形式

Meteor, an allegedly dead development platform, is still alive and can bring massive value to your everyday coding experience.

Meteor,据称已失效的开发平台,仍然有效,可以为您的日常编码体验带来巨大的价值。

Meteor appeared at the beginning of 2012, rocking the web development world. The possibility of bridging the gap between the server and client sides of a particular website or web app was genuinely tempting.

流星出现在2012年初,震惊了Web开发世界。 弥合特定网站或Web应用程序的服务器端与客户端之间的鸿沟的可能性确实诱人。

Many experts thought that this capability alone should have turned the platform into a mainstream industry standard. Nevertheless, eight years later, many people claim that Meteor is dead.

许多专家认为,仅凭此功能,该平台就应已成为主流行业标准。 然而,八年后,许多人声称流星已经死了。

Is that so? And is there any rational justification for learning Meteor? This article will give you a definitive answer.

是这样吗? 学习流星有合理的理由吗? 本文将为您提供明确的答案。

流星死了! 流星万岁! (Meteor is Dead! Long Live Meteor!)

Many developers believe that Meteor is dead. The popular explanation is simple: being introduced in 2012, it already had a promising set of features in 2015 but failed to extend them significantly.

许多开发人员认为流星已经死了。 流行的解释很简单:该功能于2012年推出,在2015年已经具备了令人鼓舞的功能,但未能对其进行重大扩展。

Some of you might have even heard of the problems with the funding of the development team, too. For many people, this fact alone is enough to forget about the platform once and for all.

你们中有些人甚至可能已经听说过开发团队的资金存在问题。 对于许多人而言,仅此事实就足以一劳永逸地忘记该平台。

However, the reality is much more optimistic than it may seem. Today, the developers of Meteor receive stable funding from Tiny, one of the most reliable investment funds in IT. The version history also shows that the development platform is far from being dead, with the most recent iterations having a proud 1.10.1 designation released in February 2020.

但是,现实比看起来要乐观得多。 如今,Meteor的开发人员从Tiny(这是最可靠的IT投资基金之一)获得稳定的资金。 版本历史还表明,开发平台还远未结束,最新的迭代版本于2020年2月发布,引以为傲的1.10.1命名。

Thus, if you have always secretly liked Meteor but were afraid to choose the platform due to the constant reports of it being dead, now is the perfect opportunity to hop onto the hype train.

因此,如果您一直暗中喜欢Meteor,但由于不断有报道称它已死而又害怕选择该平台,那么现在是跳上炒作的绝佳机会。

The reports of Meteor's death are greatly exaggerated, and the possibility of its success is greatly underestimated.

流星死亡的报道被大大夸大了,其成功的可能性被大大低估了。

空前的简单性:流星的主要特征 (Unprecedented Simplicity: The Key Features of Meteor)

Now that we have clarified the status of Meteor, it is time to describe some of its killer features. Meteor is undoubtedly among the most feature-rich and, at the same time, easy-to-use JavaScript frameworks today.

既然我们已经弄清了流星的状态,是时候描述它的杀手级功能了。 流星无疑是当今功能最丰富,同时又易于使用JavaScript框架之一。

杀手级功能1:统一客户端和服务器开发 (Killer Feature 1: Unified Client and Server Development)

Meteor, as we have mentioned before, is notable for its ability to bridge the gap between the server and client sides of any project. Thus, every aspect of your website can be developed solely via JavaScript.

正如我们前面提到的,Meteor以其弥合任何项目的服务器端与客户端之间的鸿沟而著称。 因此,您网站的各个方面都可以仅通过JavaScript进行开发。

The benefits of this feature are boundless in the modern development world, and are valuable for both fledgling and the experienced developers.

此功能的好处在现代开发世界中是无穷的,对于新手和经验丰富的开发人员都是宝贵的。

Above all, this approach allows developers to create projects without experience with other programming languages.

最重要的是,这种方法使开发人员无需使用其他编程语言即可创建项目。

Thus, a talented but inexperienced JavaScript programmer can easily maintain several Meteor projects without any problems. Experienced developers can go even further, maintaining whole ecosystems of services and products via the Meteor platform.

因此,一个有才华但没有经验JavaScript程序员可以轻松地维护多个Meteor项目,而不会出现任何问题。 经验丰富的开发人员可以走得更远,通过Meteor平台维护服务和产品的整个生态系统。

Consequently, the adoption of Meteor in your company can be an extraordinary boon for all involved parties.

因此,对于所有相关方而言,在您的公司中采用Meteor可能是一个非凡的福音。

  • Your programmers will be able to develop more and spend less time on the exhausting process of learning additional frameworks and programming languages.

    您的程序员将能够在学习其他框架和编程语言这一精疲力竭的过程中进行更多的开发,而花费的时间更少。
  • Your customers will enjoy lower pricing on services.

    您的客户将享受较低的服务价格。
  • And you will reap higher profits after the adoption of the framework.

    采用该框架后,您将获得更高的利润。

Independent developers can also be the major benefactors of the development platform today. After all, the ability to use only one language for personal programs will give you an opportunity to take on more freelance projects.

独立开发人员也可以成为当今开发平台的主要受益者。 毕竟,仅将一种语言用于个人程序的能力将使您有机会进行更多的自由职业项目。

杀手级功能2:将Web应用程序转换为智能手机程序 (Killer Feature 2: Transforming Web Applications into Smartphone Programs)

Every company that develops a specific web application seeks to have a smartphone version of its product. The benefits of such a strategy are rather obvious: after all, everyone has an Android or iOS phone today.

每个开发特定Web应用程序的公司都希望拥有其产品的智能手机版本。 这种策略的好处是显而易见的:毕竟,今天每个人都拥有Android或iOS手机。

However, the businesses that seek smartphone versions of their apps often face the problem of massive development costs. The mobile versions of their web apps are often recreated from scratch.

但是,寻求智能手机版应用程序的企业通常会面临大量开发成本的问题。 他们的Web应用程序的移动版本通常是从头开始重新创建的。

If they are lucky, this process might only involve the client-side platforms. However, smartphone development frameworks are so divergent that sometimes both the client and the server have to be extended.

如果幸运的话,此过程可能仅涉及客户端平台。 但是,智能手机开发框架差异很大,有时客户端和服务器都必须扩展。

We are quite sure that you have seen frustrating situations in which certain web apps only have iOS or Android clients for smartphones. The lack of unity regarding frameworks is the main culprit in this case.

我们非常确定,您会遇到令人沮丧的情况,其中某些Web应用程序仅具有用于智能手机的iOS或Android客户端。 在这种情况下,罪魁祸首是缺乏有关框架的统一性。

Meteor offers an elegant and extensible solution to this problem. Due to the potent integration of Meteor with Apache Cordova, you can quickly turn your web application into a smartphone app without any significant investment.

流星为这个问题提供了一种优雅且可扩展的解决方案。 由于Meteor与Apache Cordova的有效集成,因此您可以快速将Web应用程序转变为智能手机应用程序,而无需进行大量投资。

On the purely technical side, such a transition is possible due to the embedded container capabilities of Meteor and Cordova. All you would have to do is insert your web app into a pre-developed smartphone container.

在纯技术方面,由于Meteor和Cordova的嵌入式容器功能,这种过渡是可能的。 您所要做的就是将您的Web应用程序插入预先开发的智能手机容器中。

Another critical design choice is the approach Meteor takes with data. Meteor uses data on the wire – the server doesn't send HTML but data, which is then rendered by the client. If the design of your web app is already touchscreen-friendly, you can immediately push your new program into the App Store or Google Play Market with Meteor.

另一个关键的设计选择是Meteor处理数据的方法。 流星使用网络上的数据-服务器不发送HTML,而是发送数据,然后由客户端呈现。 如果您的Web应用程序的设计已经适合触摸屏,则可以立即将新程序推入带有Meteor的App Store或Google Play电子市场中。

If that is not the case, all you would have to do is slightly adjust the design using the JavaScript language. Essentially, the process would be similar to developing a mobile version of a website.

如果不是这种情况,您要做的就是使用JavaScript语言稍微调整设计。 本质上,该过程将类似于开发网站的移动版本。

Once again, such an approach will save you unprecedented amounts of time and money. Instead of having to hire some dedicated smartphone developers, you will be able to fully concentrate on your web apps. This feature is also vital from a purely aesthetic standpoint. Meteor is one of the best tools when it comes to making the design of your products uniform.

再一次,这种方法将为您节省空前的时间和金钱。 不必雇用一些专门的智能手机开发人员,您将可以完全专注于Web应用程序。 从纯粹的美学观点来看,此功能也至关重要。 当使产品设计统一时,Meteor是最好的工具之一。

The use of a unified platform will help you establish a professional standardized look in all business spheres.

使用统一平台将帮助您在所有业务领域中建立专业的标准化外观。

杀手级功能3:实时更新 (Killer Feature 3: Real-Time Updates)

Meteor is also capable of real-time updates, or so-called "full-stack reactivity." The changes you make immediately appear across all databases and style templates. In this way, you would be immediately able to see critical bugs and double check the features without having to tediously update web pages and certain programs.

流星还能够进行实时更新,或所谓的“全栈React性”。 您所做的更改将立即显示在所有数据库和样式模板中。 这样,您将能够立即看到严重的错误并仔细检查功能,而不必繁琐地更新网页和某些程序。

This feature is of vital importance when it comes to large teams. The immediate updates are visible to all team members, creating a perfect environment for collaborative development. Ultimately, your web apps and smartphone programs will significantly benefit from this feature as it makes bug fixing incredibly simple.

对于大型团队,此功能至关重要。 所有团队成员都可以看到即时更新,从而为协作开发创造了完美的环境。 最终,您的Web应用程序和智能手机程序将从此功能中受益匪浅,因为它使错误修复变得异常简单。

Without going into details, one way of implementing the feature is a publication/subscription functionality.

无需赘述,实现此功能的一种方法是发布/订阅功能。

// Code on the server side
const MyAwesomeData = new Mongo.Collection('myAwesomeData');
Meteor.publish('myAwesomeData', () => {
return MyAwesomeData.find() 
})

It creates a publication for everything in the collection myAwesomeData. This publish function is requested whenever a client subscribes to it. So, let's create a subscription.

它为myAwesomeData集合中的所有内容创建一个发布。 每当客户端订阅该发布功能时,都将请求该发布功能。 因此,让我们创建一个订阅。

// Code on the client side
Meteor.subscribe('myAwesomeData')

Now, all the subscribers will receive updates whenever a publication is requested. Also, we can receive data using a specific parameter.

现在,每当请求发布时,所有订阅者都将收到更新。 另外,我们可以使用特定参数接收数据。

// Code on the server side
Meteor.publish('myAwesomeData', (userName) => {
return Comments.find({ userName: userName })
})

The last piece of code retrieves data using a specific user name:

最后一段代码使用特定的用户名检索数据:

// Code on the client side
const userName = 'Jack Sparrow'
Meteor.subscribe('myAwesomeData', userName)

杀手级功能4:轻松进行包裹管理 (Killer Feature 4: Easy Package Management)

Often, the deployment of modified versions of development frameworks requires a significant expenditure of time and resources. Meteor, however, is extremely user-friendly in this regard, offering some of the best package management tools on the market.

通常,部署修改后的开发框架版本需要大量时间和资源。 但是,Meteor在这方面极为用户友好,它提供了市场上一些最佳的软件包管理工具。

Today, the community of the Meteor developers maintains a gargantuan database of extensions on the AtmosphereJs website. Some of the popular extensions include tools for embedding ReactJS and Vulcan Bootstrap.

今天,Meteor开发人员社区在AtmosphereJs网站上维护着庞大的扩展数据库。 一些流行的扩展包括用于嵌入ReactJS和Vulcan Bootstrap的工具。

To install an Atmosphere package, you simply run the following command meteor add nameOfThePackage:

要安装Atmosphere软件包,您只需运行以下命令meteor add nameOfThePackage

meteor add react-meteor-data

And to delete a package:

并删除一个包:

meteor remove react-meteor-data

To import and start using it in code, you should use the "meteor/" prefix:

要导入并开始在代码中使用它,您应该使用“ meteor /”前缀:

import { useTracker } from 'meteor/react-meteor-data';

More information can be found here: https://guide.meteor.com/using-atmosphere-packages.html#peer-npm-dependencies

可在此处找到更多信息: https : //guide.meteor.com/using-atmosphere-packages.html#peer-npm-dependencies

This feature is especially impressive considering its simplicity. The installation process only requires a set of simple commands that almost any advanced Windows or Linux user should already be comfortable with.

考虑到其简单性,此功能特别令人印象深刻。 安装过程只需要一组简单的命令,几乎所有高级Windows或Linux用户都应该已经熟悉这些命令。

Even if you are an absolute beginner, you should have absolutely no problems with setting up a basis for even the most complex programs.

即使您是绝对的初学者,即使为最复杂的程序建立基础,也应该绝对没有问题。

Thus, any person can swiftly create app prototypes and make them feature-rich by using this robust library of extensions and the advanced package management tools provided by some of the Meteor developers and the active community that surrounds the framework.

因此,任何人都可以使用此强大的扩展库和由Meteor开发人员和框架周围的活跃社区提供的高级软件包管理工具,快速创建应用程序原型并使它们功能丰富。

杀手级功能5:广泛的学习资源和文档 (Killer Feature 5: Extensive Learning Resources and Documentation)

One of the key problems of many open-source projects is the complete lack of proper documentation. This problem led to the death of countless promising projects as outside developers were often forced to essentially reverse-engineer their features.

许多开源项目的关键问题之一是完全缺乏适当的文档。 这个问题导致无数有希望的项目死亡,因为外部开发人员经常被迫对他们的功能进行实质上的反向工程。

Do not worry – Meteor is unlikely to fall victim to this problem. After all, the website of the platform has a powerful set of tutorials for beginners and a whole subsection is dedicated to documentation.

不用担心-流星不太可能成为这个问题的受害者。 毕竟,该平台的网站为初学者提供了一套功能强大的教程,并且整个小节都专门介绍了文档。

We recommend these resources to both the beginners and the advanced users.

我们向初学者和高级用户推荐这些资源。

If you are new to web development, Meteor tutorials will help you create your first web apps (one of the highlights includes a Whatsapp clone).

如果您不熟悉Web开发,那么Meteor教程将帮助您创建第一个Web应用程序(其中一个亮点是Whatsapp克隆)。

If you are an advanced developer, the tutorials will quickly teach you the basics of Meteor. After that, you will just need to check the documentation from time to time to resolve some issues.

如果您是高级开发人员,那么这些教程将快速教您Meteor的基础知识。 之后,您只需要不时查看文档即可解决某些问题。

杀手级特征6:活跃社区 (Killer Feature 6: Active Community           )

If you fail to find information on the Meteor website, you can always resort to the robust forums.

如果您无法在Meteor网站上找到信息,则可以随时使用功能强大的论坛。

We have spoken extensively about the death of Meteor in the first section of this article. Few facts defy this claim as much as the community of Meteor users.

在本文的第一部分中,我们广泛讨论了流星的死亡。 很少有事实能像流星用户社区那样反驳这一说法。

As the massive extension library of Meteor proves, the framework receives active support not only from its developers but also from the community.

正如Meteor庞大的扩展库所证明的那样,该框架不仅得到了开发人员的积极支持,还得到了社区的积极支持。

At the time of Meteor's presumed death, the interest from developers regarding the platform was seeing unprecedented growth. Consequently, the framework now has an incredibly passionate user base which is always ready to troubleshoot your problems.

在Meteor可能去世的时候,开发人员对平台的兴趣正在空前增长。 因此,该框架现在拥有令人难以置信的热情用户群,随时准备解决您的问题。

Many people (including myself) know that Meteor’s community is among the nicest on the Internet. You are unlikely to meet any hostility there, and many active members are eager to help newcomers.

许多人(包括我自己)都知道流星的社区是Internet上最好的社区之一。 您不太可能在那里遇到任何敌意,许多活跃成员渴望帮助新来者。

Since Meteor developers have received a significant financial boost from the Tiny Investment Fund, this community is likely to grow even more. Thus, your adoption of Meteor is likely to be very smooth as countless developers will be be ready to assist you.

由于Meteor开发人员已从Tiny Investment Fund获得了可观的财务支持,因此该社区的增长可能会更大。 因此,您的采用Meteor可能会非常顺利,因为无数开发人员已准备好为您提供帮助。

结论:那么,你应该学习流星吗? (Conclusion: So, Should You Learn Meteor?)

The short answer is simple: yes, undoubtedly.

简短的答案很简单:是的,毫无疑问。

Knowledge of the Meteor platform is the perfect addition to any developer's portfolio.

流星平台的知识是任何开发人员产品组合的完美补充。

  • If you primarily develop with JavaScript, the platform will help you or your company cut time expenditures on creating separate client and server projects.

    如果您主要使用JavaScript进行开发,那么该平台将帮助您或您的公司减少在创建单独的客户端和服务器项目上的时间支出。
  • If you are an independent developer who uses C# or Ruby, Meteor can be a perfect entry point into JavaScript development. It will allow you to create independent web app projects with one programming language.

    如果您是使用C#或Ruby的独立开发人员,那么Meteor可能是JavaScript开发的理想入口。 它将允许您使用一种编程语言来创建独立的Web应用程序项目。
  • If you are an absolute beginner, the platform will help you create your first well-functioning apps after just a few weeks.

    如果您绝对是初学者,那么该平台将在几周后帮助您创建第一个运行良好的应用程序。
  • If you want to establish a startup, Meteor can be a perfect starting point for quickly creating a powerful prototype of your future web app. More importantly, the tool is robust enough to make any transition to other platforms unnecessary after prototyping.

    如果您想建立一家初创公司,Meteor可以作为快速创建未来Web应用程序的强大原型的理想起点。 更重要的是,该工具具有足够的鲁棒性,无需在原型制作后即可过渡到其他平台。

Essentially, with Meteor, only the sky is the limit. Modern development is becoming more and more web-centric. Meteor perfectly reflects this trend, offering an all-encompassing platform for web developers.

本质上,对于Meteor,只有天空才是极限。 现代发展正变得越来越以网络为中心。 流星完美地反映了这一趋势,为Web开发人员提供了一个全方位的平台。

By using it, you will be able to create a seamless integration of web and mobile apps, both of which are the future of consumer-centric computing.

通过使用它,您将能够创建Web和移动应用程序的无缝集成,这两者都是以消费者为中心的计算的未来。

您对JavaScript项目有想法吗? (Do you have an idea for a JavaScript project?)

My company KeenEthics is an early adopter of the Meteor framework and a well-established JavaScript company in general. In case you have a promising project in mind, feel free to request an estimate.

我的公司KeenEthics是Meteor框架的早期采用者,并且是一家公认的知名JavaScript公司。 如果您有一个有前途的项目,请随时提出估计

If you have enjoyed the article, you should continue with What Are the Advantages of Node.JS? and Angular vs React: What to Choose for Your App?

如果您喜欢这篇文章,则应继续阅读Node.JS的优点是什么?Angular vs React:为您的应用选择什么?

翻译自: https://www.freecodecamp.org/news/should-i-work-with-meteor-in-2020/

代码流星雨是什么形式

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这是一个使用 Python 编写的生成流星雨动画的代码,需要使用 Pygame 库: ``` import pygame import random # 初始化 Pygame pygame.init() # 定义窗口尺寸和标题 WIDTH, HEIGHT = 800, 600 TITLE = "Meteor Shower" screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption(TITLE) # 定义颜色 BLACK = (0, 0, 0) WHITE = (255, 255, 255) YELLOW = (255, 255, 0) # 定义流星雨粒子类 class Particle(pygame.sprite.Sprite): def __init__(self): super().__init__() self.image = pygame.Surface((3, 10)) self.image.fill(WHITE) self.rect = self.image.get_rect() self.rect.x = random.randint(0, WIDTH) self.rect.y = random.randint(-HEIGHT, 0) self.speed = random.randint(5, 15) self.angle = random.uniform(0, 2 * 3.14159) def update(self): self.rect.x += self.speed * math.cos(self.angle) self.rect.y += self.speed * math.sin(self.angle) # 创建粒子群组 particles = pygame.sprite.Group() # 创建流星雨粒子 for i in range(100): particles.add(Particle()) # 游戏循环 running = True clock = pygame.time.Clock() while running: # 事件处理 for event in pygame.event.get(): if event.type == pygame.QUIT: running = False # 更新粒子位置 particles.update() # 绘制背景 screen.fill(BLACK) # 绘制粒子 for particle in particles: pygame.draw.rect(screen, WHITE, particle.rect) # 更新屏幕 pygame.display.update() # 控制帧率 clock.tick(30) # 退出 Pygame pygame.quit() ``` 运行代码后,将会在窗口中看到流星雨的动画效果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值