• 开源镜像
  • 开源沙龙
  • 媛宝
  • 猿帅
  • 注册
  • 登录
  • 息壤开源生活方式平台
  • 加入我们

开源日报

  • 开源日报第738期:《自己创建 build-your-own-x》

    5 4 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《自己创建 build-your-own-x》
    今日推荐英文原文:《The Power of Mods》

    今日推荐开源项目:《自己创建 build-your-own-x》传送门:GitHub链接
    推荐理由:在这个项目中,你能学会如何创造自己的各种工具,引擎,游戏,框架,库……有时候使用别人的,不如自己做一个,虽然这看上去很难。
    今日推荐英文原文:《The Power of Mods》作者:Alex Anyfantis
    原文链接:https://medium.com/super-jump/the-power-of-mods-ffa56c755750
    推荐理由:游戏mod为何有着如此大的力量,有时甚至超过游戏本身?因为无穷的创造力。

    The Power of Mods

    A rich history of player-created content gave rise to titles like Dreams and Super Mario Maker

    With the release of Media Molecule’s Dreams already behind us, it seems like a perfect time to look back and reminisce about the phenomenon that came before — the period where players were not just consumers of games, but were able to jump into the driver’s seat and build upon their favourite titles. There have been many instances where a group of people (and sometimes, famously, just a single person) — driven by their love for a certain title or genre — have gone on to create their own content within (and for) the gaming community.

    What I’m describing here is known as “mods”. For the uninitiated, mod is a shorter term for modification; in other words, an alteration or change that a player makes to an existing game in order to improve or expand upon the original experience. Player-created mods were not always welcomed by developers, especially in cases where fans could profit from their alterations. But over time, developers have found ways to partner with modders (in some cases, developers have incorporated mods directly into their games as part of its “official” content, while in other cases, they have provided tools to support mods and the modding community). The ultimate manifestation of mod culture, then, can be found through titles like Dreams and Super Mario Maker — toolboxes that are built by developers to provide a simplified, user-friendly environment for players to create their own games or game-like experiences.

    Traditionally though, modders have often had very few tools at their disposal, especially when compared to game development studios themselves — this makes their accomplishments all the more impressive. One of the standout examples, in my view, is a mod called NeoTokyo. It involves the creation of an entirely new game based solely on the foundation of Half-Life 2. Of course, NeoTokyo had nothing to do with the game upon which it was built — instead, it was a multiplayer first-person shooter more akin to Counter-Srike, drawing heavy inspiration from futuristic dystopian anime such as Akira or Ghost in the Shell. It’s worth noting, too, that the creators of NeoTokyo — Studio Radi-8 — began their work on the project back in 2004, only for it to be finally released five years later in 2009.

    If you think that persistence is impressive, then I must mention Black Mesa, a mod of Half-Life 2 that is essentially a remake of the first Half-Life. The project started with two separate teams who eventually united as one, with work commencing as early as 2004 — the first iteration of the mod itself was available in 2012. That’s right, it took the Crowbar Collective (as they would eventually be known) eight whole years to deliver a playable game. The team hit a large number of setbacks on their journey, but ultimately their dedication and commitment to the project allowed them to deliver a mod that received widespread praise for its high level of sophistication and attention to detail.

    Finally, there’s the ongoing Skywind project. It’s somewhat similar to Black Mesa in terms of ambition, only this time, it’s being built on the back of The Elder Scrolls V: Skyrim. More specifically, fans are attempting to recreate the world of Morrowind (which is the setting of the game’s prequel, The Elder Scrolls III) inside of Skyrim. In fact, the modders have gone a step beyond that, delving deeper into the story of the original game and expanding it to create an overall richer experience for players. This project has been underway for a long time now and there’s currently no telling when it might be released, especially given that the players-turned-developers involved are focused on giving it their utmost attention in order to produce the highest-quality results.

    The mods I’ve mentioned so far are earth-shatteringly huge in terms of their scale and ambition, as well as the enormous effort required to execute on the creators’ vision. But of course, there are many smaller — and lesser known — efforts that are equally impressive for their own reasons. One example that comes to mind is Arthur Lopes’ and GTARandom’s attempt to recreate Grand Theft Auto: San Andreas as a playable area inside GTA V.

    Whatever form it may come in, it’s always captivating to see fans draw on their passion for gaming and then go on to create entire worlds that we can all dive into and enjoy. Now that far more powerful tools like Dreams are available, there are whole new legions of players who have the power to create the worlds and experiences they’ve always dreamed of. And we, as players, get the privilege of diving deeper into their imaginations. I’m very excited to see what the future holds for what is surely an emerging golden age of player-created content.


    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 开源日报第737期:《CSS库 bulma》

    4 4 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《CSS库 bulma》
    今日推荐英文原文:《# Always Be Commenting》

    今日推荐开源项目:《CSS库 bulma》传送门:GitHub链接
    推荐理由:这个项目是一个纯 CSS 库,即它提供了大量的 CSS 类而不关心你的 JS 代码,只需要调配这些类即可完成使用。而且它还提供了为移动端上垂直阅读提供支持的布局方式,只需要将浏览器的宽度压缩一下,就能体验到这种效果。
    今日推荐英文原文:《# Always Be Commenting》作者:Zachary Flower
    原文链接:https://medium.com/@zachflower/always-be-commenting-55abd406a1a9
    推荐理由:写代码的确也是一种写作文的种类

    # Always Be Commenting

    As developers, we like to think of source code as a recipe. All the steps are written out, so understanding code is as simple as reading those steps. But that’s not the way it really works, is it? Programming is an art form, and programmers each have their own unique style and thought process, so it is important to remember that what is clear and intuitive to one may be disorganized and confusing to another.

    Rather than treating code like a recipe, we should instead treat it like literature. The code itself is prose, written for the computer to read. While we as developers can speak the language of the computer, we sometimes need a little help understanding it. This is where the gloss-or comments-provide value. Like annotations, the intended purpose of code comments isn’t to summarize the code itself, but to provide clarity about the thought process behind the code.

    Believe it or not, code comments used to be handwritten or typed notes that accompanied hard-copy coder sheets and punch cards in early decades of the computing industry. These comment cards-acting exactly as one would expect-were ignored by the compiler, but provided context to the code in the same way comments are used today. While the utility of writing notes within a pile of 500+ hand-punched cards is immediately obvious, the ability to explain how a piece of code works and what it does has carried its way through every major programming language since the 1950s, and is a convention that predates the existence of nearly every modern aspect of computing we take for granted today.

    A good rule of thumb for code comments is that they shouldn’t be necessary to get a good idea of what a piece of code does. But while code design is important for reducing the onboarding time for developers to a new codebase, they aren’t without merit. While there are countless tools that extract a significant amount of value from code comments (I’m looking at you PHPDoc), the primary purpose of code comments is to explain how a particular piece of code works, why it was written that way, and-in some cases- what it does.

    The How

    When it comes to commenting code, there’s a common misconception that explaining how a piece of code works is the same as explaining what it does. While they are similar in nature, the how is a much more nuanced method of documentation. While the what focuses only on the intended function of a method, the how details its side-effects, caveats, and gotchas. This helps prevent information that can be lost through software design patterns that obfuscate functionality.

    Take, for example, the following method found within the source code of the Go programming language:
    // Buffered returns a reader of the data remaining in the Decoder's // buffer. The reader is valid until the next call to Decode.func (dec *Decoder) Buffered() io.Reader {
      return bytes.NewReader(dec.buf[dec.scanp:])
    }
    
    Source: Go (https://github.com/golang/go)

    While the what of this method is simply Buffered returns a reader of the data remaining in the Decoder’s buffer, the how is established in the next part by detailing how long the buffered reader is valid: The reader is valid until the next call to Decode.

    The Why

    Sometimes, as programmers, we have to do things the “hacky” way-also known as the “wrong” way, in some circumstances. But as codebases evolve and projects grow beyond their original scope, writing software becomes a balancing act between building new features and properly deprecating legacy code. Without proper comments, it is nearly impossible to identify the “gotchas” in seemingly inefficient or unintuitive code. To illustrate this, let’s look at Ruby on Rails’ ActiveRecord::DefineCallbacks module:
    module ActiveRecord
      # This module exists because ActiveRecord::AttributeMethods::Dirty needs to
      # define callbacks, but continue to have its version of +save+ be the super
      # method of ActiveRecord::Callbacks. This will be removed when the removal
      # of deprecated code removes this need.
      module DefineCallbacks
        extend ActiveSupport::Concern
    
        module ClassMethods # :nodoc:
          include ActiveModel::Callbacks
        end
    
        included do
          include ActiveModel::Validations::Callbacks
    
          define_model_callbacks :initialize, :find, :touch, only: :after
          define_model_callbacks :save, :create, :update, :destroy
        end
      end
    end
    
    Source: Ruby on Rails (https://github.com/rails/rails)

    In a perfect world, the above module wouldn’t exist, but as the comments explain, it has to for now. Without the clear explanation provided by these comments, this module might be inadvertently removed, which would cause all kinds of havoc for the sake of “clarity.” Explaining why a piece of code exists is crucial, especially if the reason isn’t immediately obvious. As much as we like to pretend all good software is clear and easy to read, that assertion simply doesn’t coincide with the reality of the business of software development. Plans change, goals shift, and good code today could easily become legacy code tomorrow.

    The What

    Generally speaking, documenting what every line of code does is bad practice. Comments are intended to provide clarity, but when everything needs clarity, nothing is every actually clear. That said, there are some cases where the most efficient or streamlined way to write a piece of code isn’t always the most intuitive. This is the perfect use case for what comments. When it comes right down to it, not every method or class can have an intuitive name. Whether the functionality itself is too complex, or there simply isn’t a way to come up with a succinct name, it is sometimes necessary to use a simple method name and preface it with a short description of what that method does.

    A great example of this can be found in the source code for the Laravel PHP framework. The after() method takes a string, and returns everything after a given search value. Unfortunately, because of the highly specific nature of the method itself, a method name like returnEverythingAfter() adds unnecessary verbosity to a codebase without exactly providing an immediately clear indication about what the method does.
    /**
     * Return the remainder of a string after a given value.
     *
     * @param  string  $subject
     * @param  string  $search
     * @return string
     */
    public static function after($subject, $search)
    {
        return $search === '' ? $subject : array_reverse(explode($search, $subject, 2))[0];
    }
    
    Example: Laravel (https://github.com/laravel/framework)

    While many developers would encourage simply looking directly at the function code to understand what it does, this isn’t always practical. As you can see above, the most efficient code isn’t always the most intuitive code. By adding a simple comment before the function declaration, understanding what the method does becomes immediately clear without having to do a line-by-line analysis.

    In an industry filled with flame wars like VIM versus Emacs and PHP versus… well… everyone, one of the most surprising hot button issues is whether or not developers should write code comments. To sum it up, the “no comment” camp advocates against writing code comments because they clutter up the code, have a tendency to become outdated, and are redundant-because you can just read the code to find out what it does; to all of which, I say “grow up.”

    Look… I get it, writing proper comments isn’t always fun, but when it comes down to it those comments aren’t for you; they’re for the next poor sap who has to look at your code-who, let’s face it, might actually be you. Despite the cliche of the scruffy, basement-dwelling code monkey, software development doesn’t happen in a vacuum. It involves a significant amount of collaboration and education to be successful, and even then finding common ground on difficult issues is an exercise in patience, empathy, and compromise.

    But I don’t expect anyone to take my opinion at face value. While I don’t agree with the conclusion the “no comment” camp has come to, I’ll be the first to admit that the issues they’ve highlighted are worth discussing.

    One person’s clutter is another person’s clarity. Dismissing the value of comments because they clutter up the code is an entirely subjective-and selfish-assertion that is no different than downplaying the value of graphical user interfaces because you personally prefer to use the command line. While viewing comments as a roadblock towards reading a block of code is understandable, there are countless of plugins for nearly every editor that can be used to fold or hide comments without removing them entirely. This allows you to easily parse code while also leaving information that other developers may find valuable.

    If someone told you that they prefer not to write unit tests because they take effort to keep up to date, how would you respond? Keeping code comments up to date is a responsibility no different than keeping unit tests up to date. Bemoaning the value of comments because they get stale indicates a systemic problem at the organization level, not in the comments themselves. Like any best practice, it requires discipline to extract value out of it, because without discipline all you are doing is adding counterproductive complexity.

    Not all code is created equal, because not all developers are created equal. We all have different experiences and habits that guide us to slightly different ways to solve the same problems. This difference in thought processes is the primary benefit of code comments. While it may seem redundant to explain your code when “it’s already right there,” this information could be incredibly valuable to new developers, or even experienced developers who are unfamiliar with the language or framework you are using.
    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 开源日报第736期:《spring-boot-api-project-seed》

    3 4 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《spring-boot-api-project-seed》
    今日推荐英文原文:《Is the Switch from Windows to Linux Really That Hard?》

    今日推荐开源项目:《spring-boot-api-project-seed》传送门:GitHub链接
    推荐理由:一个基于 Spring Boot & MyBatis 的种子项目,用于快速构建中小型 API、RESTful API 项目.
    今日推荐英文原文:《Is the Switch from Windows to Linux Really That Hard?》作者:Bogdan Popa
    原文链接:https://news.softpedia.com/news/is-the-switch-from-windows-to-linux-really-that-hard-529627.shtml

    推荐理由:Linux长期以来一直被认为是Windows的替代品,而且有很多人出于各种原因开始转向开源世界,但是使用linux系统的用户在现今仍为少数, 因此我们更加需要得到一些来自Linux用户的真实体验.

    Is the Switch from Windows to Linux Really That Hard?

    Linux has long been considered a worthy alternative to Windows, and it’s also not a secret that so many people actually performed the switch to the open-source world for various reasons, starting with the desire for a completely-free operating system and ending with the search for increased security.

    Judging from the market share statistics that research firms provide every month, however, the Linux world hasn’t necessarily benefited substantially from this transition from Windows.

    In March, for example, Windows had a global market share of 89.21%, which means that nearly 9 in 10 PCs out there were running Microsoft’s operating system. For comparison, Linux secured a 1.36% market share, which means that not even 1 PCs in 10 was on Linux.

    But leaving aside these statistics, it’s not a secret that many of those who are now truly committed to the world of Linux are former Windows users. And at the same time, it’s also very well known that some of the users part of the power user Windows community are also considering a switch to Linux as we speak.

    A number of those who eventually try out Linux, however, come back to Windows, typically only a few days after installing the operating system on their devices. And there are so many reasons for this, including things like hardware and software issues, bugs they don’t know how to fix, or simply an experience that’s not necessarily familiar.

    A reddit discussion thread where users debate the reasons to return to Windows has gone viral recently. And people share their stories on the migration to Linux, many explaining that sticking with Microsoft isn’t such a bad thing, despite things that pushed them to alternative operating system, such as telemetry services.

    “My experiences with Linux have always ended up with me spending hours just trying to get basic things working. Mint: why is my trackpad all choppy? Ubuntu: why isn’t my calendar synching? Why does my desktop image keep appearing on the lockscreen? KDE why doesn’t windows+d not take me to desktop? Pop os: why doesn’t my taskbar appear? How do I get chromium to react to swipe gestures? These are just single examples but I always end up on these forums with answers from 2017 where I am entering random terminal codes, installing packets that I have no idea what they do, and praying that it works. It just gets exhausting when I just need things to work so that I can work,” the thread starter explains.

    At first glance, many of the users who return to Windows just don’t give enough time to Linux and expect a straightforward experience from one end to another. And of course, some expect Linux to work similarly to Windows, something that’s obviously not possible in every regard for various reasons.

    “I have tried VERY hard to get away from Windows but I just can’t… Gaming is very important in my life and Linux (despite having hugely increased it’s gaming capabilities in the last 2 years) just isn’t there yet… Also some basic stuff like external hard drives that don’t connect automatically when you turn on your PC…. Basic stuff that just annoyed me a lot,” someone says.

    So at the end of the day, the switch from Windows to Linux and then back to Windows might actually explain the market share above. Despite many people migrating to Linux, many actually return, eventually learning to accept the drawbacks of Microsoft’s operating system.

    And that’s why we’re asking you, the Linux user. Is it really that hard to make the switch from Windows to Linux? What’s the best advice for someone looking into giving up on Windows?

    Share your comments in the box after the jump.
    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 开源日报第735期:《UI工具 flutter》

    2 4 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《UI工具 flutter》
    今日推荐英文原文:《Is Half-Life: Alyx the VR Game We’ve Been Waiting For?》

    今日推荐开源项目:《UI工具 flutter》传送门:GitHub链接
    推荐理由:Flutter 是 Google 免费、开源的 UI 工具包,帮助开发者通过一套代码库高效构建多平台精美应用,支持移动、Web、桌面和嵌入式平台。部分实例的 github 链接:Flutter-samples***

    今日推荐英文原文:《Is Half-Life: Alyx the VR Game We’ve Been Waiting For?》作者:Joshua Gad
    原文链接:https://medium.com/super-jump/is-half-life-alyx-the-vr-game-weve-been-waiting-for-519ead49e757
    推荐理由:1998年,《半条命 (Half-life)》 问世,开创了 FPS 的新规范,堪称游戏史上一座里程碑;而2020年,Value出版的VR游戏 《Half-life:Alyx》 再度掀起热潮,或许又预示着另一个开端,VR 游戏的开端。

    Is Half-Life: Alyx the VR Game We’ve Been Waiting For?

    Valve’s ambitious new game could be VR’s first killer app

    For years gamers have awaited the return of the Half-Life series. It is no secret that Valve takes its time in order to develop, perfect, and deliver some of the best games ever made. Many gamers who were disappointed by early VR games were equally as disapproving of Valve for making the next game in the Half-Life series a ‘VR gimmick,’ but the developers at Valve knew it was something else.

    A paradigm shift is a fundamental change in the way we think about something. It has been a well-kept secret that Valve has been working on a VR game since before the technology was available to the public. Before Oculus Rift was even on the market, Valve had offered to share their VR research with them. Half-Life: Alyx is the culmination of all those years of research and development into the first fully realized feature length game made for specifically for VR.

    Valve’s view when creating games in the Half-Life series is that they have to solve a problem in game design. I haven’t played every VR game on the market, but the many I tried don’t exactly have hours of quality gameplay and depth. Valve has managed to achieve both with Half-Life: Alyx.

    The game takes place following the events of the original Half-Life. The alien Combine have decimated human civilization. You play as Alyx Vance, a member of the human resistance, who is on a mission to rescue its leader — and her father — Dr. Eli Vance. With Dr. Vance captured, you become humanity’s last chance of survival. You must venture toward the heart of the alien threat, codebreaking, shooting, and looking for anything that will help rescue your father and get the Combine off earth.

    There is a reason VR has had an unhealthy stigmatization as a ‘gimmick’. VR in its early years wasn’t ready for anything other than indie developments or AAA side projects. The technology was new and in development — it wouldn’t make sense to attempt a complex narrative game unless the system and audience could support it. So VR games started off relatively simply, such as with Eve: Valkyrie’s stationary shooting mechanics, SUPERHOT’s legendarily satisfying gameplay, or Moss’s mouse-to-scale adventure. These VR products that usually retail for $30 or less, provide players with an arcade-like experience. Even with adventure games, the space is more often than not constrained and packaged to be a neat little VR experience, but perhaps not one with the depth and scope to which more die hard gamers are accustomed. This is not to say there aren’t great VR games, but few have come close to the level of detail and variety seen in this VR installation of the Half-Life series.

    Half-Life: Alyx was released for $60, the price of a regular AAA video game, and it delivers everything you would expect from a video game and more in VR. For those who have played it, everyone’s first thought when looking off the balcony at City 17 is how detailed and amazing the graphics are. The physics of the world does not fail expectations. You can shatter a bottle, a box, a vase — and then pick up the pieces; you can throw a book or a piece of wood at a pigeon or enemy and they will react accordingly.

    We’ll get to gameplay in a bit, but the most impressive part of the game is no doubt the environment. Even though it seems that City 17 is just another apocalyptic game world, only a few hours in and you realize how different the atmosphere can be in different areas. It can invoke the wasteland, curiosity, caution, warmth, and power, and that in and of itself is an achievement for VR games.

    Other VR games do have these beautiful environments, but what they lack is the gameplay variety and narrative pacing of Half-Life: Alyx. Like all good games, early on levels and environments are about teaching you the game mechanics in a safe space. Most VR titles rely on a simulated test, but for Half-Life the main character, Alyx, is gearing up for her journey into the quarantine zone to rescue her father. Teaching the player to shoot and reload isn’t just a simple prompt with some target practice, it is very purposeful, and articulates a balance of design, attention, and threatening suspense.

    The gun mechanics are satisfying, but what impressed me most was the pacing and sparseness of the intense encounters with other characters. Early in the game there are few heated firefights, and more puzzles and room for world exploration, but towards the end of the game with the narrative tension turning up, the gunplay and intensity really shine through. Valve utilizes textbook video game pacing in all their games, and it is no different here. It works well and should inspire any developer to spend the time learning the basics of narrative structure utilized across all art forms, the basics of which include rising action, climax, denouement, and resolution. Even the ending gives way to a low intensity but ultimately satisfying conclusion, and that is no easy task.

    Aside from guns, most of the time throughout City 17 is occupied by puzzles, hazards, exploration, and general character and world interaction. Puzzles can take the form of a hazard, or a piece of machinery you haven’t quite seen before but need to mess around with to understand for a task. These tasks can take the form of a multi-tool minigame, for instance: interacting with a tool that allows you to reconnect circuits or solve various holographic light puzzles. The circuit breaking puzzles are by far my favorite and the most straightforward. They often force the player to explore their surroundings to uncover a hidden branch of the circuit. Other puzzles could have you connect the dots or neutralize lasers by finding the correct placement in 3D space. They are a welcome addition that, although some players might find them frustrating, provides spectacle and a break from intense firefight gameplay.

    Aside from all of this, what carries Alyx — and what has been the bane of most VR games — is the clunky movement and grabbing mechanism which the game rightfully does away with. The developers give you a plethora of options to change how you move. From angle snapping, smooth locomotion settings, to teleport dashing through the game, the player can choose how they want to move around the world. While movement options are great, the gravity gloves are even better. The simple act of aiming, flicking your wrist, and catching an object feels good and solves so many problems about awkwardly reaching for an item out of bounds or on the floor in VR. That box you see 10 feet in front of you, one flick of the wrist and it’s yours.

    All in all, Half-Life: Alyx is the VR game the industry has been waiting for. It offers a full-length story complete with gameplay beats in an immersive and carefully thought out world. It’s what VR was dreamed up to be, and it’s a promising look for the future of the platform. As VR tech gets better, the bar for Valve’s games and the industry will have to as well, such feat is demonstrated in Half-Life: Alyx.


    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
←上一页
1 … 74 75 76 77 78 … 262
下一页→

Proudly powered by WordPress