在我自己和其他人的代码中始终期望语义正确的标记不是明智之举吗?
- 成为语义纯粹主义者是不是很糟糕? 时间,工作时间?难道这一切都无法实现吗 时间?
当我看到任何其他代码时 人/受访者。我知道选择 用于某一目的的元素最多 重要的事情。
我应该如何判断一个人的能力 从他的代码中;从一篇好的文笔来看, 管理、优化 CSS 或者他如何 写了类名和id名?
或者每次都两者。
- Is it bad to be semantic purist all
the time, at work? is it not achievable all
the time ? when i saw code of any other
person/interviewee. I know selection
of element for a purpose is most
important thing.what i should judge person ability
from his code; from a good written,
managed, optimized css or how he
wrote class and id names?Or both every time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的。有时,这些工具无法按照您希望的方式工作,您只需使用有效的工具即可。值得付出一点努力来使代码在语义上更加正确,从而使维护更加有效,但在某些时候,您无法保护开发成本,因为它所带来的维护收益要少得多。
任何人都可能在某些领域有坏习惯或不完整的知识。你更应该根据一个人在面对代码时辨别好代码和坏代码之间差异的能力,以及对正确编写代码表现出一定的兴趣来判断一个人。
Yes. Sometimes the tools doesn't work the way that you would like, and you just have to use something that does work. It's worth a little effort to make the code more semantically correct to make maintenance more effective, but at some point you just can't defend the development cost because the gain in maintenance that it would give is a lot less.
Anyone can have bad habits or incomplete knowledge in some areas. You should rather judge a person on the ability to see the difference between good and bad code when presented with it, and for showing a certain interrest in getting it right.
这取决于您所说的“语义纯粹主义者”是什么意思。
他的代码是否如此糟糕,以至于您必须先重构它,然后才能对其进行任何维护,甚至能够理解它到底做了什么?那么这很重要。
如果代码按照您的标准并不完美,但可以忍受,并且可以维护,并且此人似乎很容易接受您有关改进方法的提示 - 特别是如果这些提示还附有解释为什么改进使代码变得 X %更具可读性/稳定/可维护性,现在他们的“纯度”水平并不那么重要。
如果这个人愿意花额外的一周时间来完善他们的代码,使其在语义上是纯净的,但以延迟交付为代价,那么他就会遭受很大的净损失。
举一个 CSS 的具体例子,如果有人仅仅因为“应该添加”而向页面上的每个元素添加一个类,那就不好了。
如果他们表明需要将类添加到位置 X、Y 和 Z,以便 jQuery 选择器的性能比替代解决方案好 20%,那就非常好。
It depends on what you mean by "semantic purist".
Is his code so bad that you MUST refactor it first before you can do any maintenance on it or even be able to understand what the heck it does? Then it's important.
If the code is not perfect by your standards but udnerstandable, AND can be maintained, AND the person seems receptive to your hints about ways to improve it - especially if those hints are accompanied by explanation of why the improvement makes the code X% more readable/stable/maintainable, it's not THAT important what their level of "purity" is now.
If the person is willing to spend extra week polishing their code to be semantically pure at the cost of shipping late, he's a net loss by a big margin.
To give a specific example for css, if someone will add a class to EVERY element on a page just because it "should be added", bad.
If they indicate that the class needs to be added to places X, Y and Z so that jQuery selectors perform 20% better than alternative solution, VERY GOOD.
两者实际上都有助于不同的能力。类和属性中的出色抽象设计将描述他分析事物的能力,而编写良好的托管优化 CSS 则表明他/她自己是一个有组织的人。后期的属性也很重要。
如果CSS至少是可观的,我仍然会选择第一个属性。
Both actually contribute to different abilities. A great abstraction design in Classes and Properties will depict his ability to analyze things where as a well writted managed optimized css expresses that he is himself/herself an organized person. The later property is also very important.
Still I will go for the first property if the css is atleast presentable.
您是否面临建立错误替代方案的危险?我们可以仔细选择类和标识符名称或者我们可以编写工作CSS?理想情况下,我更喜欢能同时做到这两点的人。
如果一个人的工作申请中有严重的拼写错误,你会如何推断他的工作质量?就像他们所申请的公司名称拼写错误一样!对于错误陈述项目目标的项目提案,您会得出什么结论?申请软件安全工作的人混淆了“身份验证”和“授权”。
在面试中,您试图从很小的信息样本中确定一个人来为您工作后可能会表现出的表现。我们需要考虑许多因素,例如面试压力对某些人表现的影响,以及他们是否使用母语工作。我在这里没有看到任何绝对的标准,也没有像您提出的简单非此即彼的问题的范围。
当然,我们需要他们能够生成有效的代码,这很简单!代码质量以及其他方面的工作质量也很重要。
Are you in danger of setting up a false alternative? We can either choose class and identifier names carefully or we can write working CSS? Ideally I'd prefer someone who can do both.
What do you deduce about the likely quality of a person's work if their job application has serious misspellings? Like the misspelling the name of the company they are applying to! What do you deduce about a project proposal that mis-states the objectives of the project? A person applying for a SW security job who confuses "authentication" and "authorisation".
In the interview you are trying to determine from a very small sample of information the likely way a person will perform if they come to work for you. We need to factor in many factors such as the effect of interview pressure on some folks performance, and whether they are working in their native language. I don't see any absolute standards here, and no scope for simple either-or questions such as you pose.
Of course we need them to be able to produce code that works, that's the easy bit! Quality of code, and quality of other aspects of work also do matter.