:syntax Off - <AUTHOR> http://www.kyleisom.net/blog/2012/10/17/syntax-off/ <comment><USER2> If you follow this reasoning I think you'd also have to shun line breaks and indentation. After all, natural language doesn't put each sentence on a separate line, or indent clauses. It flows in uninterrupted prose with paragraph breaks being the only distinguishing horizontal or vertical formatting.

Clean code is all about structure. Anything that help show structure, symmetry, hierarchy, or other patterns is bringing your reader one step closer to understanding. The difference between a keyword and an identifier is part of the program's structure. Coloring it makes it visual.

Also, properly-implemented syntax highlighting is essentially a very short feedback loop with the compiler that shows you how your code is actually being parsed. Short feedback loops make creativity easier (this is the basis of a lot of Bret Victor's work).

I agree with the author that "paying attention to what the code is doing instead of the individual elements" is important, but I don't think you have to turn off syntax highlighting to achieve this. At least I don't personally. If the colors are distracting, one idea might be to make them more muted so that they don't demand as much attention. But to me there's no going back from being able to see visually that you forgot to close a string or parenthesis, or include a proper line continuation for your macro.

<comment><USER3> > If you follow this reasoning I think you'd also have to shun line breaks and > indentation.

Not quite. As I'm sure you know, written languages have evolved over time in order to meet the needs of readers and writers alike. That includes capital/lowercase, roman style (i.e. non-script) lettering, _spaces_ , leading and paragraph indentation (thanks to printers), etc. It isn't helpful to blindly latch on to seemingly cute analogies, but in this case I think it's a pretty fair comparison. I imagine others who don't use highlighting all the time would agree that it's a happy or at least _comfortable_ middle ground. I'm a little sleepy-eyed now and shouldn't still be typing, so sorry if my tone reflects negatively. I think the response below (corwinstephen) brings up the same thing, except if you like highlighting then your middle ground leans further towards an explicit, notated style.

<comment><USER4> Further, if you write a list of instructions (say, a recipe), you will likely follow a convention that puts each instruction on a separate line, and might make use of indentation to further delineate sub-instructions.

</comment></comment></comment><comment><USER5> _> When I read a book, I don't want parts of speech highlighted in different colours. What I want to do is to read the book, to take in the information._

I actually think this would be a great idea and it would probably prevent me from having to reread paragraphs every now and then because I thought the wrong person was talking.

<comment><USER6> Yea color coding character's speech would allow for some interesting changes in structure, for example, you could have characters interrupt another without breaking the line making it much more fluid.

</comment></comment><comment><USER7> Although I think the article as a whole is insightful, I really don't agree with the book analogy. Most of the time, one reads a book in a very linear fashion - left to right, top down, hopefully with little interruption. With code, I find myself having to jump around a lot more - to find where something has been declared, or to look up a subroutine, etc. This means there is a lot more searching for the relevant text in programming than in reading a book, and syntax highlighting helps my eyes identify these parts on a line or a block a lot more quickly.

However, I can see how turning off syntax highlighting could help one learn to keep more code in their head at once, so they don't have to jump around as much, but to me, it's not worth it.

</comment><comment><USER8> I tried this before. I used to write all of my code without syntax highlighting -- for years. Once I switching to highlighting, my errors decreased, my productivity increased, and I was a lot happier. To each his own I suppose.

</comment><comment><USER9> Interesting. Both what Kyle talks about, and also the fact that I've never thought of _not_ having syntax highlighting before. It's just been a built in assumption.

I opened vim and cycled through syntax on, syntax off a few times, and thought about what I think about when I see it. After this short experiment, I think that most of what I use syntax highlighting for is just to add texture to the code. The pattern of indentations and syntax highlighting gives the code shape.

So when I scroll, or scan the code, I've got another a set of visual anchors in addition to the structure given by indentation. It makes me feel more comfortable. Past that, for me, the syntax highlighting is just noise.

Makes me wonder how to increase the feeling of visual structure in the code without introducing visual noise...

</comment><comment><USER10> Something I've found useful is to highlight (in bold) the _definitions_ of variables & types, but not their uses; and to otherwise have very little highlighting: [http://david.rothlis.net/code_presentation/distracting_synta...](http://david.rothlis.net/code_presentation/distracting_syntax_highlighting/)

<comment><USER11> This just made me think that highlighting would be way more interesting if you could change the scheme on the fly. An editor could have 5-10 highlighting schemes—not different colors, but different kinds of information shown (because let's face it, highlighting is valuable information).

Examples I just thought up:

* Variable-scoping-level highlighting—variables in the same scope highlighted the same color.

* "String only"—highlight only strings and literals. Check for language bugs.

* grep-only highlighting—define a set of things to grep for quickly and highlight them.

* block-focused—highlight code blocks so you get an idea of the overall structure of your program.

* No-highlighting: if you really want a moment of clarity on your code. There is absolutely no reason to give up the information highlighting provides 100% of the time, but I could see it being useful sometimes when you need to focus.

And countless more. If I could switch with a quick keyboard shortcut to a highlighting scheme appropriate for any given programming task, it would be phenomenal. I could see it being useful for all kinds of things, and helping to show more information from the compiler than syntax highlighting does already, in a better way. It would be instant visual information, and there's no reason to limit it to syntax like we do currently.

Hmm. Sublime Text Plugin perhaps?

<comment><USER10> > Variable-scoping-level highlighting—variables in the same scope highlighted > the same color.

I played with this idea in the syntax highlighting of the code samples in this article: <http://david.rothlis.net/c/compilation_model/#chapter005>

but would you want all variables at the same scope in the same colour? Different colours for each variable, with the darkness/lightness indicating the scope?

> grep-only highlighting—define a set of things to grep for quickly and > highlight them.

Emacs has this with the "highlight-regexp" command. To be honest I don't use it that much. What I do like is highlighting all matches whenever you're doing a "find in file" (though unlike highlight-regexp, the highlighting disappears as soon as you exit the search). I probably use this more because I use search all the time (who doesn't), whereas I tend to forget that "highlight-regexp" even exists.

> block-focused—highlight code blocks so you get an idea of the overall > structure of your program.

A few examples of how this might look: [http://web.archive.org/web/20080723220126/http://lemonodor.c...](http://web.archive.org/web/20080723220126/http://lemonodor.com/archives/2005/08/five_approaches.html)

> No-highlighting

In Emacs the "font-lock-mode" command will toggle all highlighting; and you can specify the "level" of highlighting you want by setting the "font-lock- maximum-decoration" variable (you could set up a specific key to toggle this variable). I think these levels were originally intended for performance reasons, so they're cumulative (enabling level 3 also brings in all the highlighting from levels 1 & 2) rather than individually-toggleable features.

I only bring up Emacs because that's what I'm familiar with, and because I'd like more people to experiment with these types of things in Emacs. But perhaps Sublime Text would be a better platform for such experiments, for some people; I don't know.

</comment></comment></comment><comment><USER12> I write a lot of code on whiteboards or paper as well, but I could not bear to part with syntax highlighting. When you're off the machine, a missing quote or semi-color won't cause the whole thing to come crashing down. The same can't be said for when you're actually typing things.

As the author already mentioned, strings are really annoying to work with when you don't have syntax highlighting for them. I would group comments in the same category. It's difficult to see where they begin and end without the visual cues provided by syntax highlighting. That can quickly become a disaster.

I did try out going through code just now without syntax highlighting. New and short programs weren't bad at all, but going through files with hundreds of lines quickly became a challenge. This might work for the author, but it's not for me (nor, I suspect, for most people). Colors and font styling make it easy to get a grasp of what's going on. Taking that away does reduce noise, but cuts down far more on signal.

<comment><USER13> I imagine that it has a lot to do with the language too. Things like Perl, Ruby or even shell scripts have a lot of syntax that benefits from syntax highlighting (I'd say most of them related to strings and string interpolation), while C maybe doesn't.

</comment></comment><comment><USER14> This is how that page looks like on my computer

<http://i.imgur.com/x8kqM.png>

Windows 7, Chrome 24.0.1312.2 dev-m

<comment><USER15> Yet another case of chrome's bad rendering.

The font used: <http://www.google.com/webfonts/specimen/IM+Fell+English>

Why would anyone try and use bad typewriter font imitation on a website is beyond me.

<comment><USER16> More like Windows' bad rendering. It looks fine in my Chrome on OS X. A bit of a lame font but readable and not all flaky like the Windows screenshot linked by the original commenter.

<comment><USER17> Chrome renders fonts differently than other browsers in Windows 7. Possibly for speed reasons? Both the latest FF and IE9 look decent.

<comment><USER18> It's more historical at this point. Chrome doesn't use DirectWrite because it uses Skia on Windows. At the time, the choice was between GDI+ and Skia, and Skia was much faster. But DirectWrite on Vista and 7 is extremely fast (it's GPU-accelerated, unlike the Skia backend Chrome uses).

</comment></comment></comment></comment></comment><comment><USER19> I remember when I first started to program I used Notepad.exe to write the source in. It was all I knew at the time and it worked. The day I discovered a text editor that did syntax highlighting was amazing, finally I could see at a quick glance any obvious errors in my code as well as the structural elements. This is far too ingrained in my workflow to consider removing it but I may give it a try. When I do write plaintext I usually do it in a light colorscheme (Solarized Light) and it does read more like a book.

The author makes the argument that removing highlighting forces you to be more careful with the code you write. Removing three of my fingers would also force me to be more careful, but I'll take everything I can get to make me more productive.

</comment><comment><USER20> To each their own, but I'm having real trouble imagining that this could actually be helpful!

I'm sure it's possible to get used to, but I doubt I'm the only one that remembers when they first turned syntax highlighting _on_ , and the difference it made to my productivity then.

</comment><comment><USER21> I'm always surprised when I meet folks who prefer not using syntax highlighting. At some point the surprise will go away, but for now it's still pretty darned rare. The first person I met who expressed a strong preference for no syntax highlighting was Matt Trout (mst here at HN), who is certainly productive enough to provide a compelling argument in favor of it.

I might even try it again one of these days.

<comment><USER13> I find it interesting that mst isn't into syntax highlighting as his main language (Perl) has string interpolation. Making sure that variables embedded in a string stand out can be important:

      "Number of Records: $numrec\n"
      "Number of Records: \$numrec\n"
      "Number of Records: ${\ get_number_of_records() }\n"
      "Number of Records: \${\ get_number_of_records() }\n"

Or

      my $string = <<"    HEREDOC";
      my $name = "Thompson";
          HEREDOC

It's much less important in something like C where you would just being using something like sprintf().

<comment><USER21> Perl is also my primary language, and it is partly why I like highlighting. It may state something about the opinions of the programmer; perhaps that complex interpolations in strings, among other things, might be a code smell they don't like, and avoid. Having no highlighting would remind you not to do that sort of thing.

I think the sigils alone are sufficient to flag variables in strings...but when things get complicated and span multiple lines, it can become ugly and difficult to work with. But, I'm not convinced this is the most useful function of highlighting in perl (again, because the sigils already provide visual clues)...it think it's more useful in pointing out unclosed parens, brackets, quotes, etc., and letting you know your syntax is wonky.

That said, it may be laziness on my part. I find it soothing to have highlighting enabled, and I get nervous when it's not, as I'm never quite sure I've got the syntax right until I check it.

</comment></comment></comment><comment><USER3> I agree with the author that turning syntax off is like reading a book. When I read in English, I don't want to be bombarded with color or style changes that aren't completely necessary. I appreciate their function as an aid to recognizing patterns, but I've read enough so that I can glance at the entire page and recognize all the patterns I want in a few seconds. Now, when it comes to reading books in a foreign language (e.g. japanese or mandarin) it can be a tremendous aid while you're learning because it helps you make sense of where the breaks are in something that might otherwise take a considerable amount of time to break down bit by bit. As soon as you start getting used to it the patterns become obvious on their own, and the visual aids just become a layer of noise.

My main exception is comments, or footnotes on the side. At a quick glance it's very helpful to skim through a file and see what's documented or, if it's a text/config where each section break is.

Edit: after skimming the other comments here it seems that the preference for highlighting is more to do with error checking than anything (pairing enclosures, etc.). If that's the main concern then why not zap the rest and use syntax the same way you'd use spell? I don't use highlighting for much but I might just drop that into my vimrc tomorrow to play around with it. I would rather see glaring red blocks where there are mistakes than a minor variation in my digital bowl of lucky charms.

<comment><USER22> Syntastic for vim.

</comment></comment><comment><USER23> It's an interesting idea.

I've actually gone the opposite way recently. In the past, I'd only have code highlighting. Different parts of the syntax would be rendered as different colors--nothing surprising.

However, recently I've been writing a lot of Haskell and OCaml. At least in Emacs, both Haskell and OCaml have an additional option to syntax highlighting with color: your code can also be highlighted with _symbols_. That is, parts of the syntax are not only displayed in a different color but actually displayed as a Unicode character rather than ASCII. As a moderately contrived example, something like

        \ a b c -> a >= b && b <= c || a /= c

would get displayed as:

        λ a b c → a ≥ b ∧ b ≤ c ∨ a ≢ c

Now, real code doesn't usually have symbols quite as dense; this example just shows a whole bunch of them at the same time.

I find the second snippet far easier to read than the first, especially if I'm just scanning over the code.

This is also a very good reason for using a typeface like Deja Vu Sans Mono: it can support all the symbols I could ever want. It's also very readable.

I personally find this, combined with syntax highlighting, extremely useful for reading code. Actually, thinking about this, I've found syntax highlighting even more useful for Haskell and OCaml than other languages, probably because they have very minimalist syntax. I really like the syntax, but the color does make the overall structure of any given function much more evident, which is nice.

Coincidentally, for the same readability reasons as above, I'm significantly warming up to Unicode identifiers. I think something like:

        set1 `union` set2

is not nearly as readable as

        set1 ∪ set2

And, as a bonus, the second version is easier to type:

        set1 \cup set2

Additionally, using Unicode identifiers and operators matches the way I write pseudocode. With the right identifiers, my Haskell code actually looks very close to what I would write on a whiteboard to explain some concept. That's one of the reasons I really like Haskell's syntax.

As an aside, the expression

        set1 `union` set2

is a perfect case study of why I find syntax highlighting useful. First of all, I think it's strictly better than the prefix version:

        union set1 set2

I've found being able to use arbitrary functions in an infix position can sometimes make certain expressions much more readable and natural.

However, if you're just scanning over the code, it might be easy to miss the backticks. Happily, in Emacs, operators get highlighted in a different color from normal identifiers. This includes things in backticks. So the `union` gets highlighted in a different color, making it obvious it's being used in an infix position.

<comment><USER24> This is amazing! Any idea if this is possible in vim?

<comment><USER23> There seems to be a plugin called unicode-haskell[1] for Vim. However, as I am obviously not a Vim user, I don't really know anything about it.

[1]: <https://github.com/frerich/unicode-haskell>

<comment><USER25> I wouldn't recommend using that one. There is a newer plugin [1] that uses "after" in combination with conceal syntax to achieve the same effect but without buffer hacks on load/save.

[1] <https://github.com/vim-scripts/Haskell-Conceal>

<comment><USER26> Haskell-Conceal also works a lot better than unicode-haskell: it doesn't erroneously turn "\n" into "λn", and it replaces :: with a single-glyph equivalent so that signature and definition line up nicely.

Having said that, I still prefer <\- and -> to ← and →, at least on screen: those Unicode arrowheads are too small on all the fixed-width fonts I've ever seen.

<comment><USER25> Those arrows are indeed pesky. In my fixed-width fonts (at least at the font size I'm using), → (->) and ⇒ (=>) look the same.

</comment></comment></comment></comment></comment></comment><comment><USER27> Interesting. I've done a fair amount of coding without syntax highlighting, particularly on live web servers ( _gasp_ ) without my vimrc.

What I find is that I don't really rely on syntax highlighting for find my way around the code or understanding it. I rely on it to tell me when I didn't properly close a string literal, or a comment, or fat-fingered a keyword. So, I generally enable it when I can, and find that it makes me more productive.

</comment><comment><USER28> When you read a book you do not need to be consciously aware of the syntax (unless it is either patently bad or extraordinarily original). When you are programming, most of the time you are dealing with syntax more than meaning...

In the end, what the logicians of the XXth century taught us is that logic (read maths/cs/...) is just syntax (from the formal point of view, mind you).

</comment><comment><USER29> Perhaps when you're _writing_ code, you are using it as a crutch. (I'm not one to know, really)

However, I certainly feel when I am reading someone elses' code, it is not a crutch but a tool. The highlighting helps me see an unfamiliar program's structure just a little more easily, which is nice when you're absorbing a couple hundred lines with sparse comments.

</comment><comment><USER30> While I read a book I take notice of headers providing logical partitioning, page headings & numbers for orientation. On paper text may also be set with bolder font, or with emphasis added. It helps, when done _properly_. Same with syntax highlighter. I don't want to re-read entire screen of code every time I need to make a change in this general area. I want to have mental model "indexed" upon the looks of code. This can of course be done on "plain" code, but it's slower and I can only hold my attention for so long each day -- why waste it, especially if I need to specifically disable some features of my software? And lastly -- code is not a book. I will read a book once, maybe twice if I really like it (my max being 8 repeats), but there is never time to read it again. While code? I will be read it for the rest of my life, as far as I can tell... I will not enjoy reading everything for a 1000th time, that much I know.

</comment><comment><USER31> May just be the case of a bad luck or not fidgeting enough with trying to find a colorscheme to one's taste. I have several colorschemes - not ideal, but decent enough to love and use - that I switch between depending on room lightning and language.

Book comparison is far-fetched imo. Code is not just a regular text, it's a very structured text, and reader of a structured text benefits from structure hints (expressed via color and identification), while writer of such a text benefits even more from on-the-go error checking. Looking through a dictionary without any bolds, italics and structure, just paragraphs and paragraphs of text, would be a waste of time and a pain to the eyes. And this is what I tend to do about 95% of time when 'writing' code - looking at it.

I would recommend searching for a less contrast or vibrant colorschemes like popular Solarized (too low contrast for me actually) or Tomorrow themes.

</comment><comment><USER32> There are more options than just "monochrome" and "syntax highlighting": For example, Xcode 4 assigns all identifiers taken from the current project a greenish colour whereas everything else (system headers/frameworks) are shades of violet. I just wish it would understand that CocoaPods are not project code :(

Another example, TextMate highlights some syntax _errors_ much more than it highlights syntax- type "else if" in a Ruby file and it's bright red. How is that not useful?

My love for syntax highlighting probably goes hand in hand with my love for natural language operators. "if foo and bar then qux" is much harder to parse without colours than "if (foo && bar) qux". Does anyone use a monochrome editor _and_ natural language wherever possible?

</comment><comment><USER33> I used to not like syntax highlighting, but then I started writing more complex, lengthier code in a variety of languages.

Instant feedback for error checking aside (which is incredibly useful) I like the "texture" syntax highlighting adds to the code.

Indentation is great for organizing code into individual chunks, but if it's all the same color, I find that it still starts to feel a little overwhelming when the code starts getting long. Colors help create a visual flow and, at the very least, break up the monotony, thus prevent the "wall of text" effect.... which is fine for a book, but source code isn't a book. It doesn't function like a book, you don't interact with it like you do a book, so it really shouldn't look like a book.

</comment><comment><USER34> I started out writing code in Emacs, with highlighting turned on. I loved it and couldn't deal with an editor that didn't have highlighting. At some point, I started using Acme a lot for working on Plan 9. I ended up doing a bunch of work on a variety of Unix boxes, and it was simpler to just use Vi without highlighting than to set it up everywhere. I got used to not having it, and realized I was pretty happy without it.

Plus, it always seems that whether I have light-on-dark or dark-on-light terminals set up, one of the colors is so off that e.g. strings become essentially invisible (dark blue text on black background) and it's easier to just shut off highlighting than to fix the highlighting.

</comment><comment><USER35> Interestingly there is something like syntax highlighting in natural language too. One example is that all nouns in German are capitalised which helps a lot in the context of ambiguity. To give you an idea of a case in which it actually might help:

      The complex houses married and single soldiers and their families.

vs.

      The Complex houses married and single Soldiers and their Families.

Other languages use different markers to indicate different parts of speech.

A point that could be made is that (written) language evolved for a long time and the concept of "syntax highlighting" is embedded in at least some of them. Probably because it has proven useful.

</comment><comment><USER36> First hardcore developers where shifting from IDE's to vi and emacs. Now hardcore developers are turning off syntax coloring? What' next?

<comment><USER37> Hardcore developers will start using ed. It allows you to focus on one line at once, with none of the distracting "context" of screen editors.

</comment></comment><comment><USER38> I did the same several weeks ago at work. I turned off syntax highlighting in XCode for doing objective-c coding. More specifically, I created a theme with all the same color: <http://dl.dropbox.com/u/68874506/Screenshots/xcodeterm.png>

I'm used to coding in terminal screen sessions, and using an IDE is a bit too shiny for my liking so I created my own terminal for XCode :) Now when I look at my co-worker's color-coded ruby code in Sublime Text it looks like a bunch of unreadable rainbows.

Colors are pretty, but since I turned them off I found that I haven't missed them. They turned out to be distracting, and I can't remember a situation where the colors helped me scan the code faster to help me find something. One color means I now treat all tokens equally.

<comment><USER34> Can I suggest trying a light grey font on that dark background, or even better (in my experience) black on white or very mild yellow (see Acme). In my experience, when I use green on black too long, I see purple when I look away.

</comment></comment><comment><USER25> What I found an interesting development in syntax highlighting is "semantic highlighting". Some IDEs support this by integrating directly with a compiler (such as clang).

At a primitive level it allows, for example, coloring nams of variables either by type, or by source (local/field/static field), same with function names (ie, is it a function, method, a static method, etc). See for example: <http://doc.qt.digia.com/qtcreator/creator-highlighting.html>.

But I'm sure much more is possible. Semantic highlighting could help understand the (non-local) semantic structure of the code, and allow finding mismatches between what the user intends and what he has specified.

</comment><comment><USER39> [http://www.linusakesson.net/programming/syntaxhighlighting/i...](http://www.linusakesson.net/programming/syntaxhighlighting/index.php) here is another one advocating the same thing.

</comment><comment><USER40> I write code with syntax highlighting turned off. Syntax highlighting has always given me the shits - it's noisy and distracting and I don't need it anyway.

The only time I :syntax on is if I get a parse error and can't find the culprit quickly, and it's probably a problem with string being constructed incorrectly (I mostly work with PHP so something like 'and that's that';). In that case having the syntax highlighter to tell me where the string interpolation goes awry is very useful, but I turn it off again once the problem is fixed :)

</comment><comment><USER41> This idea strikes me as appalling, but I'm trying it. I turned off syntax in vim just to see what it was like. I toggled back and forth a couple of times and found the syntax highlighting valuable, but without syntax highlighting it was still readable.

Now I've turned off syntax highlighting in vim and zsh and my irc client. Just to see what it's like. Will try it for a few days.

</comment><comment><USER42> The choice of font for the blog's body text doesn't lend the author any credibility on this topic.

For what it's worth, I tried both syntax highlighted and not - and the former results in a measurable improvement in productivity. I believe experimenting with tweaking one's tools is worthwhile in most cases.

</comment><comment><USER43> I have wondered for some time whether syntax highlighting really adds anything. Intuitively, it ought to . . . but has anyone ever tested this rigorously? I'll give it some anecdotal testing tomorrow and see if I regret it.

<comment><USER44> See this code:

      <%= render partial: 'user, collection: @user.followed_users  %>

I see (and write) errors like this all the time. Turning :syntax on saves me a browser refresh/compile cycle/spec run every time. Not sure if I'd need a rigorous test to tell me how helpful it is :)

<comment><USER43> Ah, my editor has separate error highlighting, so I don't have to forgo that immediate feedback to turn off syntax highlighting.

</comment></comment></comment><comment><USER45> Lol. That can come only from someone who actually uses vim when something like Emacs exists.

<comment><USER46> <http://ycombinator.com/newsguidelines.html>

_Please avoid introducing classic flamewar topics unless you have something genuinely new to say about them._</comment></comment>


Is "Fragrance" Making Us Sick? - <AUTHOR> http://www.motherjones.com/environment/2016/01/toxic-chemicals-fragrance-cosmetics-safety <comment><USER2> I think this an industry that needs disruption. I actually have one such headache right now as I write this.

I just can't stand most of the fragrances that come with air-fresheners, detergents, wet wipes, bathing soap, etc. I am thus forced to only use one particular type of bathing soap that is fragrance free. Unfortunately, one side effect of the same soap is that it makes my skin feel very dry. The dryness, therefore, induces occasional flare-ups of eczema. Well, at least, I can stand that and not the constant headaches. At any given time, you will find me having anti-histamines and pain-killers in my pocket, just in case.

Fortunately, I live in a country where we can afford house-helps. We actually have two of such people helping us wiht the daily household chores and we pay both above the minimum wage in our country. The monthly minimum wage, here, surprisingly is less than $100. I therefore do not have to do any sort of laundry and cleaning.

Still, while I cannot quantify the proportion of people of affected by this problem, I still believe there is a need for fragrance free products out there. If I had the resources, I would certainly have started such a business.

On the other hand, I can stand quite a number of many other types of scents. Well, I realize people are different.</comment>


Racism in talk about outsourcing - <AUTHOR> http://blog.codeboff.in/2010/06/15/racism-in-talk-about-outsourcing/

<comment><USER2> _In the end, we went with the Indian company

You asked what you did wrong. I present to you what you did wrong_

could someone explain to me, where the racism lies in the above sentence? Seriously, it may not be a well thought out response that highlights the perils of outsourcing, but it is well know that outsourcing increases risk.

India, being one of the largest software outsourcing recipients, just bear the brunt of this well know reality. I have rescued many projects from "India" and not one of them has been because of some genetic inferiority of "Indians", rather there are real logistical and cultural issues that many people are not aware of when they sink into the lowest bidder trap.

Unfortunate, individuals that make comments like the quoted one have seen this far too many times and instead of offering constructive dialog, tend to take an I told you so attitude without offering a explanation as to why. Meanwhile the overly sensitive politically correct immediately jump to the racist white guy explanation for criticism.

The fact of the matter is that outsourcing to India or anywhere else is fraught with risk, more project fail than succeed. It is not racist to be a realist and to deflect from the issue by crying racism does not fix the underlining issue, which is really that people need to be educated on how to outsource successfully.

<comment><AUTHOR> In retrospect I agree that this quote isn't particularly racist by itself. But it at least represents a discriminatory attitude towards Indians-as- programmers, which the count of net up-votes suggests is happily endorsed by people in general, presumably many of whom do work in the field and do propagate this attitude in real life, even if silently.

I also agree that the race card is overused and in general any assertions made under it are not falsifiable. But the flip side is that real racism is easy to qualify with a rote disclaimer ("I know many smart Indian programmers personally"). That doesn't decrease the sting of the isolated snide remark which was almost but not quite racist.

I believe that the number of outsourcing successes is not as low as is portrayed in online forums, perhaps because those involved tend to be less vocal about it.

My point is related to what you seem to say in the last line: people need to be able to discuss outsourcing or anything else without some being able to get away with saying 'Indians suck at programming'.

</comment></comment><comment><USER3> It's awfully hard to talk about the problems (and they're HUGE) of outsourcing (really, "offshoring") to India without sounding racist, even if you don't intend to.

In the USA at least, since the early 80s, "Human Resources" departments have trained managers, directors and up to think of employees as coming in "plug- compatible" categories. Naturally, management has extended this incorrect mindset to offshored workers. The vast cultural differences between USA and India cause a lot of problems, as does the time difference.

But nobody can say anything because of the danger of inadvertantly sounding racist.

<comment><AUTHOR> People _should_ complain about problems. But it is entirely possible to do so without being derogatory about Indians _as a class_.

The cultural differences between anywhere and anywhere else may be vast but I don't think they are unbridgeable, provided that both sides first agree to co- operate.</comment></comment>


Hologram replaces Edward Snowden statue in Brooklyn park - <AUTHOR> http://mashable.com/2015/04/07/edward-snowden-hologram-statue-brooklyn/#:eyJzIjoiZiIsImkiOiJfOTd3ZDRpNXFrdDN3YjdzcCJ9

<comment><USER2> Does anybody know whether the original was destroyed by the NYPD? If so it's a real shame.

</comment><comment><USER3> This is awesome, really in the hacker spirit. I wonder why it didn't reach the front page.</comment>


Ask HN: Switching Skillset as a Developer - <AUTHOR> I have 2 years of experience developing custom apps on PaaS (e.g. Salesforce, ServiceNow, Appian, Pega, Okta) on federal projects, but it's not fulfilling to me. I have a 4 year degree in comp sci, but I'm not sure if I should consider myself a mid-tier or entry level developer when applying to jobs outside this technology stack.<p>Have you ever made a big switch in your career in terms of the technology you're using? Did you have to learn on the go, or build up personal projects which landed you a job? It's frustrating to feel burnt out at the end of the day/week with seemingly no room to work and learn new things. <comment><USER2> My career has progressed over the years as I learned about opportunities in the tech world.

I first started out in HTML web and email design, but I found it to be too difficult to make it into anything more than beer money.

After talking to other people in the industry, I started making websites in simple PHP. Eventually I migrated to WordPress and spent a few years building my LAMP stack skills. WP and PHP becomes a nightmare for any large project, and I found myself getting burned and burnt out by clients and PHP issues.

Along the way, I picked up JS and got good enough to pass interviews. This led to a one year gig as part of a marketing team, cranking out code and dealing with non-technicals ruining projects.

The JS frameworks started exploding, and I found work as an AngularJS (1.x) dev. This got me into corporate work. I got exposed to more tech and my resume blew up.

Nowadays, I work in React and NodeJS but my experience gets me jobs across all of the stacks I dabbled in.

My recommendation is to get a job, learn all you can, coast. Then use some of your free time to educate yourself for your next job. Get more skills, rinse, repeat.

</comment><comment><USER3> Im working on leaving too. If Im a developer by the end of 2020 I'll consider myself to have failed.

The thing is I, along with every other person on Earth, am a good software developer. I just can't get anything other than these stupid bug fixing / feature adding roles. As I get older it'll continue to get more out of balance.

I've decided to learn how to build products. That means PCB design, case design, coding (already got that one), the patent process, etc. I'm done building things to impress employers who dont respect me at all other than my ability to write code. I'm making a run for it. You should too.

<comment><USER4> > I just can't get anything other than these stupid bug fixing / feature > adding roles. As I get older it'll continue to get more out of balance.

It sounds like you've made your mind up about exiting but for others, working at smaller startups usually gives you far more exposure to new areas of the stack/problems that you may not have come across. In the last year I've picked up a ton of devops knowledge, learnt UX best practises so can design far better interfaces, and I've learnt a new frontend framework. I just wouldn't have got if I'd stayed in my 'steady' role.</comment></comment>


Quantum Theory May Explain Wishful Thinking - <AUTHOR> http://www.physorg.com/news158928941.html <comment><USER2> Using quantum theory to explain psychology sounds like wishful thinking to me...

</comment><comment><USER3> I've always been of the belief that humans are incredibly complex, deterministic machines. It would be fascinating to see some people make some breakthroughs in understanding the inner workings of humans although it seems a ways off.</comment>


Hacking the Hedonic Treadmill Part 2: The "Scale Treadmill" - <AUTHOR> http://www.adambreckler.com/hacking-the-hedonic-treadmill-part-2-the-scale-treadmill

<comment><USER2> Interesting leadup, but even with part 1 it still feels like it adds up to about 50% of a blog post. I might upvote after part 3 or 4, once they start tossing around the actual hack ideas.</comment>


Google Faces Record EU Antitrust Fine - <AUTHOR> https://www.wsj.com/articles/google-faces-record-european-antitrust-fine-1497602658 <comment><USER2> I'm torn because as a consumer (and a corporate consumer), I love to use Google products, they are great.

Working within Googles systems (search, ads, publishing, etc) though has been frustrating at best, ruinious at worst.

I doubt this fine will change Google in any meaninful way though, it will take more such as a top down attitude change or serious anti-trust calls.

</comment><comment><USER3> For those without WSJ accounts:

[https://www.nytimes.com/2017/06/16/business/eu-google- antitr...](https://www.nytimes.com/2017/06/16/business/eu-google-antitrust- fine.html)

</comment><comment><USER4> And will be promptly appealed. Intel has yet to pay a dime of its 2009 fine.</comment>


Ask HN: Why should I write tutorials/how-tos for others? - irregular-john If I think a certain software pattern I use in nearly every project of mine is unique and frankly worth a lot of money (read: less time spent engineering and more time available for additional value-adding elsewhere), why should I write a tutorial on that pattern for others to consume/learn from? <comment><USER2> a) It opens you up to criticism, to find potential improvements to your style - if you think that your style can't be improved, then sure: hold onto it and never let it go!

b) If everybody held onto their knowledge because it was valuable, I'd venture to say that you'd only have a fraction of the knowledge you have now - <AUTHOR> there wouldn't be any resources for you to consume yourself

c) It disseminates your work, more people know what you're working on, and that means that when you make a claim regarding the value of your work, people will take you seriously. How am I supposed to judge the value of your work if you don't have a readily available body of work for me to cross-reference against.

d) If your pattern truly creates value, then others will start to use it in software you don't contribute to; which will mean more rapid progress that you can again benefit from.

Human knowledge acquisition is not meant to be solitary, so if you don't want to share; thats up to you. But you need to realise that sharing is always a game of give and take.

<comment> irregular-john A lot of great points. I definitely acknowledge that I wouldn't be where I am without a lot of others' tutorials.

I particularly like your third point - I obviously can't share the proprietary work I've done, but this is something I _could_ share and would demonstrate (hopefully) some of my competencies.

</comment></comment><comment><USER3> Because spreading your knowledge is one of the best ways to pay it forward that there is. (Among many other reasons!)

</comment><comment><USER4> If you publish it, you'll become famous. Then people will pay you lots of money because they'll think you're competent. Discoverability is the path to perceived expertise.

<comment><USER5> Sneaky approach - I want to see your code now!

</comment></comment><comment><USER6> I think it showcases your expertise. A future employer might stumble upon your write-up and reach out to hire you.

You might want to write a book that includes the subject in the future. If you get good feedback on the article and lots of eyeballs on it, this validates this idea.

</comment><comment><USER7> Sharing knowledge is a great way to give back to the community, meet other developers, potentially obtain consulting engagements and/or build an audience.

</comment><comment><USER8> \- There is joy in giving

\- It is not a zero sum game</comment>


Ask HN: How to get better at Data structures and Algorithm? - <AUTHOR> I am a fairly experienced programmer (10 years) and have always worked with startups building prototypes and getting products to product-market fit. I have worked in all kinds of languages Java, C#, Ruby, Elixir. However, I am not good with data structures and algorithms. What do you reckon I should do in order to get good? Any books, tutorials, course, etc that have helped you? <comment><USER2> Depends on do you want to learn DS & Algo for job interviews? Or are you genuinely interested in adding tools in your tool belt.

For the first you learn about a couple common paradigms like dynamic programming, some graph algo & ds like BFS/DFS, shortest path algorithms, backtracking etc... and just do a lot of leet code problems. The more of these you do, the better you get at them, because most of them can be solved faster by knowing techniques (like using two pointers at either end for some array based problems) etc...

For the second one, you try to learn about the landscape of DS & Algo. For example, i know about the existence of red black trees, why they were invented, types of problems you can solve with them, but i won't be able to implement them from memory or without using references (even then it might take me a while). For the second type of learning, i would just do CLRS chapter by chapter, or watch any of the numerous algorithm courses on youtube from MIT, Stanford, ArsDigita. The second type of learning lets you understand and gain an appreciation for the tools you use everyday as a developer. For example, studying B-Trees will let you appreciate how rdbms are able to retrieve information so fast.

Ideally, a good developer would be well versed in DS & Algo landscape and be able to solve leetcode problems fast, but i think #2 is more necessary to becoming a better developer, although #1 helps more in the job market.

<comment><AUTHOR> Thanks! this is really helpful. I want to both - crack interviews where DS & Algo is considered very important as well as go in depth and learn them. Such companies which give a lot of importance to DS are the ones who actually use it (Amazon fulfillment - for example)

</comment></comment><comment><USER3> For me implementing the data structure and it's operations made the difference between shallow and deep knowledge. There are a lot of data structures and I did not see anyone post a basic list so let me provide one, because once you know what you should seek things will be much easier.

Data structures:

\- linked list (single,double)

\- array list

\- hash map with different implementations

\- binary tree(and tree traversing, depth/breadth first search)

\- red-black tree

\- self balancing tree

\- stack

\- heap

\- queue

\- set (with funny set operations like intersection)

\- B and B* tree

Read about their strengths and weaknesses.

With every data structure comes operations. More or less the same with a few speciality but their implementations are vastly different. You should try to implement the same operations at every data structure:

\- Find an element

\- Find min/max

\- Add / delete an element

\- Sort the data

Take time to implement the standard sorting algorithms for a list to understand the speed implications: quicksort, bubblesort, heapsort, radix sort, bucket sort

If you look for other algorithmic challenges I suggest checking out graph algorithms. Dijkstra and A* are the most famous.

</comment><comment><USER4> Focus on the structures, leave the algorithms for later. Seek out and study the papers, and build each data structure one by one. You'll know you understand it when you can build it, when you can see its structure. There's a master key hidden embedded within the structures too. Pieces of the key are distributed among them, waiting for its fragments to be connected. Its secrets revealed and retrieved by a select few. One of the secrets you'll discover on this quest is this: Once you get the structures, you get the algorithms for free.

See [https://news.ycombinator.com/item?id=20047607](https://news.ycombinator.com/item?id=20047607)

<comment><USER5> What sorts of papers can we read to get a better understanding of data structures?

<comment><USER4> Hundreds of the best papers have been posted on Hacker News over the years. Some of the rare gems too. Look through people's posting history for inspiration. And use Google Scholar [1]. At some point you may discover you're searching Google Scholar more than you're searching Google Proper.

[1] [https://scholar.google.com](https://scholar.google.com)

</comment></comment></comment><comment><USER6> Books will bore you to death.

1.) Go to [https://leetcode.com](https://leetcode.com) It's a whole community built around algorithms and data structures.

2.) Pick an easy problem.

3.) Code it naively/brute force it just to get it 100% correct.

4.) Check the Discuss tab, sort by Most Posts and read the solutions and comments.

5.) Every time you hit a wall or encounter a new term (like space/time complexity, dynamic programming, binary tree etc) find a video on YouTube that explains it really well. Not enough? Ask community, consult a paper or a book.

6.) Go back to 2.) until you're ready for the next level.

Don't let your own mind sabotage you by telling you that 'this is not real world programming', 'this is for college kids'. Embrace it and you'll find it sort of interesting like solving a hard puzzle in a point & click adventure video game.

</comment><comment><USER7> [https://www.hackerrank.com/](https://www.hackerrank.com/) and [https://www.hackerearth.com](https://www.hackerearth.com) provides good track guides to begin with.

[https://www.codeforces.com](https://www.codeforces.com), [https://www.codechef.com/](https://www.codechef.com/), [https://www.topcoder.com/](https://www.topcoder.com/) (even if in my opinion, this last one is becoming worse and worse) provides good problems and contests to apply and discover new ideas.

And if you're even more motivated, upsolving previous contests problems. Codechef long contests are really interesting for this: after thinking a lot about these problems during more than 1 week, reading the editorial and trying to apply by yourself the idea seems to me an excellent way to learn.

</comment><comment><USER8> If you want to prep for interviews, it may be most efficient to look through lots of hacker rank problems and learn them in an ad-hoc function, looking up solutions online after you've tried them. If you actually want a good understanding of fundamental data structures and algorithms, I very much recommend reading Cormen et al. First 4 sections (17 chapters) plus Chapter 22 (Elementary Graph algorithms) are the absolute essentials (obviously some people may have some small level of disagreement with this but I think it's fairly accurate). By then you'll have enough knowledge to skim the introductions of the other chapters and decide whether you care about reading them now or just keep the basic premise of what that chapter addresses in the back of your head so if something requiring it comes up later you'll know you can refer back there.

Edit: hah, I type very slow on my phone evidently. strikelaserclaw's advice here is very similar to this :)

</comment><comment><USER9> I'll recommend: Data Structures and Algorithms in Python by Goodrich et. all, they've also done this series in Java and C++ but I am only familiar with the Python version. It has a great balance in terms of covering everything you need to know in terms of fundamental ADTs, asymptotic complexity, etc. but without the rigorous math in CLRS. Because Python is so concise, every data structure and algorithm is fully implemented.

My only con is that the answer key doesnt seem to be available.

</comment><comment> pickle-wizard I am interested in this too.

The past 12 years I've been doing automation of various types, so I've forgotten much of the Data Structures and Algorithms I learn in college.

</comment><comment><USER10> Read books; follow the worked out examples very closely until you completely understand them. Then try programming it on your own from your understanding and memory. You have to put in the time and effort. I suggest studying books where complete implementations are given in a language of your choice and only later studying books with pseudo-code (i.e. go from specific to general). Also the chosen language should be simple without obscuring the core logic in OO/Functional syntactic sugar and structure (C is ideal here). The following are a few chosen books from my collection (used copies of all can be had for cheap online);

1) Data Structures and Program Design in C by Kruse, Leung and Tondo.

2) Algorithms in C (Parts1-4 and Part5 two-volume set) by Robert Sedgewick.

3) Compared to What? An Introduction to the Analysis of Algorithms by Gregory Rawlins.

4) How to think about Algorithms by Jeff Edmonds.

5) Advanced Data Structures by Peter Brass.

Finally, study the ideas, concepts and techniques behind the C++ STL library to see how to design Data Structures and Algorithms in a clean and independent manner and yet can couple them as reqd. in myriad ways for actual usage.

</comment><comment><USER11> Read this book:

[https://www.amazon.com/Introduction-Algorithms-3rd-MIT- Press...](https://www.amazon.com/Introduction-Algorithms-3rd-MIT- Press/dp/0262033844)

It's all in there. Put away a week of time to really start digging into it, get into the habit of learning from a book. I'd say it's worth it.

<comment><AUTHOR> I did read this in college 12 years back. It did get me excited back then. But then I guess I did not get into putting those algorithms into practice when I first started working (working in smaller companies, building simple web applications). I think it will be a good idea to go back to it and start again. Thanks!

</comment></comment><comment><USER12> I'm (mainly) a Swift developer, and Ray Wenderlich's Swift Algorithm Club has been very helpful for me: [https://github.com/raywenderlich/swift-algorithm- club](https://github.com/raywenderlich/swift-algorithm-club)

</comment><comment><USER13> Yup this is a thread to follow. Will be checking yoyr advised books too!</comment>


Orkney islands could get first electric plane service - m-i-l https://www.bbc.co.uk/news/uk-scotland-north-east-orkney-shetland-45876604 <comment><USER2> The Orkney Isles are setting the example in the UK. Going green and making progress with it is also quite good for the community, not to mention the balance sheet. Another future is definitely possible and the folks in the Orkney Isles are an inspiration.

The Fully Charged Show on YouTube has been following progress for years, here is a recent three part series on wind, hydrogen and big batteries in the Orkney Isles:

[https://www.youtube.com/watch?v=Rybpaqhg5Qg](https://www.youtube.com/watch?v=Rybpaqhg5Qg)

I highly recommend liking, subscribing and giving a thumbs up to Fully Charged Show. Anyone that enjoyed Red Dwarf or Scrapheap Challenge will know the presenter.

</comment><comment><USER3> Just to make clear something that may be puzzling folk: the famous Westray / Papa Westray link is NOT the only route this plane serves! This plane serves many islands in Orkney: check out the schedule on [https://www.loganair.co.uk/travel-information/orkney- inter-i...](https://www.loganair.co.uk/travel-information/orkney-inter-island- services/)

This is really cool to see. Orkney has really pushed renewable energy and in fact, on some days they make more than they can use and export!

<comment><USER4> I thought generating more than they can use or export was the default for Orkney now?

Which is why they're leading the pack adopting EVs, heat pumps, community heat schemes etc, and the hydrogen plan for the ferries. They have to find something to do with it all, or turn off some wind turbines and solar. So they're migrating every remaining use of fossil fuel possible. Which seems a much better plan than anywhere else.

All that for a tiny fraction of the fuel bills the rest of the UK pays. I wish the mainland was a little more inspired to blatantly copy. :)

<comment><USER5> Have the crypto miners found them yet?

</comment></comment></comment><comment><USER6> Amature here; Aircraft engines aren't just rated by hours-ran but also cycles. That being start-Takeoff/landing-stop. Maintenance and part life is specified X hours or Y Cycles.

I would think there's no reason to apply any of that to an electric power plant. So can anyone familiar with the topic enlighten if this might have much impact to the cost/benefit going on?

<comment><USER7> Electric plant is also stressed by higher loads (thermal mainly, which has a number of downstream effects), and cyclic thermal stress would lead to cycle limits just the same. You also still have a lot of mechanical components just the same as combustion engines.

<comment><USER8> > You also still have a lot of mechanical components just the same as > combustion engines.

This certainly wasn't true for cars, a fully electric vehicle is simpler, resulting in an immediately noticeable reduction in maintenance overhead - <AUTHOR> you sure it will be different for aeroplanes?

Keep in mind that the combustion engine of a propeller aeroplane will have an entire electrical system as part of the combustion engine because it turns out even most private pilots are not inclined to get out and start the propeller by hand ever time.

<comment><USER9> I think, if I'm conceiving of this properly in my head, that electrically powered props would alleviate the need for variable pitch propellers; a complicated affair involving oil pressure and governors. Since the torque curve of an electric motor is flat I don't think it'd be needed. Although a feathering system may still be required to twin engine electric planes.

<comment><USER10> There would still be benefits to variable pitch propellers with an electric motor (motor efficiency, correct propeller pitch for the airspeed to name two).

I work in the UAV industry and would adopt variable pitch in an instant if it didn't come with complexity and weight penalties!

<comment><USER9> Interesting. I've always thought of variable pitch propellers as being more efficient by allowing the engine to stay at it's peak horse power. For a piston engine this is obviously at the peak of the nice curve you'll see on any dyno run. A fixed pitch propeller sized for climb would allow the engine to run above this speed in cruise and vise-versa if it were pitched for cruise.

Now an electric motor has maximum torque at 0rpm (stalled) and practically no torque at it's no load speed. The relationship in-between is practically linear. So long as the motor was matched and / or geared so that during all stages of flight the RPM stayed within a reasonable band I don't see what the advantage is. Maybe some second order effects of efficiency at lower speeds perhaps.

Edit: Actually, thinking again, it's the exact same reason that cruising at the lowest possible RPM for the required power output in a piston engine is typically the most efficient. Just less friction. Still think it'd be a smaller effect given we're talking roller bearings rather than plain bearings and piston rings.

<comment><USER10> Even if you disregard motor efficiency (which I don't, as with a battery powered vehicle you treasure every Wh more than you treasure every gram of fuel!), propeller efficiency is also important. Ideally you want to match your motors power handling and efficiency with your propeller. A given propeller/motor combination will have a design point in terms of torque/airspeed/rpm, and operating significantly outside of that (e.g. having a power system designed for cruise but operating at zero airspeed) has penalties.

Unfortunately I'm traveling at the moment, but I spend a large amount of my time at work balancing propellers and motors and could provide some plots that might help explain this. One of the few things years of working in academia proved to me, is that I'm terrible at explaining things like this!

</comment></comment></comment></comment></comment></comment></comment><comment><USER11> Is there a fully released (non-experimental license) electric aircraft out there right now? A couple years ago I saw that a lot of companies wanted to create a "short" flight electric plane but I have not seen any with a full plane license/cert.

<comment><USER12> I don't know what "non-experimental license" means as I don't know the industry very well, but wouldn't the Pipstrel Alpha Electro be what you're talking about?

or are you talking about larger planes?

[https://www.pipistrel.si/plane/alpha- electro/overview](https://www.pipistrel.si/plane/alpha-electro/overview)

</comment></comment><comment><USER13> It would be really interesting to see if they can make this viable and reliable.

Side note: no disrepect intended, but when reading the names of some of the islands it feels like they're written in pig Latin.

<comment><USER14> The names are either old celtic or norse names. If you check out the Wikipedia page for Papa Westray, [https://en.wikipedia.org/wiki/Papa_Westray](https://en.wikipedia.org/wiki/Papa_Westray), then follow the links you get quite a history on the origins of the names.

<comment><USER15> Specifically, the -ay, -ey, -øy suffixes that evoke Pig Latin mean "island" in places that had Norse presence. See [https://en.wiktionary.org/wiki/-ey#English](https://en.wiktionary.org/wiki/-ey#English) and [https://en.wiktionary.org/wiki/ey#Old_Norse](https://en.wiktionary.org/wiki/ey#Old_Norse)

</comment></comment></comment><comment><USER16> Orkney and the Shetland Isles are actually some of the wealthiest regions of the UK, so it makes sense that they might be able to get something like this off the ground.

<comment><USER17> Some more on this statement: [https://www.bbc.co.uk/news/uk- scotland-27138927](https://www.bbc.co.uk/news/uk-scotland-27138927)

<comment> m-i-l To clarify - it is wealth of the council, not average wealth of individual residents. Bear in mind also that the cost of living is very high, given most products have to be imported from the mainland. For example, the Shetland Islands has some of highest petrol prices in the UK despite being the site of the largest oil terminal in Europe (oil has to be exported for refining).</comment></comment></comment>