Slashdot Mirror


User: BronsCon

BronsCon's activity in the archive.

Stories
0
Comments
8,054
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 8,054

  1. Very often I view files using a terminal window; 'more', 'grep', 'tail'. The files will be displayed by static analysis tools using a browser, and online repository browser won't know what the preferred settings should be.

    If your tools of choice don't allow you to set a tab width, perhaps that is a problem with the tools. For example, if your more doesn't allow you to set tab width (mine does), try less; you'll find that it brings many other useful features with it, as well. Less manages this by replacing tabs on the fly with the desired number of spaces; beyond that, the rendering of the TAB character itself is a function of your terminal; if you want 4 character tabs in your terminal, configure it as such using the tabs command. If your terminal is not POSIX compliant and does not honor the tabs command, you need better tools.

    Likewise for your static analysis tools and repo browser.

    You're right, experience is key, and that includes being experienced enough to know how to properly use your tools to achieve the desired results. I find it hard to believe anyone with 30 or 40 years of experience doesn't know that; I know it didn't take me a full 30 years to figure it out.

    Using a character in a file that means "1 to 8 characters" should go against the very grain of any self respecting programmer or engineer that values precision.

    We don't write it to look pretty or display identically on every medium it might be displayed on. We right it to function properly.

    We also shouldn't be imposing our own indentation preferences on others. Someone working on a 22:9 display might prefer 8 character tabs because, hell, they've got plenty of horizontal space so why the hell not? Someone working on a 16:9 display might prefer 4 characters, and someone working a a 4:3 or 6:4 display might prefer 2 because they don't have as much horizontal space. I fit into all 3 categories depending on where I happen to be working; I have a workstation with a pair of 16:9 4k displays (well, one is portrait, so 9:16), a desk at a remote office with a 22:9 display, and occasionally use a Chromebook with a 6:4 display.

    I'll tell ya, while I never prefer an indent of more than 4 spaces, when I'm working on that Chromebook or happen to be viewing code on the portrait display at my workstation, I do prefer 2 spaces so heavily nested code still fits on screen without wrapping or scrolling. In general, though, I prefer 4 spaces on the 22:9 and 16:9 displays. I could see 2 spaces being preferable when printing 8.5x11, while 4 or 8 would look better when printing 11x8.5.

    How does one manage that when using spaces to indent?

    Now sometimes there's just something wrong or lazy with developers. I have worked on one file that used FOUR different tab indentation levels, with three levels within one function.

    That's not an issue with TABs. That might be why people who don't desire to enter pissing matches over how far a line should be indented prefer them.

  2. Howso? Configure it to use tabs to indent, then press TAB when you want to indent and SPACE when you want to align.

    Fucking Notepad can do it.

  3. That would be the ideal. Which IDE(s) will happily take a file indented with 4 spaces and display it with, for example, a 2 character indent? That's an honest question and I recognize that it's entirely possible that my IDE of choice does this and I simply don't know of the feature.

    That's why I believe tabs should be used for indentation; you don't have to rely on software guessing the correct tab depth when converting from spaces, then converting to tabs without fucking it up, then displaying those tabs at your desired width (which is the easy part, which we already have in basically every editor), then converting back to the correct number of spaces when you save. With tabs, you just specify how wide you want the tabs to be and bam that's how far your code indents. If you need to align things beyond the indent, that's what spaces are for.

    In my view, indenting with spaces is an egotistical power trip, an attempt to force your indentation depth preference on everyone who touches your code. Tabs are much more friendly to those whose layout preferences may differ from your own.

  4. Re:Both? on Developers Who Use Spaces Make More Money Than Those Who Use Tabs (stackoverflow.blog) · · Score: 5, Insightful

    I can actually see the argument for a 4-space indent consisting of 3 spaces and a tab. The developer thinks they're throwing a bone to people who use tabs by allowing them to set their own indent width. But they're wrong to use spaces at all in that case; what about people who prefer 2- or 3-char indents?

    And that's why tabs should be the standard: people prefer different indents. Using tabs, everyone can have their way; set your tab width and all tabbed indents are automatically the width you want.

    Now, for those who insist on tabs, let me explain why spaces are better: they allow you to align parameters and operators after the indent.

    That's why my preference is to use tabs to indent, then spaces to align after the indent; best of both worlds. You're already using the tab key to indent and the spacebar to align, so there's no mental or physical overhead involved, the layout of your code is preserved and, if someone else prefers a different tab width, they can have it without breaking the alignment of arguments or operators (if you bother to make them look pretty) or altering how the code displays for you, or anyone else.

    But, that's just a preference. When I'm working on someone else's code, I follow their conventions, because it really doesn't take any time at all to change an IDE setting (especially when my IDE can store per-project settings for things like tab width) and I'm not a dick.

    Beyond that, if someone uses tabs on some lines and spaces on others within the same file... yes, slap them silly.

  5. Happy to see Apple has finally invented this technology. Everyone else should have it, too, in a couple of years.

  6. Re: nearly impossible to anticipate? on Chess.com Has Stopped Working On 32bit iPads After the Site Hit 2^31 Game Sessions (chess.com) · · Score: 1

    It's called refactoring. A developer should constantly be improving any code they touch.

  7. Re: No Clicks! Wow! on New Malware Downloader Can Infect PCs Without A Mouse Click (engadget.com) · · Score: 1

    So fulfilling, you imagine being stalked on slashdot and start wading through my comments (I suppose the irony is lost on you here) to count how many are replies to yours.

    I wouldn't really say I waded through them, I didn't even get through the first page. Keep deluding yourself. I'm not the one who has nothing better to do than follow after people on the internet to tell them I think they're stupid.

  8. Re: No Clicks! Wow! on New Malware Downloader Can Infect PCs Without A Mouse Click (engadget.com) · · Score: 1

    Yeah, I'm so stupid that I'm able to live a damn fulfilling life working for myself. Sorry, too much happiness in my life to let you get to me, bro.

  9. Re: No kidding... on Google Searches Show That America Is Full of Racist and Selfish People (vox.com) · · Score: 1

    So wait... and I recognize that I'm breaking my moratorium on AC replies... you seem to be implying that he is against the LGBT community for not caring that Muslims are killing gays but, then, you imply that he supports the LGBT community because antifa?

  10. Re:No kidding... on Google Searches Show That America Is Full of Racist and Selfish People (vox.com) · · Score: 1

    And your response was "I can find more examples of your side being wring than you can find of mine."

    Why does it matter? Both sides should strive to be less wrong by virtue, not simply to be wrong less often than the other guy. That mentality leads to it being ok to kill 9 people because the other guy killed 10, and I don't think that's where you intend to end up.

  11. Re: No kidding... on Google Searches Show That America Is Full of Racist and Selfish People (vox.com) · · Score: 1

    Precisely this. And if I see it on the ballot and I don't oppose it, I'm going to vote for it. And I did.

    I just have better things to do than join a rally and wave around a picket sign.

    But I will (and did) frame a copy of the SF Chronicle "Love Won" special edition. It's not currently hanging on my wall because the box it is in, packed with other things that previously hung on my wall, has not been unpacked yet. Again, because I have better things to do.

  12. Re:No kidding... on Google Searches Show That America Is Full of Racist and Selfish People (vox.com) · · Score: 5, Insightful

    While this is correct, it is equally important to call out racism only where it exists. When the person in line in front of me at the market comes up short, did I offer to cover the few dollars difference so that I could get through the line faster? Or because they were darker skinned than I am? Or a woman? Or that I found them attractive? Or even found them ugly and just wanted to get rid of them faster? Or simply because I don't want to see a fellow human being suffer? You don't know, but people like you will automatically accuse me of making some power play if their gender or skin color does not match my own.

    Of course, if they're the same gender and skin color as me, you'll question whether I would have done the same if that were not the case.

    When that shit stops, then we can make some actual progress.

    People like you care a lot more about gender, race, and sexual orientation than people like me. If I choose to help someone in need, it is because I recognized their need during a time when I was capable of helping without setting myself back; if I don't help someone, it is because I can't. That extends to things as simple as holding the door for someone (for which only White Males typically ever thank me, mind you), which is something you will witness me doing to a fault; more often that I'm willing to admit, I have to let the door go in someone's face in order to catch up with my wife, who's already traversed the entire parking lot and started getting in the car. Because people have no fucking respect anymore.

    Most often, it is a White Male who will take the door from me and hold it for his own group. The next most common is for a Black Male to take the door from me, followed by Hispanic and Asian Women, at roughly equal rates. I've never had someone of Middle Eastern descent take the door from me, or even so much as thank me for holding it.

    But, then, I don't hold the door to be thanked, I hold the door because it is the right thing to do when not holding it would have it close in someone's face. I don't expect the thanks, but I do appreciate it. I do, however, expect that you will take the fucking door from me when you see me separating myself from my group to hold it for you, rather than being a dick and expecting me to hold it for your entire group.

    Regardless of race, gender, or sexual preference.

    Because it's the right fucking thing to do.

    Now, apply that everywhere.

    Making broad statements, expressing broad expectations, or treating someone differently based on one's gender is sexism. Doing the same based on one's race is racism. Doing the same based on one's sexual preference is yet another form of bigotry for which I am sure there is also a name.

    If you want it to stop, you must first stop assuming that everything everyone else does is motivated by it the same way everything you do is. That is, you must first recognize that, by accusing someone of being racist because of their race, sexist because of their gender, or whatever you call someone who discriminates against someone based on their sexual preference, because of their sexual preference, that you are doing the very same thing you are accusing them of.

    Stopping it starts with you.

    This isn't me complaining or whining, it's me simply stating my observations as fact. If you don't like the facts as I've observed them, change them instead of whining about what I've observed.

  13. Re:No kidding... on Google Searches Show That America Is Full of Racist and Selfish People (vox.com) · · Score: 1

    Does it matter which side of the fence they're on? Terrorism is terrorism, crime is crime, and the punishment should be the same regardless of political bent.

    Look past the partisan bullshit and your vision will become clear.

  14. Re: No kidding... on Google Searches Show That America Is Full of Racist and Selfish People (vox.com) · · Score: 1

    So fucking much THIS!

    And here's the thing: The US has the most guns per-capita, but not the most gun deaths by the same metric! Yes, we have more gun deaths than almost anywhere else, but we also have a larger population than almost anywhere else; it's really the per-capita number that matters. Moreso, if one is trying to claim that more guns = more gun deaths, it's the per gun number that matters.

    But no, the reality is that Honduras, Venezuela, Swaziland, Guatemala, Jamaica, El Salvador, Columbia, Brazil, Panama, and Uruguay all have more gun deaths per-capita than the US; and all of them have fewer guns per-capita. That is, they all have more deaths per-gun than we do. In fact, with the exception of Brazil and Panama, every country I just listed has at least twice as many gun deaths per capita as the US, with Swaziland and Guatemala having more than 3x the rate, Venezuela more than 4x, and Honduras nearly 6x.

    Guns aren't the problem, people are. People who want to kill people (including themselves).

    Solve that, then we can talk about guns.

    If guns were the problem, this chart would look virtually the same whether you sorted by "Total" per-capita or "Guns per 100 hab", but it does not; Uruguay, with roughly 1/4 as many guns per-capita, has ever so slightly more gun deaths than we do; nearly 33% more homicides, remarkably fewer suicides, but a hell of a lot more accidents.

    France has nearly the same per-capita number of guns as Uruguay, but somehow manages a total gun death rate per-capita that is roughly half Uruguay's gun murder rate.

    Why? It's surely not because they have fewer guns! Uruguay has 31.8 guns per 100 people and a population of 3.43 million: 1.09 million guns. France has 31.2 guns per 100 people and a population of 66.81 million: 20.9 million guns. If more guns meant more gun deaths, France would be a relative bloodbath when compared to Uruguay, yet it's the other way around.

    And I'm not cherry picking, here; I picked France and Uruguay because they have similar gun ownership rates but vastly different gun crime rates. If I were cherry picking, I would have compared France to Sweden, with its 1.47 gun deaths per capita despite its 31.6 per 100 gun volume; or I'd have compared Uruguay and Sweden, as their gun volumes are even closer. I specifically chose a weaker comparison so I could present a stronger one when accused of cherry picking; and I still haven't presented the strongest data that chart contains.

    But, then, there's Honduras, with the most gun deaths per-capita: 67.18 per 100,000, and a gun volume of only 6.2 per 100 people. They have fewer guns per 100 people than the UK (in fact, fewer guns overall: pop 8.08M, 501K guns vs the UK: 65.14M/6.6-guns-per-100, 4.3M guns) and, yet, 292x the per-capita gun death rate. In fact, the gun murder rate on Honduras is 289.74x the total gun death rate of the UK, despite the UK having considerably more guns.

    Again, let's figure out why people want to kill each other in these places and fix that, then we can talk about gun control. Until we fix the underlying cause of the problem, all we can do is change how we kill each other.

    Sure, getting rid of guns will prevent gun violence, but it will be replaced with stabbings, beatings, floggings, vehicular manslaughter, strangulation, drownings, poisonings, bombings, and any other horrible way one might devise to kill themselves or another.

    It's not going to stop until we address the root cause, and that root cause is clearly not guns.

  15. Re: No kidding... on Google Searches Show That America Is Full of Racist and Selfish People (vox.com) · · Score: 1

    We're far from the leader in per-capita shootings. The statistics are not hard to find, though I don't have them at my fingertips at the moment. If I have time later and you're too lazy to find them yourself, I might come back and give you a link or two.

  16. Re: nearly impossible to anticipate? on Chess.com Has Stopped Working On 32bit iPads After the Site Hit 2^31 Game Sessions (chess.com) · · Score: 1

    And I'm sure they couldn't have found time in the 3 years since they hit 1 billion games to fix this? Or did they still not realize how popular their game was? Any way you cut it, they were shortsighted.

  17. Re: No Clicks! Wow! on New Malware Downloader Can Infect PCs Without A Mouse Click (engadget.com) · · Score: 1

    If you think I find this any less entertaining than you do, you're mistaken. Just keep wasting your time arguing with me...

  18. Re: No Clicks! Wow! on New Malware Downloader Can Infect PCs Without A Mouse Click (engadget.com) · · Score: 1

    > Comments on a reply to an AC, from someone with a sig stating that they don't reply to AC posts, to point out that they replied to an AC.
    > Claims they don't look at usernames

    Right-o, then.

  19. Re: No Clicks! Wow! on New Malware Downloader Can Infect PCs Without A Mouse Click (engadget.com) · · Score: 1

    It's not just the past week, that's only how far back i felt like looking at your comment history. You go right on and think whatever you want about me, but my point was more that I don't want your attention. You have a tendency to not add anything to the conversation... and I do enjoy a good troll. You just aren't one.

  20. Re:nearly impossible to anticipate? on Chess.com Has Stopped Working On 32bit iPads After the Site Hit 2^31 Game Sessions (chess.com) · · Score: 1

    Actually, what the designers if the Internet got wrong wasn't the number of IP addresses needed; they didn't factor in companies hoarding public address space for private use (or, worse, sitting on unused address space), something which should not have ever been allowed and should not need to be accounted for in the first place.

    If IANA were to reclaim incorrectly-allocated address space, we'd have plenty of IPv4 addresses. Not every device needs a public address and, in fact, most should not have one, which is an entirely new problem brought on by IPv6.

  21. Re: No Clicks! Wow! on New Malware Downloader Can Infect PCs Without A Mouse Click (engadget.com) · · Score: 1

    No, really just curious why you seem to have a hard-on for me recently. 30% of your posts for the past week have been replies to my comments.

  22. Re:nearly impossible to anticipate? on Chess.com Has Stopped Working On 32bit iPads After the Site Hit 2^31 Game Sessions (chess.com) · · Score: 1

    You'd actually need 40 million playing 100 games each; each game requires two players.

    But yes, your point does hold up despite the (understandably, as you were making a point and not writing a freakin' dissertation) bad math. I'm just stepping in to explain away the error before someone jumps on you for it.

  23. So, wait, when this guy says it he gets a "Well, yes"; but, when I say it, you give me some diatribe about how they probably had separate 32- and 64-bit branches?

    Bit unstable, buddy?

  24. Re:nearly impossible to anticipate? on Chess.com Has Stopped Working On 32bit iPads After the Site Hit 2^31 Game Sessions (chess.com) · · Score: 1

    Still a salient example of shortsightedness

    I disagree with this part of the statement.

    But, then...

    The shortsightedness happened in the early to mid 90's when that code may have been touched with time to spare and memory now more plentiful.

    So, then, it's still a salient example of shortsightedness?

    I'm just having a laugh and yes, I do get your point. There was a reason I didn't cite that example myself.

  25. Who says they used an architecture dependent int type. They very well may have declared an int64 and then, when they ported to 64-bit, changed it to int128 but never merged the change back to the 32-bit branch.

    Just saying that it seems that's what they did; and the numbers at play here overflow a signed int32, not a signed int64, so you're wrong either way.

    Not everybody has one branch that builds for 32 and 64-bit. Often the 64-bit transition is considered "one way" and the 32-bit branch isn't maintained.

    The only valid reason to do that is if you're relying on an external, binary-only library that is no longer seeing updates from its vendor. I would have said the use of assembler might be a valid reason, but I also recently learned that (at least a handful of) modern C compilers will also compile assembler and can even replace 64-bit instructions with 32-bit routines on the fly, so you can even compile 64-bit assembler for a 32-bit platform now.

    Might not run as fast, since you're expanding single instructions into entire routines, but it shouldn't be any slower than native 32-bit assembler, either, given that you'd have had to write similar routines in the first place. If anything, it should be a smidge faster what what you'd have written yourself, given that the compiler author would likely have optimized the routines used, as compilers primarily compete on performance.

    But, all of that is irrelevant when we're talking about an iOS app, where Apple takes an intermediate representation of your app and compiles it for both 32-bit and 64-bit architectures on their end; and they won't accept apps that don't compile correctly, for hopefully obvious reasons. If you don't provide bitcode (either because you're using some library for which bitcode is still not available, or for whatever other reason), Apple still requires a fat binary for anything targeting iOS 5.1.1 or newer; anything older than that is 32-bit only anyway.

    It's basically dictated by Apple that you use a single branch for 32- and 64-bit, so it's not just a safe assumption, but an absolute truth, that the app in question was developed that way.