Thoughts on why sometimes programming/software engineering discussions suck
Over years I've seen and sometimes even took a part in a lot of discussions about programming related topics on various platforms let it be various discords, reddit, hn, forums and I think I've noticed some tricky scenerio where everyone is right, yet people still argue. This seems to occur more often around hot topics mentioned below.

1: Platform impact

I'd want to share my observations about how does the platform itself affects discussions. Different platforms have different average life span of discussions: For example if something appears on Reddit or HN, then the thread will be alive for around 1-2 days (dependent on the amount of upvotes) and once the thread drops from front page, then it's dead or pretty close to be dead. Sometimes a few people may still argue between eachother, but that's it, the rest doesn't see that unless they follow it. On Reddit that argument between a few people exists a little bit longer than on HN due to notifications. Meanwhile on forums discussions about particular topic can easily last for a week or two and in more extreme cases it can last for a months. It's mostly because on forums when somebody adds something new to particular thread, then it's "bumped" to the top and additionally all participants do receive notification. Additionally on forums the communities are smaller e.g hundreds of active people, so those people generally know eachother after years of arguing, so people know that if you have problem with architecture of Java app, then you can ping those users, but if you struggle with building Database Engine, then this person does it for living, ping him/her. If you're curious about quant/hft jobs then ask him/her. (this is more relevant to second part of this post) Something like that doesn't significantly exist on HN/Reddit, but may exist on Discord. The lifespan parameter affects how deep the discussions on average is, and it is pretty significant when it comes to programming discussions because details, code examples, precise examples generally do start appearing in those longer discussions, there's the technical "meat". In kinda simplified versions I'd say that you go on Reddit/HN when you want to see variety of topics and bigger variety of opinions, meanwhile forums do offer an ability to go real deep, but those aren't hard rules. Discord groups feel heavily dependent on the community - size, how active people are, willingness to discuss things. Don't get me wrong here, I'm not saying that one approach is better than the other, it's just different and achieves different goals.

2: Everybody may be right

The thing that made me come to those conclusions were mixed feelings after jumping to real world code bases. As I've previously mentioned - I've been reading a lot of those programming discussions, but there was one thing that was constantly making me feeling weird about them, namely: You could read a lot of discussions about various practices by various people, then jump to real world code bases like linux kernel, runtime libraries, compilers and realize that those best practices are very often violated, and I've started wondering - what the hell? are the people writing this software bad or something? Definitely not (I'm not saying they're perfect/best), so what's going on? I've started thinking about it and realized that people arguing on all previously mentioned platforms tend to have various backgrounds Web developers, desktop developers, system programmers, cloud engineers, people working at startups, people working in corporations, beginners, experienced and known in the industry people, FP/OOP fans, self-taught, people after electrical engineering/computer science/mathematics, and a looot of more. So, what's the difference? I'd say context and the context is unfortunately lost in those discussions because all you see is just somebody's comment and that's it. Nickname very often doesn't tell you anything (except on forums after you spend some time there) Even people programming in the same technology, but in completely different domains may have different opinions about the same practice. There's a lot of controversial topics to pick from like DDD, NoSQL, goto, TDD, SOLID, various Design Patterns, Exceptions, Type Systems, ORMs, the real Clean Code, code comments, Cloud, what is unit test or even whether this is worth to write tests and more
Let's pick something easy - goto (code examples randomly taken from random repos of given language) If you ask C# web developer about using goto, then he's going to tell you that you should avoid it like a plague If you ask C# runtime/framework developer about using goto, then he may tell you that in some cases it makes sense
internal static ReadOnlyCollection<byte>? ToBytes(ArrayBuilder<bool> dynamicFlags, int startIndex = 0)
{
RoslynDebug.AssertNotNull(dynamicFlags);
Debug.Assert(startIndex >= 0);
int numFlags = dynamicFlags.Count - startIndex;
if (numFlags == 0)
{
return null;
}
int numBytes = (numFlags + 7) / 8;
byte[] bytes = new byte[numBytes];
bool seenTrue = false;
for (int b = 0; b < numBytes; b++)
{
for (int i = 0; i < 8; i++)
{
var f = b * 8 + i;
if (f >= numFlags)
{
Debug.Assert(f == numFlags);
goto ALL_FLAGS_READ;
}
if (dynamicFlags[startIndex + f])
{
seenTrue = true;
bytes[b] |= (byte)(1 << i);
}
}
}
ALL_FLAGS_READ:
return seenTrue ? new ReadOnlyCollection<byte>(bytes) : null;
}
If you ask C kernel maintainer about using goto, then I bet s/he'll tell you that yea, it is a normal tool to e.g clean up stuff/handle errors.
static int smc_nl_fill_stats_tech_data(struct sk_buff *skb,
struct smc_stats *stats, int tech)
{
struct smc_stats_tech *smc_tech;
struct nlattr *attrs;
smc_tech = &stats->smc[tech];
if (tech == SMC_TYPE_D)
attrs = nla_nest_start(skb, SMC_NLA_STATS_SMCD_TECH);
else
attrs = nla_nest_start(skb, SMC_NLA_STATS_SMCR_TECH);
if (!attrs)
goto errout;
if (smc_nl_fill_stats_rmb_data(skb, stats, tech,
SMC_NLA_STATS_T_TX_RMB_STATS))
goto errattr;
if (smc_nl_fill_stats_rmb_data(skb, stats, tech,
SMC_NLA_STATS_T_RX_RMB_STATS))
goto errattr;
if (smc_nl_fill_stats_bufsize_data(skb, stats, tech,
SMC_NLA_STATS_T_TXPLOAD_SIZE))
goto errattr;
if (smc_nl_fill_stats_bufsize_data(skb, stats, tech,
SMC_NLA_STATS_T_RXPLOAD_SIZE))
goto errattr;
if (smc_nl_fill_stats_bufsize_data(skb, stats, tech,
SMC_NLA_STATS_T_TX_RMB_SIZE))
goto errattr;
if (smc_nl_fill_stats_bufsize_data(skb, stats, tech,
SMC_NLA_STATS_T_RX_RMB_SIZE))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_CLNT_V1_SUCC,
smc_tech->clnt_v1_succ_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_CLNT_V2_SUCC,
smc_tech->clnt_v2_succ_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_SRV_V1_SUCC,
smc_tech->srv_v1_succ_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_SRV_V2_SUCC,
smc_tech->srv_v2_succ_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_RX_BYTES,
smc_tech->rx_bytes,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_TX_BYTES,
smc_tech->tx_bytes,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_RX_CNT,
smc_tech->rx_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_TX_CNT,
smc_tech->tx_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_SENDPAGE_CNT,
smc_tech->sendpage_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_CORK_CNT,
smc_tech->cork_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_NDLY_CNT,
smc_tech->ndly_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_SPLICE_CNT,
smc_tech->splice_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_URG_DATA_CNT,
smc_tech->urg_data_cnt,
SMC_NLA_STATS_PAD))
goto errattr;
nla_nest_end(skb, attrs);
return 0;
errattr:
nla_nest_cancel(skb, attrs);
errout:
return -EMSGSIZE;
}
And they all are right (or may if you want to argue :)), but very often that information about their respective domains is lost and the argument is around some "generic code base" or some "average project" which is different for everybody.
The other examples are tests, for example in web dev the cost of writing backend tests is generally low, so somebody after years in only web development may tell you that'd be insane to write software without automated tests Yet there are cases where testing cost is high (e.g UI, relying so hard on 3rd party that it is irrelevant whether your code works, requiring manual intervention like changing hardware) that it may be reasonable to do so. People could argue about it for at least a few posts/replies, starting from some basic principles until they start introducing context which changes the discussions