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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Before I write a single line of code, I

13 点作者 relaunched将近 10 年前
I&#x27;m about to start coding a new project, that is a little more sophisticated than my usual tinkering. So, I&#x27;ve been thinking about the primary use case, sequence diagrams of the systems, the data structures and the like, and I still haven&#x27;t written a line of code.<p>How do you organize yourself before starting to write code? What works and what doesn&#x27;t? Why? Or, is it just better to start coding and figure it all out on the fly?

14 条评论

d23将近 10 年前
More advice: think in terms of iterations. You might be thinking of everything in terms of some holy grail platonic ideal of the project, when in fact you will hit a number of road bumps and change your mind along the way that may completely change that.<p>So start smaller. What&#x27;s a key piece of functionality that might set a good foundation you can build off of? Building this has the dual benefit of giving you a cognitive &quot;win&quot; while starting to work the &quot;bones&quot; of the project into your muscle memory. You&#x27;ll have a much clearer idea of what the next step you need to take is to get it to that larger end-goal.
jmnicolas将近 10 年前
I always model the database first then I start coding. In my experience if the DB is right the rest is easy.
评论 #9994454 未加载
EdSharkey将近 10 年前
I&#x27;m tired of working for years on hobbies that ultimately get big and I think can turn into businesses only to find I have built this huge unmaintainable edifice of untested spaghetti that I have to shelve.<p>So now, whether it&#x27;s on the job or on my home project time, I get the git repo and build scripts squared away with some awesome testing framework that constantly watches the file system and rebuilds and running my test suite as I&#x27;m working on the code. This way I can do TDD and get higher quality code more consistently.
评论 #9993181 未加载
评论 #9995923 未加载
评论 #9993708 未加载
1arity将近 10 年前
Check all the news I can find.<p>And when I&#x27;m not procrastinating, I write up a kind of spec, which I then revise into code sketches, and what I would like APIs to look like.<p>And then I fill it in. Rinse and repeat.
krapp将近 10 年前
I think there comes a point beyond which planning can be used to avoid having the purity of your ideas corrupted by the inevitable messiness of their implementation. I&#x27;ve recognized it in myself, at least.<p>The only thing I can suggest is that you put your notes aside, set up a repo, branch and just write some code.
e19293001将近 10 年前
Start your project with a plan on a piece of paper and without a computer in front of you.<p>Not sure if this comment by edw519 can help you though it works for me.<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=191275" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=191275</a>
Mizza将近 10 年前
README.md<p><a href="http:&#x2F;&#x2F;tom.preston-werner.com&#x2F;2010&#x2F;08&#x2F;23&#x2F;readme-driven-development.html" rel="nofollow">http:&#x2F;&#x2F;tom.preston-werner.com&#x2F;2010&#x2F;08&#x2F;23&#x2F;readme-driven-devel...</a>
bjourne将近 10 年前
&gt; Why? Or, is it just better to start coding and figure it all out on the fly?<p>Yes it is. Write code towards the solution and see what it leads you. Then you might get into a &quot;writers block&quot; and can&#x27;t decide whether data structure A or B is best. So you think about it some, decide which one you like and write more code. Then you might find out that you thought A was best but it turns out B was better. So you refactor your code base, write some more code and so on.
评论 #9994460 未加载
zakvyn将近 10 年前
1. write down business requirement (Break to small stores that you can finish each story in a day) 2. write down technical requirement (over all) 3. write down expect test cases in English. (When something happen, what is expected)
allendoerfer将近 10 年前
… write down the features of some extremely restricted version of an MVP and finish that first, applying YAGNI as strict as I can.
weinzierl将近 10 年前
... set up version control.<p>Thankfully nowadays this is basically <i>git init</i> for me. In the past it involved much more.
philippnagel将近 10 年前
… prepare lots of tea.
rman666将近 10 年前
Get a Mt. Dew
rhapsodic将近 10 年前
Think.