Higher Order Macros in C++ - <AUTHOR> http://journal.stuffwithstuff.com/2012/01/24/higher-order-macros-in-c/ <comment><USER2> The technique used here is called "X Macro". There are article on wikipedia and wikibooks.

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

[https://en.wikibooks.org/wiki/C_Programming/Preprocessor#X-M...](https://en.wikibooks.org/wiki/C_Programming/Preprocessor#X-Macros)

It's very useful in some situations. It offers, in a way, a mean to do a sort of compile-time introspection on some class/enum.

</comment><comment><USER3> Good grief, I remember this cruft.

       class Nineties : public Node {
          void accept(Visitor &v) {
             cout "Visitor " << v << ", welcome to the year 1995" << endl;
          }
       }

A better idea would be to write all this code processing _in_ the language that is being byte-code interpreted. That is to say, use an existing implementation of that language to write a compiler which produces byte code. Then write the byte code interpreter for that in C++. Finally, include the compiler's byte code image in the C++ program (as a static array or whatever), so that the program is a complete implementation which can compile code and then run the bytecode.

<comment><USER4> > A better idea would be to write all this code processing in the language > that is being byte-code interpreted.

That presumes the language being compiled somehow frees you from the need to use the visitor pattern.

Personally, I really like visitor. It's not a pattern I use often (basically, only for AST visitors), but it's pretty fanstastic in the places where I do need it.

<comment><USER3> Visitor leads to the wrong organization of code for processing AST's. It's better to simply have big case statement on the types of nodes you have to process. Here is why. The case statement puts together pieces of code that are related. The method framework, by contrast, puts together pieces of code which do unrelated things, which are only connected by the fact that they apply to the same kind of node. This helps you slightly if you're adding a new kind of node, but not if you want to understand at a glance how the same kind of process is orchestrated over forty different nodes: for that, it's better to be staring at a case statement. I want to see all the ways that forty different nodes are subject to type checking; I don't want to see, simultaneously, how a single node is type-checked, pretty-printed, traversed for constant folding, code-generated.

That kind of organization really works well when you don't care about the other classes which do that, like device drivers. I don't care about how a tty handles write when I'm working on a network stack's write; I don't need to see those side by side.

Thus even if you give me a language with real OO that has multiple dispatch so that Visitor disappears, I still won't do it this way. I'm going to have a single AST pretty printing function that handles all the cases, a code generating function that handles all the cases and so on. If someone adds a case, they will just have to add them to half a dozen functions.

<comment><USER4> There must be some confusion here. Your first paragraph describes what code looks like when you _don 't_ use the visitor pattern.

Just to be explicit, here's the kind of code I think you're describing (using some vague Java-esque pseudo-code):

        interface Expression {
          String prettyPrint();
          int evaluate();
        }

        class Plus extends Expression {
          Expression left, right;

          String prettyPrint() {
            return left.prettyPrint() + " + " + right.prettyPrint();
          }

          int evaluate() {
            return left.evaluate() + right.evaluate();
          }
        }

        class Number extends Expression {
          int value;

          String prettyPrint() {
            return value.toString();
          }

          int evaluate() {
            return value;
          }
        }

This is vanilla OOP code. You have all of the operations on a class directly on that class. Like you note, pretty printing and evaluating are mixed together. With something like an AST, it doesn't scale and gets gross.

Here's the AST classes supporting visitor pattern:

        interface Expression {
          String prettyPrint();
          int evaluate();

          T accept<T>(Visitor<T> visitor);
        }

        class Plus extends Expression {
          Expression left, right;

          T accept<T>(Visitor<T> visitor) { return visitor.visitPlus(this); }
        }

        class Number extends Expression {
          int value;

          T accept<T>(Visitor<T> visitor) { return visitor.visitNumber(this); }
        }

        interface Visitor<T> {
          T visitPlus(Plus plus);
          T visitNumber(Number number);
        }

These are now pure data classes, like we want. The only extra bit is the visitor pattern itself.

Now we can separate out our concerns. Here's pretty-printing:

        class PrettyPrintVisitor extends Visitor<String> {
          String visitPlus(Plus plus) {
            return plus.left.accept(this) + " + " + plus.right.accept(this);
          }

          String visitNumber(Number number) {
            return number.value.toString();
          }
        }

And here's evaluating:

        class EvalVisitor extends Visitor<int> {
          int visitPlus(Plus plus) {
            return plus.left.accept(this) + plus.right.accept(this);
          }

          int visitNumber(Number number) {
            return number.value;
          }
        }

> I'm going to have a single AST pretty printing function that handles all the > cases, a code generating function that handles all the cases and so on.

This is exactly what visitor gives you except replace "function" with "class".

> If someone adds a case, they will just have to add them to half a dozen > functions.

They'll have to _remember_ to do that. The visitor pattern makes it a compile error to forget to do that.

I also find the pattern scales up better than doing all of the type tests inside a single enormous function. I like having a separate method per AST type.

</comment></comment></comment></comment><comment><USER5> Very powerful technique. However, one of my C++ coding rules of thumb these days is 'can I step through it in the debugger?'

<comment><USER6> It's a great rule for any metaprogramming task. When writing a macro, or reflective intercession, make it a shim that wraps non-metalevel code, so it's decoupled, testable and yes debuggable.

<comment><USER7> Interesting. Do you have an example or a link to an example?

<comment><USER6> I can't find the exact quote nor site, but it's a common advice in lisp tutorials to write the macro as thin as possible and split its internal logic as tiny composable functions (the usual desired lisp/engineering style).

The rest comes from my small experience, in college we had a project patching java bytecode on the fly, you could generate correct logic at the bytecode level, but you would lose all the benefit of high level language (typechecking, debugging). One team had this excellent idea to just write the smallest bytecode hook/wrapper that would then call normal Java code.

</comment></comment></comment></comment><comment><USER8> I prefer writing scripts to generate repetitive code. The result tends to be quite readable, it can be seen in the debugger, and you have the full power of a scripting language to build your code.

<comment><USER4> Yeah, when the language isn't flexible enough to let me get rid of boilerplate using its own primitives, I like doing that too. AST classes are a good example of something where a simple script can pound them out.

When I was working on Magpie, I did just that. This script[1] generates this file[2].

[1]: [https://github.com/munificent/magpie/blob/master/script/gene...](https://github.com/munificent/magpie/blob/master/script/generate_ast.py) [2]: [https://github.com/munificent/magpie/blob/master/src/Syntax/...](https://github.com/munificent/magpie/blob/master/src/Syntax/Ast.generated.h)

I got this trick from Jim Hugunin, of Jython and IronPython fame.

</comment></comment><comment><USER9> There is a whole library around this and similar techniques in Boost. I've used it before on several occasions. It's quite nice, although it somewhat lays a trap, in the sense that CPP really should be your metaprogramming technique of last (or second-to-last) resort, so it remaining difficult keeps your incentives in line. :)

I've never used Chaos PP (the predecessor of Boost.Preprocessor), but IIRC, it enables even more cool stuff at the cost of reduced portability (Boost.Preprocessor contains all the hacks to work on broken preprocessors, while I think Chaos takes more of a "fix your preprocessor" approach).

[http://www.boost.org/doc/libs/1_59_0/libs/preprocessor/doc/i...](http://www.boost.org/doc/libs/1_59_0/libs/preprocessor/doc/index.html)

</comment><comment><USER10> Is there a template alternative? Whenever macros seem essential in C++, there's usually a better way without macros.

<comment><USER11> If there is I'd love to see it. But I'm fairly certain there's no way to do what he's doing with templates.

<comment><USER12> Also, templates can be visually unappealing and slow to compile.

(Of course, these are generalizations, and only how they work without particular care.)

</comment></comment></comment><comment><USER13> Meh, why not just use code generation for this problem? That's what CPython does.

[http://eli.thegreenplace.net/2014/06/04/using-asdl-to- descri...](http://eli.thegreenplace.net/2014/06/04/using-asdl-to-describe- asts-in-compilers)

To me this [1] looks way better than a bunch of C++ macros.

[1] [https://hg.python.org/cpython/file/tip/Parser/Python.asdl](https://hg.python.org/cpython/file/tip/Parser/Python.asdl)

<comment><USER11> The advantage of his approach is that the C preprocessor is already present, so no need to install any additional external tools. The stuff he's demonstrating is simple enough that using an external tool would be overkill.

<comment><USER8> The preprocessor doesn't necessarily behave though (just look at Visual Studio). You might actually have a more consistent result by using the same version of a scripting language on every platform.

<comment><USER14> That seems more of a reason to upgrade your tools, rather than adding a new tool. Granted, that may be easier said than done, as broken compilers may accept broken code that needs to be fixed.

</comment></comment></comment></comment><comment><USER15> Anecdote: In BS school, we had 48 hours to write a "C-with-some-kind-of- objects". My code ended up being 75% macros and we got bonus points for abusing the preprocessor.

</comment><comment><USER16> Funny, this is exactly what I am doing in such cases - I don't even have to look into any sources of others to make that up. Probably a long time experience that this is for me nothing I need to tell anyone about in a blog post.

I use this for dispatching, enum creation, method creation etc.

But probably a good resource for people trying to save their time by macro based code generation ;)

</comment><comment><USER17> upvoted for the angry Bruce Lee comparison!</comment>


Work was once the way to a better life. Not any more - <AUTHOR> https://www.theguardian.com/business/2018/oct/27/work-once-way-to-better-life-not-any-more-property-pensions <comment><USER2> > If workers have any spare time, it doesn't go into campaigning in their > workplace for better terms and conditions. It is spent in the long queue at > Aldi and Lidl for cheaper food. It is spent scouring the newspaper best-buy > tables for a cheaper mortgage deal, a lower energy tariff or discounted car > insurance.

I do feel like life is a bloody attrition war against the universe. Everything is too complicated.

Income tax return? Months of paperwork and letters sent back and forth. Car insurance? You better know what you need or the agent will sell you insurance against squirrel attack. Renting an apartment? You better know all renting regulation nuances or in the best case you lose the deposit. Job search? Months long full time job. Health problems different than broken bone or blood squirting out of your body? You're looking at months and years long waiting for diagnostics and specialist's attention. Lawyers? Various legal trolls stalk you, but once you need one, none is available.

Whatever goes wrong - it's always your fault, never the fault of the corporate or institutionalized other side, and penalty fees are waiting.

<comment><USER3> Not all places in the western world have such legal and social traditions.

<comment><USER4> Where is this small-print free paradise you allude to?

</comment></comment></comment><comment><USER5> The sub heading says property and pensions have replaced work - what are the differences between the USA and UK for pensions? As an American I think of a company provided retirement plan benefit, and this is not very common here outside of government work, so are they referring to the general system providing for retirement benefits (so that would include USA's social security/private retirement plans)?

</comment><comment><USER6> There are many underlying reasons for the ongoing deterioration of the fortunes of the "underclass" but one aspect that doesn't get enough acknowledgement is cultural change. In the 19th century society had extreme class divisions and it was a common sentiment among the upper classes that the lower classes were fundamentally (even perhaps genetically) inferior and deserved to be relegated to poverty. In the 20th century some of that changed a bit but then boomeranged back to an even more aggressively classist sentiment which started growing sometime around the 1980s and is now practically ubiquitous. That being something along the lines of "all is fair in love, war, and capitalism", the idea that the economy is a game and any behavior whatsoever is acceptable (within the law, -ish) so long as it follows from the foundational axioms of personal selfishness and greed it is seen as desirable behavior. Since the rich and powerful have all the wealth and the power this unequal situation tends to further amplify itself given such a values system.

Even more disturbing is that this values change has seem to be paired with an aggressive demonization of and heartlessness towards the poor and infirm, even compared to 19th century norms. Today it's very common to hate the poor, the homeless, and the disabled as well as those injured by institutional iniquities and injustices. If anyone gets ground in the gears of capitalism, well, they probably deserved it. Also, why should we help the homeless and the poor when their lives are full of so many problems and they are so dirty and disgusting? That values system filters up all the way into the workforce. The worker is seen as justifiably powerless, a pawn or a cog, and if they are taken advantage of, well, they had the "choice" to not be taken advantage of, right?

It's more than a little disturbing and disheartening that we've somehow managed to end up here.</comment>


What's New in Node.js v0.12 – Performance Optimizations - <AUTHOR> http://strongloop.com/strongblog/performance-node-js-v-0-12-whats-new/ <comment><USER2> I'm more excited to see that Ben Noordhuis is still working on Node.JS core.

And yay! for the round robin cluster scheduler. Got bitten by this myself. We currently use different ports on each child process and distribute traffic on our reverse proxy server (varnish) in front of node.

</comment><comment><USER3> Ok, I'm going to seem incredibly blunt and perhaps ignorant here. Hopefully someone can help me understand. I don't understand Node.js. Why do I care about being able to write javascript on the server? I can just as easily write a python script which, in my humble opinion, is much easier to read than javascript. I don't want to turn this into a language bashing session as I realise the argument can somewhat become a religous one. Is Node.js faster? Is it easier to hook into a web server? Why?

Apologies in advance for any trodden toes.

<comment><USER4> No toes trodden on!

Advantages of node.js as I see them:

\- Provides npm (a state-of-the-art package manager which introduced a number of innovations)

\- Built on V8, which is possibly the best dynamic language compiler made to date, in terms of performance

\- Provides a well-done streaming I/O and event model, which many languages fail at

\- Provides an extremely powerful and high performance async/concurrency model, which is set to improve as promises and other concurrency patterns mature

\- Has a well-tested, high-performance, properly layered standard library (most of the time)

\- Has a nice C++ extension framework

\- Has a very active (though sometimes rough around the edges) developer community

The downsides are:

\- It's Javascript, which has some serious design issues as a language

\- Currently still suffers from callback spaghetti, which is set to improve as per point 4 above

\- Can be very hard to debug in the face of its async model because of insufficient built-in debug facilities

<comment><USER5> I have to disagree with the Javascript design issues.

I've used both Python and Javascript for years, and the more I use Javascript the more I realize how ad hoc Python really is. So many of it's features (metaclasses, raising an exception to break iteration, the MRO, the import behavior, etc.) seem to be hacky solutions to problems of it's own making. Javascript is a much smaller, and therefore simpler language.

<comment><USER4> To each their own. I really dislike Javascript, and while Python is not perfect, at least it has the right set of core values and a community process that results in tangible improvement. I mean, you're complaining about the finer points of Python OOP - to me, Javascript OOP is broken, and there is no community standard to fix it.

What's wrong with raising exceptions to break iteration or with the import behavior?

</comment></comment></comment></comment><comment><USER6> Slightly off-topic, but I've basically missed out on the entire Node train and I'd like to get on it. What's the best way to get started? Official docs?

<comment><USER7> Codeschool.com has a Node.js course

[https://www.codeschool.com/courses/real-time-web-with- nodejs](https://www.codeschool.com/courses/real-time-web-with-nodejs)

Same question on SO

[http://stackoverflow.com/questions/2353818/how-do-i-get- star...](http://stackoverflow.com/questions/2353818/how-do-i-get-started-with- node-js)

<comment><USER8> StrongLoop has a few good videos to help you get a fundamental understanding of what node.js is and how it works, highly recommend spending a few minutes watching these:

[http://strongloop.com/developers/videos/#a-video-intro-to- no...](http://strongloop.com/developers/videos/#a-video-intro-to-nodejs- fundamentals)

[http://strongloop.com/developers/videos/#a-video-intro-to- ho...](http://strongloop.com/developers/videos/#a-video-intro-to-how-node- works)

For professional consulting, training and certification, check out [http://strongloop.com/node-js- consulting/strongexpert/](http://strongloop.com/node-js- consulting/strongexpert/) as well.

</comment></comment></comment><comment><USER9> Interesting on the corking stuff. I looked at this a long time ago ([http://baus.net/on-tcp_cork/](http://baus.net/on-tcp_cork/)) and found it could make a significant difference for event driven applications.

<comment><USER10> They arent actually using TCP_CORK though (its not portable), they are just constructing a cork-like behaviour, using writev to write all the parts at once.

<comment><USER9> Understood. It certainly is better to coalesce data with writev() than to use TCP_CORK.

BTW, from my link: "If you need to write multiple buffers that are currently in memory you should prefer the gather function writev() before considering TCP_CORK with multiple calls to write()."

</comment></comment></comment><comment><USER11> I'm really surprised Node hasn't hit 1.0 yet. What is the major stumbling block?

<comment><USER12> The next release after 0.12 is 1.0. They want to be sure that the APIs are stable, secure and well designed before they push the 1.0 release.

</comment></comment><comment><USER13> Does anyone know of a resource tracking the remaining todo's left before Node.js 0.12 is released?

Every time I ask what the projected release date for 0.12 is I always get a "When it's ready" response. That's fine, I understand the uncertainty of software development like everyone else. But there really should be a continually updated todo list of line items that when done will mark the release of the next version.

I'm excited about generators and Koa. I just want to get an idea as to whether I'm looking at a month, 6 months or a year before I can use them in a stable environment.

</comment><comment><USER14> For someone who is really waiting for the 0.12.0 release, I hate that they call their blog posts "What's New in Node.js v0.12".

<comment><USER15> why?

<comment><USER16> I guess he thinks it sounds like an official release.

<comment><USER17> It is certainly unfortunate that Strongloop have published this blog post in a voice that implies 0.12.0 is already released.

For _official_ messaging around Node.js, you should definitely be looking at [http://nodejs.org/](http://nodejs.org/) and [http://blog.nodejs.org/](http://blog.nodejs.org/) instead!

<comment><USER18> They also tend to word much of their social outreach in ways that imply they are releasing it, not the community. I know they have some talented people who work hard on core, but their marketing is pretty slimy and purposely misleading in my opinion.

<comment><USER15> well I don't have anything to say regarding the marketing group, but Ben and Bert are legit. the contributions to node-inspector are great and the scaling work is much appreciated.

</comment></comment></comment></comment></comment></comment><comment><USER19> I like Node because it let's me focus on a single language for my web apps. I can even use many node libraries on the client-side.

Also, NPM is an excellent package manager and makes code-reuse and API integration so much easier than other languages.

</comment><comment><USER20> I'm very happy about the AES-NI support. Thank you for the hard work!

</comment><comment><USER21> Nice overview, excited to finally get my hands on this!</comment>


Lock-Free GC Handles in Mono - <AUTHOR> http://www.mono-project.com/news/2016/08/16/lock-free-gc-handles/ <comment><AUTHOR> Hey, I'm the author and one of the engineers who worked on this feature. Happy to answer any questions. :)</comment>


Stay connected with no Internet connection - <AUTHOR> http://www.callbytext.com

<comment><USER2> Cool. I'll give it a try.</comment>


FBook removes dissident's profile for using pseudonym. Zuckerberg's dog has one - <AUTHOR> http://www.huffingtonpost.com/2011/03/08/michael-anti-facebook_n_832771.html

<comment><USER2> Zuck doesn't get that some of us have multiple online identities: I see the biggest drop off rate in Facebook occurring in Teens who drop in and out of the service. My prediction is that there's a good chance that Facebook will go out of style in a big way with everyone under the age of 25. At that point it will slowly become a gray haired version of MySpace (or think AOL 2.0) unless Zuck can open up things a bit.

</comment><comment><USER3> I love how the Facebook PR angle is that they have consulted with "child protection" experts who advised them that a real-name policy is a good idea. "Save the children" is a really lame excuse in this context.

</comment><comment><AUTHOR> Apologies for the lousy title - tough to fit the whole premise into 80 characters.</comment>


Salary Below Which You Earn More on Unemployment in Each State - <AUTHOR> https://www.zippia.com/research/unemployment-stimulus-by-state/ <comment><USER2> Really surprising numbers! Haven't seen it on other news media.</comment>


10 tips for advancing from a beginner to an intermediate developer - <AUTHOR> http://blogs.techrepublic.com.com/10things/?p=732

<comment><USER2> Wow. How amazingly boring. Let's see if I can do better in 4 minutes. No particular order:

1\. Start and complete small personal projects.

If you don't finish them, they have negative utility for you. It's fine to start ambitious things, as long as you keep starting and finishing other things. Momentum matters.

2\. Pick projects that will force you to learn new things.

Graphics. Signal processing. Math. SQL. External hashing. Networking. Distributed systems. Concurrency. Code generation. Parsing. Natural language. User interface. You will never run out of things. Don't pigeonhole yourself.

3\. Have some kind of UI toolkit.

Attention matters. It's easier to get attention to your work when people can play with it. You'll need it anyways. jQuery is a fine answer.

4\. Add a small feature to a favorite open source app.

It'll force you to absorb how the app is designed and built without requiring you to completely understand it, and it has a payoff (see #1).

5\. Fix a bug in an open source app.

Harder than #4, approximates dealing with bugginess on real teams, where problems are caused by code you didn't write, builds debugging muscles, crucial.

6\. Learn enough assembly to know how the stack works.

Even Python programs run off the stack. Helps debugging. Helps you understand what's "possible", why things are slow and why things are fast. Makes new languages easier to learn. Assembly is like Latin that way.

7\. Really, really learn GDB (or WinDBG).

Momentum matters. Nothing kills momentum like a 15 minute rebuild cycle just to get a new printf-debugger. Even Python programs segfault when they get _really_ interesting.

8\. Read code.

But you knew this, right?

9\. Build a personal library.

This is so important that it's an interview question for me. "What's in libyou.so?" Builds momentum (that much easier to start the next project). Gives you something to look at and reflect on. Solves tedious problems with finality (memory management, data structures), instead of allowing you to blow them off in future projects.

10\. Learn a profiler.

You don't know how to make code performant until you know ot to generate and read a profile, and design experiments around them. This is even more important than unit testing.

<comment><USER3> Interesting. I don't have #9. Ofcourse I sometimes re-use code I've written for previous projects, but mostly by forking and adapting the code for the task at hand.

<comment><USER4> I find that thinking "could I turn this into a library?" whenever I code improves the quality of my code dramatically (whether it gets turned into a library eventually or not). Starting with the goals of quality and reuse is always a good thing.</comment></comment></comment>


Apple unveils HomePod smart speaker at $349 - <AUTHOR> https://www.engadget.com/2017/06/05/apple-homepod-smart-speaker/ <comment><USER2> I expect Google Assistant and Alexa are technically ahead of Siri, but I will only let Apple to have an always-listening device in my home.

Google seems to be intentionally trying to make users give up on privacy. If I enable any privacy settings in my Google account, it completely disables _all_ features of Pixel Assistant, even the basic voice commands that work offline. Somehow without agreeing to logging of my "web history" I'm not even allowed to set a 5-minute timer with Google Assistant.

</comment><comment><USER3> Alexa keeps getting smarter and is substantially less at $50 for the dot (frequently on sale for $40).

The dot is also superior because it can work with any bluetooth speaker or AUX speaker. Apple once again is 2 years behind everyone with inferior technology.

</comment><comment><USER4> There's no open API for this, right?

And Siri is ~1-2 years behind Echo/Google Home. Only "innovation" is on aesthetic design.

Apple usually comes in when they know they can do something a lot better than the existing competition, but not recently. Not with Apple Watch & HomePod.

It's now about:

1) Apple has massive distribution 2) They can get a non-step-function revenue increment with that massive distribution, launching new products.

Which makes sense why it's music focused (lock-in with Apple Music)

<comment><USER5> But Apple Watch is by far the best selling smart watch... ?

<comment><USER6> Being the fastest slug doesn't mean you're fast. Smartwatches failed to live up to the hype, sales areicb lower than expected, and you rarely see them on the subway.

Honestly, the aesthetics aren't there and it wasn't Earth shattering as promised. This looks to be the same, and Apple TV joins the club.

<comment><USER5> ?? I see a ton of Apple watches. It's like, the only watch that ever looked appealing.... I agree with your "being the fastest slug..." comment, but I'm not really sure what is to be expected here? In their market segment they are by far the top seller. They have a device that does a ton of stuff, looks nice, and integrates with devices like iPhone. What else are we expecting here?

What club is Apple TV joining? The successful product club?

</comment></comment></comment></comment><comment><USER7> Assuming the audio quality is on par with a Sonos Play:1, An extra $150 is a quite a bit more to pay for Siri integration. Also, will HomePod only work with Apple Music? Another must have that I would need to see before switching from Sonos is the ability to create a stereo pair with 2 speakers.

<comment><USER8> Only Apple Music. It can create a stereo pair. It's not going to be anywhere close to Sonos in terms of audio quality. 7 tweeters and one 4-inch sub?

<comment><USER9> So basically a music speaker that doesn't support Spotify?

Seems like a risky decision.

<comment><USER10> Do you know how Airplay works?

</comment></comment></comment></comment><comment><USER11> It sure looks like a gamechanger to me. I have an Echo at home, and I've gotta say it's a bit limiting to converse with. At $349, though, they're clearly going for a smaller market than Amazon & Google.

<comment><USER12> Can you expound on why you think it is a gamechanger?

<comment><USER11> Sure. I like my Echo, but it's painfully stupid quite often, and, while the speakers are pretty good, to me, they aren't as good as a high quality wireless speaker. It seems like Apple's build quality + Siri will result in a new best-in-class home speaker.

<comment><USER9> Serious question: if better intelligence is what you want, why did you choose echo over home to begin with?

<comment><USER11> I picked up the Echo before the Home was available.

</comment></comment></comment></comment></comment><comment><USER9> I find it interesting that even though apple showed us just an empty shell, some journalist told us that this is probably the best sounding speaker out there...

RDF jokes aside, I think this will be released as a pure music player first and get smart assistant functions within a year. I don't think it will get an open API the same way google home has but apple will inatead partner with select companies.

<comment><USER13> It wasn't an empty shell, journalists got to use and listen to actual Homepods

[https://sixcolors.com/post/2017/06/ears-on-with-the- homepod/](https://sixcolors.com/post/2017/06/ears-on-with-the-homepod/)

</comment></comment><comment><USER14> I can't decide if it more looks like Hal or a Nest Protect...</comment>


'Beep,' Says the Bellhop - <AUTHOR> http://www.nytimes.com/2014/08/12/technology/hotel-to-begin-testing-botlr-a-robotic-bellhop.html

<comment><USER2> TLDR summary: Its a wheeled robot doing the job of a dumbwaiter.

(A dumbwaiter is a tiny smaller than person sized elevator in a room which reaches down into a kitchen/office area. Bigger than the pneumatic tubes that move cash at legacy brick and mortar physical stores and bank branches. I don't think they're terribly popular anymore and are best seen in black and white movies. I have the carpentry skills to build one into my house for the sheet WTFness of the artifact, but not the motivation to research any fire related building codes or just simple motivation at all.)

<comment><USER3> My understanding is that dumbwaiters and laundry chutes fall under a fire code which boils down to "Nah, dude. Don't do that" just about everywhere. Vertical passages are great for fires, and bad for people who like not being on fire.

<comment><USER2> Its not a serious challenge.

There's a whole industry built around selling trash chutes and "soiled linen" hardware for hotels and skyscrapers in even the most authoritarian nanny states. So everything sold is NYC skyscraper firecode rated and NFPA certified or whatever even if its going in a 2-floor residential in a civilized area where its not even regulated. You can get a kit of the self closing doors for the top and a fusible link gadget that closes a door at the bottom for about the cost of a Really good video card, at least for a small linen chute. Its cheaper but probably less safe to have the fusible link thing, although you can put an automatic closing fireproof door in the basement end too. This is all standard COTS stuff nothing weird or custom.

Trying to do the safety stuff by myself would likely be super aggravating and end up being more expensive than just buying the doors and tube COTS. I'll have enough carpentry agony installing and trimming it out to make it look good, anyway.

Its apparently a lot of work to fireblock the tube where it goes thru the floor and ceilings and also trimming it out so it looks nice is non-trivial. If the hole were big enough for an elevator you'd just jump in, but if its barely big enough for a shoebox, how you do that work with out ripping away all the drywall is non-trivial. And that leads to lots of work.

The hack for a dumbwaiter is building all of it inside the tube. Any hole in the tube or a hole in the doors, even just to mount stuff, and I guess its not technically fireproof anymore. Adhesives would probably be OK? So there's some serious hacking potential involved here. You end up doing the "ship in a bottle" thing with a truss inside the tube at the top and bottom and the usual array of pulleys and ropes.

Another problem with dumb waiters is the price of the fireproof doors and tube is really cheap for "laundry chute size" but if you want to carry an entire laundry basket inside a dumb waiter inside the chute, it starts getting expensive, and a fireproof door the size of a dorm fridge approached 4 figures when I last looked into this.

Still, it would be pretty awesome, in my infinite spare time...

</comment></comment></comment><comment><USER4> Quote: " ... And will the next stage of machine automation lead to more job elimination?"

That part we can be sure of. It seems there's always some hype and speculation in an article like this, but elimination of low-level jobs seems certain. Why? It's the basic economic rationale for developing this kind of technology.

This is a trend that (some claim) started with the invention of the Jacquard loom in the early 19th century, which eliminated many low-level textile jobs and resulted in what's now called the Luddite rebellion -- acts of protest and equipment destruction by people whose jobs were eliminated by automated mechanical methods.

</comment><comment><USER5> ...so basically we're at the "robot butler" stage of Cylon development? That thing seems a lot like the common household robot in the (new) Battlestar Galactica pre-series "Blood & Chrome".

<comment><USER6> Did you mean "Caprica"?

<comment><USER5> Oh, was it Caprica? Oops.</comment></comment></comment>


Ask HN: Explaining how programmers work to non-programmer workplace? - <AUTHOR>

I am the first on-site programmer and I find it super hard to get any significant programming work done during the working hours on weekdays. This is mainly due to the physical office setup(open, non-quiet office) and folks needing something from me or having a question at least once an hour.
So, what do I do? We have a bunch of offshore devs and I sit next to the PMs. I am able to offer advice in terms of prioritizing features etc. and doing the management part of my job.
However, the coding part of my job(at least 50%), I can rarely do anything that involves even tiniest of problem solving. I am left mostly to do quick 5 minute fixes or copy edits.
The real coding? I do it over the weekend. I just pushed a tiny feature that took me 45 minutes. I spent five scattered hours on Friday on the same thing making zero progress.
Ideas? Solutions? I already tried proposing to my boss(the CEO) to let me play with my hours and work evenings but he felt I should be around the office when others are. <comment><USER2> What if you were to stop thinking of yourself as a programmer and become more of a CTO in training? Your value to your team isn't doing code but in helping them work with outside coders and making sure everything runs smoothly. Instead of fighting that role why not embrace it? Code is a commodity, but managing code and being "that gray person" has real value to a company.

<comment><AUTHOR> That is what the CEO's hope was by bringing me in. However, the company's existing devs(all remote; mostly offshore) have been with them for couple years and are weary of reporting to anyone other than the CEO.

Bottom line: I feel I can get more output done by just working alone than trying to delegate the same programming task among the devs. This won't scale obviously. But the company is pre-rev and not at a point where it needs scaling(the CEO probably disagrees with me on this).

<comment><USER2> Re-read what you just wrote and you'll see the following:

CEO's hope by brining me in - vs - what i want to get done

I think I'd follow the CEOs lead — my bet is there's something that is making him unhappy with the offshore team and they know it. And frankly it doesn't matter what you or the offshore team team -- what should matter is what the CEO wants. Frankly my bet is that the CEO is seeing something in you that you haven't yet.

Suggestion: Why don't you learn something about managing? Even if you learn to manage your own time it can only help you. I'd suggest reading the "Mythical Man Month" -- it's one of the best software project management books ever written and would help you explain what's needed to management.

<comment><AUTHOR> Cool, will read Mythical Man Month. Thanks for your tips.</comment></comment></comment></comment>


An Example Moving Python Recursion to Generators - <AUTHOR> http://stackoverflow.com/questions/7083011

<comment><AUTHOR> someone suggested this would be a good blog post. since it doesn't make much sense for me to pull it out separately i wondered if people would enjoy reading the question and answer as they are...</comment>


Are Dads the New Moms? - <AUTHOR> http://online.wsj.com/article/SB10001424052702304451104577392261536405038.html?mod=WSJ_hp_mostpop_read <comment><USER2> "do something as antifeminist as doing the dishes or the laundry."

Stop assigning things like washing the dishes to a gender. In a marriage, you work as a team and split those things up.

I also find it funny that women only pull the feminist card when it involves something they don't want to do. When it involves paying on a date (most women still want the guy to pay) or being treated like one of the guys (There was a women on here awhile back that wrote a bot involving not being offended (and I'm not talking about being harassed), it's a different story.</comment>


Show HN: Dompeg – bookmarklet to save Google search results as jpeg - <AUTHOR> https://codepen.io/dosy/pen/JrQgMY <comment><AUTHOR> [https://imgur.com/sHWA4kp](https://imgur.com/sHWA4kp) example image of search results

you can also save your github repository as an image [https://imgur.com/1fqrCt2](https://imgur.com/1fqrCt2)</comment>


Ask HN: How to Explain Why NSA Situation is Important? - <AUTHOR>

In expressing my utter shock at the revelation that the NSA has secretly been accessing user data from the top tech companies, the response I've received from people who don't work in the tech industry is either a shrug or a "why are you surprised?"<p>Given this, how do you explain to the average citizen why the NSA surveillance is an important issue that they should not simply ignore? What example would you use? What is the "elevator pitch" that gets people to understand the implications? <comment><USER2> There are numerous reasons dragnet surveillance is bad, and these are only a few:

There are so many federal laws, no one even knows how many there are. Law professors and other experts have said everyone over the age of 18 has committed a federal crime, often unwittingly. Collecting and indefinitely storing information on the communications and other data of everyone in America allows retroactive and (necessarily) selective enforcement of these laws to target people who cause problems for people in power. Whether or not this is happening now, it inevitably will with a system in place long enough.

Privacy is generally considered a human right, and it should be for a variety of reasons, including to encourage a free society. People under constant surveillance by the government are less likely to speak negatively about the government or subjects that could be misinterpreted. If you know you're being watched by the government, even passively, and things you say are permanently stored and potentially on record, you self censor your own speech. Thus, this indirectly becomes a way to suppress free speech.

</comment><comment><USER3> /u/161719 offers a chilling rebuttal to the notion that it's okay for the government to spy on you because you have nothing to hide. "I didn't make anything up. These things happened to people I know."

[http://www.reddit.com/r/bestof/comments/1fw77t/u161719_offer...](http://www.reddit.com/r/bestof/comments/1fw77t/u161719_offers_a_chilling_rebuttal_to_the_notion&#x2F);

</comment><comment><USER4> I'm not sure you have anything to explain to someone who responds with "Why are you surprised?". They understand the implications; nothing to explain there. Where they probably differ, is that they are likely resigned to the belief that it is not within their power to stop it (which I tend to agree with) and the only way to live with it is to act accordingly.

These people accordingly limit their trace-ability through channels they suspect of being monitored (e.g. phone, financial transations, Facebook, Google, Twitter, etc. - not everyone signs up for these) and when they do use such channels, they do not divulge private information through them. I realize for some people I'm conjuring up an image of a person wearing a tinfoil hat, but these people (and I can't even say I'm one of them - I fall somewhere in between them and "average joe") weren't so "paranoid" after all.

<comment><AUTHOR> Except that, in the cases I've seen, the "why are you surprised" people _aren 't_ limiting their trace-ability. Again, these are not people who are in the same tech world as you and me. Their attitude comes from a cynicism toward government, not toward a confidence in their tech abilities.

More so, the "why are you surprised" attitude comes with an unsaid "so what?" "Yeah, we're being monitored. Why is this a big deal?"

And that is the point of my question: what can you say to explain that this is a big deal?

</comment></comment><comment><USER5> Three letters: IRS. Whether it was a "couple of rogue employees" or 88+ given specific orders from their boss(es), the same thing can (and some day will) happen at the NSA.

</comment><comment><USER6> Re:

"...I've nothing to hide".

"... I find it hard to care."

...

"...I hate math."

RESPONSE:

A name defines, sets boundaries, your name and your privacy; defines you exclusive of everything and everybody else. Without privacy, you have no skin, you are not interesting, you are insignificant.

"The cypherpunks credo is 'privacy through technology, not legislation.' The law of the land can be changed by the next administration. The Laws of mathematics are more rigid."

<comment><USER7> I get your core concept. you have a shell thats consisting of "name" and "privacy" (these need to be defined more). and those 2 things separate you from everyone else -- so without those you lose your identity.

Can you define a little bit more what goes into name and privacy?

<comment><USER7> something I didn't adress in my point there is that I feel like this is a weak argument because my identity isn't shattered so easily, I am not "insignificant" because I was wire taped. in fact, it would seem that someone intentionally listening in on me considers me to be significant!

<comment><USER6> If the name of pi is with itself, and the rate(in domain) of the exponential is itself, how significant are you to do otherwise?</comment></comment></comment></comment>


Wikileaks Closes Operations Temporarily Due to Budget Woes - <AUTHOR> http://www.wired.com/threatlevel/2010/02/wikileaks-budget-woes

<comment><USER2> Report from the BBC: <http://news.ycombinator.com/item?id=1092284></comment>


GPT-2 and Philip K. Dick - <AUTHOR> https://flancia.org/posts/gpt-pkd/ <comment><AUTHOR> This is intended to be the second in a series of posts about possible applications of NLP for the purpose aiding writing and other creative activities.

My models are very entry-level right now, except for this excursion to the land of basic usage of a more advanced tool such as GPT-2; but hopefully I'll be able to produce more interesting stuff as I learn more about ML.</comment>


Ask HN: What do you think are the disadvantages of bootstrapping over VC model? - <AUTHOR> From the PG essay:<p>"Bootstrapping sounds great in principle, but this apparently verdant territory is one from which few startups emerge alive. The mere fact that bootstrapped startups tend to be famous on that account should set off alarm bells. If it worked so well, it would be the norm" <comment><USER2> I'm bootstrapping my startup. Sometimes there's a conflict between your "north star" \- your main metric - to your need to generate income now.</comment>


Swedish car giant Volvo sets a target to eliminate death and injury in its vehicles by 2020. - <AUTHOR> http://www.reuters.com/news/video?videoId=81480&feedType=VideoRSS&feedName=Technology&rpc=23&sp=true <comment><AUTHOR> My proposed solution: automated driving. A $1T opportunity.</comment>


Setting up a SpreeCommerce site on a Digital Ocean Droplet (VPS) - <AUTHOR> http://pnhoang.tumblr.com/post/80274728962/setting-up-a-spree-commerce-site-on-a-digital-ocean

<comment><AUTHOR> Hello communities,

I just started writing articles to help me learn new stuff. It would be great if you guys can give me advice and suggestions. Thank you so much.</comment>


Problems with Bitcoin - <AUTHOR> http://iqpay.co.uk/problemswithbitcoin/

<comment><USER2>
        1. There is a finite number of Bitcoins that will exist

This is a good thing. It makes Bitcoins similar to gold. There is a finite amount of gold in the world. Artificial scarcity is an innovation.

        2. Whilst there is a finite number of bitcoins,
        there are an infinite number of Bitcoin-substitutes

That's true, but the network effect, being first to market, and having an enormous community counts for a lot. There is only one Facebook. Also it would take lots of additional software overhead for businesses to support other currencies in addition to Bitcoin, not to mention it would confuse consumers.

        3. Large companies couldn't adopt Bitcoin, even if they wanted to

Then explain how Shopify adopted Bitcoin? This is simply incorrect.

        4. Trust and transparency"

If someone steals your Bitcoins, they committed a crime, and the police will go after them. Bitcoin also leaves a great audit trail.

        Continued existence of currency – as noted in
        section 3 above, whilst there may be good reasons
        why cryptocurrencies could replace traditional
        currencies, there is absolutely no basis for assuming
        that Bitcoin will be that winning currency.

Yes there is a good basis - the fact that it's survived for 4 years as the leader. TCP/IP, HTML, etc. is still around.

        5. Reliance on cryptography

Everyone relies on cryptography nowadays, and in the slim chance it becomes broken, the Bitcoin community would come up with a new encryption scheme.

<comment><USER3> I agree with the author that having a finite number is not beneficial for a currency -- it is inherently deflationary. I can understand a currency which is increasingly difficult to increase the supply, but limiting production to a fixed amount will certainly lead to hoarding. I've never understood this limitation in bitcoin.</comment></comment>


Synthetic Biology - <AUTHOR> https://axial.substack.com/p/axial-matrix-7-synthetic-biology <comment><USER2> I worked in Syn Bio from 2008-2010, long before CRISPR came onto the scene. I worked on a couple of iGEM projects, that's the international genetically engineered machines conference at MIT.

The basic premise was we would design E. Coli "strains" or "models" that had foreign DNA inserted via commonly-shared genetic tools. It is comparable to using Linux as a shared OS, lots of other FOSS developers helping each other... except that to get totally new DNA into your E. coli, you had to have it shipped in on dry ice from a willing lab halfway around the world. So, you can see why the field is much smaller and more niche than anything software- related...downloading a library is WAY faster and cheaper than shipping in a new genetic module.

CRISPR would've been a game changer for us. We could've much more easily edited gene sequences, though it still would've been hard to get foreign DNA from other labs...I don't believe CRISPR is good for writing huge new sequences... But small changes, small modifications, would've been MUCH faster with CRISPR. We could've gotten a foreign DNA sequence and then tried out 100 different mutations very simply, perhaps discovering an even better functionality than nature's original code.

<comment><USER3> Crispr is not necessary for e coli mutagenesis. For plasmids you really want to use Gibson assembly. For chromosomal modification lambda red is as easy as crispr.

Gibson assembly is basically foolproof. I trained an intern with almost no molecular biology wetlab experience and in three months he designed DNA for and made fifty mutants (I picked whuch mutations to try) and ran biochemistry on half of them:

[https://pubmed.ncbi.nlm.nih.gov/24934472/](https://pubmed.ncbi.nlm.nih.gov/24934472/)

For yeast, you need neither. Just drop the DNA in and the yeast takes it up!

<comment><USER4> For doing mutagenesis on plasmids, you don't even need gibson. Overlapped primers do some weird circularization during PCR, so for point mutations you don't even need gibson mix.

I'm personally a big fan of synthesis + GoldenGate for building genetic circuits. Gibson, IMO, destroys reproduciblity (how many different PCR kits are there?) and leaning towards Gibson assembly over enzymatic assembly methods (GoldenGate, maybe even BioBricks) makes biotech an Ivory-Tower exercise, since not everyone has access to oligos.

<comment><USER5> How is gibson ivory tower? It's literally just based on overlapping sequences. And how is it hard to reproduce? You select out colonies and verify with sanger. These are not things that are inaccessible to most people, especially if you live near a DIY bio hacker space, and if you get involved in the biohacker community you'll get a sense of what providers ship to residential address, where to get certain equiptment, and so on. Just googling will get you information that can help you figure out how to get what you need.

[https://medium.com/@ThatMrE/a-guide-to-diybio- updated-2019-a...](https://medium.com/@ThatMrE/a-guide-to-diybio- updated-2019-abd0956cdf74)

<comment><USER4> Reordering of oligos is expensive, which makes people not reproduce. Sanger sequencing is pretty expensive ($5 sure, but over 5kb on 3 different constructs becomes pricey). PCR machines also ain't that cheap (when you're a noob and don't know what to buy), especially when you need to do more than 8 PCRs at a time.

In theory, works in practice, and in practice, works well in theory. Even for experienced DIYbio folks, cloning isn't just 1,2,3.

Also, PCRs themselves aren't very reproducible. It's not about the overlapping sequence.

</comment></comment></comment></comment></comment><comment><USER6> SynBio in the 2020s smells a bit like green tech in the 2000s. I see a ton of founders and funders with zero biology background thinking that they have the vision and can just hire biology expertise.

Biology is ruthlessly unforgiving and complicated, and often times very low efficiency. For example, it's a bit amusing to see the ratio of CRISPR mentions in startups vs the techniques actually being used by scientists. You would never use CRISPR if you had the option of using Cre. I've made several stable transgenic animal lines using Tol2 transgenisis, which is much higher efficiency, too.

If you're excited by the space, but don't have a biology background, consider joining an organization led by a biologist.

<comment><USER7> > I see a ton of founders and funders with zero biology background thinking > that they have the vision and can just hire biology expertise.

Genuinely curious about your data here. The two first companies mentioned in the article (Zymergen and Gingko) have founders with biology background. Many other companies I know as well.

> You would never use CRISPR if you had the option of using Cre. I've made > several stable transgenic animal lines using Tol2 transgenisis, which is > much higher efficiency, too.

That probably depends on the organism you're working with. E.g. with baker's yeast, my preference would definitely be CRISPR/Cas9 instead of cre recombinase (see e.g. [https://academic.oup.com/femsyr/article/15/2/fou004/534426](https://academic.oup.com/femsyr/article/15/2/fou004/534426) ).

<comment><USER6> > Genuinely curious about your data here.

I invest a little in the space so have seen some pitches at IndieBio, YCombinator, and talked with a bunch of companies. There are indeed some really great founders with biology background as you point out. But have been seeing more and more founders from software background. The enthusiasm is great, and people with software backgrounds have a ton to contribute! Just maybe shouldn't be the CEO.

> baker's yeast, my preference would definitely be CRISPR/Cas9

I've never worked with yeast but was under the impression that you could just give them plasmids and call it a day?

</comment></comment></comment><comment><USER8> A major issue with biology is the compensation. Biology compensation is notoriously bad outside of accredited medicine.

<comment><USER9> So you mean you can hire cheap?

Couple that with the recent fast technological advances (ex: rejuvenating stem cells), the many possible applications, cheap capital, and I see all the ingredients for a boom.

Just like the 2000s were about internet and the 2010s were about fintech and cryptos, the 2020s may be about biohacking

<comment><USER10> I (do not) look forward to seeing the results of "failing fast" here. The conspiracy theorists are convinced that this is how we got to COVID19 in the first place, and while I'm not really convinced there, I really do not enjoy thinking about the potential of such technology to create bioweapons of a scale never seen before.

<comment><USER11> Definitely don't look up 'gene drive' then :)

</comment></comment></comment></comment><comment><USER12> On a tangential note: I've seen the upcoming rise of Syn Bio for quite some time now. But I've never figured out, how to participate / help its growth as a pure SWE.

Job offers related to that field require a skill stack, that I have zero investment in. I'm also in my thirties, so starting from scratch isn't really an option. Someone else here from a similar background, who managed to get a foot into the Syn Bio industry?

 _edit_ : Should have mentioned, I'm currently living in Europe. Although I might give that up in order to break into the industry.

<comment><USER13> There is a niche of companies that are starting to let software eat biology. It's one of the latecomers to utilize the improvements, but they do exist.

[My company is one - we have pure software engineers on our team, we build synthetic therapeutic proteins]

Check out companies like Zymergen, Benchling, Synthego, Bolt Threads, Gingko, Riffyn, & Teselagen.

In terms of pure software, helping open source scientific libraries, image processing for science, and genomics software would help out what is otherwise an under-funded field.

</comment></comment><comment><USER14> It mystifies me how often Amyris is omitted from posts about synbio. Sure it's not a hot startup, but it has commercialized more molecules than anybody in the industry (and possibly as many as everybody else combined).

</comment><comment><USER15> I find synbio terrifying. Think about what you know about the dysfunctions of our field, IT, but with hardware-that-is-software and can eat you or make you sick. A _computer_ virus can infect the Internet, a _virus_ can infect the real world.

We should study life for at least two to five hundred more years before attempting applications via these methods.

Genetic engineering applications (except for human health) should be banned, IMO, until we have enough information to do it responsibly.

We already have species and methods of creating new variations that answer our needs.

> Luther Burbank (March 7, 1849 – April 11, 1926) was an American botanist, > horticulturist and pioneer in agricultural science. He developed more than > 800 strains and varieties of plants over his 55-year career.

[https://en.wikipedia.org/wiki/Luther_Burbank](https://en.wikipedia.org/wiki/Luther_Burbank)</comment>


Universal iOS batch photo uploader app for Flickr - <AUTHOR>

Hi,
We just released a new universal iOS app that will let you batch upload photos to Flickr. The iPhone is the most popular camera on Flickr and we believe that this app will be very useful for Flickr users. PhotoLoader is easy to use and does one thing very well: batch upload photos (resized or in their original resolution) to Flickr!
Please feel free to check it out: http://www.yakamozlabs.com/apps/photoloader_for_flickr.
App Store url: http://itunes.apple.com/us/app/photoloader-for-flickr/id452985601?mt=8 <comment><AUTHOR> <http://www.yakamozlabs.com/apps/photoloader_for_flickr>

App Store url: [http://itunes.apple.com/us/app/photoloader-for- flickr/id4529...](http://itunes.apple.com/us/app/photoloader-for- flickr/id452985601?mt=8)

</comment><comment><USER2> When you say you have a "universal iOS app", does that mean that you have one app that works on iPad and iPhone? I think so - just making sure. That's the first time I've heard that term.

<comment><AUTHOR> Yes, it's one app that works on the iPad and iPhone.</comment></comment>


My "Chrome to Phone" knockoff app for iOS - <AUTHOR> http://itunes.apple.com/us/app/jumping-url/id388521070?mt=8

<comment><AUTHOR> Link to website : <http://www.jumpingurl.com></comment>


Man makes own coins, convicted via civil war law: facing 25 years, $7M seizure - <AUTHOR> http://articles.sfgate.com/2011-04-04/news/29383341_1_liberty-dollars-von-nothaus-currency

<comment><AUTHOR> U.S. Attorney Anne Tompkins:

 _"Attempts to undermine the legitimate currency of this country are simply a unique form of domestic terrorism"_

More background:

[http://blogs.forbes.com/greatspeculations/2011/04/04/von- not...](http://blogs.forbes.com/greatspeculations/2011/04/04/von-nothaus- affair-shows-two-sides-of-coinage/)

[http://online.wsj.com/article/SB1000142405274870442580457622...](http://online.wsj.com/article/SB10001424052748704425804576220383673608952.html?mod=googlenews_wsj)</comment>


Analysis of Software Architectures - <AUTHOR> http://www.firatatagun.com/blog/2016/01/09/analysis-of-software-architectures/ <comment><USER2> This analysis brings to the front a personal frustration, and I imagine it's not unique to me.

This article discusses some architecture techniques, but moreover, it buys into a Culture of Architecture that we don't have a word for yet. This CoA is predominant among Java engineers who worked at large, slowly-dying companies (e.g. IBM).

The issue with the CoA is that it cares more about buzzwords than quantifiable claims or objective measures. CoA was once addicted to microservices, when that model failed it'll be "all about" another, and so on. Rife with academic good-sounding CoA words that nobody can argue with like "SOLID" and such.

To be a little more concrete, "Broker topology" is a 25-cent word for a 1-cent idea (and it's not the only one, see every keyword in bold in the page, it's almost like a college textbook). There seems to be an implicit assumption in CoA that there is a finite number of architecture patterns and they must be learned by name.

Again, to be more concrete, "layered" architecture is an oversimplification of a fundamental idea (abstraction) in engineering.

This textbook-esque presentation also really misses the spirit of coding. It presents a UML (another CoA must) of "Event-Driven" architecture, then one of "Layer" Architecture, without really explaining if these can be combined or are mutually-exclusive (of course they could be combined). But by treating them as named nouns it creates a misleading and complex language around fundamental ideas.

<comment><USER3> I _violently_ agree, and I suspect most of HN does.

There's an associated danger though: I find that many startup hackers actively dismiss good ideas (and even entire programming languages) simply because they smell a bit of CoA.

Even the CoA crowd occasionally comes up with truly good ideas that have way more substance to them than the meaningless patterns mentioned in this article.

As an example: My personal pet peeve is the startup world's ignorance of Domain-Driven Design and CQRS (Command-Query Responsibility Segregation). If you want to make scalable backends, I really recommend you read up on CQRS, it's practical and it fits modern ideas. Most examples are in C#, but _you 'll survive_.

For frontenders, CQRS is basically Flux on the backend, kinda sorta. It ought to be super hip right now but it isn't, and I suspect that's only because it comes from C#-o-world and has a ridiculous unpronounceable acronym.

<comment><USER4> > As an example: My personal pet peeve is the startup world's ignorance of > Domain-Driven Design and CQRS (Command-Query Responsibility Segregation). If > you want to make scalable backends, I really recommend you read up on CQRS, > it's practical and it fits modern ideas. Most examples are in C#, but you'll > survive.

Most starts never become successful enough to have to worry about scalability; in fact, if they do, it's almost a luxury.

I don't have experience with CQRS and event sourcing, but it does seem to come with its own share of problems, for example dealing with changes of the data model, which I suspect would happen often in young businesses.

<comment><USER5> It's very easy to do CQRS without Event-Sourcing. ES is really a separate kind of architecture-piece that's concerned with how you _mutate_ your persisted data.

For example, at work I've got a CQRS system where the MySQL database looks pretty much like you'd expect from any other system. (Customers table, one row per customer, etc.) It's still CQRS because writes and reads occur through different paths, and writes can have side-effects to proactively-build readable data. For example, "Top 100 Happiest Customers" might be its own table--managed by application code--rather than view or query.

<comment><USER4> If you do it that way, you don't get the famed scalability; it's still limited by the scalability of the mysql backend.

<comment><USER5> Not sure exactly what capability you're referring to with the "famed" scalability, but my point is that CQRS in no way requires Event Sourcing, and offers its own set of benefits. (It's also a helluva lot easier to do, or un- do.)

In particular, CQRS helps you make a sane architecture for "read models", where certain features (say, a homepage showing a hard-to-calculate leaderboard) are simple queries against a data-source designed specifically for that feature. The backing data-source is kept up to date by application code as a side-effect of your "real work".

This means you can substantially reduce the runtime load on the database as well as reducing how much application-logic "leaks across" in triggers/procedures/views. Since your database is often the "bottleneck of last resort", this means better scalability.

</comment></comment></comment></comment></comment></comment><comment><USER4> This articles makes the assumption that features are easier to develop if subsystems are broken up into separate components, with separate data sources and deployments.

But experience shows that this is only sometimes the case. Monolithic applications with a big SQL engine as the backend have the advantage that you can do joins very easily. If the data is split into three microservices, you spend much more time thinking about how to do the these cross-service joins more efficiently, narrowing down the amount of data you have to fetch from the other services and so on.

People argue that cross-service joins should not be necessary, but that's also easier said than achieved; in reality, they tend to show up, no matter how carefully you partition the services.

<comment><USER6> I guess that not just the joins become more difficult in a partitioned system, but especially transactions. Maintaining transactional consistency across multiple services seems to me like a nightmare. Even writing tests that address consistency could be very difficult.

<comment><USER7> Often you don't worry about transactions across services. I know that someone will say we have to have them. In such cases, fine worry about them. In everything else, either isolate the write side of a transaction in one service or don't require them.

<comment><USER8> "don't require them".... Transactionlity is principally dicated by the requirements to the architecture design, not the other way around.

" isolate to one service " Yep, a single service with a single database, as mentioned.

My point here, like the earlier one, is that there are a lot of situations where multiple services don't fit the domain. In fact, very many, given the extreme complexity around transactions.

</comment></comment></comment></comment><comment><USER9> Does anyone find this a bit contrived? When you build a complex piece of code, there's always more than one way to draw a diagram of it. For instance, I've written trading systems.

\- It's event based because there are publishers and subscribers.

\- It's layered because there's a UI that draws stuff from the business layer, which takes data from a database

\- It's plugin because it uses a DI container, which decides exactly which services to run on which machines.

</comment><comment><USER10> As someone who worked briefly on "enterprise" software (in Java), this article brings back memories of preposterously complex and uncomfortably bureaucratic monster-systems that were a nightmare to work on. It also reminds me of [http://www.joelonsoftware.com/articles/fog0000000018.html](http://www.joelonsoftware.com/articles/fog0000000018.html)

<comment><USER11> Good for you. I keep working more or less on similar kind of systems where an 2 line change in a method turns out 20 code + 5 config file change.

</comment></comment><comment><USER12> Regarding microservices. They sound nice in theory, and certainly work for some cases. But what is the common pattern to handle a situation like this (in a performant and "scalable" way).

Say you have two (completely separate micro-) services:

\- Order service \- Customer service

Now when a customer buys something, it is stored in the order service. But how is the customer information referenced in the order service? Do you store just some "customer id" and let the clients of this service worry about what it means? Or do you store some customer information also in the order service (in memory cache or in the services own datastore, both solutions which then need to synchronize this data somehow)?

Eg. how about a situation where you want to display a sortable list of orders, and it includes the columns for the customers first and last names. How can you sort on these columns if the order service doesn't know anything about the customer other than some "identifier"? Especially if the list is paged so you can't look up all the needed customer's information.

Just thought about this because this article (and many others) tout microservices as some kind of silver bullet.

<comment><USER4> Denormalization is often a practical answer; the order service keeps an (immutable) copy of the customer's name and delivery address.

If the customer changes the address, it will only matter for new orders.

One can argue that this is actually a sensible behavior, because there's a point after which you can't change the delivery address anyway (once it has been handed over to the delivery service, for example), and this behavior of copying the address just moves the point a bit.

Likewise, when a customer buys a product, a copy of the product description and price is included in the order; if the price changes between the checkout and the delivery, it's good if that isn't reflect in the amount that is invoiced. After all, the checkout established a contract that cannot be easily changed retroactively.

<comment><USER5> Right, I think this is an example of the importance of good requirements and scenarios before coding.

While programmers may prefer to create denormalized "model of everything at once", some business processes require copies and snapshots. Not as implementation details, but directly.

</comment></comment></comment><comment><USER13> I think the article is not bad. It just mentions some patterns and compares them. of course they can be composed.

While I agree an "architectural astronaut" approach to software engineering is wrong, we still have to understand the main underpinnings of software engineering. data, separation of concerns, composability, state vs non stateless.

recognizing patterns in granular code as well as in system composition is important. And naming them makes communication easy. PubSub, Visitor, Mvc, etc are still useful names.

What I think is funny is that the java implementations are often big compared to the same solution in functional languages.

Static OO languages often need "software patterns" such as wrapper objects, where they are nonexistent in functional languages. imho

</comment><comment><USER14> Related: "The Architecture of Open Source Applications" ([http://aosabook.org/](http://aosabook.org/))

They've recently released new chapters of the upcoming fourth volume.

</comment><comment><USER15> This analysis is a badly regurgitated copy of the free O'Reilly e-book about software architectures by Mark Richards located at [http://www.oreilly.com/programming/free/software- architectur...](http://www.oreilly.com/programming/free/software-architecture- patterns.csp)

It's a lot worse than the original.

</comment><comment><USER16> This website badly needs editing. There are a lot of bad sounding and awkward sentences.

"For several years now, many enterprises and companies employed this architecture in their projects and it almost became the de facto standard therefore it is widely known by most architects, developers and designers."

"Layers don't have to know about what other layers do, in example: business layer doesn't have to know how data layer is querying the database, instead business layer expects some data or not at all when it invokes certain method in data layer."

"Some of the features and functionality doesn't need to go through all the layers"

"If you have 20 percent of requests just passes through layers and 80 percent of requests does real processing, it is fine, however if the ratio is different then you are having sinkhole anti-pattern syndrome."

"Event mediator doesn't do or knows any business logic, it just orchestrates the events."

</comment><comment><USER17> The chart at the bottom of the article is incorrect in at least a few spots:

\- The article does not identify difficulties with testability or development of the MicroService architecture.

\- The face shown for Layered architecture's "Development" is colored incorrectly (since it is a smiley-face and the article text supports that).</comment>


Ask HN: How to make your remote life better? - <AUTHOR> I'm starting a small side project with the goal of creating useful tools for fully or partially remote teams. I think the main collaboration tools (chat, video, screen sharing) have been covered pretty well, but there seems to be a lack of more "team management" type tools.
Some ideas include:
- Onsite trip planning (A flight aggregator but you can input numerous departure cities and find the best combination to bring the team together at various destinations)
- Quick timezone availability/scheduling integration with G suite.
- Onboarding. Send schwag to new employees at their house.
As a remote employee/founder what tools do you wish you had in your day to day arsenal that don't exist? <comment><USER2> > Quick timezone availability/scheduling integration with G suite.

This would be really helpful.</comment>


Déjà vu: Fast efficient probabilistic deduplication - <AUTHOR> https://github.com/F483/dejavu <comment><USER2> Bloom filters don't seem useful as the primary means of deduplication _for an actual data storage system_ to me.

\- False positives means marking data as duplicate when it's not.

\- Bloom filters are not associative. So unless the application is very special and can find/ _identify_ /retrieve the data later in some other (likely inefficient?) way, a separate index is required anyway. But if you have a separate index of the data you already have, you can just use that to deduplicate. This index is the main memory cost of deduplicating storage.

Bloom filters are of course interesting in certain scenarios e.g. to statistically reduce network traffic.

<comment><AUTHOR> > Bloom filters are of course interesting in certain scenarios e.g. to > statistically reduce network traffic.

Yes I originally wrote it for exactly this such a scenario.

This is not for you if you cannot live with any chance of a false positive, even an extremely small one. Note that even in most cases a false positive is acceptable if the chance of a false positive is less then the chance of a hardware error.

Not that just because it is probabilistic does not mean its not useful in many cases. The default setup with 1mil entrie memory and 1/1mil chance false positive chance will run at ~8M mem usage. This is a quite an acceptable trade off in many cases.

</comment></comment><comment><USER3> May want to take a look at using a Cuckoo Filter instead of a Bloom Filter. See [https://maxdemarzi.com/2017/07/13/using-a-cuckoo-filter- for-...](https://maxdemarzi.com/2017/07/13/using-a-cuckoo-filter-for-unique- relationships/)

<comment><AUTHOR> Thanks for the feedback, will look into it.

</comment></comment><comment><USER4> Perhaps like the other ZFS fanboys on this thread, I was hoping that "efficient" would by some magic mean "sublinear in memory", but it doesn't look like that. :(

<comment><AUTHOR> Sorry I cant do magic just yet :(

</comment></comment><comment><USER5> Poor name choice.

[https://en.wikipedia.org/wiki/D%C3%A9j%C3%A0_Vu_(software)](https://en.wikipedia.org/wiki/D%C3%A9j%C3%A0_Vu_\(software\))

[https://github.com/worldveil/dejavu](https://github.com/worldveil/dejavu)

[https://github.com/appbaseio/dejavu](https://github.com/appbaseio/dejavu)

[https://github.com/IndigoUnited/js- dejavu](https://github.com/IndigoUnited/js-dejavu)

<comment><AUTHOR> Yeah, should have put more thought into it then I did. But I guess its to late now.

</comment></comment><comment><USER6> Could you use this to deduplicate files in a filesystem?

Could you use this as the deduplication method in ZFS?

<comment><AUTHOR> > Could you use this to deduplicate files in a filesystem?

Depends on what you mean and your constraints. Deduplicate file entries if you can live with a rare false positives, sure. A setup of 1million entrie limit with 1/1billion false positive chance will get ~80M mem usage.

If you want to check for duplicate files, probably not.

> Could you use this as the deduplication method in ZFS?

I would say no.</comment></comment>


Fuzzing tcpdump in the cloud - <AUTHOR> https://www.softscheck.com/en/identifying-security-vulnerabilities-with-cloud-fuzzing/ <comment><USER2> Hmm. Wouldn't take much to patch this to leverage spot instances or spot fleets. Becomes a big cost saver at significant scale.</comment>