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.

Ask HN: Do you use any mental models to design and develop a software product?

21 pointsby hkazemiover 4 years ago
I am doing some research to know what mental models do software engineers/architects use to develop a system or solve a specific problem with code. Do you use any? If yes how and what?

3 comments

nanonanover 4 years ago
Generally (and I&#x27;m not sure if these are really mental models, but often are in my head as a code, and I would imagine are quite obvious to any developer above entry level): Red Green Refactor, YAGNI, Dry, SOLID, and IoC.<p>When it comes to choosing design patterns I usually lean towards KISS, and prefer less code.<p>Cyclomatic Complexity is the enemy of maintainable software and naturally arises when users request new features and grows exponentially with the number of users and&#x2F;or developers. Because of that I do prefer Cowboy Coding - it handles one side of that count. Reflexively I&#x27;ll argue with new requests and try and predict what else can go wrong or what unintended outcomes will be that will lead to more user requests or complexity. One pattern I often use in my head is to imagine software as biological systems, evolving ecosystems in tandem with users. There&#x27;s a sort of evolutionary arms race between growing user stories, making the business money, and Conway&#x27;s law. I try and stick to the 80&#x2F;20 rule as often as I can when refactoring and making changes and often consider the biological paradigm Structure&#x2F;Function when designing. I consider it a win when the system is either less technically complicated or the use case is simpler (less steps for a users workow) after I&#x27;ve touched it between releases.
评论 #26192245 未加载
domanoover 4 years ago
I have a list of priorities when developing (most to least important):<p>Reduce Statefulness -&gt; Explicit error handling -&gt; Reduce Dependencies (sometimes even violating DRY if need be) -&gt; Reduce complexity -&gt; Everything else.<p>Designing systems or software usually has decoupling and complexity as a priority, with everything else in second place.
评论 #26193948 未加载
mikewarotover 4 years ago
I assume the customer doesn&#x27;t know what they want, they only know what they <i>think they want</i>. It takes iterations to get things right. Get a minimum viable product in front of them, and let them use it for a bit... you&#x27;ll immediately get a raft of new requirements, and this is the perfect time to ask about ideas you thought of on the way, and what they think of them. It is also the right time to say &quot;it would be hard to do X, but if I could do X&#x27; instead, would that be ok?&quot;<p>Iterate, iterate, iterate.<p>---<p>Get users unfamiliar with the program, have them try to do X, Y, Z... ask what they are looking for, if they get confused... work hard to get your mind into the space of someone unfamiliar with the system you&#x27;ve created.<p>---<p>Keep your databases as simple as possible. Don&#x27;t ever have a way to put in N of something... it&#x27;s either none, one, or infinitely many with a related table.<p>---<p>Always have a way to get help visible to the user.<p>---<p>In forms, don&#x27;t enable the &quot;Submit&quot; or &quot;OK&quot; button until all the preconditions are set. Same with other fields. Make it impossible to submit invalid data, if at all possible.<p>---<p>Never make a user type something more than once... each time data is entered is another opportunity for error.<p>---<p>Old advice: Make sure the program can be used completely without a mouse, using only they keyboard.<p>New advice: Make sure the program can be used completely without a keyboard, using only the touchscreen.<p>---<p>If you&#x27;re doing a data transfer to an external device, what happens if the connection fails in the middle of the transaction? Test it, and make it fail-safe.<p>---<p>Use GIT to keep history, and take the time to make your commit messages meaningful to yourself and others in the future. (It sure beats the heck out of a folder of versionNNN.ZIP files)<p>---<p>O(n) - If you don&#x27;t know about O(n) notation, learn it and its importance. A program that works fine with a toy dataset <i>will</i> become unusable if there is an O(n^3) operation in there somewhere.<p>A few hours of optimization an testing can outperform decades of Moore&#x27;s law.<p>---<p>Structured programming - Break down things into pieces as small as is <i>reasonable</i> to work with, but no smaller. Put related code into modules (units in Pascal)<p>---<p>Information Hiding - Keep your interfaces strict, don&#x27;t work around them to get at the internal state of objects. Doing so will limit your future options, and is a huge source of technical debt.<p>---<p>Documentation: It should be possible to effectively use your program with only the manual, and some time and effort. If not, the program isn&#x27;t done.<p>---<p>Hardware: Intermittent hardware should be treated as hazardous waste, and disposed of as quickly as possible. - Mike&#x27;s law of intermittent hardware.<p><a href="http:&#x2F;&#x2F;mikewarot.blogspot.com&#x2F;2007&#x2F;10&#x2F;mikes-law-of-intermittent-hardware.html" rel="nofollow">http:&#x2F;&#x2F;mikewarot.blogspot.com&#x2F;2007&#x2F;10&#x2F;mikes-law-of-intermitt...</a><p>---<p>Hardware: SSD drives are a great way to speed up an older system, but don&#x27;t let them get full, or they will slow down.
评论 #26197482 未加载
评论 #26198638 未加载