Hacker News new | past | comments | ask | show | jobs | submit | mnsc's comments login

Sony are giving up on the compact flagship 5 series because "People are no longer interested in compact phones and would rather go for a large one if it offers the same benefits". And unfortunately the specs of the Xperia 10 just doesn't cut it for me. :(

Ugh, pockets aren't getting bigger.

Buying my last phone was a real challenge - even 6.5 inches long feels huge, and there were very few options under 7 inches.


Funny enough I found some old pants that still fit, ~20y old, and those pockets does not fit a modern phone. But I remember my Nokia 6210 being just the right size for them.

Sounds about right. I remember around 15 years ago a family member got a new phone and I thought it was laughably big. Probably smaller than what I'm currently using in retrospect.

Some cowboy developer pushed me to prod despite a glaring beta tag and a plethora of known critical bugs. Yet here I am, 45 minors later with the beta tag still there, delivering measurable value to all my users.


What are they doing in the Philippines? Dumping household waste straight into the rivers?


Pretty much. Buying everything in sachets and then not having any real waste disposal; https://earth.org/philippines-plastic/


I think they are fishing commerially a lot. Most of the ocean trash comes from the fishing industry (e.g. abandoned nets).


But in a _relational_ database lack of spouse would not be modeled with a nullable column "spouse" but rather an absence of a spouse row/relation. Which is very real-world-like.


As a sort of challenge I had an idea of building an app using SQL as a pseudo ECS system where every table was either a 1 column table with only an id or a 2 column table with an id and a value.


And yet when you do a join because you need to actually use that data, the resulting table will have a column with nulls in it. Any way you squeeze it, you need a way to represent empty values for your database to be useful.


An inner join? Then there wouldn't be any nulls.


IDK, do you want to exclude people without a middle name or a second address line when examining a product order list? I'll leave that one for you to decide.


And yet you read the whole thing.


I have a Xc70 now, from the year they stopped making these brutalistic work horses, and having owned a 740, v50 and a V70 before I believe this is peak "herrgårdsvagn". Nowadays the large Volvos like the v90 are stupid Chinese luxury cars that I will never buy.


As someone whose first car was a 740, I'd drive one again in a heartbeat.

Did everything you needed a reasonable car to do, well, and just kept on going.


I'm sure some of their later cars after the 2/7/9 series are quite good cars, but they just don't appeal to me.


They are masterpieces for people doing actual miles. Workhorses are for neglect and occasional cargo load. Completely different things.


I have normal memory but my interpretation of the worst programmer I've worked with is that he had extraordinary memory and used that to write extremely tangled code but due to remembering every call site and randomly named function he thought the code base was flawless. And the expectation was that efter he explained a piece of code once then I too should have committed that to memory and then be able to recall it days later when it unexpectedly mattered when explaining a new piece of code. Failing to do that would lead to a "sigh, I'll explain it from scratch again". I don't really remember but I think he used intellij, but like a tabbed text editor. Always ctrl-shift-f "startoffunctionname".


So even if comments are flawlessly updated they are not a silver bullet. Not everyone are good at explaining confusing concepts in plain English so worst case you have confusing code and a comment that is 90% accurate but describe one detail in a way that doesn't really match what the code says. This will make you question if you have understood what the code does and it will take time and effort to convince yourself that code is in fact deterministic and unsurprising.

(but most often the comment is is just not updated or updated along with the code but without full understanding, which is what caused the bug that is the reason you are looking at the code in question)


> So even if comments are flawlessly updated they are not a silver bullet.

This "has to be perfect in perpetuity or it is of no value" mentality I don't find helpful.

Be kind to FutureDev. Comment the weird "why"s. If you need to change it later, adjust the comment.


I don't think comments need to be perfect to have value. My point was that if a certain piece of code is solving a particularly confusing problem in the domain, explaining it in a comment doesn't _necessarily_ mean the code will be less confusing to future dev if the current developer is not able to capture the issue in plain English. Future dev would be happier I think with putting more effort into refactoring and making the code more readable and clear. When that fails, a "here be dragons" comment is valuable.


They can write a very long comment explaining why it is confusing them in X, Y, Z vague ways. Or even multilingual comments if they have better writing skills in another lanaguage.

And even if they don’t know themselves why they are confused, they can still describe how they are confused.


And that time spent writing a small paper in one's native language would be better spent trying to make the code speak for itself. Maybe get some help, pair up and tackle the complexity. And when both/all involved is like, we can't make this any clearer and it's still confusing af. _Then_ it's time to write that lengthy comment for future poor maintainers.


You can only do the “what” with clearer code. The “why” needs some documentation. Even if it is obvious what the strange conditionals do, someone needs to have written down that this particular code is there because the special exemption from important tariffs of cigarettes due to the trade agreement between Serbia and Tunis that was valid between the years years 1992 and 2007.


This is where a good comment really can help! And in these types of domains I would guess/hope that there exists some project master list to crossref that will send both developers and domain experts to the same source for "tariff-EU-92-0578" specifically the section 'exemptions'. So the comment is not not just a whole paragraph copied in between a couple of /*/


And any attempt whatsoever is some improvement over doing nothing and wishing luck to the next guy.


Thing is, good documentation has to be part of the company's process. eg, a QA engineer would have to be responsible for checking the documentation and certifying it. Costs money and time.

You can't expect developers, already working 60 hour weeks to meet impossible deadlines, to spend another 15 hours altruistically documenting their code.


Any documentation at all > no documentation, 99 times out of 100. And requiring your people to work 60 hours/week is symptomatic of larger problems.


How about old, out of date documentation that is actively misleading? Because that’s mostly what I run into, and it’s decidedly worse that no documentation.

Give me readable code over crappy documentation any day. In an ideal world the docs would be correct all of the time, apparently I don’t live in that world, and I’ve grown tired of listening to those who claim we just need to try harder.


Every line of documentation is a line of code and is a liability as it will rot if not maintained. That’s why you should be writing self documenting code as much as possible that’s obviates the need for documentation. But unlike code, stale/wrong doc will not break tests.

Spending 15 hours documenting the code is something no leader should be asking of engineering to do. You should not need to do it. Go back and write better code, one That’s more clear at a glance, easily readable, uses small functions written at a comparable level of abstraction, uses clear, semantically meaningful names.

Before you write a line of documentation, you should ask yourself whether the weird thing you were about to document can be expressed directly in the name of the method of the variable instead. Only once you have exhausted all the options for expressing the concept in code, then, only then, are you allowed to add the line of the documentation regarding it.


> Only once you have exhausted all the options for expressing the concept in code, then, only then, are you allowed to add the line of the documentation regarding it.

But that's what people are talking about when talking about comments. The assumption is that the code is organized and named well already.

The real world of complexity is way beyond the expressiveness of code, unless you want function names like:

prorateTheCurrentDaysPartialFactoryReceiptsToYesterdaysStateOfSalesOrderAllocationsInTheSamePrioritySequenceThatDrivesFinancialReportingOfOwnedInventoryByBusinessUnit()

The code that performs this function is relatively simple, but the multiple concepts involved in the WHY and HOW are much less obvious.


Or you know, work the devs 40 hour weeks and make sure documentation is valued. Everything costs one way or another, it's all trade-off turtles all the way down.


Don't let perfect be the enemy of good.

"We don't write any documentation because we can't afford a dedicated QA process to certify it" <- that's dumb.


Yeah: "what if this code becomes tech debt later" applies to everything, not just comments. It's a tradeoff.

The best thing you can do to avoid creating debt for later maintainers is to write code that's easy to delete, and adding comments helps with that.


An outdated comment is still a datapoint! Including if the comment was wrong when it was first written!

We live in a world with version history, repositories with change requests, communications… code comments are a part of that ecosystem.

A comment that is outright incorrect at inception is still valuable even if it is at least an attempt by the writer to describe their internal understanding of things.


This. I have argued with plenty of developers on why comments are useful, and the counter arguments are always the same.

I believe it boils down to a lack of foresight. At some point in time, someone is going to revisit your code, and even just a small `// Sorry this is awful, we have to X but this was difficult because of Y` will go a long way.

While I (try to) have very fluid opinions in all aspects of programming, the usefulness of comments is not something I (think!) I'll ever budge on. :)


> // Sorry this is awful, we have to X but this was difficult because of Y

You don’t know how many times I’ve seen this with a cute little GitLens inline message of “Brian Smith, 10 years ago”. If Brian couldn’t figure it out 10 years ago, I’m not likely going to attempt it either, especially if it has been working for 10 years.


But knowing what Brian was considering at the time is useful, both due avoiding redoing that and for realising that some constraints may have been lifted.


We should call them code clues


What if you don't know that the comment is wrong?


IMO the only thing you can assume is that the person who wrote the comment wasn't actively trying to deceive you. You should treat all documentation, comments, function names, commit messages etc with a healthy dose of scepticism because no one truly has a strong grip on reality.


Right, unlike code (which does what it does, even if that isn't what the writer meant) there's no real feedback loop for comments. Still worth internalizing the info based on that IMO.

"This does X" as a comment when it in fact does Y in condition Z means that the probability you are looking at a bug goes up a bit! Without the comment you might not be able to identify that Y is not intentional.

Maybe Y is intentional! In which case the comment that "this is intentional" is helpful. Perhaps the intentionality is also incorrect, and that's yet another data point!

Fairly rare for there to be negative value in comments.


It just occurred to me that perhaps this is where AI might prove useful. Functions could have some kind of annotation that triggers AI to analyze the function and explain it plain language when you do something like hover over the function name in the IDE, or, you can have a prompt where you can interact with that piece of code and ask it questions. Obviously this would mean developer-written comments would be less likely to make it into the commit history, but it might be better than nothing, especially in older codebases where the original developer(s) are long gone. Maybe this already exists, but I’m too lazy to research that right now.


But then could you trust it not to hallucinate functionality that doesn't exist? Seems as risky as out-of-date comments, if not more

What I'd really like is an AI linter than noticed if you've changed some functionality referenced in a comment without updating that comment. Then, the worst-case scenario is that it doesn't notice, and we're back where we started.


Comments that explain the intent, rather than implementation, are the more useful kind. And when intent doesn't match the actual code, that's a good hint - it might be why the code doesn't work.


If a developer can’t write intelligible comments or straightforward code, then I’d argue they should find another job.


I mean it's easy to say silly things like this, but in reality most developers suck in one way or another.

In addition companies don't seem to give a shit about straightforward code, they want LOC per day and the cheapest price possible which leads to tons of crap code.


Each person has their own strengths, but a worthwhile team member should be able to meet minimum requirements of readability and comments. This can be enforced through team agreements and peer review.

Your second point is really the crux of business in a lot of ways. The balance of quality versus quantity. Cost versus value. Long-term versus short term gains. I’m sure there are situations where ruthlessly prioritizing short term profit through low cost code is indeed the optimal solution. For those of us who love to craft high-quality code, the trick is finding the companies where it is understood and agreed that long-term value from high-quality code is worth the upfront investment and, more importantly, where they have the cash to make that investment.


>I’m sure there are situations where ruthlessly prioritizing short term profit through low cost code is indeed the optimal solution

This is mostly how large publicly traded corps work, unless they are ran by programmers that want great applications or are required by law, they tend to write a lot of crap.


>In addition companies don't seem to give a shit about straightforward code, they want LOC per day and the cheapest price possible which leads to tons of crap code.

Companies don't care about LOC, they care about solving problems. 30 LOC or 30k LOC doesn't matter much MOST of the time. They're just after a solution that puts the problem to rest.


If a delivery company has four different definitions of a customer’s first order, and the resulting code has contents that are hard to parse - does the Blake lie with the developer, or the requirements?


If the developer had time to do it, with him. Otherwise with the company

I'm sure there's some abysmal shit that's extremely hard to properly abstract. Usually the dev just sucks or they didn't have time to make the code not suck


Curiously that made the thread better for me and the author's opinion about Twitter is exactly as true as the opposite opinion, that it is now the unfiltered source of objective truth. Or do you believe your opinions on the threads value or twitters reputation is special?


I also found it extremely helpful that the author virtue signalled to agree with me, so I know whether I am supposed to like it or not.


What's more likely: (i) famous mathematician expressing his frustration regarding how his previous internet community is now full of Nazis, or (ii) famous mathematician casually saying Nazis suck so to be perceived as morally superior by some random readers?

To me the second option is an extremely bizarre take and I cannot imagine why anyone would even consider it.


Interpretation 1 is more likely and made the dry mathematician more relatable/human which made the writing better imo.


This magnitude of data fascinates me. Can you elaborate on how that much data came to be and what kind of processing was needed for all that data? And if not, maybe point to some podcast, blog that goes into the nitty gritty of those types of real big data challenges.


Click/traffic data for a top 100 website. We weren't doing a ton, but basic recommendation processing, search improvement, pattern matching in user behavior, etc

We normally still would only need to process say, the last 10 days of user data to get decent recommendations, but occasionally it would make sense for processes running over the entire dataset.

Also this isn't that large when you consider binary artifacts (say, healthcare imaging) being stored in a database, which pretty sure that's what a lot of electronic healthcare record systems do.

A random company I bumped into has a 40TB OLTP database to this effect.


Financial market data (especially FX data) can have thousands of ticks per second. It's not unheard of for data engineers in that space to sometimes handle 1TB per day.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: