"spaces won with 51 per cent of the vote"
spacers are just as misguided as leavers, though not quite as prolific
At the Chrome Developer Summit on Monday, Google finally settled the tabs vs. spaces debate and celebrated web community diversity, now at risk of becoming a monoculture thanks to Chrome's market dominance. "Chrome is here today, and every day, to show up as one small member of this much, much bigger community," said Anil …
Spaces seem like a reasonable solution, but tabs can show customised widths for each user in the same piece of code (with a semi-decent IDE), so everyone can see the indentation level they like without adversely affecting anyone else. (Why would you use 7 spaces? Why?!)
Back in roughly 1975, one of my Big Iron mentors had a bumper-sticker:
Tabs are for typewriters!
A woman from the typing pool who much preferred Fresca to Tab took exception to the comment, so he offered to buy her lunch in compensation for the perceived slight. They are still married.
A few years later, another mentor opined "Feelthy TABs are the devil's work, unless you are using them on your Smith Corona".
Personally, I prefer spaces, but I'll use tabs where required. When in Rome & all that.
Personally, I prefer spaces
In the Bad Old Days (when I had pretensions to being an IBM TPF programmer) using tabs was a Very Bad Thing.. the assembler was very column-specific and really, really didn't like tab characters. It's really annoying when it ignores a big chunk of your code because the lines don't start in the right palce (even though they look OK on the screen).
One of the many, many reasons why I switched to doing PC/server/networking support.
Luddism in my case. I learned to type on a typewriter. A massive old Imperial thing, where you had to bash your little finger down by about an inch to get the A key to work.
The thing is, I learned by rote. juja[space]juja[space] for a whole line. Then move on to the next combination of home key and soemthing with the other hand then spacebar. Tab to get to the right place to put in my address on the top right of a letter, and always hitting spacebar twice after a full stop at the end of a sentence. And I still do it now.
I can format a letter properly, and have created templates for documents that get used a lot. But if I'm bashing something out quickly on the keyboard, I can have hit tab repeatedly and typed in an address - faster than taking my hands off the keyboard and reaching for the mouse to press the right buttons to align the text.
I'm sure this is because I wasn't taught how to use word processors, otherwise I'd know all the shortcut keys and that would probably be as quick as doing it the old fashioned way.
Creating "documents" (and their templates), and typing in addresses is a different sport than coding. I'll concede that tabs still have a place in such menial office work. But never in coding, unless the language demands it ... in which case, to date I have seen no real need for that language beyond being a learning tool for the author(s) of the language.
"(Why would you use 7 spaces? Why?!)"
I wouldn't. I'd use four, or occasionally however many it takes to get to the next tab stop. All inserted automagically by my editor of choice when I hit the TAB key.
Why would you prefer to see an indentation level not intended by the author? I honestly see no benefit.
"Why would you prefer to see an indentation level not intended by the author? I honestly see no benefit."
Indentation is more for readability than anything else*, and readability is a subjective quality. Some will find 2 spaces more readable, some will find 4 spaces better, some may prefer 7.
This is why I find tabs a better solution: They can be customised to personal preference without altering the file. It's also more space efficient, taking 1 character instead of 2+ per indent level per line.
That said, most clients I work with have specific code style rules, and it's no great hardship to put up with their choice.
* I do assume this is in a proper programming language, not a new-fangled "indentation is part of the code" abomination...
Start picking. Or not. Far be it from me & etc.
I've been using K&R (with the four-space option) for about 40 years now ... with occasional lapses into other styles, depending on local preferences, of course.
It's friday, and it's bound to be 5 o'clock somewhere. This round's on me.
> but tabs can show customised widths for each user in the same piece of code
THIS is precisely why indenting with tabs cannot be done any more. Some idiot IDE makers made them 4 steps by default, with the result the code looks awful if viewed with an editor that expands tabs in the standard way by 8 steps, or viewed on a terminal, or printed.
I used to indent with a smart mix of tabs and spaces (Emacs supports this naturally), but had to stop because of those IDE:s.
Standardising on indentation by spaces is now the only working option when you have to work with several developers, using different editors. Some projects I work on actually use hooks that reject merging code if source contains tabs.
"expands tabs in the standard way by 8 steps"
That's not what TABS were invented for. In the first place, it's not steps, it's stops. And they are a variable width across the page, by definition. The first TAB stop might be four spaces, the next might be another four, or it might be five. Or eight. And the next might be three. Etc.
"(with a semi-decent IDE)"
You don't even need an IDE. set ts=<width> in vi(m).
People who don't use tabs as indentation don't understand what they're for. And not that it matters much now, but back in the day using tabs in source code saved a shed load of disk space.
However once a piece of code is written LEAVE THE INDENTATION ALONE. Do not do what a former idiot pointy head I worked with did and convert all tabs in some code to spaces then check it back in to version control because he thought it looked better. Great - except diffing his and subsequent versions of the code against previous ones brought up almost every f*cking line!
I agree -- I very much prefer tabs for this exact reason.
However, in practice, most of the code I work with has been touched by numerous other developers, and regardless of stated style guidelines of a given company, some of those devs will be using spaces and some will be using tabs. Converting spaces to tabs is an error-prone and often time-consuming process. So, I'm resigned to this simply continuing to be a mess in the real world.
Me? I use whichever method the code I'm immediately working on already uses. Spaces are problematic, but not as problematic as mixing them with tabs in the same source file.
I prefer spaces MAINLY so that no matter what editor or viewer I load, from less and vi to pluma and IntelliJ, my indents remain CONSISTENT in the manner in which they display and, well, indent.
If you wanna "save that byte", consider how cheap storage is, and how EXPENSIVE time and effort are, and the impact of "poor or inconsistent readability" on your time/effort.
Yes, but (at least in the dev world), bikeshedding is usually more a form of recreational combat than a real argument. Everyone knows these are trivial issues of minimal importance. That's part of what makes them safe to fight about.
On the other hand, in terms of pain points, the low-grade but constant irritations are often a bigger problem than the occasional crisis.
more a form of recreational combat than a real argument
Yep, I always find it fun to poke the devs at a new place with the tabs/spaces argument. As soon as I am sure it will be taken the right way, I'll kick that off on one of the dev chats and everyone will have a good natured argument. This will often continue, on and off, for days (or weeks, or months) and can be re-triggered at any time for more hilarity.
I've never known anyone to take it seriously.
"nobody knew what the hell I was talking about"
That happened for me too ... I slid "Eight Megs And Constantly Swapping" into the conversation, and nobody in the room understood why eight megs might be considered to be a problem. Most of 'em didn't even seem to know what swap was.
The first coder to figure out how to make a nickle off each and every wasted Gig of memory world-wide will become far more wealthy than any of today's tech billionaires.
Is it any surprise that a Google-hosted event to talk about how great Google is has people mouthing nice words about privacy while defending ads and the data collection it implies ?
Of course not. Obviously engineers are trotted out to reassure people : look how reasonable we are ! We know privacy matters !
You mouth the words, but you're working for the biggest ad giant on the planet. You fool no one.
If electricians planted a surveillance device to track all of my family and visitors, I wouldn't want them anywhere near my house. Or if they started to look into any cupboard and drawer to "personalize the electric experience" - and the selling those info to the business around.
An electrician is just like a library you use in your site - it performs what it has to do and the leave without keeping anything about what it did. Google and any tracking business is like a Peeping Tom around your house.
Google is rotten down to the core, and only a real antitrust suit breaking it can save the internet...
Google is rotten down to the core
I'm not sure that's true and the hyperbole doesn't help. But, in fact, I think it may be worse than that. Particularly in America there are a lot of people who think that privacy is simply just another tradable commodity. This means they're essentially blind to the risks.
"Particularly in the Corporate World there are a lot of people who think that privacy is simply just another tradable commodity."
FTFY. No charge.
Suggesting that the uglier aspects of capitalism only exist in America is either willful ignorance, gross stupidity, or nationalistic myopia.
Yeah, sorry it wasn't nuanced enough. In the west there's generally a distinction between anglo-saxon and European attitudes with the former notoriously lax about data privacy, though often curiously squeamish about privacy, per se. The US has often ludicrous double standards: spying on US citizens is illegal unless they use libraries, but the rest of the world is fair game. But advertisting is generally much more pervasive than in Europe and this is reflected not only in laws, but also attitudes. This doesn't mean that no Americans care about privacy, nor that Europeans are particularly hot about it, with the "you've got nothing to worry if you've got nothing to hide" attitude prevalent everywhere.
And in parts of Asia, notably but not only China of course, it's debatale as to whether privacy, as opposed to secrecy, really exists.
I'm an American. The attitude of Americans on any given issue can vary wildly depending on what part of the US you're talking about, making generalizations effectively impossible. That said, let me generalize about the Americans that I personally know.
Most of them are very concerned about privacy, including ad-related privacy. However, most of them are also resigned to this being a lost battle, so they aren't willing to put more effort than the occasional complaint into it.
"I'm not sure that's true and the hyperbole doesn't help"
I don't really think that's hyperbolic. To my eyes, it appears to be accurate. Others may reasonably disagree, of course, but something isn't "hyperbolic" just because you don't agree with it.
I find vanilla wordpress perfectly responsive.
That's before we get to janky ad insertions moving the content around *as your trying to read it*
Then there's the 'count the clicks' to get to the content. Cookie consent that makes you do multiple clicks to deny all, no I don't want notifications, as clicking no to that counts as a mouse leave event, it fires a 'before you go' pop over. No, I don't want to receive news letters (hint hint el reg).
I'm a few janky ad insertions away from using lynx.
"I find vanilla wordpress perfectly responsive."
I guess that depends on what you compare it to. When I switched to vanilla wordpress, I found it irritatingly slow. Not unusably so, though, so I did the switch anyway, because what wordpress lacks in performance, it makes up for in convenience.
I've since switched away from WP due to increased security concerns, though.
No, it's all the evil 3rd party scripts, cookies, monitoring etc. Much by Google or inspired by Google.
Installing and using uMatrix helps.
No idea why 3rd party cookies are not disabled by default. I've never found disabling 100% breaks anything and aren't they illegal in Europe?
Also evil Google CAPTCHA systems that delay access to sites and are simply Google being a parasite on training data sets. SHAME on web sites installing those!
CAPTCHA is also easier to solve for bots than it is for people with visual impairments. Which is actualy quite a large chunk of the population. So I fucking hate them. But despite perfect hearing the audio ones I've tried are impossible, whereas I can usually get the visual ones after 2 or 3 goes.
Recently I've been an unpaid tester for Google to train their self-driving cars to recognise bicycles and traffic lights. Which is ironic given that Google's self-driving cars are allowed to drive around on public roads and I'm not...
I would think a "code coverage" analysis might be interesting. If a zillion functions/styles are loaded, but only a handful are used, mark it *BLOATWARE* because it should NOT be cramming a boatload of bloat into the browser EVERY! STINKING! TIME! you load the page.
"Google is exploring shaming developers of slow loading websites..."
Sounds reasonable, doesn't it - we all want faster loading websites.
Except how long before the self-appointed web police decide that if a page does not use it's proprietary non-standard extension of html then it is too slow to load?
"Google developer advocate Jake Archibald, was brought back on stage for a light-hearted scolding in which he confessed that he hadn't tested the page in Safari. Doubtless many others in the audience have done the same."
If I hired a developer to do some website coding and they later admitted they hadn't bothered to test their code in anything other than 1 browser. I would not be hiring that developer again to do any more work for me.
> how Chrome deals with the consistent concerns of web developers: making the web faster, easier to use, more accessible, more secure, and more private
Web developers have no interest in making the web faster, easier to use, accessible, secure or private. At least not from the evidence of the average website.
Web developers have no interest in making the web faster, easier to use, accessible, secure or private. At least not from the evidence of the average website.
Competent web developers do. It's just that they're few and far between. The web development market is absolutely saturated with people who think Wordpress is a platform you can build anything from, and consider copy/pasting code from Stack Overflow as making them "professionals".
Don't knock WebP too much. I can't speak for the lossy mode, but lossless wipes the floor with PNG for image compression ratio. Even pngcrush/optipng/advpng optimised PNG. If only Safari would support it, the world could consign PNG to the legacy-bucket along with GIF.
I'd add AMP to the list though.
"...Badging is intended to identify when sites are authored in a way that makes them slow generally, looking at historical load latencies."
Translation: "If your site doesn't use AMP, our beloved make-all-our-trackers-run-faster system, we'll classify it as a slow site and steer people away.
Google is exploring shaming developers of slow loading websites
Like Gmail? That consistently consumed all available RAM, grinding my not too old laptop to a grinding halt, and eventually forcing me back to Thunderbird and the generic "Email" app that came with my phone?
Any developer that doesn't test on five-year-old hardware and a mediocre wifi hotspot should get out of the business.
I generally enforce spaces for a project if I know a Visual Studio pleb is going to contributing.
I know for a fact that they will find it too awkward to keep changing tabs / spaces in their silly IDE settings and will drop the ball sooner rather than later.
Then I can scold them and try to ween them off their inefficient text editor. This also frees them up for more innovative C compilers than ol' CL.
Biting the hand that feeds IT © 1998–2019