Pentagon drafts today's kids to build tomorrow's aerial killers  - <AUTHOR> http://www.extremetech.com/electronics/115823-pentagon-drafts-todays-kids-to-build-tomorrows-aerial-killers

<comment><USER2> An interesting idea, but to pull yet more parallels from Ender's Game: what about emotional trauma when they see something they invented / inspired used to kill people? Can they sue the government? Will there be _any_ repercussions?

As much as I'd _like_ to believe they won't be working on projects like that, I think it's quite literally impossible to make that claim. A better armor idea may become a more-penetrating bullet idea. Is there such a thing as a purely-defensive technology?

<comment><USER3> > Is there such a thing as a purely-defensive technology?

I think that most medical technologies, at the least, can be considered purely defensive. Ie, a mobile defibrillator or penecillin.

Then again, inventions like spray-on bandages increase the effectiveness of an army, which would aid in offensives. But I think the inventor of any such spray-on bandage would agree that the benefits to humanity outweigh the fact that armies can march a little longer with the invention.

So I think there's probably a large class of inventions that have humanitarian uses that "outweigh" the military ones from a general conscious perspective. Spray-on banadages, canned food (which may have allowed Napolean to conduct more and greater expeditions than he would otherwise), etc.

Aside, there have been many purely war-motivated or wartime-motivated inventions that have gone on to aid the public at large. (See for instance the history of the tampon, or the history of canned food).

<comment><USER2> Spray-on bandages rely on aerosoling a drying, congealing liquid which hardens quickly. I fail to see how that core tech can't be slightly adapted to do something harmful.

Penicillin isn't really an _invention_ , nor is it a technology, but we are capable of biological warfare because we know about cellular structures and resistances.

Mobile defibrillators are essentially tasers without a propellant and barbs.

\---

There are _definitely_ cases where I'd argue something made for war has done more good than harm. Lots of them, even. But I didn't invent those things - how does the inventor feel about it all? If your accounting software turned out to have a unique algorithm that made it easier to keep ammo supplies available on a battlefield, resulting in a few thousand more deaths, how would you feel about it? What if it were tens of thousands? More?

</comment></comment></comment><comment><USER4> Seems like a bit of a beat-up to me. The page that they link to hardly seems aimed at kids, and the only bit there about the MENTOR program (that acronym helpfully left out of the article) says this:

The Manufacturing Experimentation and Outreach (MENTOR) portion of the FANG program focuses on engaging high school-age students in a series of collaborative design and distributed manufacturing experiments. DARPA envisions deploying up to a thousand computer-numerically-controlled (CNC) additive manufacturing machines—more commonly known as "3D printers"—to high schools nationwide. The goal is to encourage students across clusters of schools to collaborate via social networking media to jointly design and build systems of moderate complexity, such as mobile robots, go carts, etc., in response to prize challenges.

For balance, here's MAKE magazine's take on it:

<http://press.oreilly.com/pub/pr/2962>

</comment><comment><USER5> From inspiring kids to land on the moon and explore space, it goes down to this? Surely, there can be more productive ways to harness and encourage creativity and STEM. What about, say fuel efficient passenger planes, or cataloging cancer genes?

<comment><USER6> I'm not sure what angle they'd play with advertising, but I think "build a fighter plane!" sounds a lot more exciting to a kid than "improve the fuel efficiency of passenger planes!"

<comment><USER5> I agree. Though something like "build a personal rocket ship", like SpaceX or the lot doesn't sound too bad either. I am just disappointed that the civilian/exploration side of NASA isn't the big dream anymore.

<comment><USER2> 40 year old tech (even if it isn't, it is from the outside) probably doesn't help. NASA used to be a driving force behind more-visible tech, now they just appear to be failing to keep up. It has lost some pizazz since the Cold War.

</comment></comment></comment></comment><comment><USER7> Humanity continues to hang from Eisenhower's 'cross of iron'.</comment>


An Introduction to Using Patterns in Web Design - <AUTHOR> http://37signals.com/papers/introtopatterns//index

<comment><AUTHOR> This is old stuff, but I love how relevant it is today. Timeless.</comment>


The Yahoo Problem - <AUTHOR> http://sapan.svbtle.com/the-yahoo-paradox <comment><USER3> _> So Mayer had a plan to bolster Yahoo's mobile offerings and once again make it a top internet destination. However, a plan like this has three drawbacks: 1) Developing desirable well-trafficked mobile properties requires lots of hard-to-hire-for mobile design, engineering, and product talent. So Mayer chose to acquihire promising mobile startups instead._

Actually, when Mayer came on to Yahoo as CEO, Yahoo recruited pretty efficiently. I am a decent mobile engineer and I was _really_ tempted to apply when a recruiter reached out. It was the wrong moment for me, being really happy at my job that time - a year later or before I would have likely proceeded with the interview.

Another strong mobile engineer friend of mine got rejected on the Yahoo interviews and was pretty disappointed at the time. The story recruiters were telling was that they are builing a bunch of greenfield mobile projects, as well as having a couple of "startups within a big startup", with the financial security of Yahoo. This was very credible at the time and I'm sure they did get a lot of engineering talent into the company.

I do not know what the main things were that went wrong. However I would not pinpoint it to recruitment or lack of engineering talent: they did well on that. As an outsider engineer my guess would be culture and non consistent strategy or vision. Building mobile apps for the sake of building mobile apps and getting users was never a viable vision even in 2012.

<comment><USER4> Agree - I know a few mobile folks (designers and devs) who went to Yahoo during this time and it definitely seemed like an exciting place to be.

I remember in that period Yahoo successfully turned their reputation around from "eww why are you applying there" to "wow maybe I should too". They were doing some very cool greenfield stuff, and with the release of the new Weather app (among others) they looked like they could walk the walk.

Ultimately many of these products sputtered, but of all the things Yahoo did right under Mayer, recruiting and industry reputation was definitely one of the bright spots.

Though that said, none of the people I know lasted very long at all, so I suspect there's some deeper dysfunction.

</comment></comment><comment><USER5> Another mis-analysis of Yahoo. The situation is and had been very clear- Yahoo has never accepted what it is: A conglomeration of useful web services and utilities. Not sexy, but used by millions and potentially very profitable with properly tiered service levels. Instead it has always called itself a "media company" and chased after the success of its competitors. When I worked there a decade ago it wanted to be Google. Now it wants to be Facebook, YouTube or god knows what. This, combined with the inexperience, ego and vanity of Mayer assured Yahoo would continue its slide to irrelevance. Very sad.

<comment><AUTHOR> Would you agree though that Yahoo has not kept up with users moving their attention to smartphones, and there will be a corresponding loss in users and profit in the long run? If so, I believe Mayer was trying to correct this through her efforts.

<comment><USER5> Amazingly, Yahoo Stocks, Weather and Mail are in the top 25 apps by usage. But this isn't because of any particularly impressive strategic thinking on Y's part. Their big efforts like Katie Couric and Community flopped like crazy and their "MaVeNS" strategy (if you want to call it that) is pure stupidity: Mobile, Native, Video and Social? Mobile isn't a product, and even just as a general focus, Google seems to be making a bundle from the PC Web still, so why would Yahoo not continue to put massive effort into its most well known service? Native advertising is... mobile advertising, so OK. Video as a category is _owned_ by YouTube, Netflix and various big media companies like HBO, so focusing on that is as futile as focusing on Social which is _owned_ by Facebook, Twitter, Snapchat, etc. In summery, there's no strategy. Mobile is obvious, advertising is how Y makes money so that's a no brainer, and the rest is suicide.

Mayer's thinking is simplistic, shortsighted and driven by pure vanity. Nothing she's doing now or is willing to do can fix Yahoo.

<comment><USER6> > Mobile isn't a product, and even just as a general focus, Google seems to be > making a bundle from the PC Web still, so why would Yahoo not continue to > put massive effort into its most well known service?

Because mobile is growing faster.

</comment></comment></comment></comment><comment><USER7> His point about Yahoo being a conglomerate the day BABA started trading I think is really important. One of the biggest issues for the CFO of any public conglomerate is that it becomes very easy to see which divisions are weak.

As he mentions, when the value of BABA grew it actually created a problem for Yahoo in that it made it clearer to analysts what the real value of Yahoo was. Yahoo leadership must have know this and realized this could cut down the time they had for their turnaround.

To show the other side of being a conglomerate there are a few other interesting companies that operate like conglomerates in Yahoo's space but do so well...

Look at Microsoft....They are essentailly a conglomerate now, most people coud name their revenue stream... OS, Office, Servers and tools, Azure and what ever Bing, Xbox etc are rolled into.

Every reporting quarter people can see with a fair bit of clarity how well their search and console efforts are doing, and people did point to the huge losses early on for that division. If Microsoft didn't have such strong leadership the entertainment division may have been shuttered.

Google is an example of a conglomerate that went that way for a different purpose. They were in competition with Baidu, Bing, and Facebook for search revenue and they wanted to better hilight just how well they were doing. So they form Alphabet so they can better show just how much they spend on moon shots and at the same time show just how profitable their advertising revenue is.

</comment><comment><USER8> I figure Mayer was brought on to do one thing: sell the firm, at the best possible price.

The Alibaba stake serves as a barrier against hostile takeovers (21B is a lot of capital), but when the firm really does need a buyer, they don't have one. Presumably Mayer's goal is to attract a bid from either Google or Microsoft. She has contacts within Google, and should have a decent understanding of how the firm values acquisitions. Hence the layoffs, constructive dismissal of remote workers, the Firefox bid, and such.

</comment><comment><USER9> I have a question about this article and in general about every article in the lines of

      -how to save X
      -what was the problem of Y
      -what should XY focus to fix the problem

How is it possible for the poster (say a blogger or a more pro journalist) to be able to pinpoint a problem, a solution or to offer a plan to follow to get X afloat?

I mean if every one knows how is it that X still cannot get afloat, they could be hired to fix the solution but this is the case under which Marissa in this case were hired right?

Or are this articles baseless most of the time?

<comment><USER10> Ex-employees and Silicon Valley insiders often do have valuable insight, including foresight.

Boards generally hire a CEO to sort out the issues rather than "crowd- sourcing", so even informed opinion is not used.

Marissa was a better choice than the previous bozos, but still a bozo - somebody who only had one job since uni, dated the founder of Google, and never was a CxO in a public company. Shame on the Yahoo board, yet again.

In other words, not a businessperson.

<comment><USER11> I really wish the restrictions can be reduced or removed so @pmarca etc can tweet more on the companies of which they are on the board of. Same for the CEOs itself, and CEOs and other executives should be allowed to tweet at board members and vice versa.

</comment></comment></comment><comment><USER12> Off-topic: It's fascinating this was written by a medical student who writes code in his free time.

</comment><comment><USER13> It is so stupid that we have this concept that managers should maximize shareholder value as if they are the only stakeholders in a company.

Really and truly what did the current shareholders do for YHOO on a daily ongoing basis?

The current shareholders did not invest any money in YHOO - they bought their shares from 3rd parties (YHOO did not get any of that money )

The current shareholders are not helping make YHOO better in anyway - <USER2> shareholders in any public company are just making management's job harder to think long-term and strategically.

This concept of "maximize share price" as the true role of management has lead to financial engineering of fiscal reporting, and then subsequent earnings restatements.

</comment><comment><USER14> Build something people want. When was the last time Yahoo did that?

I briefly used Yahoo Weather until they introduced huge ads and then deleted it. Prior to that I used Flickr and Yahoo Mail in 2004/2005.

</comment><comment><USER11> This is a good reason to look at fixing corporate taxation, I think.</comment>


When memmove() Fails - <AUTHOR> https://news.realm.io/news/when-memmove-fails/ <comment><USER2> I went over the article a couple of times, but I cannot quite tell what the actual memmove bug is. Does this assert(ptr == array + 1) imply that the buggy memmove returns the wrong pointer?

<comment><USER3> As the author of the article, I might be able to clarify a bit ;-). It is not absolutely clear to me what the bug is. It only appears on a few devices so it is not a trivial bug. It seems to be triggered by certain sizes and probably how the block is placed in memory. To answer your question: yes, the return value of memmove seems to be wrong in some cases. ChengYi He's analysis indicates that an ARM/Neon instruction is skipped which could explain the miscalculation. Why it skips the instruction (more precisely, why PC is not incremented correctly after returning from an exception) isn't clear to me or ChengYi He.

<comment><USER2> What exception(s) might happen in this context? It should be possible to examine the disassembly (or the code) of the relevant exception handler(s).

<comment><USER3> The exception is related to emulating NEON instructions. So we are talking about very low-level exceptions (or signal handling) - at kernel/C library level.

I am not sure if this exception is the cause. And even if you could examine the assembler code, you will not be able to fix it: the affected devices have reach end-of-life years ago, and vendors will not fix the bug :-( The only chance for a fix is that app developers implement a workaround.</comment></comment></comment></comment>


Startup Engineering Cookbook - <AUTHOR> http://www.slideshare.net/mrjain/startup-engineering-cookbook <comment><USER2> I really think those LAMP stuff is a bit old. Most of the startups rely on ruby / nodejs for the scalability issues and much easier Ajax/API implementations. Although if the team is best at php, there's nothing wrong with working with it.</comment>


Dell Takes Venture Arm Out of Stealth, Aims to Spend $100M Annually - <AUTHOR> https://www.bloomberg.com/news/articles/2017-05-08/dell-takes-venture-arm-out-of-stealth-aims-to-spend-100-million-annually <comment><USER2> The lingering question with corporate venture arms: How do they perform compared to "regular" vc's? as corporate managers will have relative limited upside and zero skin in the game.

<comment><USER3> I believe Intel's VC arm has been very successful, and there's the added benefit that Intel gets a better preview into technologies it may want to acquire outright -- however, I'd like to see the numbers, too.

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

<comment><USER2> Haven't look at their portfolio extensively, but their Basis acquisition, one of the earlier fitness tracker watches with optical heart rate sensor, comes to mind, which was just south of $100M, and was basically shuttered with their flagship product pulled of the market after serious issues. Like most corporate VC's Intel pursues synergy deals, For intel these are categorized as "more Moore" and "more than Moore" i.e. as long as it contains silicon it could expand their markets

</comment></comment></comment><comment><USER4> I think they mean invest rather than spend?

<comment><USER5> SPEND in this case means essentially what their budget is for the group, while INVEST would be a smaller portion (essentially, the budgeted spend minus overhead).

Merely asking and answering the question "Who should we invest in?" takes a considerable amount of money by itself.

<comment><USER6> That $100M clearly is dominated by the capital that is to be invested. The use of the verb "spend" is perhaps a slip indicating an opinion on the chance of positive ROI...

"The company is spending about $100 million annually on the funding of startups, he said."

"All told, Dell Technologies Capital has invested in more than 70 startups. It puts in around $3 million to $10 million initially and usually in the A or B rounds, Darling said. The company provides more money in later rounds."

If your investment team that answers the question "Who should we invest in?" is consuming $100M itself... I need to change jobs.

</comment></comment></comment><comment><USER7> Start with an Apple-TV-like device that we can plug to our TVs and allow us to browse the web from our couches. Compete with Google and Apple in that arena and let us developers build tools for the world to enjoy the computer ten feet away, any mobile phone can be used as remote and keyboard but you are welcome to build one for less than $50, it's just an IR remote with a keyboard, not a mobile phone.

From mainframes, to desktops, to the web, to mobile. The next revolution will be televised. Be prepared.

<comment><USER8> So like webtv 2.0?

I think that'll end the same as the first version

<comment><USER9> Ahhh, WebTV. Brings me back to the glorious late nineties. So much $$$ was wasted trying to get people to use a computer on their TV screen and trying to get people to watch TV on their computer screens. Reminds me of that classic Onion article: [1]

1: [http://www.theonion.com/article/new-5000-multimedia- computer...](http://www.theonion.com/article/new-5000-multimedia-computer- system-downloads-real-1618)

<comment><USER10> Except pretty much everybody under a certain cutoff age watches tv on their computer, exclusively. So the entire media revolutions the cable companies feared, happened.

</comment></comment></comment></comment><comment><USER11> I read title and thought that they were withdrawing funds from Stealth Technology. That would have been more interesting.

</comment><comment><USER12> So... similar to Hewlett Packard Pathfinder for Hewlett Packard Enterprise?</comment>


What happened to "rate my startup" posts - <AUTHOR>

"Rate my startup" posts used to be a big part of HN, but they aren't anymore.
I really miss them. They were a great way to get feedback for a new startup, a great way to give back to the community, and a great learning experience for all of us. Some great startups were launched on HN - here's a link to one where this guy Drew launched something called dropbox: https://news.ycombinator.com/item?id=8863
So what happened? has the community forgotten about them? Have we just moved on? Were there too many problems with spam-posts?(1) Or did everyone just launch their startups? :-)
(1) In this 3 year old post https://news.ycombinator.com/item?id=1861577 PG told us that there had been a problem with new accounts spamming the site with rate my startup posts. Presumably a cheap shot at getting visitors. <comment><USER2> What am I missing here ? Isn't "Show HN" the same thing ? We have plenty of those everyday on HN

<comment><AUTHOR> Maybe they are. My understanding (and this may well be false) is that show HN is more for cool tech demonstrations and side projects, whereas rate my startup is for launching and rating startups.

Rate my startup may well be hidden in a subset of show HN though.

Another reason may be that they don't get voted onto the frontpage? A quick search shows that there are quite a few show HN posts, but they don't get traction. [https://www.hnsearch.com/search#request/submissions&q=%22sho...](https://www.hnsearch.com/search#request/submissions&q=%22show+hn%22&sortby=create_ts+desc&start=0)</comment></comment>


Google News just got stupid - <AUTHOR> Google News just got stupid. Gone are complex custom searches w/ filters set in a scripted section. it may be an attempt to deal with fake news. Feels like a credit card raising it's rates <comment><USER2> What I find annoying is that Google News just seems to be a news aggregator - search for any news keyword and you will find links to articles from questionable/unknown news sources.</comment>


Users Always Scan for Value First - <AUTHOR> http://uxmovement.com/design-articles/users-always-scan-for-value-first

<comment><USER2> I'm sorry, did not pass my scan test :)</comment>


Top Ways to Blow a Job Interview - <AUTHOR> http://www.fins.com/Finance/Articles/SB129416698193872447/Top-Ten-Ways-to-Blow-a-Job-Interview?Type=4

<comment><USER2> The first few things don't bother me. Running late? Who cares? Wearing a T-Shirt? Excellent, so am I. Your cell phone rings? Hit decline and move on. (Or hey, maybe your kid is dying. Take the call.)

The only thing that's ever bothered me is when someone doesn't know the answer to a technical question, and then aggressively bullshits me.

Example: we ask, "so, you've used Perl OO before, can you write us an example class on the board". He does, and instead of "my $self = shift" or "my ($self) = @_" in the methods, he writes "my $self = $_". Easy thing to miss on a whiteboard, no big deal. We ask, "are you sure it's my $self = $_?" he replies, "yes definitely". We mention that it would be $_[0] or @_ or shift, but he starts yelling about how $_ and $_[0] are the same thing.

They're not. No hire.

(And if he had said something like, "oh, it's so weird looking on the whiteboard, I'm not really sure", that would have been fine. Next question, plenty of time to redeem yourself. But if you are going to yell about a trivial mistake... well, I'm glad we caught this in the interview. Not only do you not know Perl, you aren't even nice.)

</comment><comment><USER3> I have never sent a thank you note. Not for any job I've ever had. Not for those who really wanted me and fought for me and made me great offers, never. Perhaps I am rude, or perhaps companies looking to make money are not looking for "polite" developers?

And cellphones are rude, but it is not rude if you can not or forgot to turn yours off and it rings. It is not rude to apologize and briefly take the call if only to explain why you can't talk on the phone now. It is not even rude to strongly apologize further if the call turns out to be important and you have to take <5 minutes to deal with it. This applies equally to both sides.

</comment><comment><USER4> Interesting, but

> 4\. Wait a week to send a thank you note. Or don't send one at all.

got me thinking. Is it an American thing? What are you thanking them for anyway?

<comment><USER5> I've never sent a thank you note. I've received maybe 1 from the ~200 interviews I've conducted in 15 years. ( The candidate that sent it was awful.) Is anyone offended if they don't receive one ?

<comment><USER6> I can't say it would really make a big difference to get a "thank you" and I've never sent more than cursory thanks.

One thing I have done, though, when interviewing for a job, is to not ask all my ?'s when the interview enters the "what do you have to ask about us?" phase. I try to keep one in reserve and send that to someone in my interview loop after the fact. I feel that it shows continued interest in the position and I have never gotten a negative reaction from anyone for asking a follow-up ?.

</comment></comment></comment><comment><USER7> > And if you really don't want the job: "Take a call during the interview from > a girl you just started dating and sweet-talk her."

Priorities, priorities... :)

</comment><comment><USER8> Top Ways for a Company to Blow a Job Interview

1\. Make me wait in the waiting room past our appointment time. My time is as valuable as yours.

2\. Make me meet with Human Resources first. My time is as valuable as yours.

3\. Make me fill out forms. This can be done in advance. There's this thing call "the internet".

4\. Don't shake my hand. (I have no idea why this happens, but it does.)

5\. Begin the conversation with anything other than, "Hello," or "Nice to meet you." Again, why would the first words of any interview be, "How would you handle mass emails?"

6\. Don't give me your business card. As a job applicant, I'm just as important as any vendor or business associate. This is a good chance to demonstate it.

7\. Criticize my job history. Here is the reason I've had 9 jobs in the past 5 years: Because there were poorly run businesses, assholes, and mismatches. The reason I'm here is to try to fix all that. Move along.

8\. Expect me to have 10 years experience in every possible technology your entire enterprise uses. I can learn what I need. Promise.

9\. Ask me how many gas stations are in the United States, how many ping pong balls fit in a bus, or why manhole covers are round. Frankly, I don't give a shit. There, now you have the results for both your I.Q. test and your personality test.

10\. Don't follow up. I know that I'm probably not the only person your interviewing and this may take some time. Extend me the same courtesy you would the window washers. Don't make me email you every week.

<comment><USER9> Well said. #8 really resonates with me. There has never been a time when I haven't been able to get up to speed on a new stack/toolset within a few days (weeks at most). Why, oh, why can't companies just focus on hiring smart/curious/motivated problem solvers? I happen to think it comes down to lazyness - it's too hard to find those people, so companies resort to keyword soup.

</comment></comment><comment><USER10> ... Did anyone else read the title and do a double-take?

<comment><USER11> yyyup......Thought HN was being taken over.</comment></comment>


Latest Windows 10 update breaks Windows Media Player, Win32 apps in general - <AUTHOR> https://arstechnica.com/gadgets/2018/11/latest-windows-10-update-breaks-windows-media-player-win32-apps-in-general/ <comment><AUTHOR> I'm on build 1803 and I have the issue with "some Win32 programs can't be set as the default program", which is irritating because I can't open log files in SublimeText. So that isn't unique to the 1809 update.

That seems to be fixed in today's patch Tuesday updates though[1]. I'll check after that installs.

[1]: [https://support.microsoft.com/en- us/help/4467682](https://support.microsoft.com/en-us/help/4467682)

Edit: today in the US.

<comment><AUTHOR> It's fixed with the latest update.

</comment></comment><comment><USER2> Annnnd I am so comfortable staying on Win 7 And my computer is powerful enough so that I don't need to buy a new one in ~5 years

</comment><comment><USER3> The title of this submission is misleading as the issue is "some Win32 programs can't be set as the default program for a given file type"</comment>


Is it possible to improve upon the traditional BBS format or are they obsolete? - <AUTHOR> http://www.zerocensorship.com/

<comment><AUTHOR> I am just curious if BBS's can be improved upon or if news aggregators have made them obsolete.

<comment><USER2> I don't think they're obsolete, at least not completely so. There's something... "a certain je ne sais quoi" if you will, that BBS's have that most modern sites seem to lack. It's hard to pin down, but a BBS like site that can capture that essence, while remaining modern in most other ways, could potentially be very appealing.</comment></comment>


Lily: An interpreted language with a focus on expressiveness and type safety - <AUTHOR> http://lily-lang.org <comment><USER2> One of the bullet points is "Abstract data types (with `Option` and `Result` predefined)." I wonder if they mean "Algebraic data type", since I have seen Option/Result before as an example of those, and they're both commonly abbreviated ADTs. Or maybe they're trying to get at a concept I'm missing here?

<comment><USER3> Yeah, that's a mistake on my part. I pushed a fix just now. Thanks for the tip.

</comment></comment><comment><USER4> Maybe off topic, but I do a lot of ad-hoc python scripts where I drop scripts everywhere in my filesystem, but I need dependencies installed in a virtualenv so my ad-hoc scripts can access them. The problem I'm having is that sometimes things will run for a whole day and then fail at the end because of a typo or something.

I've been looking at other languages to see if there's a language like python but type checked, or some kind of prechecking so I don't lose hours of processing to a print(str+int).

I took a look at Scala but instead of virtualenv style dependency management it's more like maven projects. It has Ammonite where you can declare dependencies at the top of files but that seems kind of hacky.

The other option is Python compile time checks using type hints and mypy, which I think I should eventually learn but haven't gotten around to.

The Lily language looks like the closest thing to "functional type checked python" that I've seen and that's cool.

<comment><USER5> It was weird for me at first, but actually Rust provides a great solution here.

With [https://github.com/DanielKeep/cargo- script](https://github.com/DanielKeep/cargo-script) you can have single file Rust "scripts" with ecosystem dependencies.

When executing the file (via the cargo-script wrapper), dependencies are fetched and a binary is compiled on demand (and cached for re-runs).

It's pretty awesome for scripts where type safety is important.

        #!/usr/bin/env run-cargo-script
        //! This is a regular crate doc comment, but it also contains a partial
        //! Cargo manifest.  Note the use of a *fenced* code block, and the
        //! `cargo` "language".
        //!
        //! ```cargo
        //! [dependencies]
        //! time = "0.1.25"
        //! ```
        extern crate time;
        fn main() {
            println!("{}", time::now().rfc822z());
        }

Then you can just execute it with ./my-script, which will download dependencies, compile and execute.

<comment><USER6> Likewise with Apache Groovy, which has optional typing:

        #!/usr/bin/env groovy
        // @Grab annotation won't work in scripts
        import static groovy.grape.Grape.grab
        grab(group: 'org.apache.commons', module: 'commons-csv', version: '1.5')

        println "Starting to parse CSV"

<comment><USER7> Kotlin can do it, too: [https://github.com/holgerbrandl/kscript](https://github.com/holgerbrandl/kscript)

</comment></comment></comment></comment><comment><USER8> I read the first example of Lily on the site. I found nothing offensive in the language at all - in fact there's a lot to like particularly the readability.

Side rant. Unfortunate I can't get past the decision to use exception handling to deal with non-existing keys in map. I'm of the exception-disliking school which is thankfully growing but I guess not yet universal. For me using an exception to indicate the lack of a value corresponding to a key in a map (is it really exceptional for this to happen?) is a textbook example of exception- abuse where the code is obfuscated by the non-locality of the control flow.

<comment><USER9> Well, for good or for bad, python does the same.

<comment><USER10> You can use dict's get() method to get back a None for missing keys instead of throwing a KeyError exception. That avoids the overhead of checking `if key in dict` or catching KeyError.

<comment><USER11> Another option, it's very easy to wrap a dict in a defaultdict:

        class optionaldict(defaultdict):
    	"""
    	A defaultdict that disregards KeyErrors and returns None for missing keys.
    	"""
    	def __init__(self, *original, **kwargs):
    	    super().__init__(lambda: None, *original, **kwargs)

<comment><USER12> This is almost always a bad idea, though; it doesn't distinguish between

        {k: None}[k]

and

        {}[k]

</comment></comment></comment></comment></comment><comment><USER13> > Lily uses reference counting for memory management with garbage collection > as a fallback.

I'd just call this GC where it's rc + (presumably) a tracing GC.

> .reject(|r| r.is_space() )

This is nice. I've always found "filter" to be a confusing name. Filter in? Filter out?

'reject' is a very clear name - if it is a space, reject it.

Code looks really reasonable.

I find `: {` to be a strange idiom. Why not one or the other? Seems to distinguish between single vs multiline? I guess that's reasonable. A bit noisy.

<comment><USER14> 'reject:' is originally from Smalltalk, along with 'collect:' (map), 'select:' (complement of reject), 'detect:' (first matching element), and 'inject:into:' (foldl). I agree that these names are better -- they even rhyme so they're easier to remember!

</comment></comment><comment><USER15> Prior art like Wirth's or Modula-3 language added a minimal amount of features like exceptions or some OOP on top of simple, efficient, systems languages. Usually have a GC but many prefer ref counting for efficiency. This seems like that kind of thinking in an interpreted language.

Just going by what's on the front page: didn't dig deep into it or anything. Interesting project.

<comment><USER16> Reference counting isn't more efficient than GC; usually the value of reference counting is that it's deterministic and you can bind finalizers to them (with traditional GC, finalizers run when GC runs which may not even happen). The canonical example is a file object that closes its operating system file when the object is no longer used; this is nice in theory, but as the Python folks found out, not a good substitute for properly closing files.

<comment><USER15> Oh yeah, my mistake. I should've said predictable, not efficient. I remember people liked it to avoid long pauses coming out of nowhere.

<comment><USER7> With (naive) ARC you can still get long pauses "seemingly out of nowhere", e.g. when a large object tree goes out of scope.

<comment><USER17> That's not out of nowhere, since you have exact control over when it goes out of scope.

</comment></comment></comment></comment></comment><comment><USER18> I'm not seeing what sets this language apart. None of its features are very unique, and I believe all except garbage collection already exist in C(++). Can anyone explain what makes it interesting?

</comment><comment><USER19> I wish we had humane keyboards with special symbolic row (or two), since this:

      ["+" => (|a: Integer
      split(" ").reject(|r|
      stack: List[Integer]

is a shift-hell challenge to type it. Most of my unproductivity goes from being tired of mistyping or too concentrated on precise shifting. Even $150 keyboards go with classic/tkl layout at most; no chance unless going handmade.</comment>


Ask HN: what could a startup decipher from a public companies balance sheet - <AUTHOR>

i'm thinking of picking up on how to read a balance sheet to get an understanding of how large ad-networks, and predominantly hi-tech/online companies work, margins, where they invest, where they burn, etc<p>are there any such balance sheets that have been insightful to your startup ?<p>~B <comment><USER2> Need to remember public companies manipulate their balance sheets, how do you think GE usually grows by the same percentage every year like clockwork. If you are trying to gain detailed insights instead of generalizations it won't work. You're best bet is to talk to someone in the industry that actually knows the real numbers.

</comment><comment><USER3> try classmates.com</comment>


Show HN: No more frustration in finding perfect Subs for ur Movie/TV Show - <AUTHOR> http://findmoviesubtitle.com/ <comment><USER2> Searching by video file never worked for me.

So I made these to solve this problem. Now I spend less than a minute to get the perfect subtitle, instead of upto 30 minutes without these.

[1] [https://hackage.haskell.org/package/hastily](https://hackage.haskell.org/package/hastily) (Haskell)

[2] [https://pypi.python.org/pypi/Titley/1.7](https://pypi.python.org/pypi/Titley/1.7) (Python3)

<comment><USER3> Cool! does it work on torrent files that are still downloading? Will try this out.

<comment><USER2> It does not use the movie file at all, so yes.

What it does is this. It goes and fetch all available subtitles for a movie (You can limit this if you provide a partial release name). It then selects a candidate dialog from all the subtitle files based some criteria and prints out the time at which that dialog appear in the each of the subtitle file.

You can use this to co-relate the best subtitle file for your movie file.

A downside of this approach is that you have to seek forward and actually find out when the dialog actually occurs in your movie file.

<comment><AUTHOR> Thanks for your feedback. My experience was that 9 out of 10 times you'll be able to find a subtitle developed specifically for your movie/tv show release.

For the remaining, 10% of cases I think this approach could ease the pain a bit.

<comment><USER2> It never worked for me.

The hash/filesize will be different even if the movie has been ripped from the same source. Right? So unless someone has made the subtitle for the exact same file, that you have, as opposed to a file with the same timing as the one you have, your search will not find it. Right?

<comment><AUTHOR> True. But usually people end up watching most seeded rip/release, which will have a subtitle created for it.

I do the same and that's the reason I end up finding the perfect subtitle, 80-90% of times, through the above method.

</comment></comment></comment></comment></comment></comment><comment><AUTHOR> Hey guys, feedback welcome. I'm happy to answer any questions you have!

<comment><USER3> Getting links to each search would be something I would like to see in future! Anyways, awesome product (y)

<comment><AUTHOR> Thanks for your feedback! Yes, we have this feature on our roadmap.

</comment></comment></comment><comment><USER4> Love the interface. You're assuming you found the right subtitle but it's not always going to be the case, a list of possible or top results would be helpful.

<comment><AUTHOR> Thanks! Yes, that's a good idea.</comment></comment>


Hacking YC After Being Rejected - MELD, the GitHub for music - <AUTHOR>

mymeld.com
We've been rejected from YC a couple times, but we think we have a hack to get in. Some background, we're the founders of SoundBrush, an iPad app that lets you draw music. To date, we have 300k+ downloads, with thousands of dollars in app sales; yet we realize this is not a billion dollar opportunity. From our experience in the industry, and from talking to our users we've identified that the true opportunity lies in the discovery and collaboration of creative content. This is how MELD was born.
MELD is the GitHub for music.
It allows musicians, producers, and fans to track and comment on all stages of music creation.
We would love your feedback on our MVP at mymeld.com <comment><USER2> I actually applied to YC with a similar idea a year or two ago, but we didn't have a product yet. My team came entirely from art school, where we definitely see a market for an app like this. Maybe in the future even consider expanding to more than just music--you can include visual arts as well, like graphic design, film, even something like dance!

Best of luck!

</comment><comment><USER3> maybe too much focus on the market opp in the spp and not the problem you are solving?

<comment><AUTHOR> we generally have never look at market opp. SoundBrush started of as a fun project that ended up helping people create music that otherwise couldn't</comment></comment>


Discussing OOP with Alan Kay right now on my blog - <AUTHOR> http://www.yegor256.com/2017/12/12/alan-kay-was-wrong.html <comment><USER2> the discussion on the page itself is amazing :) from THE _dude_ himself:

> The basic misunderstanding here is between what I meant as objects and what > the term has been turned into. The main one was that the intent was to have > the interior of objects be a system of objects. I.e. "objects" and "modules" > are the same thing. This harmonizes with the compositional ideas above.

> Another misunderstanding was the idea of objects as "data types" or as > "operators" (both of which can be done by virtue of an object being > semantically a whole computer). But we really thought about objects as "loci > of goal satisfactions" and that the best messages would be to request goals > and the best objects would be those who can satisfy "large goals".

> The universality of objects could be used to make every part, with the aim > to get stronger semantically as more comprehensive objects were made. Some > of the precursor ideas here were "systems theory" (Bertalanfy, Alexander, > etc.), programming as "constraint solving" (Sketchpad), etc.

> In practice, we did a lot less during the Parc period because of some of the > resource constraints of the 70s. Still, it was clear that composition was > almost always better than inheritances, and that recursive systems of name > spaces was better than the more "Lisp-like" architecture we used for > references, etc.</comment>


Lessons learned from implementing a text editor related to front-end development - <AUTHOR> http://lpan.io/what-i-learnt-from-viw/ <comment><USER2> I'd like to post a purely positive, encouraging comment here :-)

Thanks for the article, and good job implementing an entire editor from scratch in C! That's impressive.

Also, as a very accomplished programmer who happens not to have done much recent UI programming, who has read quite a bit about React/Redux/Rewhatever, Elm, The Haskell School of Expression, etc., I find articles like this extremely helpful: you took a simple example, and clearly and straightforwardly demonstrated the underlying goals and principles of "Unidirectional UI". While I mostly "get it" already from reading articles on React-based architectures, clear reiterations of the idea are a huge aid in getting the concepts solid.

<comment><USER3> Thank you, for this! I could not say it better/nicer. I was getting upset with the overwhelming negativity here. Monday morning syndrome?

<comment><USER4> It's because the challenge he set himself isn't hard and he didn't do a particularly good job of it either (other comments have covered that so I wont reiterate it) yet he is soapboxing his experiences as if the topic isn't entry-level stuff. And I mean "entry-level" quite literally as you learn about event-driven programming in high school or equivalent IT classes. This isn't something you need a CS degree to learn.

I mean kudos to the guy for trying something new but honestly I'd expect anyone working as a developer in IT to have learned this much before calling themselves a professional. And that includes Javascript devs since so much of frontend development is event-driven anyway.

Personally I get a little fed up by just how _bad_ many frontend developers seem to be these days. I'm not tarring everyone with the same brush as I'm known some really amazing frontend devs too (though they ususally consider themselves full stack). But I've lost count of the number of Javascript developers who I've had to explain HTTP status codes and the difference between GET and POST. It feels like frontend development is a place where people go if they like the idea of coding but can't be bothered to learn how to actually programme nor any of the principles they're building their code on top of. Thankfully the topic author bucks that trend a little but even in his case the lessons he is learning are painfully basic.

By the way it's a bank holiday (long weekend) in the UK so no Mondays blues from me. :D

<comment><USER5> _> I'd expect anyone working as a developer in IT to have learned this much before calling themselves a professional. _

According to author's webpage[1], he's a _" student at the University of Waterloo, class of 2021"_.

So probably age 17 or 18. He's not passing himself off as a "professional".

If majority of HN readers feel this article was beneath their skill level and a waste of time, that's more on the submitter (mxstbr) for misjudging its value to the HN audience rather than the article's author.

(Although at this time, the article does have 110 upvotes while simultaneously, the top-voted comment (poster mmjaa) is critical about its simplistic banality. So maybe the submitter got the pulse correct for half of the HN split-personality?)

[1] [http://lpan.io/](http://lpan.io/)

<comment><USER4> > _According to author 's webpage[1], he's a "student at the University of > Waterloo, class of 2021"._

> _So probably age 17 or 18. He 's not passing himself off as a > "professional"._

Fair enough, though I am still surprised he hadn't learned that in formal education already. I was taught about event driven programming before I got to university. The schools I went to weren't particularly good either so it's not like I had a "better" education or come from privilege.

Maybe they just don't teach event-driven programming any more? :(

<comment><USER6> Most students have close to zero programming training of any kind before getting to university in Canada.

<comment><USER4> Maybe this is where regional differences come out as most students in the UK have had _some_ programming lessons before starting uni (albeit they often haven't done any recreational programming).

That was my observations at the time anyway. Things may have changed and/or I might have introduced selection bias by hanging around with the nerdier kids. Who knows - too late to find out now.

<comment><USER7> _Maybe this is where regional differences come out as most students in the UK have had some programming lessons before starting uni_

At the level of professional-standard software architecture for UIs?

There have been some positive efforts in the UK over the past few years to introduce programming as a more serious subject at secondary school level (roughly, ages 11-18). I think it's great if kids get to write a simple mobile app to chat with their friends or make a simple game, instead of only learning things like how to use a word processor or graphics program. I think it's great if there are teachers in schools who themselves have the skills and knowledge to help the kids do that, too.

However, there are plenty of new starters entering the industry who have just graduated with _degrees_ in CS or related subjects from good universities and still won't have been exposed to these kinds of ideas at more than a trivial level. I'd be surprised and impressed if I had a school-leaver turn up for an interview for a programming position with more than a passing knowledge of these subjects.

For what it's worth, I don't think the original author does themselves any favours by inflating their experience as they do. The way they describe themselves in the introduction on their web site seems rather out of proportion to their actual experience, and their CV _screams_ "I read a guide to how to write impressive-sounding CVs and I'm trying way too hard". But as a card-carrying member of the "I thought I knew everything at the start of my career and tried way too hard" club, I think you just have to see that as a combination of genuine enthusiasm and understandable immaturity, and give them credit for having a go and sharing their experience. I'm happy to see someone at that stage in their development taking an interest and spending the time to experiment and discuss and learn, and surely we should all be encouraging the next generation of programmers along that path?

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> Very interesting work! It seems that educational text editors are becoming a trend after Antirez published his :-)

Excuse me the shameless plug, I'd like to show mine too: [https://github.com/arximboldi/ewig](https://github.com/arximboldi/ewig)

It is written in C++, but using a style that is unlike what most C++ developers use: it is composed mostly of pure functions. The architecture is very much like that of Elm programs, and there is even a `store` class like in Redux.

Like the project from OP, it is about 2K lines of code. But it also supports asynchronous loading/saving, copy-paste (you can copy-paste a 1GB file instantly), very robust undo, dirty markers, UTF-8 (not perfect), etc.

The magic? Immutable vectors based on RRB-Trees. This is like the vectors in Clojure/Scala, but also supports log(n) slicing, concatenations, insertions--- these operations are fundamental for a text editor, and I'd say, to most interactive software supporting big data models [1].

The code has been written in a style as simple as I could. I'd like to think that even non-C++ developers might be able to understand it. It might be specially interesting for web developers invested in Clojure, Elm or Redux and the single-atom architecture.

Probably one day I should go ahead and just write a blog post about it or a tutorial or something. But so far I don't have a blog I am not really a social media person. The code is still moving also...

PS. And thanks a lot to @kostspielig her help writing and reviewieng the code! <3

[1] The data-structure can be found here: [https://github.com/arximboldi/immer](https://github.com/arximboldi/immer)

<comment><USER9> Awesome project, you're inspiring me to pick back up a text editor project I had started to learn Rust a while back. Yours is much more featureful, however!

By the way, if anyone else is thinking about doing the same, HN had a great discussion on an article (also very useful) on the various data structures one can use for text editors: [https://news.ycombinator.com/item?id=11244103](https://news.ycombinator.com/item?id=11244103)

<comment><USER8> Thanks for the link and the encouragement! You have your Rust project somewhere online? I'd love to take a look at it.

I sometimes fantasize about rewriting Ewig in Rust, as a learning project (have been reading about it but didn't dare to write code in it yet). But I'd like to use RRB-Vector there too. Sadly, this data-structure is not really trivial to implement... (the concat algorithm in particular). Maybe one day I'll find the time :-)

<comment><USER9> It's not on a public repo, and I abandoned it half-done a couple of years ago while using Rust Nightly, so it will need some work I think to run on current Rust. I stopped because I got frustrated and confused with Rust's lifetimes, and just quit Rust for over a year.

Fortunately, a few months ago, after another attempt at Rust writing a simple ML-like language, something clicked and now I'm enjoying writing Rust. If you do attempt Rust, just expect to be frustrated for a while with Rust's ownership system, it's a new concept for almost everyone. I think it's kind of like monads in Haskell, you struggle with it until suddenly it "clicks" and then it doesn't seem very hard, but it then becomes hard to convey your understanding to someone else.

Rewriting Ewig in Rust, including the persistent tree-based immutable vector, would be an excellent exercise. Indeed, just starting with the RRB-Vector would be a great project. By the way, your immutable data structures library is quite impressive, it would be nice to have such a library in Rust. As far as I know, there is no such maintained library of functional data structures in Rust.

</comment></comment></comment></comment><comment><USER10> > In other words, UI programming is about mapping incoming events to a series > of effects.

Sort of like programming with _Monads_.

This is one of the reasons why programming with Monads is so powerful: the programmer can explicitly compose and control effects.

Good on the author for digging in and learning new things. I'd recommend following up with reading the source to vi and doing some research on programming patterns of the day. One of the things we're pretty bad at preserving is context; it'd be neat to read about what the author discovers (ie: why was vi written the way it was? What did the original authors discover? etc).

<comment><USER11> I've tried to push pretty hard for writing rationales for any project we make, and we've also tried to adopt making records of "big decisions" including a tl;dr of the context. Unfortunately, these tend to take a backseat to "moving tickets from left to right on a board" and in prioritizing what gets on the board, unfortunately writing things down for posterity simply never makes the cut. :o(

<comment><USER10> Those who cannot remember the past are doomed to repeat it.

And as I like to say: software is built in the image of the organization and processes that created it.

If the organization I work for doesn't openly condone it I still journal what I work on and spend time on documentation and specifications before we work on an important feature or project.

If we make a mistake or forget why a certain architectural decision was made I've found it immensely helpful to have context for those decisions. It helps make planning changes much easier.

</comment></comment></comment><comment><USER12> It's worrying how sometimes the most basic programming concepts can appear revolutionary to web developers. So much so, they've recently stumbled across the concept of a read input-update-render loop, and are now trying, with frameworks like React, to contort the DOM tree, just to get back to how UI was programmed since decades.

There's a fairly old concept called "immediate mode UI", which even gets rid of the tree structure, and keeps the whole state on the user side, giving you full control over when elements are updated and where they are placed. These days it's used mostly in video games, since they already rely on a 60 FPS loop, and the UI complexity tends to be low.

If not for the necessity to use standard platform form elements due to their various quirks and interactions with the system, I'd be doing UI programming only in immediate mode with custom controls, simply because how convenient, and simple it is.

<comment><USER13> I don't know how many times my colleagues and I have half-jokingly suggested just throwing out most HTML and CSS and just draw everything to a canvas.

<comment><USER14> Well, that is the approach of the new Fitbit smartwatch.

It makes use of only SVG, CSS and JavaScript.

<comment><USER15> The Canvas is much more fun and easier to work with then SVG though.

</comment></comment></comment></comment><comment><USER16> Storing every character in a doubly linked list seems like an extremely inefficient use of memory. Depending on your architecture, that could use 24 bytes per ASCII character (if the char in the struct is padded with 64-bit pointers). I imagine that vi wouldn't have gotten very far if it had been that memory constrained.

<comment><USER17> 2MB of characters in Atom use 300MB of memory or more, so it's like 150/1 -- compared to 32/8 that's nothing.

<comment><USER16> OK, but Atom isn't pitched as a "lightweight vi." If I want to ssh into an embedded device and view a 2MB log file, then I sure wouldn't want that to require 300MB of RAM.

</comment></comment></comment><comment><USER18> Is the (pseudo?) code there for state mutation representative of a widely used pattern? It looks like using a pattern from a functional programming book, but applied to mutable data. What I mean is this snippet:

        function handleAddTodo(state) {
           if (!newTodoField) {
             state.error = 'Empty field!'
           }

           state.todos.push(state.newTodoField)
           state.newTodoField = nil

           return state;
        }

This looks like a function newState = fun(oldState) but there is one huge problem: the new state is the _same_ data as the old state? In a Rust-like type system this might be OK because you couldn't accidentally keep using the original state after sending it to this method, and in an immutable scenario there would be no problem because you created a new state instead of mutating. But this looks exactly like mutating the argument sent to a function. So out of curiosity, do any modern UI frameworks in JS (this looks like that type of code) do this, or was it just an unfortunate example?

<comment><USER19> Vuex works like this: you actually mutate the state instead of creating a new one as it's expected with Redux. But this mutation takes place is a single, controlled place (in the store mutation functions), so you get the benefit of centralising the state management code and avoid the cumbersome immutable transformations patterns which Redux requires.

That said, after having worked with Vuex, I much prefer the immutable newState = f(oldState) pattern used with Redux.

</comment></comment><comment><USER20> Once you move to making mobile or desktop front end you appreciate how easy front end web dev really is.

Contrary to popular opinion I think the DOM, HTML, and CSS, are an awesome way of defining and styling a scene graph. When I did some C++ front end I missed them every day.

<comment><USER14> I bet you didn't use any of VCL, Windows Forms, QML or XAML on your C++ front end.

<comment><USER21> How about MFC or WTF or WinAPI?

<comment><USER14> They are good if one likes to write boilerplate with lots of C style coding in a C++ application.

MFC always suffered from not being as high level as OWL or VCL, because the internal devs at Microsoft thought that Afx (the original implementation) was too high level.

By WTF, I think you actually mean WTL, which is based on ATL, full of templates and low level COM style programming. Another one that gives no pleasure using.

WinAPI was already out of fashion on the Win16 bit days, I was already using Turbo/Borland C++ with OWL on those days.

The only reason to use Win16 directly was to wrap APIs not exposed to OWL.

Sadly due to how Borland got themselves mismanaged, OWL lost to MFC in the early 32 bit days, and only enterprise customers with deep pockets adopted C++ Builder with VCL, which allows for VB/Delphi style programming with C++.

</comment></comment></comment></comment><comment><USER22> For anyone interested in building a text editor, I really enjoyed working over this tutorial:

[http://viewsourcecode.org/snaptoken/kilo/](http://viewsourcecode.org/snaptoken/kilo/)

The author builds a terminal-based text editor in C from scratch. It's very well written and the incremental diff-style format makes it easy to follow along.

</comment><comment><USER23> not C, but probably very C useful [http://scienceblogs.com/goodmath/2009/01/26/ropes-twining- to...](http://scienceblogs.com/goodmath/2009/01/26/ropes-twining-together- strings/)

<comment><USER24> I made one of those in C, using skip lists instead of trees so it wouldn't need rebalancing:

[https://github.com/josephg/librope](https://github.com/josephg/librope)

It could happily do 5M random single character edits / second on my old laptop. Its wild what you can pull off with C. Much more memory efficient too (it uses about 4 pointers of overhead per 180 characters).

I'd love to see a version which supported traversal using more methods though - that library needs to support searching by line as well as character count.

I tried porting it to Rust a few times but unfortunately couldn't figure out how to port it without introducing indirection everywhere. Modern 'C replacement' languages don't let you do the same funky memory management tricks. (Like using a dynamically sized array at the end of a struct allocated in the same block.)

<comment><USER25> Implementing efficient datastructures in Rust often requires `unsafe` code. Unlike in C, though, you can use Traits (which provide both static and dynamic dispatch, depending on usage) to provide a safe, zero-cost interface.

<comment><USER24> Even using unsafe I couldn't figure out how to pull it off in rust without doubling my heap allocations.

Each item in the skip list has an associated randomly sized list of next pointers. In C I store that list at the end of the node data structure, and dynamically allocate the struct based on how much memory I need (basically, size of static array of characters + size of dynamic nexts array). In Rust in theory I can make my struct unsized to do the same thing. (Well, it pushes the nexts height out into the pointer but that's not too bad). But there doesn't seem to be any syntax to initialise the values in my unsized struct array itself once I've allocated it - even in unsafe.

If you can figure out simply how to initialize a custom heap-allocated unsized struct I'll happily keep working on it. My conclusion at the time (and, still, after trying out tokio) is that rust isn't mature enough to replace C yet.

</comment></comment></comment></comment><comment><USER26> I am a novice in this area, so forgive me if I am missing something, but I have some questions regarding the two approaches in the article, specifically if there is a performance trade-off being made between them.

To my untrained eye, the initial version seems to be doing a minimal set of updates based on the input it receives, whereas the latter version will call the monolithic render procedure no matter how small a change is made to the state.

Does each of the sub-procedures in renderTodo! check internally if the state actually changed (by keeping a copy of the previous state?), or do they just unconditionally re-render the entire UI? If the latter is true, then doesn't this supposedly better way of structuring code come with a large performance penalty? Or is it simply the case that this penalty is outweighed by the added test-ability and improved consistency of the state?

I believe that React and similar frameworks run a diffing procedure to find out which parts of the UI actually need to be updated (so a more minimal set of updates is actually applied). In the first version, however, it seems like the same diff occurred naturally as part of the code's structure - only a subset of the render* functions are called - and therefore the diff does not need to be computed at run-time.

Is this something worth being concerned about, or is letting the framework compute the diff on every state change not that big of a deal?

<comment><USER27> > I believe that React and similar frameworks run a diffing procedure to find > out which parts of the UI actually need to be updated (so a more minimal set > of updates is actually applied)

That's true. React diffs the virtual DOM and applies the changes to the actual DOM. However, the fastest is still to diff the actual data to be rendered, and determine whether the render function needs to run at all (this is opt-in via React's shouldComponentUpdate() lifecycle method).

</comment></comment><comment><USER28> So this guy has rediscovered how we did GUI development back in 80s and early 90s?

<comment><USER6> Yes. He's a student. It's cool.

</comment></comment><comment><USER29> What is the difference between Event Sourcing and the Command Pattern here? For decades the Undo/Redo functionality has been implemented by the Command Pattern it seems. And looking at what Event Sourcing is, it looks a lot like the Command Pattern which purpose is to encapsulate into an object a side- effect performed on some data structure. That object can then be executed at a later time, reverted, logged, etc...

</comment><comment><USER30> Another C tty oriented text editor is the classic MicroEmacs:

[https://github.com/DigitalMars/me](https://github.com/DigitalMars/me)

I learned a lot about programming from reading the source code to it. It's a gem of clarity and design (and you could reasonably argue that many of my changes to it messed it up).

</comment><comment><USER31> All i can say is "watch this kid!". He is showing the motivation, perspectives, insight and intelligence to be able to do important work in the future. Great article and the C code worth reading to learn from. Thanks for sharing and looking forward to reading future blogs and seeing what you create.

</comment><comment><USER32> > In other words, UI programming is about mapping incoming events to a series > of effects.

So I guess the word `event-driving programming` is lost in time.

And I don't think the Unidirectional pattern described is suits for C programming. When I see people use C, I think performance, and unless the compiler optimized it away the state mutating function is gonna cost a lot of unnecessary memory copy. And worst offender is that unless you have React-like UI diff-ing library, it's gonna be a costly entire screen redraw event for the most simple update.

<comment><USER33> > unless you have React-like UI diff-ing library, it's gonna be a costly > entire screen redraw event for the most simple update.

He's using ncurses, which actually does that - it only redraws the parts of the screen that change. It can require a bit of coxing at times to ensure that things get redrawn properly but I'm pretty sure he's good - I didn't see anything in his code that would force a full redraw every update.

<comment><USER34> > He's using ncurses, which actually does that - it only redraws the parts of > the screen that change.

Heh, when I first read about React, my immediate reaction was like, "oh so it's like ncurses for the web, cool, makes sense."

</comment></comment></comment><comment><USER35> A cursory look into the linked github pull request changes made me spot this, and I must admit that never in a million years would I've thought to erase the possible endline character of a string returned by getline with this:

      line[strcspn(line, "\n")] = 0;

I don't think I'm going to start, either, even if it is a nifty oneliner. Anyway, I've always found this kind of little projects a good sport.

<comment><USER36> Wise choice.

<comment><USER35> That's not correct. If the scanned string doesn't contain any of the search string's characters, strcspn will behave like strlen, and the snippet ends up doing effectively nothing.

However, the statement is inefficient in what it does (and even then, not the most obvious way to achieve that, which your comment also highlights in a roundabout way).

</comment></comment></comment><comment><USER9> Nice article, good summary of the purpose of unidirectional UI approach like Redux's, although it doesn't get as much into persistent data structures as maybe it could have.

What's the point of the exclamation mark after certain function names? Is that a pseudocode thing? Is that supposed to be shorthand for an impure function? (if so, not sure why `handleKeyboardEvent` doesn't have an exclamation mark.

</comment><comment><USER37> The more I read, the more I felt that the author was long-windedly discovering FSM's, only describing them using the language de-jour - i.e. JavaScript- ecosystem-ism's.

Is this the state of things today - that kids start off as highfalutin' "developers", whereby 95% of their apps are written by others (because: "npm -i <all the things>"), and then .. eventually, from the top-down, trickle through the stack learning "the things", giving it all a new fancy name, and blogging about it? Because to me, this seems more like devolution at work in the computer science industries, not some kind of radically derived insight.

I'm not trying to be overly critical, but for a lot of us, "discovering that C-based apps are, weirdly, similar to what us React-ites are doing" sure seems like a step backwards from real stack competency.

<comment><USER38> It's true that today's devs are glorified plumbers.

On the other hand, so much gets done, it would be insane to go back to "C for all the things!".

It's a trade off, you're either a high level hacker, piping stuff together and watching for leaks, or your a low level system guy, squeezing the carpet.

<comment><USER37> I would argue that a lot more of the worlds productive plumbing depends on C-based apps/libraries/frameworks than we would care to admit - its just that its 'not sexy' enough for the young-uns to get behind and start using, since everyone knows that C is a greybeard language and, therefore, not cool.

The same argument ("so much gets done") was made for Visual Basic back in the day, you know. Oh, how the hoipolloi cried and crowed for the death of C developers back then. Oh, how they were wrong, oh so wrong!

I'm not saying the world doesn't have a debt to pay to the Node/Javascript camp - it surely does. I just feel that there is something really missing in the scene, if in fact things that C developers knew and applied well 'back in the day' are just now being re-discovered as "Cool New Shit™" by those who chose - willingly - to ignore the very mechanics of the components their stacks are highly dependent on.

Still, I guess its not worth complaining. Its good to know that JS guys can get over the wall, and discover that we've all been using state machines for decades now, and so on, eventually. I just wish there was a lot less hubris on the "crowing about it" side of things. Honestly, JS guys: you should know a little C. Its still there, underneath all the cool shit, and you're still heavily, heavily dependent on it, no matter what your "npm up" tells you...

<comment><USER39> In my purely anecdotal experience, learning web-based technology over C/C++ was not a choice I made personally. It was a career path that was foisted upon me by job availability and hiring requirements.

I have yet to see a job posting for a fresh-off-the-boat C developer. It's nearly always 5-10 years industry-related experience required. Web, on the other hand, seems more willing to take on the new guys.

<comment><USER40> I think they're more willing to take new people mostly because there are more jobs and not enough programmers in Web.

</comment></comment></comment></comment></comment><comment><USER41> I'm new to frontend development. Is this kind of how Vue works?

</comment><comment><USER42> Dat JavaScript coding style

</comment><comment><USER43> If you plan on allowing future employers to look at your Github profile, you might want to change the way you write your commit messages.

> REFACTOR: :hocho: future queue (I was retarded)

Not exactly an appealing commit message.

</comment><comment><USER44> It is not surprising that C gets that much of a bad reputation when devoloper show such poor capacity at managing errors; malloc(3) return values are never checked and everything is expected to always succeed, throughout the source tree.

<comment><USER45> Competent C devs are rare these days. Just too many did retire. At the very start of my professional career I thought of becoming embedded dev, but I was disheartened by the job market.

The very few jobs I found were like "Senior C dev, minimum 7 years subject matter experience, $65k" at the time when web dev roles were paying 85k+ and were so easy and dumb...

What distinguishes a good C developer? A high self discipline. That language gives you a lot of ways to introduce bugs, but unlike JS you do have clear realisation why they appear most of the time.

<comment><USER46> You can use my own experience as a little bit of anecdotal evidence. I started out of collegue and started programming in C/C++ as a game dev. I started at 40K AUD in Sydney in 2002 just before the housing boom here in Australia. Granted stayed with the business for 4 years. During the time my colleges got a job in web development CRUD application systems for the web. Their starting salary was 85K.

I remember walking into the CTO/CEO office at the time asking how much they valued experienced C/C++ developers. They honestly said at the time that (frank) who had 10+ years doing game dev they couldn't see any point in paying him anymore than 60K a year. I thanked them for their time and went back to my desk.

Next day I walked in and handed in my resignation. Both the CEO/CTO was shocked. The next week I walked into a web development shop (oracle/java/javascript) and tripped my salary.

<comment><USER47> Game dev is built on the backs of people sacrificing salary for "working in games". You really can't compare it to any other job. All my friends who worked with C/C++ in game dev that moved out of game dev, but still used C/C++, at least doubled their salary.

<comment><USER46> A job is a job. For me the simple truth of the matter is I couldn't support the quality of life I wanted to live working in games and the salary and rewards they where offering. It was fun, but going back to C/C++ is something I would avoid at all costs, although if the salary doubled over night I would put up with C++ although I think I would take up drinking.</comment></comment></comment></comment></comment>


Everyone Who Has Immigrated to the US Since 1820 - <AUTHOR> http://thesoundingline.com/everyone-whose-lawfully-immigrated-us-since-1820/ <comment><USER2> Blogspam of

[http://metrocosm.com/animated-immigration- map/](http://metrocosm.com/animated-immigration-map/)</comment>