TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Hacks can be good code too

16 点作者 sonicrocketman大约 3 年前

3 条评论

Sydneyco大约 3 年前
Interesting reasoning and I like the questions you ask yourself.<p>This makes me think of Polaris Methodology I heard from a french tech team: Sometimes you just need to get the code working to advance in your feature or whatever you are trying to build so you add a TODO to your code; The problem is that you never come back to it.<p>The Polaris methodology is that after 6 weeks of the sprint, they have 2 weeks of &#x27;rest&#x27;. Rest time is used for code that hasn&#x27;t been completely finished, code that &quot;smells&quot;. You use those two weeks to refactor what is fresh in your mind and whatever you feel needs to be made better.
评论 #30787462 未加载
评论 #30787600 未加载
bryanrasmussen大约 3 年前
won&#x27;t go into the whole thing, but nearly 10 years ago I was part of a large project that needed to do very funky things with iframes, one of the things it did was to open an iframe with a different than http, https uri scheme - I want to say about uri scheme but I think it was something else - this was to get around security restrictions about writing to iframes - as it happened when content was written into these iframes you needed to be able to follow relative uris, so a link between one part of the iframe and another should cause scrolling to the target.<p>This worked. In Chrome and other browsers, except FF. So I suggested - well why would FF know to scroll when a link is clicked when the content we have written into the iframe doesn&#x27;t have a mime type? Let&#x27;s try to give it a data uri. That worked in FF, but in Chrome it raised the security issues you would run into if you were getting html from a different domain.<p>So in the end we had to do browser detection to load the non-FF with the about or other uri scheme (can&#x27;t remember) and FF with data uri.<p>Actually the product of this large project is being phased out now, maybe they&#x27;ve gotten wind that hack isn&#x27;t going to work anymore soon.<p>At any rate my hack was chosen by the guy who had to fix the bug because it could be done with one line of code, there was another hack suggested but we didn&#x27;t explore if it would even work (it would have depended on JavaScript access to DOM in iframe which I suspect might not have worked either because if browser doesn&#x27;t know mime type for iframe why would it waste memory building a DOM?)
Terry_Roll大约 3 年前
Initial Code, Optimise Later. (ICOL)