以图形化的方式编写C ++? [英] Write C++ in a graphical scratch-like way?

查看:180
本文介绍了以图形化的方式编写C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑设计一个应用程序,允许人们以图形方式开发C ++代码的可能性。当我发现Scratch时,我感到很惊讶(请参阅网站教程视频)。



我相信大多数C ++可以用图形表示,但预处理器指令和可能的函数指针除外。



你认为什么C ++功能可以(或不是)由图形项目表示?
这样的申请的优点和缺点是什么?



RECAP更多:



优点:




  • 直观


  • 有助于避免打字错误






  • 对于大型(中等)大小的应用程序可能无法读取

  • li>
  • C ++对于这种方法语言太复杂了。



考虑到我们的工作 - 已经有相当多的现有C ++代码,我不是在寻找一种全新的编程方式。我正在考虑一种完全兼容传统代码的替代编程方式。某些类型的病毒语言,人们会使用新的代码,并希望,最终将用于替换现有的代码(在它可能是有用的)。



您对此病毒方法有何感想?



在手动和图形编程方面,我倾向于同意您的答案。这就是为什么,理想情况下,我会找到一种方法让用户在打字和图形编程之间选择。逐行解析器(+部分解释器)可能能够将类型化的代码转换为图形设计。 是可能的。

是否有注意到提供打字和图形编程功能,我应该仔细考虑和分析?

p>

我已经从事过模板类(更常见的是类型级C ++)及其图形表示。
有关模板类的图形表示示例,请参见 。框表示类或类模板。第一个顶级节点是类本身,下一个(如果有的话)是类中的typedef指令。底部节点是模板参数。边缘,当然,将类连接到实例化的模板参数。
我已经有一个原型用于处理这种类型级别的图表。



如果你觉得这种表示模板类的方式是错误的,

解决方案

编写代码是最简单的部分开发商日。我不认为我们需要更多的帮助。阅读,理解,维护,比较,注释,记录和验证是我们仍然缺乏的地方 - 尽管有大量的工具和框架。






要剖析您的专业人员:



直观对于小应用程序非常简单;请将其替换为误导。它使它看起来很简单,但它不是:只要它很简单,VB.NET是更简单。当它变得复杂,视觉设计会阻碍。



帮助避免拼写错误 - 这是一个好的风格,一致性, intellisense是为。

p>

你在思考错误的层次:C ++语句是不可重复使用的,健壮的组件,它们更像是一大包的齿轮,需要正确地放在一起。 C ++与它的复杂性和异常(规则)甚至不是特别适合。



如果你想让事情变得容易,你需要在更高级别的可重复使用的组件。即使你有这些,插在一起并不简单。尽管多年来的斗争,并在许多环境中的许多尝试,这有时工作,往往失败。






/ strong> - 您是正确的IMO关于该要求:允许增量采用。这与在源代码和可视化表示之间平滑切换密切相关,这又可能意味着您必须能够从修改的源代码生成可视化表示。






IDE支持 - 这里是大多数基于语言的方法的误区。现代IDE不仅仅是一个文本编辑器和一个编译器。如何调试图 - 用断点,数据检查等?分析器,泄漏检测器等是否突出显示图形中的节点?将源代码控制给我一个视觉差异的昨天的图形与今天的图形?






也许你正在做某事,我的不:更好的方式来可视化代码,一种方式来放置不同的过滤器,使我看到我需要看到的。


I am considering the possibility of designing an application that would allow people to develop C++ code graphically. I was amazed when I discovered Scratch (see site and tutorial videos).

I believe most of C++ can be represented graphically, with the exceptions of preprocessor instructions and possibly function pointers.

What C++ features do you think could be (or not be) represented by graphical items? What would be the pros and cons of such an application ? How much simpler would it be than "plain" C++?

RECAP and MORE:

Pros:

  • intuitive
  • simple for small applications
  • helps avoid typos

Cons:

  • may become unreadable for large (medium?) - sized applications
  • manual coding is faster for experienced programmers
  • C++ is too complicated a language for such an approach

Considering that we -at my work- already have quite a bit of existing C++ code, I am not looking for a completely new way of programming. I am considering an alternate way of programming that is fully compatible with legacy code. Some kind of "viral language" that people would use for new code and, hopefully, would eventually use to replace existing code as well (where it could be useful).

How do you feel towards this viral approach?

When it comes to manual vs graphical programming, I tend to agree with your answers. This is why, ideally, I'll find a way to let the user always choose between typing and graphical programming. A line-by-line parser (+partial interpreter) might be able to convert typed code into graphical design. It is possible. Let's all cross our fingers.

Are there caveats to providing both typing and graphical programming capabilities that I should think about and analyze carefully?

I have already worked on template classes (and more generally type-level C++) and their graphical representation. See there for an example of graphical representation of template classes. Boxes represent classes or class templates. First top node is the class itself, the next ones (if any) are typedef instructions inside the class. Bottom nodes are template arguments. Edges, of course, connect classes to template arguments for instantiations. I already have a prototype for working on such type-level diagrams.

If you feel this way of representing template classes is plain wrong, don't hesitate to say so and why!

解决方案

Writing code is the easiest part of a developers day. I don't think we need more help with that. Reading, understanding, maintaining, comparing, annotating, documenting, and validating is where - despite a gargantuan amount of tools and frameworks - we still are lacking.


To dissect your pros:

Intuitive and simple for small applications - replace that with "misleading". It makes it look simple, but it isn't: As long as it is simple, VB.NET is simpler. When it gets complicated, visual design would get in the way.

Help avoid typos - that's what a good style, consistency and last not least intellisense are for. The things you need anyway when things aren't simple anymore.


Wrong level

You are thinking on the wrong level: C++ statements are not reusable, robust components, they are more like a big bag of gears that need to be put together correctly. C++ with it's complexity and exceptions (to rules) isn't even particulary suited.

If you want to make things easy, you need reusable components at a much higher level. Even if you have these, plugging them together is not simple. Despite years of struggle, and many attempts in many environments, this sometimes works and often fails.


Viral - You are correct IMO about that requriement: allow incremental adoption. This is closely related to switching smoothly between source code and visual representation, which in turn probably means you must be able to generate the visual representation from modified source code.


IDE Support - here's where most language-centered approaches go astray. A modern IDE is more than just a text editor and a compiler. What about debugging your graph - with breakpoints, data inspection etc? Will profilers, leak detectors etc. highlight nodes in your graph? Will source control give me a Visual Diff of yesterday's graph vs. today's?


Maybe you are on to something, despite all my "no"s: a better way to visualize code, a way to put different filters on it so that I see just what I need to see.

这篇关于以图形化的方式编写C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆