897 karma · joined Aug 26, 2022 (4y ago) · 561 submissions
186.
Some tricks for interactive usage of Bash shell(mahesh-hegde.github.io ↗)
1 points · by never_inline · 1y ago · discuss
comment 1y ago · link · parent
GP comment reeks of textbook "performance doesn't matter" rhetoric.
comment 1y ago · link · parent
> So the question I want to part with is: have we advanced much in 30 years? Modern IDEs have some better refactoring tools, better features, and support more languages, but fundamentally… they haven’t changed much.
I can't give up any of: intellisense, type checking as I type, semantically meaningful navigation.
comment 1y ago · link · parent
Indeed. Go has like 5 options for SQL DDL migrations now. On python side there's alembic and bunch of homegrown stuff in various frameworks.
I think much of the complexity in liquibase comes from supporting various databases.
One thing to remember: mark a new version before each step that can fail, even if the steps themselves are together in the same file.
This is a problem I ran too much into with alembic in which each file is a single unit - a statement in the middle of the script fails and there's no simple way to roll back (unless your DB supports transactional DDL). So the pattern I have settled is to have only one simple change in one file. Liquibase of course doesn't suffer this because it has unique IDs per statement.
comment 1y ago · link · parent
specifically:
* Excessive indentation / conditional control flow * Too verbose error handling, eg: catching every exception and wrapping. * Absence of typing AND precise documentation, i.e stringly-typed / dictly-typed stuff. * Hacky stuff. i.e using regex where actual parser from stdlib could've been used. * Excessive ad-hoc mocking in tests, instead of setting up proper mock objects.
To my irritation, AI does these things.
In addition it can assume its writing some throwaway script and leave comments like:
// In production code handle this error properly
log.printf(......)
I try to follow two things to alleviate this.* Keep `conventions.md` file in the context which warns about all these things. * Write and polish the spec in a markdown file before giving it to LLM.
If I can specify the object model (eg: define a class XYZController, which contains the methods which validate and forward to the underlying service), it helps to keep the code the way I want. Otherwise, LLM can be susceptible to "tutorializing" the code.
comment 1y ago · link · parent
* Test whether they understand data types and abstraction. * You have a function returning two numbers in <your favorite language>, how will you do? * Now you need 4 items from this function called getUserInfo(), how will you return it? (Eg: username, email, location and age). * You need to share some state between two calls to this function. i.e a database connection. How will you do it? * Now imagine multiple threads / requests call this function. how will you share state?
And so on..
r/CSMajors types who have done only leetcode will fumble this kind of open ended discussion.
Similarly for networks
* Google "my IP address" from your phone?
* Is it really the IP address of your phone?
* There are more than 4 billion mobiles + computers on this planet. How are they getting unique IPs then?
* If you run your school project (likely to be django or express js app), will you be able to reach it from another phone or desktop using this IP?
* Why or why not?
These are kind of things they should be able to answer if their networking / OS etc... classes were any good.
comment 1y ago · link · parent
I have seen good and bad engineers who had been programming before graduation. Fortunately, good ones outnumber the bad ones.
comment 1y ago · link · parent
Eg: https://www.lesswrong.com/posts/Q8zqoBWBBHD2RjDuS/autism-and...
comment 1y ago · link · parent