是否有一种高级网络语言?
序言
要构建动态网站,我们必须掌握至少四种语言:
- 用于构建网页的 HTML
- 用于布局和设计的
- CSS 用于交互的 JavaScript
- 用于业务规则或动态驱动数据的语言
此外,还有用于持久存储的 SQL、用于会话和缓存的 Memcache,用于许多不同内容管理系统的 API。我们还应该考虑在构建 Web 应用程序时与 OpenID、Facebook、Twitter、OpenSocial 进行交互,以使其变得有趣。
总而言之,简直是一团糟!
如果您考虑两个目标:
- 向孩子们教授 Web 开发
- 保持团队高效
问题
存在哪些统一 HTML + CSS + Javascript + 的高级系统(在此插入高级语言,首选 PHP)?
背景
- 我是一名软件工程师,拥有 15 年以上的项目领导和开发经验,拥有 Broadvision、Autonomy、Enterprise Java 和 Oracle 等技术。
近年来,我专注于使用 Drupal 或 PHP 框架(例如 CakePHP)开发社区网站。我喜欢网络开发,并且喜欢所涉及技术之间的阻抗不匹配。但我不可避免地得出的结论是一定有更好的方法。
- 我是两个儿子(13 岁和 9 岁)的父亲,虽然我不希望他们成为程序员,但我希望他们将计算机理解为不仅仅是游戏机。我喜欢激励他们稍微修改一下网络开发来表达自己。
每当我向他们展示零碎的东西时,我都希望他们有一个工具集,可以让他们在周日下午的一两个小时内创建“有趣”的结果。
Preamble
To build dynamic web-sites, we have to master at least four languages:
- HTML for the structure of web pages
- CSS for layout and design
- JavaScript for interactivity
- A language for business rules or dynamic driven data
In addition, there's SQL for persistent storage, Memcache for sessions and caching, APIs for the many different content management systems. We should also consider interacting with OpenID, Facebook, Twitter, OpenSocial in building a web application, for it to be interesting.
All in all, it's an utter mess!
If you take into account two objectives:
- Teaching web development to kids
- Staying productive as a team
Question
What high level systems exist that unify HTML + CSS + Javascript + (Insert High Level Language here, PHP preferred)?
Background
- I am a software engineer with 15+ years of experience as project lead and developer with technologies like Broadvision, Autonomy, Enterprise Java, and Oracle.
During recent years, I have focused on the developing community websites, using Drupal or PHP frameworks such as CakePHP. I like web development and enjoy the impedance mismatch between the technologies involved. Still the inevitable conclusion I come to is there must be a better way.
- I am the father of two sons (13 and 9), and while I don't want them to become programmers I would like them to comprehend computers as more than gaming machines. I like to motivate them to tinker a bit with web development to express themselves.
Whenever I show them bits and pieces, I would love for them to have a toolset that allows them to create "interesting" results in an hour or two on a Sunday afternoon.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(19)
GWT 在某种程度上成为一个高级工具包,让您可以编写 Java 来生成 Javascript。
GWT goes someway towards being a high level toolkit, letting you write Java to produce Javascript.
“Links 是一种新的编程语言,旨在使 Web 编程变得更容易......Links 变得更容易通过为所有三层提供单一语言来解决阻抗不匹配问题;例如,将一些代码转换为浏览器的 JavaScript,将一些代码转换为服务器的字节码,将一些代码转换为数据库的 SQL。 ”
起初我不打算发布这个,因为它是一个研究项目,而不是一个生产系统;但所有这些回答都说“事情就是这样,处理它”,都要求有一个反例。
"Links is a new programming language designed to make web programming easier. . . Links eases the impedance mismatch problem by providing a single language for all three tiers. The system generates code for each tier; for instance, translating some code into Javascript for the browser, some into a bytecode for the server, and some into SQL for the database."
At first I wasn't going to post this, since it's a research project, not a production system; but all these answers saying "that's how it is, deal with it" begged for a counterexample.
Web 编程本质上是一门多学科的技术。
造成这种情况的主要原因是关注点分离……HTML、CSS 以及 JavaScript、SQL 等之所以没有以一种语言混合在一起,是因为它们各自有不同的目标、警告、陷阱和优势。
您能想象尝试调试一个将 SQL、CSS、JavaScript 和 PHP 代码混合在同一源文件中的网站吗?您可能已经不幸这样做了。可悲的是,实际上有数千个网站都是这样编写的,尝试调试或添加这种混乱的表示、数据和结构融合完全是一场噩梦。
我认为最重要的是教授编程基础知识并让它们坚持下来。变量、逻辑、指针、内存管理、算法、数据结构等。
当您掌握了编程基础知识时,就可以轻松地使用多种语言、学习新语言,并且可以轻松地进行更改次。对于像网络编程这样不断发展和基于趋势的事物来说,这是一项非常宝贵的技能。
在我看来,刚接触编程的人应该从较低级别的语言开始,例如 C。人们应该学习编程的内在、基本概念,并且应该在学习 PHP 或 Python 等高级语言之前了解幕后发生的事情。
我认为这种对编程教学的态度将产生培养更好的网络开发人员的效果,并提供进入壁垒,淘汰那些没有兴趣或智力的人。我认为这种态度的结果将是更好的开发人员、更好的软件以及最终更强大的语言和工具。
Web programming is an inherently multi-discipline craft.
The primary reason for this is because of seperation of concerns...the reason that HTML and CSS and JavaScript, SQL, etc, are not mashed together in one language is because they each have seperate goals, caveats, pitfalls, and strengths.
Can you imagine trying to debug a site that has SQL, CSS, JavaScript and PHP code mixed together in the same source files? You may have already had the misfortune of doing so. Sadly, there are literally thousands of sites written like this, and it is a complete nightmare trying to debug or add to such messy amalgamations of presentation, data, and structure.
I think the most important thing is teaching the fundamentals of programming and making them stick. Variables, logic, pointers, memory management, algorithms, data structures, etc.
When you have the fundamentals of programming, it's easy to work in multipe languages, pick up new ones, and easy to change with the times. This is an invaluable skill for something as constantly-evolving and trend-based as web programming.
In my opinion people new to programming should be started at lower level languages, like C for example. People should be tought the intrinsic, fundamental concepts of programming and should gain knowledge of what is going on behind the scenes before even being shown a higher level language like PHP or Python.
I think that this attitude towards teaching programming will have the effect of breeding better web developers as well as providing a barrier of entry that will weed out people that don't have the interest or intelligence. I think the result of this type of attitude will be better developers, better software, and ultimately more powerful languages and tools.
网络开发领域的一群孩子使我们的职业退化,因为现在几乎每个人都称自己为程序员,而我们却越来越难与他们保持距离并获得体面的报酬。
许多语言和技术需要掌握?这是一件好事。让加入开发者行列有一定的准入门槛。
补充:通过以下评论,我可以看到我还没有完全清楚地表达自己。我没有说年龄,无论是10岁、30岁、50岁还是80岁。这都是关于态度的。一个人是否理解并接受这样一个事实:这个职业不仅仅是在某些设计师或 CMS 中用鼠标移动控件。有很多知识需要学习,包括计算机科学基础知识、算法、数据结构、数据库、架构、可扩展性、维护、性能、可伸缩性、可用性、营销等等,这些知识属于专业软件开发人员的工作坊。我一个人对那些一无所知,又不采取行动去教育自己,努力变得越来越精通,他们不属于这个职业。并且让这个观点带有偏见。
An army of kids in web development is what has degraded our profession since now just about anyone calls himself a programmer while it's getting harder and harder for us to get distanced from them and get decent pay.
Many languages and technologies to master? It's a good thing. Let there be some entry barrier to join the ranks of developers.
ADDED: By following comments I can see I have not made myself entirely clear. I say nothing about the age, be it 10, 30, 50 or 80. It's all about attitude. Whether a person understands and accepts the fact that there is much more to the profession than moving controls with a mouse in some designer or CMS. There is a lot of knowledge to be gained, including basics of CS, algorithms, data structures, databases, architecture, extensibility, maintenance, performance, scalability, usability, marketing and much more that belong to the workshop of a professional software developer. I a person is ignorant of those and doesn't make a move to educate themselves and strive to become more and more proficient, they do not belong to the profession. And let this opinion be biased.
我认为您会得到的最接近的是.NET。许多语言都有许多框架,但据我所知,没有一个框架可以处理所有事情。除此之外,你不能试图让孩子们相信编程就像在公园里散步一样。这是一个艰难的职业,需要大量的学习和坚持。我们所使用的技术今天还存在,明天就会消失。
如果你仔细想想,编程与木工或航空没有什么不同。几乎您选择的任何职业都需要您学习很多不同的东西,以便更好地做好自己的工作。
The closest I think you'll get is .NET. There are many frameworks for many languages, but none that I know of that handle absolutely everything. Beside that you must not attempt to convince children that programming is a walk in the park. It's a difficult career, that requires a lot of study and keeping-up. We work with technologies that are here today, and gone tomorrow.
If you think about it, programming isn't any different than carpentry, or aeronautics. Just about any profession you chose will require you to learn a lot of different things to be better at what you do.
您应该如何向孩子们教授网络开发?哇,这真是一个棘手的问题。如何教授他们外科手术、知识产权法或土木工程?或者就汽车机械、管道或总承包而言?
你有没有想过放一盘芝麻街磁带?
艾莫不喜欢你贬低他的职业。
How are you supposed to teach web development to kids? Wow, that's a thorny one. How does one go about teaching them surgery, or intellectual property law, or civil engineering? Or for that matter auto mechanics, or plumbing, or general contracting?
Have you thought about popping in a Sesame Street tape?
Elmo doesn't like it when you trivialize his profession.
软件行业正遭受着不合格人员的困扰,他们除了创造质量低劣的产品外什么也不做,同时也使这个行业远离了真正的工程学科。这不是需要认证的事情。看在上帝的份上,不要“教”任何人软件开发。向他们解释,只有多年的经验和对过去和当前技术的丰富知识才能创造出出色的软件。你能做的最糟糕的事情就是引入另一个半生不熟的开发人员,为与他们一起工作的其他人创造工作。告诉他们要受教育。我知道这可能不是您想听到的答案,但我希望有人阅读。
Software industry is suffering from unqualified individuals doing nothing but creating poor quality products and at the same time distancing this profession from becoming a true engineering discipline. This isn't something to get certified on. For the love of god, don't 'teach' anyone software development. Explain to them that making great software only comes out as a result of years of experience and wealth of knowledge of past and current technologies. The worst you can do is introduce yet another half-baked developer creating work for others working with them. Tell them to get educated. I know this isn't the answer you probably wanted to hear, but I wanted this to be read.
我认为 Web 开发的问题在于它最初并不是为当今的使用而设计的。我们使用 HTML+CSS+JavaScript 以及生成它的任何服务器端技术在浏览器内构建富客户端应用程序。是的,它确实有效,但很痛苦,尤其是那些烦人的浏览器不兼容问题。 Flash和Silverlight的存在证明了这一点。它们让您可以在浏览器内使用一种技术构建应用程序。不过,内容需要插件的缺点是显而易见的。
I think the problem with web development is that it was not originally designed for what it is used today. We build rich client applications inside a browser with HTML+CSS+JavaScript plus whatever serverside technology generates it. Yes, it works, but it's a pain, especially with those annoying browser incompatibilites. The existence of Flash and Silverlight proves this. They let you build your app with one single technology, still inside the browser. The downsides of needing a plugin for your content is obvious though.
语言是您最不用担心的。他们所处理的问题领域很复杂。使用不同的语言实际上使事情更易于管理,因为 a) 它使边界明确,b) 可以针对领域优化语言。
The languages are the least of your worries. It's the problem domain that they work with that is complex. Using different languages actually makes things more manageable because a) It makes the boundaries explicit and b) the languages can be optimised for the domain.
编程(PHP/JS)和文档格式(HTML/CSS)是两个不同的东西。
同时学习 PHP 和 JS 编程也会很困难。
一开始就应该关注客户端的 HTML 和 JS。然后,您也可以让他们在服务器上编写javascript。这将使其成为一种编程语言,并且首先将重点放在 HTML 而不是 CSS 上。
一旦他们学习了 JS 和 HTML 的基础知识,您就可以教他们更广泛使用的服务器端编程语言(如 PHP、Ruby 等)和 CSS。
Programming (PHP/JS) and document format (HTML/CSS) are 2 different things.
Learning to program in PHP and JS at the same time will also be difficult.
You should focus on HTML and JS on the client at start. You could then let them program javascript on the server as well. This will make it only one programming language, and focus on HTML over CSS to start with.
Once they've learned the basics of JS and HTML, you can teach them a more widely used server side programming language (like PHP, Ruby, etc) and CSS.
Django 可以带您部分了解其清洁性。它专注于生产力。教学并不比任何其他语言/框架更容易,但这样看:当教授这个工具时,您的学生充分了解它应该是多么容易。在学习了 Django 之后,他们将永远不会接受 Javaservlet 或类似的噩梦。
Django can take you part of the way through its cleanness. It is focused around productivity. Teaching is not easier than any other language/framework, but look at it this way: when taught this tool, your students are well equipped in their knowledge of how easy it should be. They will never accept Java servelets or similar nightmares after having learnt Django.
查看 Opa:http://opalang.org/
这是一项新兴的 Web 开发技术。看起来很有前途。在过去的几年里,我做了很多 Web 开发,如果我必须做出预测,新的框架/语言/技术将成为 5-10 年内网站开发的主要方式,我会这么说将是欧帕。
文档很棒,社区很棒,教程和对项目团队提出的问题的响应都非常好。总体而言,他们似乎在开发这个似乎无与伦比的新框架时注重细节。
Check out Opa: http://opalang.org/
This is an up and coming web development technology. It looks quite promising. I have done a lot of web development over the past couple years and if I had to make a prediction which up and new framework/language/technology is going to be the primary way websites are developed in ~5-10 years I would say it will be Opa.
The documentation is great, the community is great, the tutorials and responsiveness to questions asked of the team working on the project is excellent. Overall they seem to have an attention to detail in regards to developing this new framework that seems to be unmatched.
很多技术掌握并不是好事。无论精英主义者怎么说,我们都需要 Web 版 Visual Basic。
Many technologies to master is not a good thing. We need a Visual Basic for the web, no matter what the elitists say.
您需要不同的语言来实现不同的目的。在大多数 Web 应用程序中,实际上发生了很多事情,因此您需要不同的语言和解决方案。
如果目标是统一一种语言,你就可以做到。您可以在服务器上使用 Javascript,然后使用
document.createElement()
构建页面,并将样式直接应用到styles
属性。在服务器上,使用 Javascript 将数据直接存储在文件中。显然这不会有那么好的结果。 HTML 并不完美,但它如此普遍是有原因的——它简单而良好地完成了它该做的事情。 CSS 既复杂又过于简单,但定义可重写规则来表达设计的基本思想是合理的。 SQL 有时可能很难理解,但以这种方式表达数据库查询是富有表现力的,而且实际上效果很好。
话虽这么说,我并不是说存在或应该有一种架构。不应该有。每个项目都应该使用符合其要求的架构。
在你的下一个项目中尝试简化:你真的需要数据库吗?您能否使用 GWT、Applet、Flash 或 .NET 等方式组合视图层以进行简化?您真的需要在浏览器中提供您的内容(这会引入 CSS、HTML 和 Javascript 的复杂性),还是您可以只编写一个应用程序?
You need different languages for different purposes. In most web applications there's actually quite a bit going on, so you need the different languages and solutions.
If the goal is to unify on a single language, you can do that. You can use Javascript on the server, and then build the pages using
document.createElement()
and apply styles to them directly to thestyles
property. And on the server, store your data directly in files with Javascript.Obviously this wouldn't work out that well. HTML is not perfect, but there is a reason it is so ubiquitous-- it does what it does simply and well. CSS is both convoluted and too simplistic, but the underlying idea of defining overrideable rules to express your design is sound. And SQL may be a pain to understand at times, but expressing database queries this way is expressive and actually works pretty well.
That being said, I'm not saying there is or should be one architecture. There shouldn't be. Each project should use an architecture in line with its requirements.
On your next project try to simplify: do you really need a database? Can you combine the view layers to simplify, either using something like GWT, Applets, Flash or .NET? Do you really need to serve up your content in a browser (which introduces CSS, HTML and Javascript complexities), or can you just write an application?
我认为你的方法可能需要重新考虑。我认为,就这样吧,但我认为这种顺序可能会更好。
首要任务:(无特定顺序)
下一步:
在知道如何解决问题之后作为个人和团队,他们可以转向具体细节,例如:
逐步积累他们对所涉及内容的了解,而不是立即跳入深渊 - 他们很快就会不知所措。
此时您可以开始介绍文件 I/O 和数据库等内容。
这将为他们提供相当全面的技能。从这里他们可以真正开始学习。
这些本身就是一个完整的主题,你无法将它们全部咬断。尤其是当你从 0 开始招募这些人时。在你能够构建一些有趣的东西之前,你必须学会构建一些平凡的东西。
HTML5 可能比 Flash 或 Silverlight 更符合您的需求,但是还没有完全实现……尽管支持正在建立。
迈出一小步,奥拉夫 - 如果这是黑客帝国,您可以一次性下载所有信息,但我们还没有做到这一点……还;-)
目前,以及不久的将来,网络开发是许多不同技术的协同作用,共同提供有趣的用户体验。
好吧,这就是我的 2 美分
I think your approach might need to be rethought. Take this for what it is, my opinion, but I would think this ordering might work better.
Top Priorities: (no particular order)
Next:
After they know how to solve problems as individuals and as a team they can move onto specifics such as:
Build up their knowledge of what's involved piece by piece rather than jumping into the deep end off the bat - they'll be quickly overwhelmed.
At this point you can start to introduce things like file I/O and databases.
This will give them a fairly comprehensive skill-set. From here they can really start learning.
These are whole topics unto themselves, you can't bite them off all in one chunk. Especially if you're taking these people from 0. Before you can build something interesting you have to learn to build something mundane.
HTML5 will probably be more in the vein of what you're looking rather than Flash or Silverlight but it's not quite here yet...Though support is building.
Baby steps, Olav - if this were The Matrix you could download all that info in one shot but we're not there...yet ;-)
For the moment, and near future, web development is the synergy of many different technologies working together to deliver an interesting user experience.
Well, that's my 2 cents
Web 开发的多学科性质是使其工作充满乐趣的原因之一,尤其是在团队环境中。
为了作为一个团队良好地工作,您自然会与一群具有各种专业知识的人聚集在一起,从 UI/图形人员到 DBA 和系统管理员。即使在团队的单层(例如后端程序员)中,每个人通常都专注于不同的领域,例如,有些人可能在 UI 方面拥有更多经验,而另一些人则在数据方面拥有更多经验。
与在一个由 10 个 Java 程序员组成的房间里工作,他们都在开发一些中间件应用程序相比,我每天都会接受这种变化。
The multi disciplinary nature of web development is one of the things that makes it a joy to work in, especially in a team environment.
To work well as a team, you naturally come together with a group of people with a range of expertise, from UI/graphics people down to DBAs and sys admins. Even within a single layer of the group (for example back end programmers) each person generally specialises in a different set, for example some people may have more experience up towards UI, others down towards data.
I would take this variety any day, compared to working in a room of 10 java programmers all working on some middleware application.
如果您只是想教他们编写动态网站,请让他们学习 w3schools.com 上的 HTML 教程,一旦他们完成,就可以为自己找到一个看起来不错的样式表,他们可以将其包含在内并使用 PHP 设置它们。这会让他们把启动和运行作为一种爱好,如果他们想做更多,他们可以开始拼凑额外的知识,比如 CSS 和 JavaScript。
If you simply want to teach them to write dynamic websites, set them going through the HTML tutorial on w3schools.com and once they're done, find yourself a decent looking stylesheet that they can include and set them going with PHP. That'll get them up and running as a hobby, and if they want to do more, they can start piecing together extra knowledge, like CSS and JavaScript.
Ruby on Rails 在统一所有这些方面取得了很大的进展,但对于 CSS 来说,它让您感到冷落(尽管可能有一些 RoR 框架使 CSS 过时,但我认为您还有另一种标记语言),并且您仍然需要 Javascript(尽管它确实为您编写了很多 Javascript 以及所有数据库代码)。
另一方面,关于你的孩子:编程是程序员的事。在周日下午,要在几个小时内将一些东西组合在一起,您需要了解一个框架,并购买一些插件,然后无需太多工作就可以将所有内容安装并移动。像 Drupal 或 Joomla 之类的东西,他们出售模板(对于 Joomla,你可以购买数百个包)和插件来完成各种事情。当这失败时,您的孩子可能应该知道如何使用 ODesk 并花 100 美元在您的框架上完成一些工作。如果你想成为一名程序员,学习编程是很好的选择。否则,最好了解雇用优秀程序员或购买优质预制组件所需的知识,并有足够的现金来做到这一点。
关于孩子的最后一点:让他们玩电子游戏。无论计算机方面的未来如何,这是他们可以获得的最佳培训。视频游戏让您可以通过电脑进行调查、玩耍和放松。一旦掌握了这些,学习 HTML、CSS、Javascript 和一些应用程序堆栈就是小菜一碟。
Ruby on Rails goes quite a way towards unifying all of those, but for CSS it leaves you out in the cold (though there are probably a few frameworks for RoR that make CSS obsolete, but then you have another markup language, I think), and you still need Javascript (though it does write a lot of Javascript for you, and all DB code).
On the other hand, about your kids: programming is for programmers. On a Sunday afternoon to put something together in a few hours, you would need to know a framework, and buy some plugins, and get everything up and moving without much work. Something like Drupal or Joomla, where they sell templates (for Joomla you can buy packs of hundreds) and plugins to do all kinds of things. And when that fails, your kids should probably know how to go on ODesk and drop $100 to get something done on your framework. Learning to programming is good if you want to be a programmer. Otherwise, it's best to learn what you need to hire good programmers or buy good predone components, and have the cash to do it.
Last point about the kids: let them play video games. That is the best training that they can get for whatever the future holds in store on the computer side. Video games let you investigate, play, and relax with the computer. Once you have that, learning HTML, CSS, Javascript, and some application stack is cake.
angularjs 可能是一个选择。它适用于单页应用程序,在 Nodejs 堆栈上运行,并执行一些模板 JavaScript“魔法”。
示例(模板/代码):
它将(通过自动生成的客户端-js)输入字段中的值绑定到标题(h1)。
如果您在输入字段中输入内容,标题中的文本就会更新。
而且你不必编写前端js。
angularjs could be an option. it is inteded for single-page-applications and runs on a nodejs-stack and does some template-javascript "magic".
example (template/code):
It binds(via auto-generated-client-side-js) the value from the input-field to the the heading(h1).
If you type something to the input field, the text in the heading gets updated.
And you don't have to write the frontend-js.