Revisiting Solid State Hard Drives - <AUTHOR> http://www.codinghorror.com/blog/2010/09/revisiting-solid-state-hard-drives.html <comment><USER3> There's not really very much revisiting, as opposed to repetition. What's new: (1) Atwood recommends the Crucial RealSSD C300 (citing a couple of reviews). (2) Seagate have a reasonably priced hybrid SSD/spinning-rust drive, the Momentus XT, which according to AnandTech has good performance. (It uses 4GB of flash as a read cache; performance is intermediate between typical HD and typical SSD.)

<comment><USER4> It's a revisited taxation on a gullible readership, many affiliate links there covering all budget points.

My PC has both a standard, non-hybrid magnetic disk for volume, and a very, very fast SSD for speed. I use the SSD for development and, humorously, Steam games. It's nice, but given that I have 8GB of RAM and most everything I touch regularly is cached...and I virtually never turn my PC entirely off (S3 sleep is your friend)...outside of database tests it just doesn't make that much of a difference.

<comment><USER5> Interesting. I didn't notice the affiliate links the first time and then when I did look, I saw domain names like kqzyfj.com. What purpose does it serve to hide the fact that it's an affiliate link behind a disposable domain name? Are there things like Firefox extensions that would search for "commissionjunction.com" and replace it with non-affiliate links?

<comment><USER4> I always look for affiliate links when bloggers suddenly start shilling merchandise outside of their competency.

I don't mind when there's an obvious "best prices" DIV at the bottom or wherever, where its purpose and commercial motivation is obvious, but embedded affiliate links just feel....scummy.

It's like getting invited to dinner and the host starts an Amway pitch. It colours the entire presentation.

<comment><USER6> > It's like getting invited to dinner and the host starts an Amway pitch.

I respond in the same way, I leave, never to return.

<comment><USER7> Maybe try not attending dinners titled "revisiting Amway products". Just a suggestion.

</comment></comment></comment></comment></comment></comment><comment><USER8> Decent article, but out of date by a few months. None of the drives listed use the newer SandForce controller, which skyrockets sequential writes into the 275 MB/s range, and random writes into 50K IOPS. _These_ drives are where it's at (for home/commodity use, etc).

<comment><USER9> The Crucial RealSSD C300 drive he cites has a theoretical max of 355MB/s. I happen to have have this drive. Writes comes close to 150MB/s at times, after a month and a half of use on OS X (which apparently lacks TRIM). Thats not too shabby.

Here's an Xbench result from about a month and a half ago (when I first got it) and one for today (as of 10:36am est): [http://db.xbench.com/merge.xhtml?doc1=459679&doc2=469412...](http://db.xbench.com/merge.xhtml?doc1=459679&doc2=469412&setCookie=true)

<comment><USER10> It only has that max if you happen to have a sata 3 compatible host, otherwise you'll be downgraded back to sata 2 and your speed will be comparable to everyone else.

</comment></comment></comment><comment><USER11> Was surprised to hear OSX doesn't support TRIM. Does anyone know why? I was gettin all excited about getting a new SSD for my MBP, but now I'm not so sure...

<comment><USER12> As a commenter pointed out, it seems that TRIM is not needed, in practice, on OS X. [http://www.bit-tech.net/hardware/apple/2010/07/01/mac-ssd- pe...](http://www.bit-tech.net/hardware/apple/2010/07/01/mac-ssd-pe..). As a MacBook Pro user who has had an SSD for a few months now — with a very full drive, frequent media file rotation, git repos, etc., I have not noticed any slowdown. And yes, it was worth it.

<comment><USER13> that link is a bad test. they wrote 0's to the drive, which is bad because 1) empty nand flash contains all 1's and 2) writing 1's or 0's doesn't mark the blocks as cleared, you have to use secure erase

</comment></comment></comment><comment><USER14> I used to know OCZ as a bit of a shady, benchmark gaming outfit "back in the day". Today however, the SandForce based Vertex II Pro SSDs are amazing. 10K+ IOPs sustained with a genuine database load. 100GB for just over $600. Compare that with STEC Mach8 devices at ten times the price, not super-capacitor backed, and lower throughput.

Sure a couple JBODs stacked with 15K RPM disks could do the same for $50K... Now imagine a small single-parity array of four SandForce devices. ;-)

For most things, meh. But for databases, it's a real game changer. 2010 is definitely the year SSDs changed everything.

</comment><comment><USER15> Did anyone else notice that the performance of the Seagate Momentus XT is _awful_ compared to all the solid state drives? It's only about 20% faster than a regular hard disk drive (the SSDs are about 1000% faster, according to Jeff's own chart). It's an awful, awful recommendation. If you want the performance of a solid state drive, buy a solid state drive.

<comment><USER16> It'd be nice if there existed a thing that acted like the SSD part of the Seagate Momentus XT. That way I could hybrid-ize my existing drives and have greater flexibility for future upgrades.

<comment><USER17> There's the HDDBOOST, from SilverStone, though it almost sounds like you were just begging someone to link to it ;)

Some benchmarks: [http://www.phoronix.com/scan.php?page=article&item=silve...](http://www.phoronix.com/scan.php?page=article&item=silverstone_hddboost_re&num=1)

<comment><USER16> Hrm. I was hoping that such a device would perform better.

Yeah, I _was_ hoping someone would link something. In this case, I didn't really know what I was looking for. What do you call a doohickey that does that sort of thing?

<comment><USER17> I'm not personally aware of any specific name for it, but I used search terms in the neighborhood of "SSD hybrid adapter" to find the Phoronix article.

</comment></comment></comment></comment></comment><comment><USER18> I would disagree about not needing >2GB of ram, but other than that - <USER2> rock.

<comment><USER19> On my Ubuntu machine, I rarely use more than 1GB (apart from the disk cache, of course, which can fill all remaining memory. Note: windows only has an 8MB cache)

<comment><USER20> On my Kubuntu machine with 4GB, I rarely use more than 1.5GB of RAM, and that's _counting_ the disk cache which will grow to fill all available space. Unless I run a VM, the system literally has no use for half my RAM, except for dual-channel access.

</comment></comment></comment><comment><USER21> I have the 2010 Mac Pro @ 3.33GHz. Going from the WD Caviar Black that it ships with to two SATA SSDs (60GB each, one for Boot and one for Apps) and one PCI SSD (120GB, for scratch work) has been unbelievable. This was a fast computer to begin with, but now I literally never find an application waiting on the disk. Xcode builds that take several minutes on my laptop (copying lots of resources into the bundle, for example) complete in seconds on the new machine. Highly recommended.

</comment><comment><USER22> Does anyone know how to get Linux to support TRIM? I just reformatted my SSD and would hate for it to become slower just because of deallocated blocks.

<comment><USER23> According to the linked wikipedia page on the TRIM command, Linux has supported it "since Feb 2010", so I would imagine that anything running the 2.6.32 kernel would correctly utilize that feature if your drive supports it. Please correct me if I'm wrong.

<comment><USER24> Looks like you'd need the Linux 2.6.33 kernel:

<http://en.wikipedia.org/wiki/TRIM#Operating_system_support> [http://forums.debian.net/viewtopic.php?f=7&t=51105](http://forums.debian.net/viewtopic.php?f=7&t=51105)

<comment><USER25> It also requires filesystem support. ext4 was the first support it.

I believe btrfs, nilfs2, and xfs support it now as well.

</comment></comment></comment></comment><comment><USER26> C300 is definitely NOT the fastest SSD drive. There are a few that are much much faster.

1) FusionIO ioXtreme = 670/280 MB/s

2) FusionIO ioDrive = 770/750 MB/s, 140,000 IOPS

3) FusionIO ioDrive Duo = 1500/1500 MB/s, 261,000 IOPS

4) RamSan-440 = 4 GB/s, 600,000 IOPS

5) NextIO vSTOR S100 = 5.5/6 GB/s, 2,200,000 IOPS

There are many more listed here: <http://www.storagesearch.com/ssd- fastest.html>

<comment><USER27> These are either rack-mounted or PCIe drives. If I look at the chart on that page, then the C300 is the fastest 2.5 inch SATA drive. I.e. its the fastest drive that can practically be added to a laptop.

</comment></comment><comment><USER28> Tangential: Does anyone have experience with using SSDs in production web/DB servers? Is it viable (yet)?

<comment><USER29> MySpace replaced all their fast hd's with SSDs about a year ago with good results [http://www.computerworld.com/s/article/9139280/MySpace_repla...](http://www.computerworld.com/s/article/9139280/MySpace_replaces_all_server_hard_disks_with_flash_drives)

</comment></comment><comment><USER30> I don't understand the reasoning about not wanting to put a relatively expensive SSD in a relatively cheap laptop.

<comment><USER31> I've got an expensive SSD in my cheap laptop (free, actually, it was the one they gave me at Microsoft PDC 2009) and it really makes a huge difference. This cheap little laptop, with the SSD, hooked up to a huge monitor, is one of the best dev environments I've ever used.</comment></comment>


SHA256 implementation in c++ - <AUTHOR> https://www.programmingalgorithms.com/algorithm/sha256?lang=C%2B%2B <comment><USER2> is it audited? is it safe? licensing?

<comment><AUTHOR> Yes its safe and according to site's terms of use [https://www.programmingalgorithms.com/terms-of- use](https://www.programmingalgorithms.com/terms-of-use) you can can use it anywhere</comment></comment>


The Unintended Consequences of Trying to Replicate Research - <AUTHOR> http://www.slate.com/articles/technology/future_tense/2016/04/the_unintended_consequences_of_trying_to_replicate_scientific_research.html <comment><USER2> Doesn't wash. If replication attempts are subject to publication bias, we are still better off because the subsequent meta-analyses overcome sampling error better and are able to show publication bias using funnel plots or other techniques like p-uniform, and sometimes can even correct the bias to give you a less biased and more accurate estimate. In contrast, you cannot show publication bias for a particular novel result nor can you easily correct for it. So given the choice between 5 studies on a single hypothesis (all afflicted by publication bias) and 5 studies on 5 hypotheses (with publication bias), you are better off in the former scenario. (In the latter scenario, you could try to use informative priors estimated from field-wide demonstrations of publication bias, but at least so far, this is an extremely unpopular approach.)

<comment><USER3> Yes, a much better headline would be "The value of study replications is positive but suppressed without some combination of pre-registration and result-blind refereeing".

<comment><USER4> Pre-registration doesn't help because it simply gives the author's a narrative to fake. As pointed out in the article, result-blind refereeing is officially claimed by most journals, although from the rejection I have received this does not appear to be the case in practice.

<comment><USER3> > Pre-registration doesn't help because it simply gives the author's a > narrative to fake.

Like timroy, I don't know what your objection to pre-registration is. I'm definitely talking about pre-registering the analysis, not just the data collection.

> As pointed out in the article, result-blind refereeing is officially claimed > by most journals,

Did I miss something? That doesn't seem to be what the article is saying:

> One proposed remedy is to modify the peer review process so that reviewers > grade manuscripts on the quality of their introductions and methods sections > rather than the novelty of the findings. Similarly, journals could assess > submissions based solely on the rigor of their methods—as does Plos One.

PLoS One is an anomaly. This is not normal.

</comment></comment></comment></comment><comment><USER3> Tangential point: Because of frictions and biases, the need for high-power and replicated research is even larger if you want to translate the science into real-world action. I highly recommend this post by Holden Karnofsky of GiveWell (and formerly of Bridgewater):

[http://blog.givewell.org/2016/01/19/the-importance-of- gold-s...](http://blog.givewell.org/2016/01/19/the-importance-of-gold- standard-studies-for-consumers-of-research/)

GiveWell is an organization that tries to estimate the impact per philanthropic dollar of various charities, and they partially rely on controlled trials of health interventions in the developing world.

> Chris Blattman worries that there is too much of a tendency toward large, > expensive, perfectionist studies, writing: "...each study is like a lamp > post. We might want to have a few smaller lamp posts illuminating our path, > rather than the world's largest and most awesome lamp post illuminating just > one spot. I worried that our striving for perfect, overachieving studies > could make our world darker on average."

> My feeling – shared by most of the staff I've discussed this with – is that > the trend toward "perfect, overachieving studies" is a good thing...

> _Bottom line_. Under the status quo, I get very little value out of > literatures that have large numbers of flawed studies – because I tend to > suspect the flaws of running in the same direction. On a given research > question, I tend to base my view on the very best, most expensive, most > "perfectionist" studies, because I expect these studies to be the most fair > and the most scrutinized, and I think focusing on them leaves me in better > position than trying to understand all the subtleties of a large number of > flawed studies.

> If there were more diversity of research methods, I'd worry less about > pervasive and correlated selection bias. If I trusted academics to be > unbiased, I would feel better about looking at the overall picture presented > by a large number of imperfect studies. If I had the time to understand all > the nuances of every study, I'd be able to make more use of large and flawed > literatures. And if all of these issues were less concerning to me, I'd be > more interested in moving beyond a focus on internal validity to broader > investigations of external validity. But as things are, I tend to get more > value out of the 1-5 best studies on a subject than out of all others > combined, and I wish that perfectionist approaches were much more dominant > than they currently are.

</comment><comment><USER5> Seems like replication attempts should have reverse publication bias by default - they are much more interesting when they contradict the original paper.

</comment><comment><USER6> I really look forward to the day (because it seems it must come) when the whole publication system is restructured into an open system. I have no idea what it will look like (I.e. how merit will be calculated in such a system), but for the reasons mentioned in this article and several others, I think it will be a glorious day for science!

</comment><comment><USER4> At the heart of the problem is that "replication" experiment have the same "novelty" or "sensationalist" demands required of regular research papers.

It's like the difficulty in creating "anti-art" and finding it exhibited in a museum.

We need to get rid of this format and focus on deliverables, and more modern forms of discourse such a collective knowledge curating like wiki pages, git repositories, or patents.

<comment><USER7> I was thinking that this might cause some sort of self correcting mechanism to come into place. If a study is useful, and others want to build upon it, it will need to be replicated.

If on the other hand its just a novelty study that doesn't lead to any further studies (and happens to be flawed), it will be forgotten about.

Curious if other think this would be the case?

</comment></comment><comment><USER8> An overaggressive pattern recognizer coupled with an overaggressive double- checker (something that pattern matches for incorrect results) is still a stronger system than the overaggressive pattern matcher alone. And depending on the shape of the data, it can be far more effective than a single statistically correct pattern recognizer. There's an interesting bit of math here that I'm not sure has been laid out in any accessible fashion yet, but I'd have to check around a bit.

The human brain more or less works because of this - it overtrains on every signal it takes in, recognizing patterns that it has no statistical justification to pick out. But since it's simultaneously (over)training the process of _rejecting_ those false patterns, it all works out okay, and it's actually far more effective than if it only made "proper" inferences from the data coming in, at least in the world we live in.

<comment><USER9> > There's an interesting bit of math here that I'm not sure has been laid out > in any accessible fashion yet, but I'd have to check around a bit.

I'd love it if you would.

</comment></comment><comment><USER10> This is more of a problem if you use a weak definition of replication such as: "statistically significant effect in the same direction". If instead the effect sizes need to be similar to each other (+/\- some uncertainty), then a correspondence between the multiple results means much more.

Of course, if people will just game this system to only publish results that fit _whatever_ criteria then you will get a biased literature. Requiring a more precise range of results to qualify just makes it more difficult.

I don't see how people gaming the system is a consequence of replicating each others results though. That seems like it is due to deeper cultural problems.</comment>


Every Supreme Court Justice Went to Harvard or Yale Law School - <AUTHOR> https://www.businessinsider.com/every-supreme-court-justice-went-to-harvard-or-yale-law-school-heres-where-they-went-for-undergrad-2016-2 <comment><USER2> So I guess you could say that Harvard and Yale are centers of excellence for constitutional law. Good for them!

</comment><comment><USER3> That could change with Amy Coney Barrett, who is from Notre Dame.</comment>


CSS3 proven to be Turing complete? - <AUTHOR> http://my-codeworks.com/blog/2015/css3-proven-to-be-turing-complete <comment><USER2> 1\. Feeding infinite HTML is not the same as feeding tape. A million tape cells can keep a typical Turing machine running indefinitely. A million rows only keep this running for a million execution steps, which is what, a tenth of a second if optimized?

2\. The 'crank' here is not part of CSS. Computer languages that are declared 'Turing complete' need to be able to crank themselves. You need to be able to tell them to go, and wait. I accept that magic the gathering Turing machine, (at least as long as you remove the word 'may'), because it's _part of the MtG rule set_ that you continue performing all the state transitions until you reach a halt.

3\. Allowing this completely external pump means that anything that can add and multiply three numbers and then exit would be counted as Turing complete, because you can then instantiate an infinite number of these and pump data through. The Turing complete nature of that construction lies mostly in that pump. It is not at all just a crank that say 'go'.

And 3 is really the important part here. None of the scary implications of 'Turing complete' come into play, because you can't take the result of one arithmetic statement and feed it into more. All of that playing around is roughly O(n) in terms of page size. Not O(unlimited) as 'Turing complete' might imply.

<comment> d-Pixie 1\. Sure, but just since finite input can be handled quickly doesn't mean it's not turing complete. A million cell tape for the Rule 110 automaton in any language will probably execute in milliseconds, if at all optimised... There might be other turing complete problems that can reuse tape the way you suggest, but Rule 110 isn't one of them.

2\. In Turings own paper he envisions the "crank" to be a human. I think we can all agree that a human is more than turing complete. The process of feeding the next cell etc isn't part of what makes something Turing complete. There is no requirement that it be self-cranking in Turings papers, nor the current formal definitions I have read. Could you supply an example of where this is brought up as a formal requirement?

3\. Well, yes. The point here lies in the _rules_. The method of executing the rules doesn't really matter, as discussed in 2. Humans are > Turing complete ...

<comment><USER3> About 2, sure. But when people say "X shown Turing complete", that doesn't have much meaning unless the X is somehow doing it without external input. Why? Because otherwise everything is Turing complete. Literally, "series of bits proven Turing complete!", "line of rocks on a sidewalk Turing complete!"

Because, the fact that computers exist is not a surprise. I mean, the original concept of a Turing machine is literally a tape and a read head.

<comment><USER4> I'm sorry if I totally butcher the fundamental concepts of Turing completeness here; I was neither a CS nor a math major.

But as I understand it a Turing machine is a physical impossibility because it is defined as having an infinite stream of data being inputted. And the physical presence of an infinity of information is a physical impossibility (I also wasn't a physics major, so I'm not sure if this violates physical laws or is just a practical impossibility, but either way it's obviously impossible).

So instead of an infinite stream of input, we usually define something as "Turing complete" if it's possible for it perform arbitrary computations on arbitrary input supplied in real time. CSS3 cannot do this; programming languages with real-time I/O can do this.

So CSS3 is "weakly" Turing-complete because it can perform arbitrary computations on arbitrary data input supplied ahead of time. With an infinite amount of random HTML-formatted data input ahead of time (same as a Turing machine), it can be equivalent to a Turing machine. C or Javascript are "strongly" Turing-complete because they can perform arbitrary computations on arbitrary, properly-formatted data input supplied ahead-of-time _or_ in real time.

</comment></comment></comment></comment><comment><USER5> Two comments:

1) it's not surprising: a lot of very simple systems can compute. It seems to naturally happen as you add flexibility to your rules. See for instance Wang Tiles or some cellular automata.

2) it's not a good thing: it means that the behavior of CSS3 is undecidable in general, which makes it much harder to build tools that can meaningfully analyze it.

<comment> d-Pixie I completely agree that it's not a good thing. I know that the browser maintainers also see the increasing complexity of CSS as a bad thing. That's why I was so sceptical to it from the start ...

<comment><USER6> GUIs tend to do this. I think the reason is that programmers fundamentally underestimate the problem of building a good graphical user interface, and therefore systematically design solutions that are inadequate. These inadequate frameworks then accumulate ugly nasty cruft because their underlying structure is not adequate to elegantly address the problem domain.

GUI toolkit and renderer development should begin with the humble admission that building a good GUI system is _incredibly hard_ , on par with massive distributed systems and AI, and that the problem should be tackled with that level of difficulty as an expectation. A good analogy would be between a GUI toolkit and a mature 3d virtual world game engine. Those are probably roughly equivalent problem domains.

<comment><USER7> AI=~=GUIs=~=3D game engine? One of these is not like the others, and I'm not talking about the number of letters in the name. I take your point in general, but I don't buy the idea that designing a good GUI system is as hard as AI or distributed systems.

<comment><USER6> I dunno. Can you deal with right-to-left, left-to-right, and vertical languages with different glyph forms on the same screen while also coping with multiple accessibility settings, sub-pixel anti-aliasing, embeddable GL components, component reusability, efficient updates on state changes without a full re-render, and platform support for over 200 different graphics chipsets?

I'm just saying it's a problem domain that is consistently underestimated.

<comment><USER5> It's not the same type of difficult; it's extremely painstaking and it's by no mean an easy task, but it's much less conceptually hard than a 3D engine, let alone an AI.

</comment></comment></comment></comment></comment></comment><comment><USER3> I'm skeptical a little, in that the article starts off by saying it is "more" Turing complete than C. Something either is or is not Turing complete. The nitpick that a C implementation has a pointer size which limits the memory to !infinite is an unimportant implementation detail. If that's your argument, nothing is Turing complete because the universe is made out of a finite amount of matter and energy.

Also, as others have pointed out, it doesn't "run" unless an external thing is pressing buttons. If you allow what are essentially external programs to run, you might as well have Javascript doing the job, and then the headline becomes a lot less interesting.

</comment><comment><USER8> So CSS3 is both Turing complete _and_ so low-level that most projects of significant size use a preprocessor like LESS, SASS, etc to write their CSS3 for them.

<comment><USER9> What's your point? The same is true for x86 and you don't see many people writing that by hand.

<comment><USER10> It means that JS-as-web-Assembler just got itself a competitor.

<comment><USER11> Boo! Boo to this comment and the horrors it may unleash.

</comment></comment></comment></comment><comment><USER12> That's horrifying. And I'd argue a damning indicator that CSS3 is wildly overcomplicated. It really _shouldn 't_ be Turing complete.

<comment><USER13> Can you center images yet? :>

<comment><USER14> Such knowledge exists, but it requires a long and dangerous journey filled with adventure, thrills, and excitement too bold for most to endure. Many have traveled down that path, but few have returned to tell the tale.

I am one of those few.

I could easily share that knowledge, but for one to fully understand, one must walk such a path thyself guided by the voices from the source that flows over the stacks of such knowledge.

<comment><USER15> As I walk through the valley of shadow of vertical-align, I took a look at my codebase and I realize there isn't much left ...

</comment></comment></comment></comment><comment><USER16> I think there's a flaw in the model.

"Assume that the amount of HTML currently loaded is finite but sufficient for all of the state to be properly rendered."

So consider

1

2

3
 . . .

I've never met an HTML streaming solution that won't just stream this sequentially, which means no
 for myContainer will ever be emitted (and therefore the HTML will never be well-formed, and the CSS will never have sufficient information to lay out).

If the HTML were streamed such that

 were received, and then the interior of myContainer were streamed, that'd be a different story, but that doesn't exist. So I don't think this blog post's argument that CSS3 is Turing complete works for any real implementation.

<comment> d-Pixie What relevant CSS rule can't be applied to this? We know our previous context and everything before which is what CSS acts on anyway, no lookahead rules in CSS :)

And yes, there could come an yet as to unknown element later that changes the display, displays on top of using position:absolute; for example, of current content. But not that changes how current content itself is displayed.

</comment></comment><comment><USER17> Great, so now I can write an x86 emulator and run Windows 95 in CSS, but I still can't figure out how to reliably vertically-center an element.

<comment><USER15> There are two widely known techniques for vertically centering an element in CSS that are virtually supported across the board:

        display: table-cell; vertical-align: middle;

or

        position: absolute; top: 50%; transform: translateY(-50%)

You can't really complain about that point anymore.

<comment><USER18> so hack it into a table cell, and valign like it's html 4.01 all over again, or render the full page, then reposition content based on that size? am I understanding these techniques correctly?

<comment><USER19> There's an important difference between creating a table in your HTML for layout, and using CSS to tell the browser to use its table layout algorithm on a particular element to center it.

Yes, it's still inelegant and nonobvious, but it's also better than throwing document semantics out the window.

</comment></comment></comment></comment><comment><USER20> Does this mean that in addition to a javascript blocker i need a CSS blocker to stop malicious code from being run in my browser?

<comment> d-Pixie Not yet :)</comment></comment>


A static_cast is not always just a pointer adjustment - <AUTHOR> https://blogs.msdn.microsoft.com/oldnewthing/20160224-00/?p=93081 <comment><USER2> Multiple inheritance in its many forms (including interfaces as found in Java/C#/Golang) always makes casts interesting, even sometimes when methods aren't involved.

Somewhat related stuff that might be interesting:

dynamic_cast in C++: [http://mentorembedded.github.io/cxx- abi/abi.html#rtti](http://mentorembedded.github.io/cxx-abi/abi.html#rtti)

Golang's interface casts (also used by Swift I believe): [http://research.swtch.com/interfaces](http://research.swtch.com/interfaces)

Speculation for interface casts in Java: [https://wiki.openjdk.java.net/display/HotSpot/PerformanceTec...](https://wiki.openjdk.java.net/display/HotSpot/PerformanceTechniques)

</comment><comment><USER3> I tried, but I never could understand _cast_ in C or anywhere else. On the other hand, for decades I've seen, seen documentation for, and used several data type conversions among common elementary data types -- binary, 2's complement integers, decimal, base 2 floating point, base 16 floating point, precision differences, character strings, etc.

So, on the one hand there is _cast_ , and on the other hand there is data type conversions. _Cast_ is usually documented as just a _cast_ where the meaning of that word is not in any dictionary and is not well explained otherwise. So, with a _cast_ , often are getting a data conversion of some kind, but are usually missing the documentation to know just what.

My best explanation: C wanted some cases of _strong typing_ , e.g., so that pointers could have data types and, thus, the relatively heavy use of pointers would cause less trouble. But a _cast_ was an instance of overriding the usual strong typing. So, really, _cast_ was presented as a way to override strong typing, but the issue of just how the data conversions would be done was left poorly or undocumented.

When I do a data conversion, I'm fully aware of the violation of strong typing -- I know that and am not concerned. But what I am concerned about is just how the data conversions are done, and in C, etc., I don't see the documentation to tell me. In strong contrast, PL/I was very careful to document how the data conversions would be done.

So, each time I see _cast_ without details of how the data conversions are done, I'm ready to scream.

Am I the only one who cares about the details of the data conversions than the violation of strong typing? Again, to me, the main issue is the data conversion, not the strong typing.

<comment><USER4> Cast (according to the C99 standard, section 6.3, linked at bottom): A construction formed by preceding an expression by a parenthesized type name, converting the value of the expression to the named type.

So in C, casting is a language syntax that provides and explicit way to specify type conversion (rather than the implicit conversion that happens in cases like promotion). Most type conversions

Section 6.2.5 contains the defined type conversions, but most of what I'd consider edge cases are "implementation-defined" or have "undefined behavior".

Does any of this bother me? No, not really. No more than it bothers me that there isn't a single, authoritative, and clear definition of what constitutes "strong typing" and which operations are a "violation" of it.

(Linked from Wikipedia as being the C99 standard "effectively available for free"): [http://www.open- std.org/jtc1/sc22/WG14/www/docs/n1256.pdf](http://www.open- std.org/jtc1/sc22/WG14/www/docs/n1256.pdf)

<comment><USER3> Thanks for the reference.

Gee, that's a long way ahead of what I got out of reading K&R!

In

> So in C, casting is a language syntax

right. So, _cast_ is just syntax but short on _semantics_ , that is, how the conversion is actually done so that we can know the results, that is, if you will, what the heck happens.

In

18.104.22.168 Real floating types

is

> If the value being converted is in the range of values that can be > represented but cannot be represented exactly, the result is either the > nearest higher or nearest lower representable value, chosen in an > implementation-defined manner. If the value being converted is outside the > range of values that can be represented, the behavior is undefined.

So, yes, this is an example of where I'd be concerned.

On "strong typing", I always thought that the concept was poorly defined and described but never screamed bloody murder about it if only because it didn't directly affect what my software would do. I used "strong typing" in my post if only because it seems to be what the C community likes to do, and when in Rome do as Romans do. Or, maybe strong typing is better than _weak typing_ or _typeless_ \-- okay by me.

</comment></comment></comment><comment><USER5> Reminds me of point 3 in [http://www.sebastiansylvan.com/post/language-design- deal-bre...](http://www.sebastiansylvan.com/post/language-design-deal- breakers/): "You have to make sure that nullable pointers _cannot be dereferenced_. (...) Having every few statements potentially trigger a runtime crash is an expensive price to pay... _for nothing!_ " [emphasis in the original] Once you have proper non-nullable pointer types, `static_cast` is a single pointer bump once again.

<comment><USER6> This is why C++ code should use references more and pointers less. How's that working out in the era of move semantics?

Bjarne has said that "this" should have been a reference; making it a pointer was a mistake. But the early design of constructors pointed the language in the wrong direction.

At least you can't assign to "this" any more. You can still assign to "*this", but probably shouldn't.

<comment><USER7> > This is why C++ code should use references more and pointers less. How's > that working out in the era of move semantics?

The point of move semantics is to enable use of values instead of pointers. That's even better/safer than using references.

<comment><USER5> Unfortunately, move semantics in C++ is broken, and will remain so until the type system finally understands that `std::move` is supposed to invalidate the original object. But, this being C++, I won't hold my breath.

<comment><USER6> Trying to fix this with the type system doesn't really work. Tracking the changing attributes along a path of control flow with the type system requires an insanely complicated type system.

Rust's borrow checker understands invalidation via move, and lots of other changes in variable state which occur along execution paths. That seems the way to go. But it has to be integrated into the language design. As a backwards compatible bolt-on to C++, it just won't work.

(It's been tried. I tried once, about 10 years ago, and gave up. I talked to the designers of Rust, and they tried and gave up. There have been other attempts to get C++ ownership under compile time checking, and the result is either a new incompatible C++ variant or something that leaks like a sieve. Ownership needs to be a fundamental language concept independent of type)

<comment><USER8> Have you seen the Core Gudelines and the GSL? Not as powerful as Rust, but very interesting.

<comment><USER5> The C++ Core Guidelines aren't always mechanically enforceable. Experience shows that unenforceable rules _will_ be broken. After all, what's undefined behavior, if not an unenforceable "don't do this" rule?

<comment><USER8> Also, they don't deal with concurrency currently, either.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> It's possible to have 'this' == NULL. Consider the code:

      #include <iostream>

      using namespace std;

      class myclass
      {
          public:
              int sum(int a, int b)
              {
                  cout << this << endl;
                  return a + b;
              }
      };

      int main()
      {
          cout << ((myclass*)0)->sum(10, 11) << endl;
          return 0;
      }

this will print: 0 21

And it's not a null pointer dereference because in C++ it's the function responsible to know the class its belongs to. It means that this code:

      ((myclass*)0)->sum(10, 11)

should become:

      sum(0 /*this*/, 10, 11)

and not

      0->sum(10, 11)

It can be UB in the C++ specification, but considering the systemv abi, 'this' is just a parameter that will be pushed in the call stack before calling 'sum'.

<comment><USER10> What happens if sum is a virtual function? Or does it not matter? I am not too familiar with c++ casting magic.

<comment><USER11> Most likely you'll get a segfault when it tries to read from page 0 to get to the class' vtable (which is where the references to the virtual functions live).

</comment></comment></comment><comment><USER12> static_cast is used mainly to "reuse" existing code base

<comment><USER13> I use it mostly to switch between numerical types like double, float, int, uint32_t, char, size_t.

</comment></comment><comment><USER14> Jesus Fucking Christ, now we're exploiting undefined behaviour to remove one compare instruction? You don't even need the jump, just use a conditional move. Just..

        test rax, rax
        add rax, $offset
        cmovz rax, 0

Or keep the damn jump and expect the cpu to profile it correctly.

Sorry for sounding angry, but this kind of thing isn't what makes my programs faster, this kind of thing is what makes it harder to write correct programs.

Edit: clang does exactly this at -O1: [https://godbolt.org/g/o6gh0M](https://godbolt.org/g/o6gh0M)

<comment><USER5> That you need to invoke undefined behavior to remove the compare instruction is only the symptom. The actual disease is nullable pointers themselves, which create the need for a compare instruction at every pointer dereference in the first place.

<comment><USER15> No. Java has nullable pointers and almost all JVMs implement them with a pointer to address 0 and unmap the first couple of pages of the address space. That will cause a fault, leading to a signal, which is then handled to materialize and throw the exception. No compare. Just naked loads/stores with fixed offsets. The disease is multiple (implementation) inheritance.

<comment><USER5> > No. Java has nullable pointers and almost all JVMs implement them with a > pointer to address 0 and unmap the first couple of pages of the address > space.

This is just plain ugly. Why should the normal operation of a program written in a _high-level_ language trigger page faults? But, leaving aesthetic concerns aside, I'm not even sure it works. How do you guarantee that the OS won't give you back the same pages you unmapped when you try to map new pages (say, to grow the heap)?

<comment><USER15> > This is just plain ugly.

Yeah. Unfortunately the only really efficient protection mechanisms that modern processors have is virtual memory. C++ programs generally unmap the first few pages for exactly the same reason; to catch nullptr derefs.

> Why should the normal operation of a program written in a high-level > language trigger page faults?

NullPointerExceptions are not considered normal operation. They are safety violations that have a controlled, well-defined semantics. BTW page faults happen all the time; the OS transparently handles them and maps in new pages as necessary. The problem you are referring occurs when a page fault happens and the OS knows there is no mapping for those addresses.

> How do you guarantee that the OS won't give you back the same pages you > unmapped

Because the mapping is for an address space range (e.g. 0-N), and the OS does not overlap new request with existing mappings unless specified in the request.

<comment><USER5> > and the OS does not overlap new request with existing mappings unless > specified in the request.

Ah, so by "unmap", you actually something like POSIX's `mprotect()`, rather than `munmap()`?

<comment><USER15> Sorry, yes. You can do this just through segment declarations in both ELF and MachO binary formats, to prevent anything getting accidentally mapped there before startup.</comment></comment></comment></comment></comment></comment></comment>


Ask HN: Would you be interested in a FPV drone/quadcopter racing event? - <AUTHOR>

Hey folks - curious if there is any interest in a friendly competitive drone racing event. Imagine showing up and racing either a stock FPV quadcopter setup or an entirely custom one against a group of like minded racers?
As an event host, we'd provide feeds to racers vehicles, prizes, course design and setup, logistics and all the other things necessary for a smooth running event. Of course we'd provide alcohol and awards like "Best Crash" One of the challenges is that the cost of the quadcopter/drone might be prohibitive for casually interested people, but open to ideas. Maybe we could organize a group buy and save some money for participants.
https://www.youtube.com/watch?v=NsxyV-kgfio
https://www.youtube.com/watch?v=H19z1X3V4UQ <comment><USER2> Quick tip, directed at you, past me, future me, and all others reading this.

Don't ask for permission. Say you are doing something and then get to it.

So ... my suggestion would be to change the title / post from what it is to the following:

"Tell HN: Let's do an FPV dron/quadcopter racing event"

I'm looking for some help getting it together (sponsors/workers). Here's my email, let's make this dream a reality!

<comment><USER2> Useful links:

[http://mashable.com/2015/02/12/drone- racing/](http://mashable.com/2015/02/12/drone-racing/)

[http://www.techtimes.com/articles/32546/20150212/first- perso...](http://www.techtimes.com/articles/32546/20150212/first-person-drone- racing-is-the-sport-of-the-future.htm)

<comment><USER3> I'm almost certain the OP has Googled drone racing and viewed the top two links as well.

</comment></comment></comment><comment><AUTHOR> Thanks for the information!

I've started a successful event series in the fitness space, so I know a little about event promotion and operations. I was more interested in the communities that would like to get involved in this.

Our current event company runs events in 30 major markets in the US, so it can be based anywhere. I'd probably do the first one in the mid-Atlantic, but would quickly organize a others in the Bay Area/Austin/Charlotte markets if things went well.

So, first event, in DC/Richmond area?

If you want to get involved, email me. It's email@example.com.

I think the meetups and small events are great, but they are really geared towards people who are super enthusiasts, not those people who want a more casual, approachable racing event. Just some thoughts.

Thanks for all the great feedback! Keep it coming!

What are current drone racing events missing?

<comment><USER4> [http://www.godronex.com/](http://www.godronex.com/)

</comment></comment><comment><USER5> There's also the demo-derby version:

[http://www.meetup.com/GameOfDrones/](http://www.meetup.com/GameOfDrones/)

"We believe in trial by fire, there is no faster way to develop state of the art drone technology than our method of aerial combat sports."

</comment><comment><USER6> In the Bay Area this already happens weekly. I've checked it out a few times and each time manage to drag along a new friend to Berkley/Oakland area.

[http://www.meetup.com/FPVexplorers/](http://www.meetup.com/FPVexplorers/)

</comment><comment><USER7> Here's how a few guys are doing it in the Bronx.

"Drone Racing, 'Star Wars'-Style, in the Snowy Bronx" [http://motherboard.vice.com/read/drone-racing-star-wars- styl...](http://motherboard.vice.com/read/drone-racing-star-wars-style-in-the- snowy-bronx)

Looks pretty awesome.

</comment><comment><USER8> I think this is a great idea! Watching the first video linked I'm reminded of star wars pod racing. I dunno I'm qualified to race (just have a phantom 2, and very little fpv experience) but I'd sure love to watch 'the pros' at work here!

</comment><comment><USER9> That's a great idea, I would like to see some kind of drone racing. On a side note, what about quadcopters fighting inside an arena, like the _Robot Wars_ tv series? you could make a youtube channel or send a concept pilot to tv studios.

</comment><comment><USER10> For sure. If you host it, let me know, I'll help promote it on www.droneocular.com Drop me a line and we can talk about it some more email@example.com

Cheers

</comment><comment><USER11> There's a meetup tonight at London Hackspace and the organizers of FPVLeague.co.uk are going to be there.. Free to come along.

</comment><comment><USER12> Where do you get/make a FPV drone? I didn't realize they existed!

</comment><comment><USER13> It would be very helpful if you could narrow it down geographically a bit.

</comment><comment><USER14> Sounds good, but I seriously doubt you're going to come over to my place here in the Netherlands.

<comment><USER15> well, they can fly and they are controlled remotely...

</comment></comment><comment><USER4> Where?</comment>


Can Tesla convince "practical" Ford-loving pickup drivers to buy the cybertruck? - <AUTHOR> https://marker.medium.com/teslas-cybertruck-has-a-huge-cowboy-problem-bebe81377c6d <comment><USER2> Is the "practical" in quotes because practical solution would be Toyota truck?

<comment><USER3> Some people buy pickup trucks for reasons of fashion. Ten or so year ago, pickup trucks were all the rage in suburbs of Portland, ME that were dominated by white collar and service workers.

My brother-in-law, however, has a big-ass pickup truck with a plow. The money he makes plowing parking lots and driveways in the winter takes a big chunk out of the big payment he makes on it. When he's not doing that he is going to job sites. Similarly my dad (who was a carpenter) had a Ford F150 to carry tools around which was an astonishing hunk of junk which had trouble going up modest grades and was harder to shift than an old manual drive school bus that one of my hippie friends lived in.

Certainly some people really use pickup trucks in a "practical" way, other people seem to drive a pickup because they want to bask in the aura of "practicality."

What's most important about trucks in America though is

[https://en.wikipedia.org/wiki/Chicken_tax](https://en.wikipedia.org/wiki/Chicken_tax)

Roughly, foreign trucks face a high tariff, so truck-based vehicles are less competitive and more proftiable for American car makers.

That's a big part of why you might go to a car dealer and find that all the little cars are out of stock, but that they have huge trucks in a row that they are pushing with deep discounts.</comment></comment>


9 Tech Analogies That No Longer Mean Anything To Those Young Whippersnappers - <AUTHOR> http://h30565.www3.hp.com/t5/Feature-Articles/9-Tech-Analogies-That-No-Longer-Mean-Anything-To-Those-Young/ba-p/3267 <comment><USER2> I completely forgot tv channels didn't used to be 24 hour, I'm not sure when it became like that in Australia but I do remember the off the air thing on ABC especially I think.

List is missing the joys of trackball mice and floppy disks.

<comment><AUTHOR> I don't think it's trying to list all the items we miss... the link at the end goes to an article of cool but dead tech. This is looking mainly at the terms that made it into the language (like "dial a phone") that are no longer literally relevant.</comment></comment>


Ludwig: A DSL for the Cloud of Today and the Future - <AUTHOR> https://blog.fugue.co/2016-10-11-why-we-built-ludwig.html <comment><USER2> Closed-source - thanks but no thanks! We'll stick to Terraform for the time being!</comment>


Ask HN: Is GDRP causing commercial censorship? - <AUTHOR> Here's the website in question: https://www.carrabbas.com/
I mentioned this restaurant to my girlfriend in Italy (because they catered a Christmas party last night), and she can't access the site at all.  That is, it says "Our website is unavailable in your region."
Is an Italian restaurant afraid of Italians?!?
In all seriousness, is this just GDRP stupidity?  How can someone in the EU have full access to information when companies do stuff like this?
Granted, this is a seemingly innocuous example, but to me it hints at a much larger problem! <comment><USER2> The EU recently clarified how GDPR applies to external entities, mostly along lines that were probably obvious: [https://plus.google.com/u/0/+SophieWrobel/posts/fZRjFA9fj1C?...](https://plus.google.com/u/0/+SophieWrobel/posts/fZRjFA9fj1C?cfem=1) [1]

GDPR isn't stupid and GDPR isn't a bad law. Unfortunately, people suffer from what I've seen described as "GDPR hysteria", which causes people to make irrational, unreasonable shifts blaming GDPR as the cause, such as blocking foreign countries from visiting a website entirely, shutting down services completely worldwide, etc.

[1] I like the summary at that link, though in the interests of post-Google+ context later, the article linked is this: [https://edpb.europa.eu/sites/edpb/files/consultation/edpb_gu...](https://edpb.europa.eu/sites/edpb/files/consultation/edpb_guidelines_3_2018_territorial_scope_en.pdf)</comment>


Show HN: Hyperdeck – a new client-side programming notebook - <AUTHOR> https://www.hyperdeck.io <comment><USER2> Clicking save when not logged in redirects to /signup. Think it should be register. Looks cool though.

<comment><AUTHOR> Thanks! Should be fixed now</comment></comment>


Ask HN: React Native Equivalent of NativeScript Playground? - <AUTHOR> "{N} Playground is a solution that allows you to write your {N} code in a web client at play.nativescript.org and deploy it to your device with the help of the NativeScript Playground app (Android, iOS) and the NativeScript Preview app (Android, iOS)"
link to relevant article: https://www.nativescript.org/blog/life-is-easier-with-nativescript-playground
^^ does anyone know of a React Native equivalent? I like {N} Playground as you can dump components in, and see them almost immediately on you device using the app - as a newbie (only have working knowledge of HTML/CSS/JS) it's been a cool tool to see how syntax looks/dive right in.
Colleague showed me this today, and I've been wanting to learn React Native for a while, so figured I'd ask - half curious/half serious <comment><USER2> Sounds like you're looking for Expo.

The easiest way to try it is the in-browser version at [https://snack.expo.io](https://snack.expo.io)</comment>


Amazon discounts James Franco's "Palo Alto Stories" (Kindle edition) - <AUTHOR> http://www.amazon.com/gp/product/B003V1WUKS/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B003V1WUKS&linkCode=as2&tag=destinyland-20&linkId=FXAEE3GPEQH55Z7T

<comment><USER2> "The building is beige, but the shadows make it shadow-color."

</comment><comment><USER3> Why is this here?</comment>


Robert W.Floyd: In Memorium (2003) [pdf] - <AUTHOR> http://oldwww.acm.org/pubs/membernet/stories/floyd.pdf

<comment><USER2> Bob was my friend. Although he died over a decade ago, I still miss him. Don's _In Memoriam_ essay brought back many memories.</comment>


How bicycles have changed in the last 25 years - <AUTHOR> https://arstechnica.com/gadgets/2018/11/25-years-of-two-wheeled-tech/ <comment><USER2> When Reynolds 531 double butted was the next plus ultra, welded alloy cheap bikes flooded the market and I (and other impoverished students) suddenly found ourselves able to ride lighter frames than we'd dreamed of.

When shock absorber systems arrived, we went off road seriously.

When disc brakes hit, rims changed significantly. Centre pull 666 brakes stopped being trendy very quickly.

Gel saddles killed brookes but somehow they came back. Fixies and hipsters?

New bag technology made panniers easier and waterproof.

LED lights made old type generator systems redundant. wicking clothes made riding a lot more comfortable although a lot more pongy: wool and cotton don't stink as much. Bamboo viscose has helped there.

Frames now reflect human biology better. Women ride frames sized and shaped for their bodies by women.

Power assist is normal. Sealed gears like sturmey Archer live on in rental bikes (there used to be plant-and-moon orbitals combined with derailleur systems believe it or not)

You can see shaft drive bikes in the Prague technology museum from 100 years ago. I still wish they were available.

Trikes and quad bikes are trendy again!

<comment><USER3> Sealed headsets, bottom brackets seemed to increase reliability and make it easier to repair

Braking didn't go from side pull caliper brakes to disc brakes as the author suggested. Disc brakes are still quite heavy and expensive and unsuitable in many cases. There are still many new bikes today with side pull caliper brakes and V brakes. Over the years, a ton of different designs were tried like U brakes and cantilever brakes.

<comment><USER4> But are all the newfangled bottom brackets really more reliable? I know Shimano's Hollowtech BBs are lighter and therefore more attractive to certain consumers these days, but people seem to have to replace them more often than the old square-taper BBs that one installs and then forgets about for 20,000 km.

> Disc brakes are still quite heavy and expensive and unsuitable in many > cases.

My Spyke disc brakes weigh little more than the Shimano XT V-brakes I replaced with them. While the cost of the disc brake was higher, they might actually prove cheaper in the long run due to less rim wear and therefore a need to have the wheel rebuilt and hand-trued once the rims go.

</comment></comment></comment><comment><USER5> I was a bike mechanic for 5 years in the early 1980's. Bikes were perfectly reliable then. A well maintained bike was ajoy to ride and would hardly fail you. A clap trap beater was also reliable.

So what has changed? The sturdy bikes of old were built within the tolerances of the materials and designs of the time. If you pushed the limits, you would break the bike.

It seems the new tech as described by the author didnt solve a reliability problem. What it did was push the materials and construction methods. For instance he talks about hubs, spokes, and rear stays breaking. That never happened. But we laced wheels of 36 holes 3 and 4 cross. Modern wheels are straight laced and 28 or less holes. The change has lightened the wheel while maintaining the strength of the old wheel.

</comment><comment><USER6> this person is thinking road bikes which might not have changed much, but mountain bikes have changed a lot

1) suspension forks and full suspension bikes

2) move from 26" to 29" and 27.5

3) dropper posts

4) major changes in geometry, e.g slack head tube angles from 71/72 now the standard is around 66. Shorter chainstays.

5) fat bikes

6) hydraulic disc brakes

7) tubeless tires that use sealant that automatically seal punctures

8) electronic shifting

9) power meters

10) carbon fiber frames and wheels

11) major changes in axles from skewers to through axles

12) internal changes to hubs to increase points of engagement

13) major changes in handle bar lengths

14) drop in gears from 20+ down to 10/11 with no front shifter

15) adjustable geometry with flip chips

16) e-bikes with pedal assist

17) major changes in suspension design, horst, vpp, dw-link, etc.

18) multiple categories of bikes, downhill, enduro, all mountain, trail, xc, gravel/cyclocross

19) bike parks via ski lifts.

I expect there to be bikes that adjust gearing automatically based on a desired power output to allow you to maintain the desired cadence at the desired power.

<comment><USER7> Dropper posts was such a game changer for me. Redefined my riding, even more so than full suspension or disc brakes, I think.

</comment></comment><comment><USER8> In at least a couple of ways, bicycles have regressed:

1) It used to be possible to shift down multiple gears quickly (e.g., when coming to a stop light). Now, many index shifting systems outside of twist shift only allow one gear shift at a time.

2) It used to be all bikes had replaceable chainrings, allowing you to replace worn rings, adjust the overall gear ratio of the bike higher or lower, or change the ratios to create a half-step shift pattern. Now, many bikes have sprockets riveted to the crank arm and derailleur systems so tightly matched to the size of the chainrings that changing chainring size is no longer feasible.

<comment><USER9> Re: (1), I recently upgraded to a bike with "brifters", and was delighted to discover that newer Shimano levers have mostly solved this problem. When downshifting, you can push the lever further to the right to dump multiple gears at once.

It doesn't work when shifting up, or allow for the truly violent changes I used to pull off with my friction shifters, but the convenience and speed of shifting right without moving my hands from the brakes is well worth the trade-off.

<comment><USER10> > _It doesn 't...allow for the truly violent changes I used to pull off with > my friction shifters, but the convenience and speed of shifting right > without moving my hands from the brakes is well worth the trade-off._

??? I don't understand. You can mount friction shifters next to your thumbs too. They only require moving your hands if you stick with less accessible frame mounting positions that likely only ever existed because it was easier and slightly cheaper to mount that way (one less cable guide, sigh).

I personally love the absolute simplicity of friction shifters. Doing finicky derailleur adjustments to make sure that every index step transitions smoothly is such an annoying process.

</comment></comment></comment><comment><USER11> Bicycles I think in general hit a high point in the late 1990s. Good aluminum frames and 8 or 9 speeds (as in number of cogs).

Carbon frames are not suitable for the vast majority of riders. Any damage to carbon makes a bike unridable, and it can happen fairly easily. In addition, carbon can fail catastrophically, unlike metal frames.

This is all for a few minor or alleged benefits. The lightest carbon frames are around 700 grams. The lightest steel frame is around 1 kilo, and the racing aluminum frame I use is 1100. That frame is lighter than most people's carbon frames, and I have had it for 12 years and many crashes. It has some damage, but because it is minor the bike is still safely rideable.

Carbon is billed as stiffer. It usually is, but the energy wasted from frame flex is less than one watt. Carbon can also be minimally lighter. However, 80-90% of energy in road biking goes to aerodynamic resistance. Decreasing weight by a percent therefore has a negligible impact on speed.

The most important thing is to get a reasonably light bike that makes you aerodynamic. It should also be reliable. If it is reliable you will ride it more, and therefore be faster.

</comment><comment><USER12> This entire article kind of reads like someone visiting a foreign country then coming home and reporting on how different everything is. The truth is bicycles have not really changed that much, especially since the 90's. There has been tonnes of evolution and everything works better, but we're still shifting with derailleurs, road bikes still slow you down by squeezing the rims, locomotion comes from spinning one set of rings and transferring it to another with a chain, regardless of material or literal form the frame is still 2 triangles.

Bikes these days have new geometries, exotic materials and everything works way better, but not because we're doing anything dramatically different from 25 years ago.

<comment><USER4> > we're still shifting with derailleurs

Not cyclists with Rohloff hubs. Rohloffs have become a hot item for touring cyclists, but even on the streets of a German or Austrian city you will see Rohloffs on people's commuting bikes. If not Rohloff, then perhaps a Shimano Alfine.

> road bikes still slow you down by squeezing the rims

Many new road bikes (even BSOs at the local hypermarket) are shipping with disc brakes now.

</comment></comment><comment><USER13> Nowadays I only ride Citibikes, and they only have 3 speeds. This seems a bit below the optimum, but can someone opine, do we really need 30 speeds?

<comment><USER14> The trend in high end mountain bikes is to have 1 front ring and eleven rear so only 11 in total. This is less complex and less annoying. The problem is that you loose out on some high or low gear ratios that you might want. There are limits to the range of gears that are possible in that setup. So that is why front derailleur's were used. It expands the range rather than just the count of gears.

A 30 gear bike has three rings on the front. The outer and inner are only supposed to be used on the outer few, or inner few rear rings. Otherwise the chain will be stressed and possibly break. Only the middle ring is used with all rear gears. So you actually have only about 16 usable gears.

A more modern design is to use two front chain rings. This does not strain the chain so much, and you can use the full range of rear gears. It is also much more natural feeling to shift the front gear. A 20 speed bike actually has more usable gears than a 30 but probably less range.

A further iteration is to have a larger inner ring on the rear derailleur that is a bigger step up from the last. Eleven speed cassette's try to give enough range on the rear derailleur to only need one front ring.

</comment></comment><comment><USER2> Another one. It used to be impossible to spend more on a bike than a car. I have a friend who admitted his _wheels_ cost more than another colleagues secondhand car.

Carbon fibre does that.

</comment><comment><USER15> It's odd that maintenance heavy derailleur gears are still so popular even in daily driver commute bikes (as opposed to hobby/sport bikes).

</comment><comment><USER16> i know mountain bikes get pretty much all the innovation, but here's Cervelo's p5x tt bicycle: [https://www.cervelo.com/p5x](https://www.cervelo.com/p5x)</comment>


Forget Agile and Kanban, understand what your user wants first - <AUTHOR> https://dev.to/prahladyeri/forget-agile-and-kanban-understand-what-your-user-wants-first-2pjn <comment><USER2> I recognise that different folks have had very different experiences of agile, lean, kanban and so on. Many of those experiences have sucked. I've had a few bad agile exeriences, usually "it means we never write docs" layered over an existing hack-and-patch culture.

But this is just straw-punching clickbait. And it had the intended effect: I'm annoyed.

> _If things like Kanban and Agile actually worked_

I have personal experience of them actually working. Multi mega SLOC distributed systems with dozens of teams working for several companies on multiple continents.

So as you might imagine, I somewhat resent being painted as an accomplice to hucksters.

<comment><USER3> As in all things, we humans are predisposed to think in all-or-nothing terms. Agile works or it doesn't. Lean is effective or it's not. People just don't want to do the hard and nuanced work of realizing that these are just management methodologies (ffs). They will not by themselves make your business good or bad. There are a hundred other factors at play in your work life, from the personalities of upper management to the viability of your product. Picking a methodology, just like picking a religion or a philosophy or a brand of toothpaste, is not, and never will be, a silver bullet. It's a tool in the toolbox, with pros and cons. Nothing more.

<comment><USER2> I agree.</comment></comment></comment>


Xbox 180: Microsoft Fully Reverses Xbox One's DRM Policies  - <AUTHOR> http://www.wired.com/gamelife/2013/06/xbox-one-drm/ <comment><USER2> I think this story is more interesting than 7 points and 0 comments. (Not the Wired article, but the underlying story.)

It was a _collossal_ fuckup for Microsoft -- but only because Sony made the right moves. If Sony also tried to impose daily internet-check DRM on its users, and decided to bar them from being able to loan or rent games, then there would have been a ton of grumbling, but it wouldn't matter.

But since Sony decided to weaponize this issue and announce they were doing none of this stuff, and aggressively mock MS for it, they scored what appear to be real hard body blows against MS, and came out of it looking great. Even though MS has now reversed all its controversial and objectively user-hostile ideas, a lot of the tarnish wills stick to it and the next-gen Xbox.

(Disclaimer: I'm not a gamer, I just think this has been a really interesting business story.)</comment>


Kafka as database – is it safe? - <AUTHOR> Specifically, how strong are the durability & backup guarantees?
The setup is:
-kafka is the underlying source-of-truth for the data.
-querying is done on caches (I.e. Redis, ktables) hydrated from kafka
-Kafka configured for durability (infinite topic retention, 3+ replication factor etc)
We are not allowed to lose data in any circumstances
Is the proposed setup nuts?
In theory the replication should guarantee durability & resiliency. Confluent themselves encourage the above pattern.
The only flaws I can think of, are:
- cache blows up and needs to be rehydrated from scratch
-broker disk gets wiped/corrupted -> kafka rebalance, resulting in prolonged downtime if topics contain mountains of data
Has anyone run and battle tested this kind of setup in production? I.e. encountered disk corruption, brokers going down, but still retain data?
My gut feel is, this is a bad setup, because kafka wasn't originally designed for RMDBS levels of durability, but can't point to a concrete reason why this would be the case. <comment><USER2> Can you talk more about the use case?

My question would be, why use that setup if you don't have to?

That setup is not something I would reach for unless I really really had to (and when you think you really really have to, check again, then check again, you probably don't really really have to).

How about a RDBMS like Postgres setup with streaming synchronous replication and durability-tweaked parameters?

<comment><AUTHOR> In my opinion, using RMDBS as source of truth makes more sense, because these systems were optimised for reliability, durability & data retention.

To be completely honest, some have drunk the proverbial Confluent koolaid, with kafka being the hammer to hit all nails.

I just want to communicate the risks & tradeoffs with taking this approach. Problem is, the theory sort-of holds up, if configured correctly, kafka _should_ be as reliable/durable as PG/SqlServer/MySQL cluster. But I can't find any material on companies experience running kafka this way, I.e. 'we ran this setup for a year in prod, one of our brokers disks got corrupted, but we were able to get back with no data loss, via X,Y,Z.' or 'we couldn't recover and had to accept data loss'.

EDIT: in short, are the claims made by this article reliable: [https://www.confluent.io/blog/okay-store-data-apache- kafka/](https://www.confluent.io/blog/okay-store-data-apache-kafka/)</comment></comment>


Show HN: 2 guys -- Learned to code in 3 months and built this - <AUTHOR>

4 months ago sucked. Our technical co-founder quit after 6 months and we still had no product.
My co-founder and I had been 'working' on our startup for 8 months. I say 'working' because as the "business people" - there wasn't a whole lot we could do except philosophize. We had gotten really awesome intros to some of the top VCs and entrepreneurs, but had nothing to show.
And now we felt stranded. Had we wasted 8 months of our lives? Identity crisis? Check.
So we did what any rational person would do - we ran to the mountains. Literally. In Boone, NC - we talked about why we started Knowit, what we believed. We talked about how we had taught ourselves so much on our own time, but couldn't save or share what we were learning. We didn't get any real and tangible credit for it.
And then it hit us - we are saying that anyone can teach themselves anything. That's the web. We simply had to give it a shot -- we owed it that. So we taught ourselves to code, for free, from the web. In many ways apropos.
We starting building and 3 months later we have a real product with over 375 users who have added over 3000 items.
We built Knowit to make it really easy to save and share your thoughts on the things you read, watch, and listen to. We want to help people build an online portfolio of what they know and what they're learning. We are excited about helping people take the things they are already doing - and make them count.
Check it out at http://knowitapp.com/ and example portfolios at http://knowitapp.com/jeff and http://knowitapp.com/nash - Things are still very early - and we have a ton of really cool ideas. What do you all think?? Are we doing this right?
If you want to check it out in more detail - we set up an invite backdoor for HN. http://knowitapp.com/invite/hn
What we learned from all this: - You can learn almost anything on the web from free resources. (and everything w/i 10yrs)
- It's easier than you think - the hardest step is the first one.
- If you are not technical - start learning - you will never regret it.
- Save and share your journey and teach the rest of us how you got so awesome. <comment><USER2> Clickers!

<http://knowitapp.com/>

<http://knowitapp.com/jeff>

<http://knowitapp.com/nash>

<http://knowitapp.com/invite/hn>

<comment><AUTHOR> Thanks Rust.

</comment></comment><comment><USER3> Congrats! I love getting inspiration like this!! I just signed up through the backdoor, good looking website. Are you going to publish your blog on how you got it done? I see the link to the blog on the site isn't working at the moment.

<comment><AUTHOR> We we're pushing our blog over to Tumblr, but this feature has been down on tumblr over the last two days. But yes - soon! Thanks!

</comment></comment><comment><USER4> Nice looking site! When you say "business people" do you mean "interaction designer"? Orrrr did you also have no experience in UI?

Congratulations!

<comment><AUTHOR> Our only experience in UI was using the web. I had extremely little html experience, no css, no jquery. Thanks a lot!

</comment></comment><comment><USER5> Expand on this:

4 months ago sucked. Our technical co-founder quit after 6 months and we still had no product.

Did you build off work that he did? Was he not producing? You built it in three months - and he had nothing in six months? Or, were the ideas difficult to communicate that it took a crisis for you to finally buckle down and get to work?

<comment><AUTHOR> Sure thing.

Happy to communicate privately with you more (jeff at knowitapp dot com). Publicly I'll say: \- the site didnt work after 6 months and was built in python. \- we didn't know python, but Nash had read one book on php so we went from there building the site from scratch. \- We built on LAMP stack with jquery and open-source. A beautiful, intuitive MVP was our mantra. Just make it work.

</comment></comment><comment><USER6> Two suggestions:

1\. It should endlessly scroll. Clicking load more is annoying.

2\. The top part requesting my e-mail is annoying. It should not permanently stay there and take up valuable screen real estate when I'm trying to scroll down and read content.

</comment><comment><USER7> NICE! I wish I had determinated co-founders like you guys.

The UI looks good :)

<comment><AUTHOR> Thanks! We are making it up and figuring it out as we go along!

</comment></comment><comment><USER8> nice work, and inspirational. There was another one, a while ago, two guys built an iPhone app from scratch, and launched it successfully. No prior programming experience, mobile or otherwise. I can't remember the app name right now :(

</comment><comment><USER9> What languages did you use and what was your learning process?

<comment><USER10> I as well am interested in hearing more about the learning process.

<comment><AUTHOR> Will post up a blog post in the next few days!

</comment></comment></comment><comment><USER11> What resources did you use to learn what you needed?

</comment><comment><USER12> Congrats. Can you share details on which programming language you learned and roadblocks if any?

<comment><AUTHOR> The site is LAMP(php) stack on AWS ec2 and jquery on the front-end.

Let's see, roadblocks: \- front-end -- getting everything to work tolerably in IE7+ \- front-end -- the bookmarklet. Definitely the bookmarklet. Huge issues injecting javascript into DOMs. The version live now finally works every time without fail. (details: array leaks, style conflicts, calling in jquery, etc) \- back-end -- nothing too serious. Joins in mySQL took a while to get right. Ajax can be finicky but nothing too bad. \- Server -- we hadn't set up DDOS protection on our amazon server and so the site went down a few times. There are some great tutorials for getting a Lamp stack up on ec2 - if you know what you are doing should only take five minutes.

Needless to say figuring out what to search is the biggest problem. Once you know what to search, stackoverflow and google can fix all your problems.</comment></comment>


Why Photographer David Burnett Shot 4×5 Film at Impeachment Hearing - <AUTHOR> https://pdnpulse.pdnonline.com/2019/11/why-photographer-david-burnett-shot-4x5-film-at-impeachment-hearing.html <comment><USER2> > Burnett's stock archive, we should note, includes coverage of the Watergate > hearings in 1973, an impeachment hearing that felt, Burnett says, less > "tribal."

I won't pretend to know much about Watergate or what he meant by "tribal", but I thought it ironic that hearings about one party literally tampering on the property of another, felt less tribal.

<comment><USER3> He was also in Vietnam.

This was a fascinating story about the "Napalm Girl" photo. He was also there and struggling to load film into a camera when Nick Ut took that iconic image.

[https://doculinks.wordpress.com/2012/07/06/david-burnett- nap...](https://doculinks.wordpress.com/2012/07/06/david-burnett-napalm-girl/)

</comment></comment><comment><USER4> They didn't mention the 4x5 look, 4x5 is huge [0] and gives you an insane amount of detail with shallow DoF, perfect for portraits. What cracks me up every time is that his camera uses a lens made for reconnaissance planes during ww2 [1]

I'd encourage anyone interested in photography to try film, gear is quite cheap these day (I just bought a medium format lens for 100$, it used to be sold for 1500$ less than 30 years ago), it's quickly getting more expensive though. You can easily develop your own film at home and scan it yourself too

[0] [https://www.thephoblographer.com/wp- content/uploads/2014/06/...](https://www.thephoblographer.com/wp- content/uploads/2014/06/frame-sizes.png) [1] [https://lommen9.home.xs4all.nl/aero/](https://lommen9.home.xs4all.nl/aero/)

<comment><USER5> I'd add that development is also pretty foolproof since there are charts with precise times and concentrations for every known film and developer combo. There's also stand development which is actually fool proof.</comment></comment>


The original Macintosh user manual - <AUTHOR> https://www.peterme.com/2007/08/27/thoughts-on-and-pics-of-the-original-macintosh-user-manual/ <comment><USER2> I have one in Portuguese and is beautiful and everything is very well explained.</comment>


Why You Need to Take 50 Coffee Meetings - <AUTHOR> http://www.bothsidesofthetable.com/2011/08/15/why-you-need-to-take-50-coffee-meetings/ <comment><USER2> Only 50? I'd say double that.</comment>


Python 2 will be replaced with Python 3 in the next RHEL major release - <AUTHOR> https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.5_release_notes/chap-red_hat_enterprise_linux-7.5_release_notes-deprecated_functionality <comment><USER2> This is good:

\- Python 2 support officially ends somewhere in 2020

\- most popular packages are now compatible with Python 3

\- Python 3.7 performs about as well as 2.7 with future release expected to be better

Although it still took way too long, if you consider Python 3.0 was released about 10 years ago.

<comment><USER3> The double standard when it comes to Python is mindblowing. No other language could have gotten away with such ridiculous fragmentation and perf regression for such a long period of time.

<comment><USER4> I think it's the opposite. When other languages make incompatible changes, they have serious problems (e.g perl6).

Previous versions of python were back-compatible. Java versions stress back- compatibility. I don't know if HN can find any counter-examples, of a language that thrived through an incompatible, code-breaking upgrade.

Python has done everything possible to avoid this fate, by maintaining 2.7. And I'm not even convinced python has gotten away with yet (e.g. kalite, offline khan academy, needs 2.7). RHEL may end up reversing this. Give it another ten years!

Amd the Enterprize is the most back-compatible thing you've ever seen. This change is going to break lots of code, and they will reverse or lose customers.

<comment><USER5> _I don 't know if HN can find any counter-examples, of a language that thrived through an incompatible, code-breaking upgrade._

Of course. Swift 3 is one example. Ruby 1.9, as others have pointed out, is another.

PHP is yet another, and perhaps more relevant because it is close to contemperaneous. It had its "Python 3 moment" with the migration to PHP 5. Lots of BC breakages.[0] That transition took about 3-4 years for most.[1] Most users are now on the current major version, 7, and the remainder on 5 are mostly using its latest release (EOL is EOY). No one uses 4.

[0] [https://secure.php.net/manual/en/migration5.php](https://secure.php.net/manual/en/migration5.php)

[1] [https://web.archive.org/web/20110720002753/http://www.gophp5...](https://web.archive.org/web/20110720002753/http://www.gophp5.org/faq)

<comment><USER6> Swift 3 is compiled. So you can provide the binaries and be ok.

Ruby 1.9 is a great example of why you should not be too nice: they told everybody "you have a fews months, deal with it". The community moved. Python said "poor things, we understand, take those tools and years to do the thing", and the community cried, and did nothing.

PHP literally failed. They canceled V6 and jumped to V7.

The funniest part ?

None of those languages are even close to Python popularity.

Swift is not even used for most Apple codebase. Python supported even Atari.

Ruby and PHP has almost no use case outside of the web. Python is used by OS, on the web, in GIS, by data analysts, for CGI, in AI, for sysadmin, to make GUI, video games...

And Python is much, MUCH older. 1990. 4/5 years older than Ruby/PHP. It has way more technical debt to pay. Swift ? 2014

Yeah the migration was badly handled from some aspects. But honestly, given the challenge and track record of the competition, it's not too shabby.

<comment><USER7> Comparing Python and Ruby upgrades is not fair.

Ruby 1.9 was working mostly the same as 1.8 while provising 2-3x speed improvment, and new exciting features.

Python 3 breaks even the basic Python 2 hello world, everything was notably slower, and not anything new and exiciting feature-wise apart ubified string support.

<comment><USER5> Yes, Python really botched it.

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> It's for system use. You should never depend on the vendor-supplied compilers for anything, because their goals are different from your (the developer/application-wrangler's) goals. Always develop in a defined, controlled virtual environment, period. If you want be stylish, there's a fancy new thing called a container in which you execute your application in defined, controlled environment. :-)

<comment><USER9> This is really by far the most important point in the thread. I understand the points about embedded use cases and all the other stuff that people bring up when the flames come out in 2 vs. 3. But this is specifically about RHEL.

If you're using RHEL, the point here is almost entirely moot. You should never have been depending on system python for anything important anyway. If RHEL replacing Python 2 with Python 3 breaks any part of your code or your company, you have already made a huge shit sandwich for yourself.

The fix, however, isn't that bad. Just start using virtual environments. It will take you a while to unravel hidden dependencies, but it's doable in a reasonable amount of time.

</comment></comment><comment><USER10> Django also recently dropped python 2. I think it's nice that we're finally seeing support for Python 2 end. We've been in a frustrating middle ground of supporting both for too long now.

</comment><comment><USER11> About goddamn time. Now let's take care of PHP <= 7 and Node <= 8 and us sysadmins can stop living a foot in a decade ago and a foot in today.

<comment><USER12> > _Node <= 8_

Great! Mostly no problem. The backwards-incompatible changes are few and seem to rarely be used in the projects I've seen.

> _PHP <= 7_

Totally different story. PHP does upgrade slowly, but many of the backwards- incompatible changes are almost impossible to detect without 100% code coverage. A lot of legacy PHP < 7.x code bases are also going to be lacking perfect coverage.

That said, I think bespoke PHP is less common than people think. The WordPress/Drupal/whatever installations are major drivers of the usage numbers for PHP.

<comment><USER13> We upgraded our bespoke, massive php5 codebase to php7 in a week.

The much bigger upgrade was 4 to 5. We have something like 6 custom C extensions and that was a huge pain.

php7 is a great language though. Worth the pain.

<comment><USER12> I believe you did that conversion and that it worked for you. I still don't think it's a slam dunk when you're talking about a stable, production product that can't have errors. It's almost impossible to do the conversion with static analysis alone, unless you know something I don't.

</comment></comment></comment></comment><comment><USER14> This is good, but it's sad that #!/usr/bin/env python will no longer work as the go-to shebang since python won't exist, only python3 will exist by default.

Geofft[1] has a nifty solution but it's not as cross platform as the old tride-n-true #!/usr/bin/env python:

#!/bin/sh """"type python3 >/dev/null 2>&1 && exec python3 "$(readlink -f "$0")" "$@" #"""

""""exec python "$(readlink -f "$0")" "$@" #"""

[1] [https://ldpreload.com/blog/usr-bin- python-23](https://ldpreload.com/blog/usr-bin-python-23)

</comment><comment><USER15> I think this has been the ugliest, most badly managed update for a major language since Perl6. And this is not completely over, yet. Over the next 5 years I still expect to see people complaining about this Python3 thing. I hope the designers have learned a lesson.

<comment><USER16> Perl6 isn't an update to Perl5. It's a completely unrelated language with a misleading name.

<comment><USER17> You could easily argue the same is true with Python2 and Python3.

<comment><USER18> With one main difference being that we are perfectly content to let people continue to use Perl 5. (Most of us anyway)

Another is that Perl 6 brings in many features from other very disparate languages while making them seem as if they always belonged together. It doesn't seem like Python 3 brings that many new features.

</comment></comment></comment></comment><comment><USER19> The Internet may switch to 3 but industry will stay on 2.7 for the next decade and no EoL will change that. There is absolutely nothing that can change that because there is zero benefit to rewriting a decade's worth of code and no manager will authorise that.

So don't bin those 2.7 books just yet if you want a job at a big co.

<comment><USER20> ... Said the COBOL developers.

To some degree, you may be correct, that there will be companies that refuse to upgrade for many years. By and large, I think most people will start to switch:

* Small orgs will begin to see costs of maintaining legacy code skyrocket as it becomes harder and harder to get 2.7 interpreter support for newer kernels. Those that aren't already transitioning now will eventually bite the bullet.

* Medium orgs will probably be the laggards. They have enough funds to pay someone else to make compatible interpreters for them. Your observation about manager authorization very likely applies here so many probably won't bother to upgrade without an internal skunkworks-style initiative.

* Large orgs will upgrade. Their infosec departments will freak out that an old, "potentially insecure" language is being used, regardless of third party vendor support. I see this a fair bit now in the PHP space; where RHEL supports and backports patches for old, insecure versions of PHP, but the infosec people still can't stand it. These days, infosec is getting more and more pull in every huge organization, so it wouldn't surprise me at all to see them start to treat 2.7—or the old, un-updated packages that are locking someone to 2.7—as a possible attack vector and force a change.

All that said, you are right about jobs. If someone knows 2.7 inside and out, they will start to see higher and higher paying contract gigs over the next 15-20 years. Just like the COBOL programmers saw.

<comment><USER21> ...and then there's Mega Large orgs, like Google, who are used to maintaining their own software.

I am super curious what Google will do. The thing to watch is whether Chrome/Chromium (and therefore Node.js) can ever be built without using Python 2.7.

<comment><USER22> Mega large orgs have already moved, in some cases. They have the advantage of being able to throw significant resources into infrastructure to make switching easy.

<comment><USER21> I'm thinking about Google, Mozilla, Dropbox, etc. They still use a lot of Python 2.

<comment><USER23> Google created Golang and then created a tool to convert Python2 -> Go.

[https://github.com/google/grumpy](https://github.com/google/grumpy)

<comment><USER21> That grumpy project seems to have stalled in the last 6 months.

I feel like Google hasn't made much progress converting away from Python 2.

Python 2.7 is still required to build Chrome, for example, and I don't think there are any plans to change that. [https://bugs.chromium.org/p/chromium/issues/detail?id=61357](https://bugs.chromium.org/p/chromium/issues/detail?id=61357)

And, I believe they use 2.7 whenever they use TensorFlow.

</comment></comment></comment></comment></comment></comment></comment><comment><USER24> Let's hope this will finally change the "compatibility with py3 is a feature" to "no py3 compatibility - no library" state of things. It's really surprising how stubborn some teams are.

<comment><USER25> What's amazing is that pip3 gladly downloads and tries to install py2 stuff. Because package/dependency management is a complete afterthought in Python.

And sure, it'll get better, and finally we have lockfiles (Pipenv), and maybe eventually a proper SAT solver will help resolving dependencies [https://github.com/pypa/pip/issues/988#issuecomment-36084645...](https://github.com/pypa/pip/issues/988#issuecomment-360846457) , aaand gradual typing is nice too, and maybe eventually we'll have a proper async library (python-trio, as asyncio is there, but not low level and/or not ergonomic enough).

Yet Python is free and open, and amazing, and I haven't contributed much other than report bugs, so I'm not complaining, just comparing to other ecosystems.

<comment><USER26> Conda has a silver and has been available for however many years. It also works well with pip.

Among people complain about python package management, I have never heard an argument against Conda other than "I don't like that they recompile base python". What's your reason to discount conda?

<comment><USER27> Our python is compiled with the latest versions of gcc (on Linux) and clang (on macOS). So you're getting gcc 7.2 compiled python on RHEL/CentOS 6. And all of the security and performance enhancements that come along with it [1]. (Ok we're still on 7.2; we'll update to 7.3 in the next couple months.)

[1] [https://www.anaconda.com/blog/developer-blog/improved- securi...](https://www.anaconda.com/blog/developer-blog/improved-security- performance-in-anaconda-distribution-5/)

<comment><USER27> P.S. If you're looking for a latest and greatest C/C++ compiler toolchain that's backed with "production" testing via hundreds of millions of package installs and works on older versions of linux...

</comment></comment></comment></comment></comment><comment><USER28> If this is an issue for you, I would highly recommend that you have a look at virtual environments via tools like virtualenv and conda. That way you'll be able to run all the versions you like.

<comment><USER29> I tried this a while ago.

I think Conda allows installing different versions of Python (good) but it doesn't play well with Pip (bad)? Last I tried it also bundled dependencies in its own particular way (ugly)? I think it was more geared towards SciPy and NumPy and other scientific development than towards general purpose programming.

<comment><USER27> > doesn't play well with Pip

The focus of my _current_ right-now dev work is to teach conda to better understand non-conda-installed python packages so we respect what's already there even if it's not a conda package.

<comment><USER29> That would be a humongous boon, especially for Windows. I really wanted to use Conda, but I really, really needed Pip for packages. I don't really remember what blew up when I tried it, but it wasn't pretty.

Glad to know that soon enough that will be just a memory :)

</comment></comment></comment></comment><comment><USER30> I'm a Rubyist. Why are Python users so doubled down on keeping on with Python 2? I can't imagine using Ruby 1.8.x at this point, and even older versions seem well outside the realm of consideration.

<comment><USER14> We're not, nobody uses Python 2 anymore. It's just a shame we have to type "python3" and "pip3" now even when Python 3 is the default on a distro.

<comment> cup-of-tea I don't. I use pyenv and it's always just python, even though I have many different versions on my system.

<comment><USER14> Same with virtualenv, but without users of scripts using pyenv or virtualenv the shebang is broken if it's pointing to #!/usr/bin/env python. Many users of scripts aren't python developers, so they won't be using pyenv or virtualenv. Just wish we had a cross-platform way to run python scripts reliably like we did when /usr/bin/python always existed.

</comment></comment></comment></comment><comment><USER31> I've recently started writing all my scripts in Python 3 as I need to future- proof some things. And it just works now. No problems. So if you tried Py3 years ago and had issues, try again today.

</comment><comment><USER32> `brew install python` also installs python3 now

<comment><USER33> yes and it took me a while to fix things. I still need to maintain my python2 code

<comment><USER34> Doesn't OSX come with python2 by default?

<comment><USER35> It does, what can break is what `python` points to.

<comment><USER36> This is un-broken as of 2018-03-09[1,2,3]. `brew install python` installs python3, but it only installs a link to this at `/usr/local/bin/python3`, not `/usr/local/bin/python` (as it did for a while).

In other words, `brew install python` now complies with PEP 394[4].

      $ brew install python
      …
      ==> Caveats
      Python has been installed as
        /usr/local/bin/python3

      Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
      `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
        /usr/local/opt/python/libexec/bin
      …
      $ ls -l /usr/local/bin/python{,2,3}
      lrwxr-xr-x 1 osteele staff 38 Mar 22 11:23 /usr/local/bin/python -> ../Cellar/python@2/2.7.14_3/bin/python
      lrwxr-xr-x 1 osteele staff 39 Mar 22 11:23 /usr/local/bin/python2 -> ../Cellar/python@2/2.7.14_3/bin/python2
      lrwxr-xr-x 1 osteele staff 34 Mar 31 12:27 /usr/local/bin/python3 -> ../Cellar/python/3.6.5/bin/python3

[1] [https://brew.sh/2018/04/09/homebrew-1.6.0/](https://brew.sh/2018/04/09/homebrew-1.6.0/)

[2] [https://github.com/Homebrew/homebrew- core/issues/24812](https://github.com/Homebrew/homebrew-core/issues/24812)

[3] [https://discourse.brew.sh/t/python-and- pep-394/1813](https://discourse.brew.sh/t/python-and-pep-394/1813)

[4] [https://www.python.org/dev/peps/pep-0394/](https://www.python.org/dev/peps/pep-0394/)

</comment></comment></comment></comment></comment><comment><USER37> As someone completely ignorant in everything python... can someone explain why Python 3 has never replaced Python 2?

<comment><USER38> For us the primary reason is because not only is Python 2 the default in RHEL 6 and RHEL 7 (and thus downstreams like CentOS and Scientific Linux), they don't even ship with Python 3 or have it in the base yum repos, so getting it installed on our thousands of diverse systems is nontrivial.

Furthermore we have a large base of scripts, owned by many people, that use Python as they would use bash, so changing the default Python on them will be like linking /bin/bash and /bin/sh to /bin/csh.

<comment><USER39> There's SCL. It's a pain in the ass, especially if you want to ship RPMs, but it works and is - more or less - official.

</comment></comment></comment><comment><USER40> Great to hear this, just tried to install Python 3.6 on RHEL yesterday without luck, ended up downgrading my code to Python 2.7.

<comment><USER41> Did you use SCL?

</comment></comment><comment><USER42> Anyone know if /usr/bin/python will point to python3?

<comment><USER43> That would be really bad.

The new scripts should just use the right #! string

<comment><USER44>
      #!/usr/bin/env python2

There, fixed it.

Much like `#!/usr/bin/env bash` for bash scripts instead of `#!/bin/bash` (which won't work on many OSes)

[https://github.com/search?q=%23%21%2Fusr%2Fbin%2Fenv+python2...](https://github.com/search?q=%23%21%2Fusr%2Fbin%2Fenv+python2&type=Code)

<comment><USER45> You can't "there fixed it" for the infinite number of projects that exist in the field that this breaks. "It never worked on FreeBSD" is very different from "it no longer works on new versions of RHEL".

<comment><USER46> >You can't "there fixed it" for the infinite number of projects that exist in the field that this breaks

Of course you can. Python files are plaintext.

        $ find ./some/module -name "*.py" -exec sed -e 's:#!/usr/bin/python:#!/usr/bin/env python2:g' -i {} ;

</comment></comment></comment></comment></comment><comment><USER47> I wonder how things will fare for Mercurial, or GYP (used by Node.js).

</comment><comment><USER48> Any leaks/leads when Red Hat will announce RHEL 8.0?

<comment><USER21> > We're expecting to hear more about RHEL8 next month. Other current > expectations are that Btrfs will be completely gutted in favor of the > company's own Stratis Linux storage tech, the workstation session using > GNOME on Wayland by default, shipping with the GCC 7 compiler, and possibly > shipping with the Linux ~4.14 kernel. We're expecting an alpha sometime soon > and would be perfect if announced at May's Red Hat Summit 2018.

[https://www.phoronix.com/scan.php?page=news_item&px=RHEL-8-N...](https://www.phoronix.com/scan.php?page=news_item&px=RHEL-8-No- Python-2)

<comment><USER48> Thank You.

</comment></comment></comment><comment><USER49> > next RHEL major release

This links to the release notes for RHEL 7.5, which was released today, and is a minor release (in RHEL terms).

<comment><USER50> "Python 2 has been deprecated Python 2 will be replaced with Python 3 in the next Red Hat Enterprise Linux (RHEL) major release."

So, deprecated in RHEL 7.5 as a fair warning to everybody and replaced with Python 3 in RHEL 8.

You'd know this if you had actually read the linked release notes you mention. ;)

<comment><USER49> Ah. Still weird to say that "Python 2" is deprecated as of RHEL 7.5 when both the installation frontend and yum use Python 2.7.5, and Python 3 isn't even on the installation media.

(Grabbed the ISO and made sure the above assertions are true.)

</comment></comment></comment><comment><USER51> They're two different languages. I don't see why python3 "replaces" python2 anymore than say ruby does. IMO they should have separate namespaces and invocation.

<comment><USER52> They do -- it's trivial to have python2 installed on the same system as python3. The deal with RHEL is that they will no longer include python2 packages at all.

That isn't really to say that somebody else won't make packages.

<comment><USER51> Thank you, that's much more clear. So RHEL is deprecating their python2 package i.e. declaring their intent to eventually remove it.

For some reason "replaces X with Y" suggests to me that they swapped one for the other (e.g. /usr/bin/python) which seems error-prone.

<comment><USER53> There are things included in RHEL which use Python. These will now use Python3 instead of Python2, so from that perspective it has been replaced.

</comment></comment></comment></comment><comment><USER54> The real news is that Sendmail is also deprecated.

</comment><comment><USER55> Several shared-hosting companies don't support Python 3 yet. HostGator's default Python is still 2.6.

<comment><USER56> Python applications are second class citizens at HostGator and other cheap hosting services. Most people using Python applications are using VPS, containers or PaaS because deploying Python applications is a lot harder than just "drop the files" somewhere like it is with PHP.

</comment></comment><comment><USER57> As a point of reference: Py 2->3 has taken a bit over a decade.

The first electric computer is about 8 decades ago.

</comment><comment><USER58> The legacy is dying, finally.

</comment><comment><USER59> About time. Now fix your vim distro.

</comment><comment><USER60> But woowee, we might get a Perl from 2015…</comment>