TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Hacks can be good code too

16 pointsby sonicrocketmanabout 3 years ago

3 comments

Sydneycoabout 3 years ago
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 未加载
bryanrasmussenabout 3 years ago
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_Rollabout 3 years ago
Initial Code, Optimise Later. (ICOL)