HNHacker News
TopNewBestAskShowJobs

benstopics

393 karma · joined September 5, 2022

submissionscomments
benstopics··on Monocraft: A programming font based on the typeface used in Minecraft
Thank you for 1) making the font I’m actually going to try using it in VSCode simply because I think it will be fun and oddly enough easy to read, and 2) teaching me what a ligature is.
benstopics··on Ask HN: Seriously, how do you TDD?
I think you are doing it correctly, you just need to break that iceberg into smaller chunks. You’re getting caught up in the ideological nonsense that surrounds TDD and Scrum. “It can categorize a single transaction correctly” should be translated to a problem statement, “I want to be able to categorize a transaction.” You must then brainstorm feasible solutions for this or different aspects of the problem, develop the spec for implementing that, in the form of tests, “able to do this, able to do that,” and build the solution. Then afterwards you can test it against some examples and ask yourself, does this solve the problem? How to improve? Come up with a change or completely different solution, rinse, repeat. I would say a general statement like categorize a transaction is difficult because you don’t have any specific examples. Come up with a list of a dozen transactions that need categorizing and your TDD experience will become much less frustrating.
benstopics··on Doug Engelbart’s design for knowledge-based organizations (1992) [pdf]
I think the issue with this is that as individuals we attach our identity to our dialog and put it out into the world to share it, express ourselves, to provide value to the world, and also to collaborate and iterate and learn ourselves… with other individuals. The problem with deconstructing human ideas and information like this is that it ignores temporality. What is true today may not be true tomorrow, what is relevant today may not be relevant tomorrow. For the preservation of scientific or historic information this works great, and even allows copywriting of works. However, the true order of the day is leading and making decisions which ends up taking place in dialogue.

Dialogue is the single-threaded brute forcing and tree traversing activity for making decisions. Within a single thread, multiple subthreads do branch off, but then they become decentralized which is not what we want. We want each subthread to be conscious of it’s uniqueness to all other threads globally and for any duplication to be catalogued or ideally merged and then hyperlinked and indexed within the grand scheme. This is difficult when the most granular we can get in terms of categorization is the factual information or simply the topic itself. Places like HN and Reddit do well in allowing you to provide an entire article or website as the context and allow that to be explored, but how would you categorize this information? The real question is how do you make this visible and accessible from a single standpoint: an individual trying to learn something or make a decision. I think search engines like Google have solved this problem well simply by using the heuristic method of merit (backlinks, page rank, keywords) and so to implement this on a miniature scale for an organization would be useful, but the problem is that it would require users within the organization to forgo going to Google and instead use the provided Intranet which initially would be less useful and again may never be as useful as Google. So the solution might be to use Google as an indexing service which currently is not possible.

I think at the end of the day we are ignoring is the incentives. If people were incentivized to construct the information in this way, get some sort of reward, then it would happen naturally. But I don’t even think it is possible for a human to do that, say, store all of HN dialogues globally for example in their head and consider THAT before writing anything otherwise hyperlinking to what is already there.

The main issue is that knowledge is a graph, not a tree, and dialogue is linear. So in order to consume knowledge through text as quickly and efficiently as possible is more of a graph or traveling salesman problem which is very hard to solve, maybe something that Quantum AI can help with. One thing would be to incentivize hyperlinking. Another might be to store information in images using something like a way more advanced DALL-E that allows the human mind to grasp concepts simply through looking at trippy images or videos. To somehow use spatial and visual understanding to up the number of dimensions of what knowledge we can store and download into our brains.

benstopics··on Python multi-level break and continue
The first thing that came to mind was either for/else, try/except, or refactoring out to a function which were all mentioned in the article. This solves the problem in all cases except a multi-level continue as it was called, and the solution by Python Millionaire was essentially goto labels. The reason high level programming languages moved away from goto labels is because they create spaghetti code. Goto labels were before for and while loops and are not necessary now, but this is a shallow answer because goto labels do work.

To dig deeper into why goto labels are bad and the alternative, what goto labels allow you to do is to create a state machine in procedural code. The more explicit way to do this is to create a dictionary object that tracks the state and a while loop with state-based logic that includes a halting condition. But according to Python Millionaire this would not be “Pythonic” which is basically just a blanket term for saying it is built into the language and therefore designed to be simple and easy to read. However, I would argue that goto statements are inherently un-Pythonic because they encourage spaghetti code. I don’t see how for/else or try/except is not Pythonic, but also I don’t see the aversion to refactoring to separate function which is the accepted cross-language way to refactor and simplify code. It even lets you write a built-in comment for what the function does, the function name. That being said, an easy way to determine if the function failed is to either throw and exception or simply return a result like True/False which would determine whether to break out of the parent loop.

benstopics··on Ask HN: What tech-stack would you use for the following?
EDIT: I put a lot of emphasis on testing but didn’t mention what technologies I would use. For C# I would use XUnit or something similar there’s a few good ones. For integration testing specifically the db and api layers together I would use XUnit with a containerized docker compose of SQL Server and the application and maybe even use pytest to hit and assert the API, there are many ways you could do this. Same for the Python API, just use pytest and do what you need to do. For e2e I think Cypress is better than Selenium. Selenium is server/client based and requires more boiler plate code. Cypress can be ran as a command line tool, can record video per test, comes with an IDE and has a time travel feature. The only downside is that if you don’t understand React life cycle then the errors you get may be extremely difficult to troubleshoot. Most of the time it involves simplifying your state change events and reducing the number of asynchronous function calls. Selenium I have found is much more forgiving than Cypress, supports XPath out-of-the-box, and is a bit more forgiving when it comes to rendering. But in either product it would be recommended to wrap the base selector function in a while loop try catch which would eliminate this issue altogether.
benstopics··on Ask HN: What tech-stack would you use for the following?
My choice of techstack has nothing to do with the feature list because at the end of the day it is whatever gives you an advantage which is whatever you are better at than everything else so long as it has a rich third party library ecosystem to borrow from.

For the database I would choose PostgreSQL because you can rollback schema changes which you can’t in MySQL. SQL Server would also be good but it is more expensive which it is not always supported well depending on the platform, so you would end up gravitating towards Microsoft cloud services for convenience, which can get pricy if you’re not careful.

For the application layer I would pick either ASP.NET Core/C# if I was going the Microsoft route, otherwise Python all the way for everything. I admit that I always thought Python was comparable to PHP in terms of a terrible programming language, but I have discovered that the lack of types, similar to JavaScript, is it’s power. I will say in the wrong hands it will be a disaster for a large monolithic application due to lack of unit testing and clean code principles, and static typing is a great first line of defense from a regression testing standpoint. However, if you know what you’re doing, Python allows you to build infinitely complicated software at the speed of light which is exactly what a startup needs to be able to do: iterate as fast as you can. Build the MVP as fast as possible and user test it, and then go back and unit test as much as you can and also write e2e for the main workflows. If you don’t get into the habit of doing this, or don’t foresee yourself writing unit tests, avoid Python like the plague and stick to a typed programming language. I would not use your product at least because your site is going to go down at some point because a junior dev you hired had a typo and you were too tired or busy or lazy to properly review their code.

For frontend, React. I think any framework would be fine, including vanilla HTML/CSS/JS. I would vouch for any framework that has a lot of third party libraries, although the upside of React is how fast you can build things. I’ve heard of Angular and I’m sure there is so many more, if you’re familiar with it then you will probably be fine.

I know this is a hypothetical situation, but I think in reality you would not really know what all features your users want from the getgo because you have no users yet. One thing I noticed, and I know this is more to do with picking techstacks than a discussion on product market fit, but what is the problem you are trying to solve? It seems like you have a product in mind that you are trying to find a problem for it to solve, which is not recommended. Assuming this hypothetical scenario is in present day, it sounds like you would have Facebook, Reddit, Hacker News, and a multitude of other platforms to compete with. The problem they are trying to solve is that people want to connect with other people. It is interesting to point out that they all solve that problem in similar but different ways and are better at connecting certain kinds of personalities better than others. So I’d just be interested in whether you have thought about a specific type if person you are thinking of or have met that would be better suited for your platform than the others available?

benstopics··on Ask HN: What tech-stack would you use for the following?
You could scale the API with Kubernetes and MySQL with Vitess off-the-shelf or architect the sharding yourself. My only concern with MySQL would be that, contrary to PostgreSQL, you can’t rollback DDL statements which makes migrations a PITA, but this is true at all stages and unrelated to scaling. I find it interesting PHP was mentioned since it gets a bad wrap. I personally think it isn’t that great of a programming language but if it’s what you’re familiar with then more power to you. It’s like if someone said you could articulate ideas in French much better than in English, because it has words for things that English doesn’t, I’d still write a better book in English than French. Although, if you understand the fundamentals of programming languages, then learning a new one, especially a high-level OOP one, doesn’t take that long.
← PreviousPage 3 of 3