简体   繁体   English

我忽略了快捷方式编程语言?

[英]Shortcut programming languages am I missing something?

I'm seeing a rise in the number of projects online that require additional "short" syntax to generate underlying code (commonly HTML and JS), and every time I see another pop up I wonder if I'm missing something. 我看到在线项目数量的增加需要额外的“短”语法来生成底层代码(通常是HTML和JS),每当我看到另一个弹出窗口时,我想知道我是否遗漏了一些东西。

Surely the additional time taken to learn and remember these shortcodes is lost when passing projects between different team members (designers et al) who then have to relearn basic languages such as HTML and JS? 当然,在不同团队成员(设计师等)之间传递项目时,学习和记住这些短代码的额外时间会丢失,然后他们必须重新学习HTML和JS等基本语言?

Point in question: YAML being used for generating templates, and projects (such as) CoffeeScript used to generate Javascript. 问题点: YAML用于生成模板,以及用于生成Javascript的项目(例如) CoffeeScript I'm just wondering if other Stackoverflow folk think that there's major benefits to this granular level of abstraction, or if there's a feeling that these types of projects have any lifespan, considering the improvements in the base technologies (I'm thinking HTML5 / CSS / JQuery) here. 我只是想知道其他Stackoverflow民众是否认为这种粒度级别的抽象有很大的好处,或者考虑到基础技术的改进,我认为这些类型的项目有任何生命周期(我在想HTML5 / CSS) / JQuery)这里。 Have markup languages not evolved enough to really warrant these? 标记语言的进化是否足以真正保证这些?

Realise this isn't really a question as such, but would be interested to hear the community viewpoint. 意识到这不是一个真正的问题,但有兴趣听取社区观点。 I'm sure there are genuinely good reasons for these types of projects when creating self generating code, but outside of that, I'm puzzled - with many folks using them day to day. 我确信这些类型的项目在创建自生成代码时有充分的理由,但除此之外,我很困惑 - 很多人每天都在使用它们。 Is this a bandwagon worth jumping on? 这是一个值得一试的潮流吗?

Personally I don't think that it's worth it as most things you can do in javascript are already simplified by libraries such as jQuery. 就个人而言,我不认为这是值得的,因为你在javascript中可以做的大多数事情已经被jQuery这样的库简化了。 As far as their lifespan goes it's hard to tell. 就他们的生命而言,很难说。 However, as long as you know javascript, and you understand the code output, moving to a new project that isn't using CoffeeScript for example is a simple matter of taking the output code with you. 但是,只要您了解javascript,并且了解代码输出,那么转移到不使用CoffeeScript的新项目就是一个简单的问题,即随身携带输出代码。

Any sufficiently complicated program contains an implementation of Lisp . 任何足够复杂的程序都包含Lisp的实现

This is the ideology that Lisp and friends promote over many years. 这是Lisp和朋友多年来推广的意识形态。 Basically, you're discouraged to code any application logic in a "raw" language. 基本上,您不鼓励用“原始”语言编写任何应用程序逻辑。 Raw languages are universal and low level, so your logic quickly gets verbose and contaminated with lots of code needed to support the language itself. 原始语言具有普遍性和低级别,因此您的逻辑很快就会变得冗长,并且会受到支持语言本身所需的大量代码的污染。

Instead, create a DSL that suits your application best and code your logic, and nothing but the logic, in this DSL. 相反,在这个DSL中创建一个最适合您的应用程序的DSL并编写逻辑,而不仅仅是逻辑。 Hide all nasty language details behind the DSL. 隐藏DSL背后的所有令人讨厌的语言细节。 This makes the logic much easier to improve and support. 这使逻辑更容易改进和支持。

On the other side, things like Coffescript, Groovy etc are IMO the wrong way to go. 另一方面,像Coffescript,Groovy等东西是IMO错误的方式。 They are basically trying to create new universal languages but with a "better" syntax, however, this doesn't solve the fundamental problem - these languages still describe abstract calculations rather than your problem domain. 他们基本上试图创建新的通用语言,但是使用“更好”的语法,然而,这并没有解决根本问题 - 这些语言仍然描述抽象计算而不是问题域。 A more productive way is to have a very basic underlying language and a well-developed macro facility that would simplify creating DLSs. 更有效的方法是拥有一个非常基础的底层语言和一个完善的宏设施,可以简化创建DLS。 This is how lisp itself works, another example of this approach is Haxe/Neko . 这就是lisp本身的工作方式,这种方法的另一个例子是Haxe / Neko

In my opinion I prefer jQuery for writing short JS instructions and prevent everyone from bloating the final product. 在我看来,我更喜欢使用jQuery编写简短的JS指令,并防止每个人都膨胀最终产品。 I don't like css frameworks because we are building huge portals and you don't always need all of the stuff hidden inside these. 我不喜欢css框架,因为我们正在构建巨大的门户网站而你并不总是需要隐藏在这些内部的所有内容。 I prefer writing modular css based on some common rules like using clearfix for clearing an using a css reset. 我更喜欢基于一些常见规则编写模块化CSS,例如使用clearfix来清除使用css重置。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM