Why a Logging Framework Should Not Log - <AUTHOR> http://www.russet.org.uk/blog/3112 <comment><USER2> No, this guy is 100% wrong. The distinction is absolutely clear. If someone else is expected to build on top of a framework he provides then he is building a library, and it would be inappropriate to tie future consumers to a back-end. This is relatively simple to fix - you mark his library as a dependency and add an additional <exclude> for slf4j-nop to that dependency, but it's not the right way to do this. Those messages aren't meant for him, they're meant for future consumers, and now after including his library they have to dig through and figure out why SLF4J suddenly broke.

I can't find exactly what this Tawny-OWL thing is (his link is broken), but it sounds like it might have some kind of interpreter application provided. If he is offering a finished application within the same build unit as his UI library, this is the "big ball of mud" architecture. The fix is to break his application out into a separate build unit that depends on his library. The application can then include slf4j-nop without messing up SLF4J for all his library's consumers. Maven Reactor can automatically build his dependencies when his main application builds, if desired.

The thing about having to deal with 2 different logging frameworks is exactly what SLF4J is meant to fix. SLF4J lets you route the messages from multiple sources to a single sink/backend defined by the final consumer application. Yeah, it sucks to deal with multiple logging frameworks, but that's simply how it is and you don't help anything by having a whinge about it. You include the routing/bridge modules (JUL-to-SLF4J, Commons-to-SLF4J, etc) in the final- consumer application and call it a day. If you don't want to do that, find some other dependency that doesn't use those logger frameworks.

<comment><AUTHOR> My framework is built in Clojure. The interpreter is always there. Think of it like a statistics library with R.

The idea of a "main application" is itself not a clear one. There are a set of functions you can use. Whether you choose to launch directly over the library or import it is a matter of convenience.

<comment><USER2> I would say that the responsibility to define a backend falls either on the Clojure interpreter or the user of the interpreter, then. Java is not typically run on an interpreter shell and the defaults that normally are sensible for Java probably aren't appropriate there.

It's a perfectly sensible default for a framework to warn you at runtime that it's not configured properly, and stderr is the appropriate channel for that to go out over. I would even go so far as to say that it should default to stderr output on warn/error messages unless explicitly muted, instead of merely switching to NOP output after the initial misconfiguration warning. An interpreter might prefer another default but I think that's probably the best default for most Java projects.

The way I see it here, Clojure built on top of a stack without understanding the caveats that go with the stack. It's simply a fact that Java logging is a mess, there are four major competing standards and you need to tell Java which one you prefer, because any project will eventually need to interact with all of them if it continues growing. It's a fact of building on that stack.

<comment><USER3> The problem is that it is a Facade/API that is initializing and printing to STDERR.

I completely disagree with the idea of making slf4j-nop a required exclusion dependency (that is a I agree with @paulmd and not the OP) but a facade/api should have very little interaction with the boot process of Java. The default should be to do nothing and require either a java.util.ServiceLoader like mechanism or some other explicit configuration (or in SL4J's case adding a bridge).

That is slf4j-nop _behavior_ should be the default (not the dependency). I understand that would confuse users but I think it would be the correct behavior. (also see my other comment for more reasons)

</comment></comment></comment></comment><comment><USER4> Whoa. The author recommends including slf4j-nop as an explicit dependency of libraries?! This means that when a developer writes an application and forgets to include an slf4j backend, instead of getting a warning that no backend is configured, that developer will get absolutely no output. This is really bad advice.

<comment><AUTHOR> It's ugly advice. Wish there was a better alternative. Ideas on a post-card please.

<comment><USER5> The JVM works this way after C programs popularized the precedent - refuse to run at all with a dynamic link error stating the shared library that was expected without any mention of what version of the library should be present in the LD_LIBRARY_PATH or that the shared library version expected actually doesn't match the ABI in some corner cases and silently fails during runtime. That's part of why customizable classloaders in the JVM exist.

<comment><USER6> That is not what is happening with SLF4J. The nop logger is present in the API artifact. The API artifact chooses to warn when using it. The nop dependency, despite the name, contains no logger at all. It just explicitly forces the usage of the nop logger.

It's pretty clever actually, and works in a straight-forward way.

</comment></comment></comment></comment><comment><USER7> This is a well understood problem and I think the design pattern SLF4J uses has become quite popular.

The ability to allow consumers to bind at runtime the implementation they want by providing an api jar is kind of a neat idea.

The thing I dislike the most is when libraries force me to use their logging runtime. If they need it just for tests they should add the 'test' scope and just use the 'api' jar as a 'compile' dependency.

<comment><AUTHOR> It doesn't force anything though, unless you statically refer to the runtime. It does force you to exclude their logging backend, but that is straight- forward enough.

<comment><USER8> Dependency exclusions is a code smell everywhere but java. I don't understand why someone is actively giving this advice.

<comment><USER6> The alternative is _not_ specifying a nop dependencies and then inflicting on downstream uses the choice that I was not prepared to make.

</comment></comment></comment></comment><comment><USER3> My feeling is that SLF4J and in general the boot strap initialization is fundamentally flawed in Java because of the plethora of libraries that do static initialization. I have been meaning to blog about this for sometime. The reason is simple. Bootstrap configuration should load before logging but that is not the case.

In a large application it can be very difficult to control what boots up and the overall order of things being initialized particularly with SL4J, configuration frameworks like commons-configuration (archaius) and DI frameworks like Spring and Guice.

I understand that SLF4Js binding method is a static dependency to enable the very small case of Java JIT elision of method calls when using the NOOP logger.

But that is such a small case. If you have a library that is extremely hi performance do not use SLF4J for god sakes.

The reality is most large application projects should really create their __own __SLF4J binding so that they can control the initialization process particularly if you use a networking logging infrastructure such as AMQP. And this is fairly annoying because you will have to copy and paste the bridge library (ie because of the static nature it is impossibly to intercept the logging framework).

SLF4J should really do its binding dynamically (one option would be to use java.util.ServiceLoader). This is so that you could wrap and load existing bridges with out essentially having to copy and paste existing bridges.

Overall I would say if you have either a hi performance library, networking library, configuration library, or any other low level library please do not link to SLF4J. It is trivial to make your __own __one class logger that either uses system properties or what not to do its dispatching.

Some example libraries that do this correctly are the Kryo serializer, RESTEasy, and Tomcat (although flawed Tomcat does try).

Spring and most Apache projects some of the worse because they rely on Commons logging and the use static loggers on initialization (commons-config and most of Spring).

</comment><comment><USER9> Caches:

[https://web.archive.org/web/20160505153552/http://www.russet...](https://web.archive.org/web/20160505153552/http://www.russet.org.uk/blog/3112)

[http://webcache.googleusercontent.com/search?q=cache:9BEl9sv...](http://webcache.googleusercontent.com/search?q=cache:9BEl9svPfs0J:www.russet.org.uk/blog/3112&num=1&hl=en&gl=us&strip=1&vwsrc=0)

<comment><USER10> ty!

</comment></comment><comment><USER11> I really wish Java developers would just use java.util.logging and be done with it.

<comment><USER12> That's an all-or-nothing solution. As third-party libraries often use alternative loggers, and java.util.logging cannot be substituted on the classpath (because of the java.* namespace), then using JUL locks consumers out of using their own logging facade as it cannot be bridged to SLF4J.

<comment><USER13> java.util.logging can be bridged into SLF4J using the jul-to-slf4j bridge.

</comment></comment></comment><comment><USER14> I always found SLF4J's reasoning quite simple and logical and not at all an example of "those situations which show that software is difficult, and that often there are only compromises".

I think the core problem in this case is that the author is not clear if they are writing a library or a (command line) application.

The following workflow has always worked well for me:

1) Do you expect users of your project to use it by putting it in their classpath and calling its methods from their code? Then it's a library. You have no idea what else will be on the classpath and which context your library will be loaded in. (In fact, the user might not even be aware they are using your library thanks to transitive dependencies)

Libraries should never (if they can avoid it in any way) modify application- wide settings. So: Don't include any logger implementation at all, _especially_ not the nop logger. (Please. Seriously. I've had to deal with misbehaving libraries in that regard and finding out why your logger settings are suddenly overwritten is a serious PITA.)

2) Do you expect your project to be used as a command line/standalone utility via java -jar ... or java -cp ...? Then you're writing an application. _Do_ include a logger implementation and all necessary configuration. You can do it safely here as no one else should be using your project as a dependency.

3) Your project is a mix of 1) and 2) : Find out which parts of your project are library and which are application and split into sub-projects accordingly.

There are a few special cases I see, but not many:

4) You're writing unit tests for a library project: Do include a logger implementation, but make sure it's only visible to the test system. E.g., in Maven, you would add the logger implementation as a test-scoped dependency and put all configuration in src/test/resources.

5) You're writing a plugin/servlet/etc: Read up on your host system and find out if they provide logging or if it's your responsibillity. Proceed accordingly.

6) You're not using SLF4J but one of your dependencies does and so you get that message: Think about using SLF4J in your own project. Really. It's becoming almost a standard and usually you can keep using your old logging framework below it - but it will make things much easier later on. But if you don't want to, for some reason... 6a) If you're writing a library: Don't do anything at all. Do not include any logger implementation. See 1). The user of your library will be in a much better position to deal with the problem than you are. 6b) If you're writing an application: Include the slf4j-xxx implementation that corresponds to your logging framework: The log events from your dependency will be routed to the logging framework you're using and you can continue like you did before. If you're very certain you don't want _any_ logging from _any library using SLF4J_ , use the nop logger - however that is a very unusual case and a very inflexible solution.

<comment><USER6> It's a set of clojure code that I expect people to use in an interactive shell by, yes, calling methods. Whether people do that within an IDE, directly at a REPL or by running a script is up to them.

I'm still not understanding why I should perform major surgery on my tool for the sake of a logging library which is a transitive dependency.

Nor am I understanding why I should pass the error message that confused me on to downstream users. I'm happy to make the decision rather than sit on the fence.

<comment><USER14> My point is that "not passing on the error message" could make life harder for downstream users too, depending on who those users are. (Sorry if my reply was arrogant or harsh - I got burned by this in the past, that's why I'm telling it)

If you're developing a project and use SLF4J by yourself, and use a third- party-dependency that already includes a logger implementation, this dependency can override your logging and cause all sorts of havoc. This can be a frustrating and hard to find bug.

(I'd say the fact that this can happen at all is a design flaw in it's own, partly caused by Maven's way of dependency resolution, partly by SLF4J. But I don't see that changing in the near future...)

I think it's important to consider how your project will be used. if it's really just for exploratory use in a REPL/a few scripts, then including a logger is fine. If you think this project could be used in larger projects, you should consider leaving it as it is or restructuring.

If you do include a logger, leave a note about it in the documentation. This way, users can at least exclude it again if they have to.

</comment></comment></comment><comment><USER15> The logging in java is supper idiotic. This is because everyone agrees that Java's logging is shit.

So every library uses something else. I have a small project and have 4 logging systems (that I had to integrate).

ps: if you are a business person and have an option on this, I don't care for it regardless of your pov.

<comment><USER2> Yeah, it's the exact situation described in that XKCD: "There are 14 competing standards! Let's create one that is perfect for everyone's use-case!" "There are 15 competing standards..."

[https://xkcd.com/927/](https://xkcd.com/927/)

And, as you noticed, pretty much every Java project will reach a point where it has to deal with all four-ish of the major logging frameworks. Some module, somewhere, will include an Apache dependency and then you get JCL, and some other purist will insist on java.util.logging and away you go.

With that said, it really isn't that bad to fix. You can use the SLF4J bridge modules and dump all 4 of the logging systems to a single output system. This doesn't actually have to be via SLF4J either - there are modules to dump SLF4J out to JCL or JUL or whatever.

[http://www.slf4j.org/legacy.html](http://www.slf4j.org/legacy.html)

This is one of those things about Java that's annoying as hell to get set up, but you plug through it for an hour and then you never need to touch it again. And the next time you can crib from your working build and 99% of it will be the same.

<comment><USER15> I doubt that you have used the SLF4J bridge in any realsitic situation, else you would not say that it works.

<comment><USER2> I have and it works fine.

<comment><USER15> I don't believe you.

Even the docs say it does not work w/ multiple loggers. But I'm not here to teach, good luck.

<comment><USER2> You're quite simply wrong - the docs do not say that anywhere.

What they do say is that you are not allowed to route loggers _circularly_ \- if you route (for example) JUL through SLF4J, you are not allowed to route that output back to JUL, otherwise messages would never be dumped to output.

<comment><USER15> That's why I said that you have not used it in anger in production environments. Anyway, good luck.

</comment></comment></comment></comment></comment></comment></comment><comment><USER16> Archive.org cached version: [https://web.archive.org/web/20160505153552/http://www.russet...](https://web.archive.org/web/20160505153552/http://www.russet.org.uk/blog/3112)</comment>


Google OnHub Review - <AUTHOR> http://www.theverge.com/2015/8/31/9228739/google-onhub-router-wifi-review <comment><USER3> What I'm most concerned about, as somebody switching back to a Windows Phone soon, is the apparent lack of a web interface for the OnHub. According to this page [1] the OnHub requires an Android or iOS device, with the app installed, to setup and configure the router. I don't blame Google for not supporting Windows Phone, the market share is still very low, but I'm not convinced that requiring an app instead of using a web interface like every other router is what I want from this.

[1]: [https://on.google.com/hub/support/#get- started](https://on.google.com/hub/support/#get-started)

<comment><USER4> Apple Airports all require apps. There's no web interface. They have Windows, OSX, and Linux apps.

I agree with you I prefer a web interface. Just pointing out that there is a pair of very popular routers that don't have one.

Fortunately they also don't need internet which it sounds like the OnHub currently does? In other words if I'm doing some kind of installation that users a router without internet I can still configure an Airport but if understand correctly I could not configure an OnHub ... yet?

<comment><USER5> >They have Windows, OSX, and Linux apps.

That's sort of a crucial distinction. You have to run the application, but pretty much everybody has something that can run it. That's very different than requiring an application that only runs on mobile devices, and even then only _some_ mobile devices.

I'm actually not seeing a Linux version of the Airport utility anywhere, although apparently the Windows version pretty well with WINE.

<comment><USER6> I spent an hour fighting with the Airport utility in WINE a couple months ago. It launched, but I had issues discoving the Airport. Eventually I caved and had a non-technical friend with a Macbook configure my router for me. </shame>

</comment></comment></comment></comment><comment><USER7> Worth noting that Ars also reviewed the OnHub [0] and weren't all that complimentary about it.

Particular negatives were the price tag, single LAN port, poor wifi performance (particularly important if you're not supposed to use wired Ethernet...) and no web interface.

[0]: [http://arstechnica.com/gadgets/2015/08/google-onhub- review-g...](http://arstechnica.com/gadgets/2015/08/google-onhub-review- googles-smart-home-trojan-horse-is-a-200-leap-of-faith/)

<comment><USER8> Not sure I would put much weight in an article with a click-bait label like "Google's smart home Trojan horse". I know there are many that are suspicious of this, but a site like arstechnica putting this in the title when it's, at best, speculation seems a bit sensationalist.

<comment><USER9> In context the Trojan part of the title is: _Google's smart home Trojan horse_.

It's a Trojan horse because it is their way of rolling out "connected-home" devices without people having to decide to "move to a connected home". That's what all the non-enabled sensors and hardware are for.

It's a smart play on Google's part, and Ars is correct to note it.

It doesn't mean it is malicious in anyway.

<comment><USER10> Smart or connected home stuff has never been about moving to such a home, its always been ways to enhance an existing home, so its bizarre to describe what you put out as unusual in anyway.

And, "Trojan horse" _always_ implies malicious deception; its an inappropriate metaphor for any other intended message.

So, I'd say this is _doubly_ misguided.

<comment><USER9> > _Smart or connected home stuff has never been about moving to such a home, > its always been ways to enhance an existing home, so its bizarre to describe > what you put out as unusual in anyway._

[0] would disagree:

 _" more elaborate systems could easily reach up to $1000 if you have a lot of hardware to install and don't shoot for the cheapest units you can get. Putting in a smart switch in three bedrooms, a living room and a kitchen can be $200-250 by itself, and that assumes a fairly spartan set up and excludes any power outlet installations. Be sure to tally up all of the parts you'll need before you start buying anything."_

> _" Trojan horse" always implies malicious deception; its an inappropriate > metaphor for any other intended message._

It's commonly used in this way. [1][2][3] are good examples.

[0] [http://lifehacker.com/how-can-i-get-started-with-home- automa...](http://lifehacker.com/how-can-i-get-started-with-home- automation-510246491)

[1] [http://www.taniaellis.com/blog/the-trojan-horse-changing- bus...](http://www.taniaellis.com/blog/the-trojan-horse-changing-business- from-within/)

[2] [http://www.huffingtonpost.com/seth-schachner/a-trojan- horse-...](http://www.huffingtonpost.com/seth-schachner/a-trojan-horse-called- tidal_b_7163438.html)

[3] [http://www.techrepublic.com/article/microsofts-trojan- horse-...](http://www.techrepublic.com/article/microsofts-trojan-horse- strategy-to-rule-the-world/)

</comment></comment></comment></comment></comment><comment><USER11> ~3 weeks ago I upgraded to an industrial-quality Cisco Aironet 1252AG access point (no -ac but it does -n 300Mbps just fine), that I got off eBay with power supply for a grand total of $60.

I'm a big fan of separating the NAT/router functionality from access-point functionality, and my core "router" is a Ubiquiti EdgeRouter (X right now, used to be the Lite).

I'm also a big fan of tweakable routers/APs (I formerly wouldn't buy something unless it could run DDWrt or OpenWRT) and have a couple storage tubs full of various wireless gear, including an Asus AC68U and the Ubiquiti Unifi-LR (running OpenWRT) that was formerly my main AP.

Despite all of this, I have an OnHub on preorder that should get here tomorrow, and I'm excited. There's tons of promise for this hardware, including home automation features that haven't been implemented yet - <USER2> despite what one review said, you _can_ use it just as an AP - that's what "bridge mode" is.

However, I'm going to run it in parallel with the Cisco AP for a while before moving all my stuff over. Always have a fallback plan...

<comment><USER12> Sorry this is a bit off topic, but - What made you move away from the Unifi LR?

I'm actually going to be upgrading my networking equipment soon and was considering doing an edge router x and a unifi LR - I've deployed a few LR's professionally and found them very stable with far reaching quality signal.

Was there an issue you ran into with the AP, or did you just want something more that it couldnt do?

<comment><USER13> Do you have access to the UniFi beta forums?

I've _heard_ that UBNT is going to release some new UniFi APs soon-ish-ly. You might want to consider waiting to see their specs and price point before performing your upgrade.

</comment></comment></comment><comment><USER14> This review seems based purely on one anecdote. I'm curious whether the antenna positions on his Asus were partly to blame.

The Wirecutter review [1] was a bit more negative on performance.

But, even with Wirecutter there's not much consistency in review quality with APs. I usually trust the methodology of Wirecutter but Smallnetbuilder has the most comprehensive coverage I've seen and they rate the Wirecutter top pick (the Archer C7/C8) quite middle-of-the-road for its class. I'm interested in what SNB's test results say once he tests the OnHub.

[1] [http://thewirecutter.com/reviews/best-wi-fi- router/#](http://thewirecutter.com/reviews/best-wi-fi-router/#)

</comment><comment><USER15> Seems pretty lacking. The best dual band routers have MU-MIMO, the ability to talk to multiple clients at once without making them each take a turn, or at least send an extra spatial channel to help reception with more limited SU- MIMO clients. This which would go nicely with the support in the Nexus 6, it's a nice advantage iPhone 6 doesn't have, but I don't see it mentioned or listed for the OnHub.

The reviewer points out the disabled USB, so no storage options, and lack of ethernet ports. For routers that don't have MU-MIMO, the best ones right now are tri-band (one 2.4GHz, one low 5GHz, and one high 5GHz channel) and the OnHub is only dual band.

There's also no mention of open source firmwares and distros like some routers make sure to mention they support ("open source ready" WRT routers by Linksys). So this product seems like a failure in the $200 router segment according to features power users care about.

I guess maybe a rich consumer willing to pay the price tag despite the lack of features might go for it, though. The claim is that the design is unique, but D-Link has had similar design for a long time. Here's a round router of theirs from 2 years ago: [http://www.pcmag.com/article2/0,2817,2422521,00.asp](http://www.pcmag.com/article2/0,2817,2422521,00.asp)

<comment><USER16> Disclaimer: I work for Google, but not for OnHub and know nothing about it that hasn't been made public.

TBH, this comment reads a lot like "No wireless. Less space than a nomad. Lame." [1] I'm not sure why you would buy an OnHub if you wanted to put your own distro on it (that's clearly not the target audience), USB is only disabled for _now_ (why have it there if there were no plans to use it?) and The Verge notes that the connectivity is very good, which is what I think the target audience very much does care about.

[1] [http://slashdot.org/story/01/10/23/1816257/apple-releases- ip...](http://slashdot.org/story/01/10/23/1816257/apple-releases-ipod)

<comment><USER17> This router [1] can do everything yours can, costs the same, integrates with an existing ecosystem of smart home devices, can be used as NAT, VoIP server (with their own app), is moddable, etc.

Your connectivity is worse than competitors (especially the LAN-port is an issue), and it has less features.

If you don't change something in either functionality or price point, the OnHub will end up like the Nexus Q – beautiful device, practically useless, economic failure.

[1] [http://en.avm.de/products/fritzbox/fritzbox-7490/](http://en.avm.de/products/fritzbox/fritzbox-7490/)

<comment><USER18> You've written the same comment several times now, so I'd like to point out a few things:

1) The Fritz!Box seems to be much more focused on telephony, rather than home automation.

2) Many of us do not like modem functionality integrated with our router (I have a Docsis 3 cable modem).

3) Fritz!Box doesn't have a Zigbee transceiver, which seems to be the technology ideally suited to home automation(replacing de facto standards that have been around for years, i.e. zwave).

Just so we're clear, I have no interest in Onhub, and would never consider letting Google have access to my router firewall.

<comment><USER17> Yes, but now you have to see that in some countries, like Germany, the standard router you get from your ISP is the Fritz!Box 7490 – if you already have that, the OnHub is literally a waste of money, because it does everything slightly worse.

One thing the Fritz! System does to retrofit existing devices with "smart" capabilities is that it also allows you to use socket adapters [2] to old stuff, so you can automatically turn on / off devices like your sprinkler, etc.

In general, it uses DECT (or WiFi) for home automation, which also allows you to connect normal phones, babyphones, wireless cameras, etc to it.

[1] [http://en.avm.de/products/fritzpowerline/fritzpowerline-546e...](http://en.avm.de/products/fritzpowerline/fritzpowerline-546e/)

<comment><USER13> > [I]f you already have [the Fritz!Boz 7490], the OnHub is literally a waste > of money, because it does everything slightly worse.

Don't take this the wrong way, but this is pretty much equivalent to saying "If you already have a good router that you're happy with, a similarly priced router with similar features and performance will not interest you.", which is a statement that should surprise no-one. :)

<comment><USER17> Well, it wasn't a "this device is shit", more a "well, the OnHub isn't really filling any niche, nor disrupting the market – it's a mediocre product in an oversaturated market".

<comment><USER13> > Well, it wasn't a "this device is shit"...

That's not how I interpreted it. ;)

The situation in Germany appears to be _very_ different than the situation in the US. If folks get a router and/or AP from their ISP it's almost always a flaky pile of shit.

If this doesn't become yet another abandoned project with in a year (or vaguely-rubber-stamp compliance effort inside of two), the Google folks will likely put a sizeable chunk of R&D effort into ensuring that they push the state of residential wireless APs forward.

As it stands now, there are _ALL_ _SORTS_ of really cool things that WiFi APs should do, but just fucking don't for reasons that are beyond my comprehension.

<comment><USER17> Well, except for the Fritz!Box, all other routers we get here are also shit. But the Fritz!Box is something special xD

AVM, originally a huge advertising company on German BTX (a kinda internet before the internet), became large with modems and home phones, so their routers are an extension of that.

And, well, as all devices are assembled in Germany, the price tag is usually accepted, as you get the best of the best out of it – the routers are prolly gonna last a lifetime.

But yeah, Google OnHub might have some potential, but if the ISPs in the US didn't give their users a Fritz!Box in the past decade, they won't give them an OnHub either.

And only for Google Fiber or self-bought seems pretty... wasteful.

<comment><USER13> > And only for Google Fiber or self-bought seems pretty... wasteful.

Eh? If your current wireless router either sucks or dies, then you're in the market for a new one. When it comes to networking gear, it pays to pay for quality. Not everyone knows that, but many people do.

> ...if the ISPs in the US didn't give their users a Fritz!Box...

It seems that the only people I hear talking about Fritz!Boxes are Germans. I've known many techies with many strange devices, but I've _never_ seen a Fritz!Box in person. Their fame _might_ be restricted to Germany and maybe neighboring countries. :)

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> _> But I've had zero issues with the OnHub: coverage has been shockingly good, I haven't needed to use the wireless repeater at all, and the interference I saw with the baby monitor has disappeared. In areas that were formerly dead zones, the OnHub has given me enough bandwidth and throughput to stream 4K video, even in my basement, a full two stories below my office. This is despite putting the router in a less-than-ideal location: upstairs, in my office, far from our general living areas._

This is what I was hoping for. It seems every router I've tried -- and I even have the ASUS RT-N66U, which is supposed to have great coverage -- never fails to have multiple bad spots in our home (and it's not that large).

If OnHub has the advertised coverage, it may set a bar that hopefully other manufactures will be forced to follow.

<comment><USER19> Have you considered either doing actual ethernet or failing that powerline ethernet?

A lot of these dead spots are caused by the physical materials or distance of the property, which often cannot be overcome WELL unless you used directional antennas, or exceeded the legal power of your WiFi equipment (which can sometimes cause overheating or signal issues).

Instead of trying to break through the dead spots with better and better WiFi, maybe you should just cut your losses, get wired internet onto the other side, and then set up an inexpensive AP there to complete the coverage picture. If your budget is $200, then you could easily do powerline ethernet and a cheap AP.

Just a thought...

<comment><USER8> I've tried multiple solutions, actually. Re: ethernet, everything that _can_ be ethernet in our home, _is_. All of our consoles & desktops are on ethernet, as is our printer. Fortunately our home was built with ethernet installed.

The problem is my laptop and handheld devices (which don't support ethernet obviously). For these, we've tried various routers, multiple locations for the router (though this is somewhat limited), and even setting up multiple access points.

The problem with access points, is that WiFi devices are notorious for hanging on too aggressively to the wrong (weaker) access point. So we found we were frequently having to manually switch between the access points. So I gave up with that, and decided to go back to a single router.

Which is why, as you say, I keep shopping for better and better WiFi.

<comment><USER13> This feature may be present in other manufacturer's devices, but I know that Ubiquiti's UniFi APs let you set a minimum client signal strength [0], below which the AP will disassociate the client. [1] Folks in the support forums report that this works really well, but that you _do_ have to play around to find the right setting.

The three downsides to UniFi APs are:

* There is controller software which is required to configure (but not _run_ ) the APs.

* The price of the UAP-AC v1 and v2 models.

* Every AP setting change requires that the controller reboot the affected AP. The APs take ~60 seconds to reboot.

The controller software is reasonably well done [2], easy enough to use, and makes managing a swarm of APs pretty easy. I fire it up when I need to change channel settings or add an SSID or whatever and shut it down afterwards.

I _hear_ that Ubiquiti is going to be releasing some new, lower-priced 802.11ac units soon-ish-ly that aren't _much_ slower than (and are _much_ less power hungry than) their existing 802.11ac units. So, if you want to give their hardware a try, you might want to wait until the new units are released. (Edit: Unless -of course- you don't care about 802.11ac, in which case I hear good things about the UAP-Pro, which does 2.4 and 5Ghz 802.11n.)

If you have questions about the APs or controller software, feel free to ask.

[0] AKA RSSI.

[1] The idea is that the newly-disassociated client will search for a new AP to attach to, find that the one it was ignoring has better signal strength after all, and attach to _it_ , rather than the previous one it was attached to.

[2] It's some Java software that presents a web page on localhost that you log in to to manage your existing APs and adopt new ones that you've attached to your network.

</comment></comment></comment></comment><comment><USER20> Several people are complaining about the lack of ethernet ports.

Back in 2012(?), Apple came out with the MacBook Air, which did not have an optical drive. Everyone was up in arms: NO OPTICAL DRIVE?!? Has Jobs lost his mind??!? I was the same: what the heck? How will I get along without an optical drive?!?

Then I thought about the last time I used the optical drive on my MBP. After a bit of thinking, I realized that I had basically never used it in the ~4 years I had that MBP! I had been lugging around an optical drive, which I had used zero times! Then it dawned on me: I've been getting along fine without an optical drive.

Something tells me that the story will be similar with ethernet ports. Most of our devices today (laptops, tablets, phones) don't use wired ethernet. Ye cranky old desktop does, but..... what if you could put a $50 ac card in it, and presto, no wires!

<comment><USER21> I see the point, but can't those people just throw on an extra hub?

</comment></comment><comment><USER22> Single, non-functioning USB port is disappointing. I'd hope for a $200 router that I could at least get a NAS out of it.

<comment><USER23> This is a Google product. NAS isn't cloud-dependent, and it keeps data out of their hands. So probably not going to happen.

<comment><USER17> Yup. Another feature competitors have, that we won't see here, is integration with VoIP and phone apps – if someone calls your home number, you can respond on your mobile. You have an app where you can see who called when – and listen to the recordings of the answering machine. Essentially competitors have self- hosted Google Voice, Google has... well, US-only Google Voice.

<comment><USER24> Since you're quite obviously an AVM fan (given that you promote their product all over the thread) and it seems you're referring to them here as well (the "phone app" integration is a historical emphasis/accident of that company, given that they got into the DSL-Modem business by expanding from their telephone systems and ISDN cards, and much more of an issue for them than for any other vendor of dsl/cable/wifi modem/router thingies):

Outside the German (speaking) market AVM doesn't matter much. And looking at the tiny selection on the German version of [http://store.google.com](http://store.google.com), the German market doesn't matter much to Google.

That's market segmentation at work, and OnHub likely won't be a threat to your favorite DSL modem brand (and it isn't a DSL modem, btw)

<comment><USER17> Well, it's not my favourite brand or anything, the issue I'm just seeing is that I'd like to see a good deal from Google.

And what we're seeing here is that a lot of people say "this router is awesome", "it does so much and is so cheap", "there's no other router with that performance", and I'm just here, facepalming.

It's an upper-mid-range device in an oversaturated market, not something worth hundreds of reviews and articles.

Tbh, I don't care about AVM – the Fritz!Box 7490 was just the first router I could find with a similar featureset and similar price.

Also, the Google Store is even more empty in many other countries – US, Canada, sometimes UK, NZ and AUS get the nice products. Some european countries still have no Google Books, Google Movies, Google Music, or even the ability to buy Nexus devices.

</comment></comment></comment></comment></comment><comment><USER25> If ease of setup and attractiveness of the device are the issues, Apple has been making AirPorts a long time (at a similar price point, I'll add).

<comment><USER26> Agreed. However, Apple has a nasty habit of disabling features (such as power settings) and making the control software less and less friendly. I love my Airport Extreme it's software doesn't do everything that the OnHub software does. Some things I would really like is the ability to quickly see who/what is connected to my network, some history of connections, and even a way to tune QOS for specific devices (i.e. my Roku boxes should have more bandwidth than my phone).

</comment></comment><comment><USER27> Sorry, but this device is idiotic. It gives Google the ability to entirely remotely control your network from outside, is entirely designed to facilitate their own services, and will become a privacy nightmare ... because if they can access it, someone else can, and law enforcement will be able to go to them and say "OK, we need access to that network, you have to give it to us".

This is the "bend over and take it" device which puts control of your home network in the hands of Google .. primarily to benefit Google.

This is a terrible idea, and it's not something I'd trust even a little. This is all about locking you into Google, and making it easy for them to manage your home remotely.

I would put absolutely zero trust in this device.

<comment><USER28> From the privacy policy:

"Importantly, the Google On app and your OnHub do not track the websites you visit or collect the content of any traffic on your network. However, OnHub does collect data such as Wi-Fi channel, signal strength, and device types that are relevant to optimize your Wi-Fi performance."

The first sentence is even bolded for emphasis.

<comment><USER29> [https://support.google.com/onhub/answer/6279845?hl=en](https://support.google.com/onhub/answer/6279845?hl=en)

DNS Settings While OnHub doesn't track the websites you visit, your DNS provider can associate your web traffic with your public IP address. OnHub sets your default DNS provider to Google Public DNS. (This can be changed in the Advanced Networking settings of the Google On app.) Google does not associate Google Public DNS information with your Google Account. Learn more about Google Public DNS.

We are constantly working on new features and controls that help you get more out of your OnHub. It's possible that, in order to implement these new features, we may need to change the way it collects, stores, and uses data.

Jump over to Google DNS [https://developers.google.com/speed/public- dns/privacy](https://developers.google.com/speed/public-dns/privacy)

For what they keep permanently. (Network AS and requested DNS Site, with my home business account, that is enough to uniquely identify my houses traffic)

<comment><USER30> (Tedious disclaimer: my opinion, not my employer's. Not representing anybody else. I'm an SRE at Google, and my team is oncall for public DNS.)

I believe you have misunderstood what a network AS number is. This identifies your ISP, not your account. So the permanent logs would say something approximating "a level3 user queried news.ycombinator.com".

</comment></comment></comment></comment><comment><USER31> I'm gonna be that guy.

I can't trust Google with my router.

<comment><USER32> Cool. Out of curiosity, who do you trust in this domain?

<comment><USER31> A router where I can install DD-WRT.

<comment><USER32> I see. Makes sense to me. I'm glad there are people who love to tinker, test, and modify. FWIW, no steps were taken to prevent installation of DD-WRT or any flavor of Linux. There are no carriers to de-certify the device, just the FCC. There is a developer mode. More details to come. You can install whatever you want, just like with an Android or CrOS device.

</comment></comment></comment></comment><comment><USER33> I have an Apple Extreme which is good, but getting a bit up there in age. Might hand it off to my parents and upgrade to this. My experience has been that investing in good routing hardware makes my life much more pleasant. Internet when I need it, and none of the nonsense. When I've had cheap hardware in the past (growing up, in college), I feel like I was constantly battling it to get it working -- ddwrt or not. I actually inherited a nice Apple Extreme when my startup graduated to pro-grade networking hardware, and I've loved using it.

</comment><comment><USER34> I am not worried about the lack of extra ethernet ports, or internal storage as most content is moving to the cloud and off-site backup and video security is a best practice.

What do I find to be missing is a backup WAN, ideally 3G/LTE cellular modem via USB. This is important if you are setting, say, Dropcams for security while away from home -- in addition of backup power.

That's one thing I do like about Peplink/Pepwave routers, such as the Balance One or Pepwave SoHo -- I am curious to hear anyone's opinion on these devices. Granted, Peplink goes a level further with extra WANs to increase bandwidth and allow business continuity.

I assume Google may actually add this functionality on the USB port, and I think this would be more important than storage.

</comment><comment><USER35> My take has been that this is basically a combinatition of a smart hub (like wink and smartthings) and router/access point. The real question I have is whether radio level integrations for IoT really makes sense. The good news I suppose is that a lot of heavy hitters are following google. The bad news is that a lot aren't. As a consumer, there aren't that many use cases where I really need a radio level integration as opposed to something over the web (or even if it stays in my local network) so I would argue this is going to be a bit of a mess. With that said, if I were Wink I would be more afraid of this than if I were Linksys...

</comment><comment><USER36> Would be nice if there was an additional model that had a built-in DOCSIS 3.1 cable router.

It's cute that Google is going for "something you'll want to leave in the middle of the room," but cable modems make that a non-starter.

<comment><USER37> What's the difference between routing a coaxial cable to the middle of a room versus an ethernet cable? At least you can get long flat ethernet cables.

<comment><USER38> I think there's insufficient difference, and that's the original poster's point.

The fact that the device is aesthetically pleasing isn't a misfeature (other than perhaps bumping it in the cost bracket, if it even did so). But as long as it's connected to a bulky, obnoxious Surfboard by a physical cable anyway, it's not something you'll be using as a room centerpiece unless you intend to put an unusual amount of work into cable-routing.

<comment><USER37> I think I was being misunderstood.

Even if it wasn't connected to a surfboard (assuming the OnHub was also capable of being a modem), you would then need to route a coax cable to the middle of the room. There's 0 reason to keep the surfboard physically close to the AP, and IMO, it's preferable to not keep it close (because that way I can keep my network switch near the modem instead hidden behind all my electronics never to be seen). Either way, you will be routing a cable to the center of the room, you're just deciding whether you're routing a coax cable or an ethernet cable.

<comment><USER13> I know from experience that _I_ would rather run Cat5 than coax to the center of a room. :)

</comment></comment></comment></comment></comment><comment><USER39> I think the main reason I probably won't be getting an OnHub (for myself at least -- it might be perfect for my parents) is my love of tinkering and learning networking. I like that firmware like DD-WRT lets me poke around at the internals, and actually calls features by their standardized names instead of some made-up copyrighted marketing name.

<comment><USER40> I'm no DD-WRT fan: I find the interface is inconsistent and ugly. And the support forum is full of aggressive bofhs.

<comment><USER39> The interface is definitely not going to win any Awwwards. The feature set, though, is one you'd usually have to pay a considerable amount more to get directly from a router manufacturer.

<comment><USER40> The feature set, yes, but definitely not the interface.

</comment></comment></comment></comment><comment><USER41> Good throughput?... This review says otherwise. [http://arstechnica.com/gadgets/2015/08/google-onhub- review-g...](http://arstechnica.com/gadgets/2015/08/google-onhub-review- googles-smart-home-trojan-horse-is-a-200-leap-of-faith/)

</comment><comment><USER42> hmmm, just bought the Nighthawk X6 AC3200 and it is still unopened. I think I will keep it and wait for another rev on this.

Anybody has any opinions on the X6 AC3200? Bought it for $399 based on "I don't want to have Wi-Fi problems at home" (tons of devices, works from home, etc. etc.)

<comment><USER43> There are 237 critical reviews of the Nighthawk on Amazon, with problems like needing daily reboots and the 2.4GHz network maxing out at under 15mbps repeated across reviews, where the cheaper router it's replacing had no such problems. All of the consumer AC3200 products have similar high percentages of negative reviews, probably because they largely share the same chipset. I wouldn't spend $300 on something that'll create more problems than my current $20 N router, and it appears there's a high probability of that being the case with that product.

</comment></comment><comment><USER44> Sorry, I'm not trusting Google with my edge device under any conditions. I'm not even trusting Google as an AP hardware option under any conditions.

Google has too much to gain from farming data right at the network level, they have no business being on any home network.

<comment><USER32> If you see Google as an adversary, then this is a great position to take.

<comment><USER44> It's about being realistic, you _are_ the product for most of Google's services. This will no doubt be any different.

If you see Google as your "friend", then your minimal and non-contributing comment could be considered of value. I see that you just made this HN account, and appear to be astroturfing for this new device. Mind explaining to HN why that's the case?

<comment><USER44> As figured, the user has gone inactive since the Google device has gone off the front page. Can we get an HN mod to look at this user?

</comment></comment></comment></comment><comment><USER45> The main dealbreaker for me here is the lack of ethernet ports. I currently have a Sonos bridge and a NAS device plugged into my router.

The lack of a web interface is also a problem, but should be resolved at some point based on other comments in this thread.

<comment><USER46> You should be able to pick up a 5-port gigabit switch for around $25.

<comment><USER47> But you shouldn't have to. This is a $200 router.

<comment><USER13> I would rather have my LAN stay up while my router is rebooting than save a slot on a power strip. Perhaps I am in a minority.

<comment><USER45> What does it mean for your LAN to stay up if your devices connected wirelessly lose connectivity and the other devices on your LAN lose Internet access when your router goes down?

<comment><USER13> The majority of the devices on my LAN are wired and -even though this _might_ not apply to OnHub users[0]-, my wireless APs are also attached to a switch. So, what it means for _my_ LAN when my router reboots is that the LAN loses Internet access [1] for about a minute.

[0] I guess we don't know how sophisticated the link handling is in the OnHub. It might be able to keep the AP active and pass traffic through it (and its LAN port) while restarting the OS and do similar things while restarting the AP. The marketing copy _does_ make it sound like you'll get near-constant connectivity, no matter what the software on the thing is doing, and I _have_ seen (ages ago) NICs that would do basic packet handling even if the machine they were attached to was powered down.

[1] And -I _think_ \- all uPnP-initiated port forwards.

</comment></comment></comment></comment></comment></comment><comment><USER48> Interesting, even though there's only an app interface your router must be acting as a pure API. The question is what kind of API is it providing?

Can you update your routers firmware through your phone app for example?

</comment><comment><USER49> When I saw this, the first thing that came to my mind was Amazon Echo and whether Google had come up with a smart router that embedded Google Now features.

</comment><comment><USER50> I want to know how much of a difference in terms of speed/range was observed by the author when compared against the Asus router.

</comment><comment><USER51> All these comments, while interesting, miss the point: how on earth does one trust Google with their router? Google makes some great products but their entire business model _requires_ them to hoover up more & more data from customers.

That's not a company whose products I want to use anymore. Not for email. Not for search. Not for a thermostat. Not for a realtime JSON database. And not for listening in to all the data in my house.

<comment><USER52> > That's not a company whose products I want to use anymore. Not for email. > Not for search. Not for a thermostat. Not for a realtime JSON database. And > not for listening in to all the data in my house.

While I can't say I disagree with your point on Google's incentives being exactly the opposite of absolute privacy, you're clearly in a tiny, tiny minority. Even assuming that the majority of users simply aren't aware of this (which is a faulty assumption in my opinion), there are many (myself included) who have simply accepted this and go about our lives, preferring to have a simpler, easier to use life than obsess over every single privacy concern.

<comment><USER53> I'm guessing you were born after the Berlin Wall came down, and missed all of the palpable Western demonstrations of just how fragile freedom is, and just how dangerous it would be to build a turn-key surveillance state.

In my experience, the people who "don't care" (as opposed to simply not understanding the insanely complex topic) are the people who:

1) benefit from it, e.g., SaaS/startups heavy on analytics, and

2) lack the context to understand that the current state of Western civilization is not in any way immune to regression, and

3) don't understand how their own actions can in fact induce that regression by creating a high-value turn-key totalitarian system ready for the taking,<USER2>
4) don't understand that their actions are _already serving this purpose_ in more totalitarian states outside of the USA.

That's even ignoring the implications of __massive__ information asymmetry when it comes to negotiation between corporations and individuals.

<comment><USER54> You think you care, but you have no idea who gives you privacy. Maybe you trust Apple, but have you seen their code? What if snarfing your data leads to better data for siri? Then let's not talk about the millions of small sites snarfing your data as you browse through the web, none of them beholden to sarbanes-oxley, your cell phone conversations which are snarfed by your carrier and aggregated with geo data and sold to the highest bidder, providing billboard locations that maximize demographics. You say you care about privacy, but you have no idea that you have no privacy. You may hate google / think you're maintaining your privacy by warning people about google, but it's just the beaten horse that you beat to make you feel better. It's the bright colorful logo in your face that you see, but that's the tip of the ice berg. In short you are ignorant and lashing out and making no difference whatsoever. Google's just easy to attack because it's more up front regarding how it uses your data, you can login to your dashboard and see everything. Your cell phone carrier and friends, Apple, not so much. Don't remember seeing their dashboards with the data they collect on you. So, continue on pretending like you are making a difference.

</comment></comment></comment></comment><comment><USER55> This device is one these things that are not missing in your life until you realise that they exist.

</comment><comment><USER56> After helping people setup Chromecast and running into many issues that were 100% related to the design of the thing, I am skeptical at best.

And when the Internet isn't working I don't want to troubleshoot a blackbox cylinder of a device with only a single status light.

No web interface, configured using an app? Let's hope they have done better QA than their other products.

<comment><USER57> >After helping people setup Chromecast and running into many issues that were 100% related to the design of the thing,

like what? I've setup two of them in my house and never had a problem.

</comment></comment><comment><USER58> Seems like it requires too many dependencies. Give me an independent interface any day.

</comment><comment><USER59> The term "privacy" and "security" are not mentioned. TDangerousDR;

</comment><comment><USER60> soooo, no words spent on privacy? this is akin to paying someone to build a fence and gate for you, and then making sure they have a copy of the key at all times, and never asking them what they do with it... rhetorical question here, is it common practice prefer Internet servers which look cool and cost a ton and are managed by Google, and not discussing privacy issues? the consumer is being transformed into a marionette, and the issue isn't even mentioned in this article. beyond frustrating that it has come to this.

<comment><USER61> > soooo, no words spent on privacy?

It's The Verge. Personally I glance their reviews for nice videos and pictures, but that's it.

<comment><USER60> Fair enough, all things in context :)

</comment></comment></comment><comment><USER62> I've seen a lot of complaints about this router only having one ethernet LAN port. This really could just be an issue of different use cases, but are there a large amount of modems out there that don't have plenty of ethernet ports on them? I have never needed to plug in anything to my router that I can't just plug into my modem, but I'll be the first to admit that I don't connect too much to either to begin with.

<comment><USER7> If your modem (which isn't really a modem if it has >1 LAN port) is plugged into the WAN port on the OnHub (or any other router), anything plugged into the ports on the modem will have trouble seeing things on the LAN because of NAT and firewall rules.

<comment><USER63> Has nothing at all to do with either NAT or the Firewall rules; it has to do with routing. Assuming your modem/router has this capability, all you should need to do is set up a static route pointing to the network/subnet that the devices behind the other router. You should not need a corresponding route on the other router because since it's on both networks, it already has a route to the other network. Even if it didn't, the default gateway on the router is the modem which can take care of routing the packets correctly. This is all assuming that the modem/router combo is assigning an IP on a private network/subnet to the additional router.

</comment></comment></comment><comment><USER64> It is a spy device to peek inside your home and your internet usage to 'improve' the quality of ads that you see.

The fact that it has sensors scares me.

Sure they can adjust the brightness of that ring with the ambient sensor.

What I would do if I ran an ad company is use that sensor to find out what time you turn off the lights and go to bed. And what time you wake up. And then send you more relevant ads.

Or use the bluetooth in it to find out what devices you have at home, or what car you drive. Or what IoT devices you are using.

And I would use the microphone to find out how many people are in your home. Or if you have kids, and how many.

<comment><USER65> It is mentioned in the article that the OnHub lacks a microphone.

<comment><USER66> Every speaker is a microphone, just not a good one. Would be hard to tell if it can listen to it.

<comment><USER67> Every ceramic capacitor is also a microphone. Better dust off the tin foil.</comment></comment></comment></comment>


Why I left Mac for Windows: Apple has given up - <AUTHOR> https://char.gd/blog/2017/why-i-left-mac-for-windows-apple-has-given-up <comment><USER2> [https://news.ycombinator.com/item?id=13797042](https://news.ycombinator.com/item?id=13797042)</comment>


Threads.js, Make web workers and worker threads as simple as a function call - <AUTHOR> https://threads.js.org/ <comment><USER2> Im happy with the non-threaded design of JS. It makes it easier so reason about the potential number of states the program can be in.</comment>


Ask HN: What is that blog platform with runnable/editable code chunks? - <AUTHOR> It was relatively popular on here a few months ago, a kind of medium-style site but the twist was you could run code examples, edit variables and indeed edit/fork the whole source. Often used for explanations of programming or statistical concepts. For example I saw one for COVID-19 where you could adjust variables like R to see a live update of the drawn curve, and run simulations of people interacting with various rates of transmission etc. Googling various related terms has not shed any light... <comment><USER2> Sounds like [https://observablehq.com/](https://observablehq.com/) ?

<comment><AUTHOR> That's the one! I should have been googling some combination of 'notebook' and 'magic' it seems. Thanks for your help :)</comment></comment>


What is Albert Einstein's theory of happiness? - <AUTHOR> https://www.washingtonpost.com/news/worldviews/wp/2017/10/24/einstein-scribbled-his-theory-of-happiness-in-place-of-a-tip-it-just-sold-for-more-than-1-million/?tid=pm_pop <comment><USER2> Everyone has their own definition of happiness - happiness can't be measured, but satisfaction can.</comment>


Yes, We Scan (Obama arrives in Germany) - <AUTHOR> http://netzpolitik.org/2013/yes-we-scan-privacy-activists-protest-against-prism-and-nsa-surveillance-as-president-obama-arrives-in-berlin/

<comment><USER2> We Americans should be doing the same.</comment>


Breakdown of Color Preferences by Gender - <AUTHOR> http://blog.kissmetrics.com/gender-and-color/ <comment><USER2> "The most unpopular color for women is orange."

And here we have one explanation for the discrepancy between the number of male and female applicants to Y-Combinator.</comment>


How could a software dev build a bottom-up understanding of quantum computing? - <AUTHOR> I would like to get started with Quantum Computing, I would like to go from Bottom to Top, that is building an understanding from the ground up (instead of Top to Bottom, hands-on first approach, that doesn't work for me). Introductory textbooks? MooCs? Curriculum? Important subjects? Important Topics and concepts? <comment><USER2> An accessible quick introduction. This abstract links to a 19-page pdf:

From Cbits to Qbits: Teaching computer scientists quantum mechanics N. David Mermin

[https://arxiv.org/abs/quant-ph/0207118](https://arxiv.org/abs/quant- ph/0207118)

After that, the textbook by Nielsen and Chuang, Quantum Computation and Quantum Information. It's a big book but the first couple of chapters, 60 pages or so, are self-contained and make a good introduction.

<comment><USER3> I just read that paper for a second time and now I understand QC is magic.</comment></comment>


The first tropical 'metal farm': Perspectives from field and pot experiments - <AUTHOR> https://www.sciencedirect.com/science/article/pii/S0375674218302620 <comment><AUTHOR> Full text available here: [https://espace.library.uq.edu.au/view/UQ:19c7f10/UQ19c7f10_O...](https://espace.library.uq.edu.au/view/UQ:19c7f10/UQ19c7f10_OA.pdf)</comment>


Ask HN: Software Engineering with no post-secondary degree? - <AUTHOR>

So here's the deal: Right now I am in college and due to a maelstrom of recent events including difficulty in non-cs and -math related courses, I'm really not sure that I want to continue studying at a university next year.
While I thoroughly enjoy my computer science and math courses, I find that I just can't keep up with the class. Take my calculus-based physics for example. I'm sure that, given enough time, I could make it through the course and learn everything I need to know; but because I am working and taking 4 other courses, I just don't have that time. I feel that I would benefit a lot more from teaching myself these courses one at a time, i.e. finishing Calculus before I take calculus-based physics. I probably should have registered for the algebra-based course, but it's too late to do that now.
What kind of repercussions (career-wise) would there be if I decided to drop out of school and learn on my own? I might consider coming back after a few years of working full-time, but I really don't know. Is it worth paying for school if I don't feel like I'm gaining as much as I can from it? <comment><USER2> I have no college degree, yet work in jobs surrounded by Ph.D.s. My expertise is valued just as a much as theirs is, and we don't throw titles or degrees around as status symbols. I've been mistakenly addressed as "Doctor ..." on several occasions, either by professional societies or by colleagues who didn't know I didn't have a degree.

I'm 41 and started programming when I was 10, doing assembly language by the time I was 15. I have played with digital and analog electronics since I was 5. I taught myself calculus and numerical analysis at 12. I was, and would still be, interested in computing, whether I got paid or not. If you have that level of passion and self-learning, you can succeed without a degree.

I dropped out of college after 2.5 years. I worked at a gas station for 5 years while continuing to do research and programming at home or during graveyard shift. I finally got a job at a computer company due to a friend. Once you get in the door, if you're good, you can make it.

I've had bad managers in the past who've kept my salary down because I didn't have a degree, and said so in the performance review (one actually used the word "glass ceiling"). I've had other managers turn around and pay twice as much and not care at all about the degree. Given my age and 15+ years of experience in a very specific field of computing, the degree issue doesn't come up much anymore like it did when I was in my 20's and 30's.

Some will not consider your application because you don't have a degree. Some (especially HR types) do it because they don't trust people without degrees. Others do it because they must put a degree requirement on the job due to obscure clauses in labor regulations, e.g., H1B visas, NSF or other grants, or, under some interpretations of US Labor Law, even the "professional" designation for salaried (overtime exempt) positions. Still others do it because they want to set the bar high for candidates, and even if you're more experienced than a Ph.D. fresh out of college, they cannot consider you because then they would have to consider everyone without a degree or face discrimination charges.

That happened to me once -- the hiring manager checked references and knew I was legit, but said that since the originally posted job description said a degree was required, they could not consider me because their HR department was strict on anti-discrimination laws. Another company was working out how to get around the degree requirement but I got a position at another company before they could get back to me.

Someone said "if you don't finish undergrad, you can't go to grad school". Actually that's misleading. You can get honorary Ph.D.'s, or get hired as research staff, if you've demonstrated enough contributions and have a professor who will be your advocate. Not saying it's easy though.

Given the growing backlash against college education (see College Conspiracy: <http://www.youtube.com/watch?v=VpZtX32sKVE> ), and the economic climate, employers seem more willing than before to consider non-degreed candidates who are perfect matches for the job. But they must be very good matches. A computer generalist who is just out of college or never finished college, and doesn't have any special skills related to the job, faces a much harder time now.

<comment><AUTHOR> You know, it's stories like this that inspire me but are, at the same time, somewhat depressing. They make me think of all the things I WISH I had done. I've always considered myself to be capable of doing whatever I want to do, but I've also been pretty lazy. My mom never made me do my homework while I was growing up and it took me until my second year of university (this year) to realize that I really do have to work to get what I want. I like math and I frequently hear stories about people who leaned calculus when they were 11, 12, or 13 years old and I wish that I had even bothered to take some AP math courses while I was in high school. Now I am, quite literally, paying for my mistakes.

Kudos to you friend.

<comment><USER2> My drive was intrinsic, not extrensic. I could have cared less about my parents' and teachers' approval. I did it because of interest in the subject.

Full disclosure: At age 40, I was officially diagnosed with Asperger's. So my case may not be normal.

And by mentioning those "accomplishments", I am not intending to brag. To those like us, the predictability and order of math/CS way more than offsets any difficulty in learning it. And I had problems in English too. History too. Political science was easier, since it was framed in discrete terms (left/right), although personally I am an independent small-l libertarian.

It depends on a large degree of luck, to land where you do. Not everyone in my position will land the jobs I did, due to chance luck. But it is not totally due to luck -- developing connections and establishing a reputation is important.

I wish you the best.

</comment></comment></comment><comment><USER3> First, Let me say that chancing out of my eecs degree after putting in all the pre-reqs and entry level classes was one of my biggest regrets. While years ago I was coined as a true autodidact by everyone I know, learning on my own is indeed slower than class because life distractions make it MUCH easier to stretch something out into months instead of weeks.

Second, unless you have a plan don't drop out. The best advice I've ever received, which I routinely ask myself all the time, is simply, 'Do you have a plan?'. If you've some clear cut goals that you don't need college to achieve then by all means pursue them. But if you don't, that degree will help you lay down the foundation for a path. More specifically, it will open doors for you and is a great networking opportunity.

Lastly, you sound like you are in calc based physics and calc I at the same time? I did this too. Go to the tutoring center in your physics department and get a grad student to help you. The amount of calculus you need to know for physics I is really simple stuff. Don't bother yourself trying to learn _why_ it works, but rather simply learn exactly when and where you need to apply it. By the end of physics I was integrating velocity into position on tests without any clue why it worked.

</comment><comment><USER4> Define your goals and passion. What is it about "Software engineering" that you like the most? Not every kind of software engineering work necessitates all the things you are required to learn over the course of a CS degree. But of course, some do, and some jobs will require you to have a degree. Some won't.

I don't have a great answer for you other than, 1) focus on becoming more efficient at your studies and/or 2) realign/cut back on your course load so that you can actually learn and retain the information. Short of that and you'll just be wasting your time and money.

BTW I have posted a similar question here, coming from a slightly different perspective of one without a CS degree who has somehow wound up in programming. I create some excellent solutions that are valued by others, but wouldn't presume to call myself an "engineer," and I'm fine with that. <http://news.ycombinator.com/item?id=3063828>

</comment><comment><USER5> tl;dr: You can make a go of it.

I've done really well for myself with 2 1/3 years of a degree (in Chinese!) I started off dropping out of Chicago for money reasons, and lucked into a sysadmin/programming job with the University. I was able to move laterally until I found something that fit me better than my original gig; I stuck it out for a few years until the private sector started returning my calls.

I am largely self-taught, which has its advantages and the obvious disadvantages, particularly as how I am the sort of learner who needs the social aspects of classroom interaction to really pick stuff up fast. But I discovered that taking jobs with people who are much smarter than you, and then taking the time to help them with shit work, is almost as good a learning environment as a classroom.

I've bounced around a lot; but not since the first couple of jobs has anybody asked about my incomplete degree. It's a results orientated business; I know that there are jobs that I won't be able to get -- and, to be honest, that I wouldn't be good at -- because of my lack of a formal CS education; but the jobs that I get, I work hard, learn new stuff, and _get shit done_.

But I've worked on really cool stuff, learnt _a lot_ about digital video, started a company, and now am comfortably employed in a position where I can use the social and technical skills that I've developed to really make a difference.

 _EDIT_ : One important thing you need to figure out is how you learn best. Some people clone a github project and just learn Lambda Prolog by reading source; some peruse books; I've meet some wizardly hackers who seem to know every possible thing already. As I said above, I need to talk about stuff to really get it to stick, but that's me. Know how you learn and put yourself in a position to maximize your opportunity to learn, because everybody is dumber and less knowledgable than someone else.

</comment><comment><USER6> This sounds dumb to someone dropping out of school, but if you don't finish undergrad, you can't go to grad school.

Can you get a tech job without a degree? Yes

Can you advance without it? Yes

Will there be non-tech folks that skated through easy majors that look at you askance without it? Yes

But something to consider.... Undergrads are cattle in Most schools. They pay the bolls that keep schools going, but aren't what the professors care about. In grad school I learned and enjoyed the coursework 10x over undergrad. But you need that undergrad paper first. If you can't afford undergrad, do it at a public school.

<comment><AUTHOR> I think I might want to do a grad degree at some point, but I think that is mostly coming from the part of me that wants to impress everybody else.

<comment><USER6> It's a lot of time and money to impress people. Buy Italian sports car instead. Grad school should be about intellectual curiosity first, connections second, and brand third. Unless you get an MBA, in which case the order is reversed.

</comment></comment></comment><comment><USER7> Some jobs artificially demand a degree, as in, the HR department will file your application in the garbage if you don't have one. There may be other ways into those jobs, but to a first approximation, you "need" a degree.

And some jobs flat out don't care about degrees, just so long as you can do the work.

You might consider transferring to a different school. Cornell College, for instance, offers a one-class-at-a-time schedule, so you could do your proposed, "study calculus, then study physics" sequence. And Olin College is reputedly very good for teaching engineering-oriented subjects.

</comment><comment><USER8> Depends on what you want to be. An artist or craftsman needs a good apprenticeship, or perhaps to build a good portfolio, and can easily blow away academic credentials.

But an engineer should have the chops one gets from doing the academic obstacle course.

Good luck.</comment>


Why Pylint Is Both Useful and Unusable, and How You Can Actually Use It - <AUTHOR> https://codewithoutrules.com/2016/10/19/pylint/ <comment><USER3> FWIW, I like pyflakes because of its design philosophy:

""" Pyflakes makes a simple promise: it will never complain about style, and it will try very, very hard to never emit false positives.

Pyflakes is also faster than Pylint or Pychecker. This is largely because Pyflakes only examines the syntax tree of each file individually. As a consequence, Pyflakes is more limited in the types of things it can check. """

<comment><USER4> I have pyflakes as a vim plugin but it is not enough on big projects, as it will not catch import errors (which are the most common code-breaking errors)

<comment><USER5> Yep pyflakes is fast, but the tradeoff is that it does relatively little and can't do cross-file inspections or anything somewhat complex.

It's also even less well-documented, I have no idea if you can even create a custom flake. pylint's got the advantage that as badly documented as it is creating custom lints is supported and normal.

</comment></comment></comment><comment><USER6> > The real problem is the amount of output.

That's a nonsense argument. The output is proportional to the number of violations. If you keep your project clean, then you'll have about a report of about 100 lines showing the statistics, with a one-line message: "your code has been rated at 10/10" at the end.

Of course, if you run it against a project that is full of violations, you'll get lots of violation messages. If you use a linter or style checker or whatever on a project that is full of violations, and it doesn't produce lots of output, then the tool is rubbish.

The right thing to do is to use it from the start and either fix or explicitly ignore any violations as they come up.

The approach described in this blog post is good for existing projects. However, the linked examples disable all warnings and explicitly enable those that the author has deemed important. It would be better to explicitly disable unimportant ones.

<comment><USER7> But having classes without an __init__ method is not a violation. (Amongst several other warnings, like number of methods, size of methods, etc)

Don't get me wrong, pylint is great, but at some point it seems those tools begin to get opinionated instead of helping

<comment><USER6> It's a violation of someone's coding standard, if it's not a violation of yours, then add it to your exclusion list. The point of the __init__ warning is that a class without a constructor might not really be a class at all.

Number and size of methods are both code smells that indicate that you might be creating a God Objects or God functions. If there's a good reason for an enormous function, then violations can be ignored on a case, project or user basis. I'd prefer a tool that can warn about that sort of thing, to one that can't.

Most of the limits are configurable, and set to reasonably generous defaults. Methods per class is 20 and statements per method is 50.

<comment><USER8> This seems like one of those articles where nobody seems to have read past the first couple of paragraphs. It doesn't matter how wonderful the warning about things missing __init__ are if it's buried in a pile of other noise. The noise is the problem, not the specific warnings.

And the author has _already provided_ a constructive solution to the problem other than "not linting", which is to start with a whitelist and slowly crank the linter up, providing instant value and a path to move forward to obtain incrementally more value over time, instead of trying to crank the linter down, which means a lot of work before you're provided with any value, followed even then by, in the real world, probably staring at the list of issues, getting overwhelmed, and deciding the code seems to be working fine the way it is so why bother?

(Remember, we are not superhumans. None of us respond to a list of 20,000 style issues by dropping everything and fixing them all. This is not even wrong; we can not operate like that, so there's no point in pretending that we either do or should.)

<comment><USER4> First thing I do with a legacy code base is to commit it to git, then pass it through pep8 and pylint to get a sense of its level of dirtyness, then run autopep8 to fix all that can be autofixed. Then commit the autofix. Then manually fix the remaining pep8 warnings after muting the ones that are too many. Then run pylint on it. I'll mute some of the most offended violations, and fix the others, so to have pyflakes and pylint run with zero warnings. Then hook the linters in ci, so the dirtyness do not come back through the window.

In this process, I may exclude a folder or two if they are non vital and have a lot of dirty files. I think I have fixed code with nearly 10.000 violations this way, it takes 3 hours max if you use an efficient editor. Then the code is is _some_ shape that you can start working on.

</comment></comment></comment></comment></comment><comment><USER9> I'm also not a fan of pylint - and I just ran it against a small project, 812 LOC of Python.

The code was developed with help of the 'pep8' tool which only finds 12 offending lines we declared ok (all too long, but it's SQL where formatting for readability is more important than 80 chars..) and wlthough pylint gives it a 7.26/10 there's a TON of errors.

So yes, I could now spend a while blacklisting some rules, fixing some stuff, but the defaults are just so bad I won't bother, as usual. Because I think the shape of this code is pretty good.

<comment><USER4> I beg to differ, to me python (and js) are tolerable languages only when they are controlled with linters and automated tests. And pylint is still the best linter for big python projects. It is fully configurable and each and every default rule is interesting per se. For example, a class with no `__init__`, no or too many attributes or methods, is a potential code smell and candidate for refactoring.

<comment><USER10> I don't know any other linter for any other language that complains about too many methods (or too many lines in a method, or too long variable names, etc) in a class. I should know my domain better than pylint.

<comment><USER6> PMD: [http://pmd.sourceforge.net/snapshot/pmd- java/rules/java/code...](http://pmd.sourceforge.net/snapshot/pmd- java/rules/java/codesize.html#ExcessivePublicCount)

Scalastyle: [http://www.scalastyle.org/rules-0.8.0.html#org_scalastyle_sc...](http://www.scalastyle.org/rules-0.8.0.html#org_scalastyle_scalariform_NumberOfMethodsInTypeChecker)

JSHint: [http://jshint.com/docs/options/#maxstatements](http://jshint.com/docs/options/#maxstatements)

</comment></comment></comment></comment><comment><USER11>
      >> configure it with a whitelist of lint checks

I have found Pylint to be very helpful, and always use it on Python projects past the size of a short script.

If you start using Pylint at the beginning of a project, you can blacklist warnings that you want to ignore fairly easily.

<comment><USER12> Agreed. I mean you don't need to follow it religiously, but it's pretty workable with a small blacklist (docstrings, locally disabled, and a few more I don't instantly recall). When the hacks get bad, maybe the odd `#pylint: disable=<blah>` but at least it shows you've though about the pylint warning.

>> If the errors are utter garbage, delete those checks from the configuration.

I've never had "utter garbage" errors. I've had errors I didn't agree with/made the conscious choice to ignore. And I've had errors I thought were garbage, but really I just didn't fully understand them.

(Although I've experienced how applying it to an existing, unlinted project is horrible.)

<comment><USER13> >> I've never had "utter garbage" errors. I've had errors I didn't agree with/made the conscious choice to ignore. And I've had errors I thought were garbage, but really I just didn't fully understand them.

I've had lots of spurious errors with numpy code, where pylint seems to think everything is a list.

<comment><USER12> I've experienced something similar with SQLAlchemy, because of the amount of auto-magical stuff it does. I solved it with `[TYPECHECK] generated- members=query`, although this can be slow so blacklisting SQLAlchemy classes is still an option.

NumPy's `__init__.py` code is a bit messy and manipulates `__all__` a lot [0], so I can understand why pylint (and other static code analysis tools) struggle with it.

Yeah, it's frustrating hitting errors in third party modules, and it's tedious for one person initially to set up pylint correctly, but so worth it for a team.

[0] [https://github.com/numpy/numpy/blob/master/numpy/__init__.py...](https://github.com/numpy/numpy/blob/master/numpy/__init__.py#L183)

</comment></comment></comment></comment><comment><USER14> Why weren't the functionality of those for-loops tested? It seems like a strange thing to burden PyLint with catching.

<comment><AUTHOR> They were tested, but it didn't catch the bug unfortunately. I got bit by the fact that I was testing with synchronous callbacks, but real world use was with asynchronous callbacks.

<comment><USER15> It's an extremely common bug in basically all languages that allow closures to capture "live" variables. Almost every developer that uses any kind of async programming gets bit by it eventually. For-loops and closures do not mix well.

<comment><USER14> The author did not create any closures in the example code. Python only creates a closure for a def in a def.

Regardless, using functools.partial solves that problem: ``callback = partial(print, i)``.

</comment></comment></comment></comment><comment><USER16> Pylint is usable in PTVS projects:

[https://github.com/Microsoft/PTVS/wiki/Pylint](https://github.com/Microsoft/PTVS/wiki/Pylint)

Also Sublime Text has a nice plugin called Anaconda, where PyLint can be enabled:

[http://damnwidget.github.io/anaconda/IDE/](http://damnwidget.github.io/anaconda/IDE/)

</comment><comment><USER17> Like an article that is both for and against it's subject, I agree and disagree. Pylint is painful for the author this time but it should get easier and easier with each project. If you use pylint from the start you won't get bitten by that "mountain of errors" problem and you develop a default .pylintrc file that you can bring from project to project, tweaking as needed.

A (hopefully) short story: on my last contact job I was brought in as a senior developer for a growing Django project that had 0 coding standards. I imposed a small set of coding rules (what I actually did was say we would follow the Django coding style guide, as I've learned over time pointing at an existing, 3rd-party guide means when people get butthurt about having to change a habit they get mad at the guide and not at a coworker) and then added pep8 and pylint to the git commit hook. That lasted for about a day because of the massive amount of errors from pylint (the situation the author describes), so I modified the hook to block on pep8 violations and just give a guilt-trip in pylint errors for the time being. Then myself and a couple of team members who drew short straws sucked it up and actually fixed pylint errors as we went until we could turn pylint back on. We fixed a number of bugs in that process and then going forward pylint started to show it's strength by catching the sorts of bugs the article mentions (and still enforcing a standard coding style so you could no longer look at a file and say "That's tclancy's code" but rather saw "That's our-project's code".

Having pylint in the hook process is better than running it as part of CI or ad hoc because it's run more often, meaning you get hit with a smaller number of errors at once. Having pylint or pep8 as part of your IDE is even better because you fix problems as you go. One of my current side projects is a Django project written by a Rails dev (no idea why) that I do maintenance on. The first thing I do when I open a file I've never seen is get rid of all the red and green squigly lines (or at least look at why they are there). Most of the time it's just a formatting issue but there are plenty of actual bugs it turns up. Just by opening the files to make an update or fix a bug I often wind up improving things people didn't even know were broken as a side effect.

Linters are a good thing. They can always be better and they will always annoy for some idiosyncrasy they have (or you do), but it beats ignorance.

<comment><USER18> I think a formatter is really best. Linters know what's wrong, the obvious next step is to just fix it. I'm not interested in thinking about this stuff anymore, just fix it so I can move on.

</comment></comment><comment><USER19> I use pylama, it wraps pylint and other code checking tools. It also has a cool logo.

[https://github.com/klen/pylama](https://github.com/klen/pylama)

</comment><comment><USER20> I've got my pylint set up to work right from the very beginning of the project, with most rules enabled, so I can keep a fairly clean linted state and never have to play "catch up" to any great extent. (I also use pep8; pep256 and radon to control formatting; documentation and complexity).

I wrote a wrapper around all of these linting tools so I can call them programmatically from the same Python process, and each time a file changes I run my linting tools on _that_ file. (Not the whole codebase). I also intercept the output and re-format it to give a (brief) report in a common format. I can also control thestrictness of linting (i.e. which config file to use) with a YAML-format comment in the file header, so we can write quick prototypes without worrying too much about style then bring them into the quality system on a file-by-file basis.

In this way, linting runs fast enough to be useful in the edit-lint/test loop, and the error messages are both telegraphic and immediately actionable.

</comment><comment><USER21> Using pylint in emacs with flycheck has saved me more hours that I can count debugging simple syntax and other python errors. As the author mentions, whitelisting is the only way to go.

[http://www.flycheck.org/en/latest/](http://www.flycheck.org/en/latest/)

</comment><comment><USER22> Have pylint integrated with sublime and configured it to run checks on every save. Its really a life saver!

Plus if you want to disable some features you can even do it at the local level rather then having a single central rule. eg:- using #pylint: disable=I0011,E0401 in your .py files.

</comment><comment><USER23> Also, now you can use mypy for additional bug catching. Personally I have flake8 + mypy + py.test + coverall + mccabe, running on all my new projects.

<comment><USER20> I've really got to start using mypy. Looks awesome.

<comment><USER23> The concept is awesome, the implementation is less so. There is still a lot of ironing to do. But it does catch many bugs, even when you don't annotate anything. Anyway, it's good tu use it early to help guido fix the last warts.

</comment></comment></comment><comment><USER24> big +1 for pylint - saved my butt more times than I can count.

Subtly, pylint makes it easy to migrate teams to new APIs, e.g. by disallow rules.

-1 to whitelisting - I just devote ~1 day to going through the 1000s of warnings, not a big deal.

</comment><comment><USER25> How does Pylint compare with PyCharm's inspections? Is there a reason to use both?

<comment><USER26> I think PyCharm is closer to flake8. It's good but more surface level.

<comment><USER5> > I think PyCharm is closer to flake8.

PyCharm does type inference and cross-file name/object checking, these are not things pyflake can do.

<comment><USER26> Ah that is true, it does a little bit of MyPy stuff too.

</comment></comment></comment></comment><comment><USER27> I have pylint integrated with vim through syntastic. The amount of output is thus limited to one module at a time and not intrusive nor disruptive. Also, like suggested, I have blacklisted some errors I don't care about.

</comment><comment><USER28> I'm using pylint daily and usually running it doing "pylint -E" to discard warnings and display errors only. I found it very useful, and never seen a case of an error that shouldn't be fixes. I'm probably missing some useful warnings, but it's always better than not using it at all, or getting lost with thousands of them!

<comment><AUTHOR> The problem is the bug that pylint caught that would've gone to production was caught by a warning, not an error. So we could've just used -E but then we'd miss out on some very useful stuff.

<comment><USER28> That's a fair point I agree. The pylint config files in the article are great, and I will definitely look into it. Pylint -E is more like a quick lazy option to make 80% of the work :)

</comment></comment></comment><comment><USER29> Your unittests should have caught both of those errors. Also Django does use linting: [https://github.com/django/django/blob/master/tox.ini#L36-L41](https://github.com/django/django/blob/master/tox.ini#L36-L41)

<comment><AUTHOR> I did have unit tests, they didn't catch the bug though because the test used a synchronous callback (much easier to test) and real world code ran with async callback.

</comment></comment><comment><USER30> What would be awesome is an interactive pylint onboarding tool. Start with no checks, then add them iteratively in order of severity showing the new errors at each step asking if the rule should be adopted or not.

</comment><comment><USER31> I find frosted (a reimplementation of PyFlakes) very useful.

</comment><comment><USER32> I actually think that unused initialized variables might be the only pylint rule which has found genuine production bugs for me.

</comment><comment><USER33> The fact that your unit tests did not catch that bug tells me you should spend less time linting and more time covering.

<comment><USER32> Linting is cheaper than unit testing.

<comment><USER33> They serve two completely different purposes. Testing ensures the logic is correct, linting is checking the code for syntax errors and bad practice.

<comment><USER32> They don't actually serve completely different purposes. Linting is supposed to catch bugs and it does, very cheaply. It just doesn't catch very many.

In terms of coding style I've found it fairly ineffective at picking up on most bad practices.

<comment><USER33> Sure, "bug" as a term is as elastic as you want it to be. I was pointing out the false equivalence you implied by writing "cheaper". Testing and linting does not provide the same value, so calling it cheaper is a kind of fallacy.

<comment><USER32> That's like saying that a sandwich and a condo do not provide the same value so calling a sandwich cheaper is a kind of fallacy.

There's no elasticity over what the OP reported. That was a bug. Clear as they come. He may have unit tests but they didn't catch it and since you can't have unit tests for everything, why not spend 500ms running a linter?

<comment><USER33> You are making my point. It makes no sense to call a sandwich cheaper than a condo _when_ you are evaluating what to buy when looking for a place to live. That is what I was pointing out.

Testing and linting does different things. Of course a sandwich is cheaper than a condo, but what does that have to do with what we are talking about?

As for the claim that you can't have unit tests for everything: What do you mean? No, you can't test all branches or combinations in a system, but you can have a 100% test coverage (aka. hitting each line at least once).

<comment><USER32> >You are making my point. It makes no sense to call a sandwich cheaper than a condo when you are evaluating what to buy when looking for a place to live. That is what I was pointing out.

Yeah not really. Both linting and unit tests catch bugs. This is a fact that you refuse to actually face.

>you can have a 100% test coverage

You can but it's A) a bad idea and B) it won't even necessarily catch the bug that the OP brought up if you do.

<comment><USER33> I grant you that linting catches bugs, but what I've argued for (perhaps badly) is that the bugs it catches are very shallow, but more importantly they make up a relatively small subset of the bugs proper unit tests catch. That's what makes the comparison you made deceptive.

I use both linting (pylint actually) and unit tests, so I am not advocating that you should scrap your linting tools. I am just trying to point out the difference.

Your B) argument is yet another indication that the tests are not good enough. The example bug OP posted is what made me comment in the first place. If your tests don't catch that your tests are useless.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER34> Vim + Syntastic + pylint + mypy works pretty well for me

</comment><comment><USER35> I've been quite happy with pycodestyle (formerly pep8), using autopep8 to automatically apply fixes when deemed safe.

</comment><comment><USER36> Oh Pylint, used by my previous employer as though it were a type checker. Now I just use a language with a type checker.

</comment><comment><USER37> Does python not have anything like `use strict;`?

Edit: What the heck, this is an honest question. :(

<comment><USER38> No, but even a use strict type clause wouldn't have helped in this case, since the entire syntax was valid (volme was being properly initialized as part of the loop definition). The error occurred because 'volume' was considered to be part of the function scope, despite being defined as part of the for loop scope.

To me, it's a good reason to use different loop variable names for successive loops. A good practice to use in any language, since it helps keep loops distinct to your mind as well.

        for volume in get_volumes():
            print volume
        for other_volme in get_other_volumes():
            print other_volume

The second loop throws a runtime error and an error level linting alert.

<comment><USER37> It would help if it restricted variables auto-vivified in a loop declaration to the body of the loop itself, instead of making it available for the entire parent scope. I'm used to working with languages that behave like that.

I'm actually a little surprised something like that hasn't been attempted yet for Python.

Thanks for the answer!

</comment></comment></comment><comment><USER39> Some more Python checkers:

[https://anonscm.debian.org/cgit/collab-maint/check-all- the-t...](https://anonscm.debian.org/cgit/collab-maint/check-all-the- things.git/tree/data/python)

</comment><comment><USER40> IMO the first example is a good use of a linter, the second should be caught by coding style: I keep the following rule with closures:

1.) _Never_ go more than two layers deep, so you have one "def" inside another "def" and _that 's it_.

2.) _Always_ keep the closures at the top of the containing function - <USER2> further nesting.

Kids today coming from Javascript seem to be way too much in love with their closures.

Example:

        def my_routine(flag, foo):
          def my_little_helper(thingy)
             if flag:
               return thingy
             return thingy + foo

          return my_little_helper(42)

<comment><AUTHOR> That's a good idea, but you shouldn't assume too much about why people are making mistakes, I've been working with and on Twisted since 2001, so not a JS kiddy :) I made this mistake fair and square even though I knew better.

Which is why I like having a tool that'll catch it for me.

My typical approach is `lambda x, y=y: f(x, y)`. Inline functions are much more readable, is the thing. But I can see the argument for this coding style, yes.

<comment><USER40> Sorry, didn't want to attack you personally with the 'kiddy' comment. I think my proposed style mashes well with yours though.</comment></comment></comment>