Writing more legible SQL - <AUTHOR> http://www.craigkerstiens.com/2016/01/08/writing-better-sql/ <comment><USER2> Here is how I write SQL:

        select
            t1.col1,
            t2.col2,
            t3.col3
        from table1 t1
            join table2 t2 on t1.col2 = t2.col1
            join table3 t3 on
                t1.col3 = t3.col1 and
                t3.col2 = something_else
        where
            t1.col1 > 0 and
            t2.col2 <> t1.col4
        order by col2
        limit 100

So:

1\. SQL capitalization is not sacred. I lowercase everything.

2\. I just indent subclauses, with four spaces, like I indent other languages. I don't go out of my way to line up things vertically.

3\. Conjunctions like "and" are put at the end of a line, like a comma, not at the beginning. I think it lines things up better vertically.

4\. I try to keep lines short, but I also try to keep it from getting needlessly long vertically. So if the statement is short and simple, I might fold some things back onto one line, like:

        select col1, col2, col3
        from table1
        where col1 = something_or_other

or even:

       select * from table1 where col1 = something

<comment><USER3> I fully agree with the sentiment, and especially with treating SQL code as code, because it really is code. My style differs in 4 regards:

1\. "join"s are at the same level as "from", and the contents of from/join are indented

2\. prefer tuple comparisons of multi-comparisons, i.e. "(a,b)=(c,d)" instead of "a=c and b=d"

3\. operators auch as "and" are at the beginning of a line, as in style guide of almost all other programming languages, too

4\. the contents of "order by" and "group by" are also indented, the same way as the "select" columns

Example:

        select
            t1.col1,
            t2.col2,
            t3.col3
        from
            table1 t1
        join
            table2 t2 on t1.col2 = t2.col1
        join
            table3 t3 on (t3.col3,  r3.col2) = (t1.col3, something_else)
        where
            t1.col1 > 0
            and t2.col2 <> t1.col4
        order by
            col2 asc,
            col1 desc
        limit 100

<comment><USER4> I always keep the joins indented from the table that they are joined to:

      select    t1.col1,
                t2.col2,
                t3.col3,
                t4.col4
      from      table1 t1
                    join table2 t2 on t2.colx = t1.colx
                    join table3 t3 on t3.coly = t1.coly
                        join table4 t4 on t4.colz = t3.colz
                    join tablen tn on tn.coln = t1.coln
      where     tn.colnx in (...)

                -- Table 3 and Table 2 have some values while Table n value is not something OR Table n has value that is exactly something
                and (
                        (t3.col = x and t2.col = y and tn.col != z)
                        or
                        tn.col = z
                    )
      ...

So in above you can see by the indent on which table some other table is joined to. Tables t2, t3 and tn are related to t1, but t4 is related to t3, not directly t1.

<comment><USER3> _> indented from the table that they are joined to_

There is not always "the" table.

How does your coding style work if you join into multiple tables? (because in reality you join the new table with the joined result of the previous tables, and hence can reference any combination of any previous table columns, unless you group your joins with parentheses)

      select
          ...
      from
          table1 t1
      join
          table2 t2 on t2.colx = t1.colx
      join
          table3 t3 on (t3.coly, t3.colz) = (t1.coly, t2.colz)

<comment><USER4> What you are saying is correct. In this case I would have the join of t3 on the same indent level as the join of t2 as t3 table has also the common key with t1. Somehow I just find the parent comment style not so intuitive for me.

</comment></comment></comment></comment></comment><comment><USER5> A couple of jobs ago, I worked at a company that did a ton of SQL and we used right justified keywords, which looks like:

        select t1.col1,
               t2.col2,
               t3.col3
          from table1 t1
               join table2 t2 on t1.col2 = t2.col1
               join table3 t3 on t1.col3 = t3.col1
                and t3.col2 = something_else
         where t1.col1 > 0
           and t2.col2 <> t1.col4
         order by col2
         limit 100

Initially it seemed weird to see the ragged left edge, but over time I got used to it and grew to prefer it. It doesn't really hold up for extremely complex queries with lots of subqueries because everything tends to start drifting too far to the right (unrealistic example below):

         select *
           from blah b
          where b.whatever in (
              select blah
                from c
               where c.whatever = in (
                   select blah
                     from d
                    where d.whatever = 'foo'
               )
          )

I almost never see this style used these days, and I was curious if anyone else does it this way?

<comment><USER6> I use this style. I work with queries that are a little bigger than average, and it's very difficult to keep track of it unless it's well laid out.

conditionals, loops, etc, get formatted like they would in a procedural language. the DML gets formatted similarly to what you've posted.

a not unrealistic example from this morning is as follows:

      if (select object_id('aTableName', 'u')) is not null begin
        select column
          from aTableName
         where thisIsTrue = 1
               and somethingIs in (select aList from aListTable)
               and somethingElse = (
                 select aValue
                   from aValueTable
                  where aValue = 'somethingImportant'
               )
      end else begin
        print('Oh noes! I couldn't find somethingImportant or something in someList form aTable!')
      end

we work with huge amounts of data with systems and processes that don't lend themselves to other methods (yet... it's coming.) so we have to make SQL as readable as possible.

edit: yes... i know... subqueries are bad... it's just an example. those would have been done in joins or as temporary variables or something else.

</comment></comment><comment><USER7> I also use UPPER case for SQL Keywords to visually distinguish them from user- defined names (i.e. similar purpose to syntax coloring), but I don't collapse SELECT over multiple lines and line up each statement so the conditions line- up, e.g:

        SELECT foo, bar
          FROM baz
         WHERE foo > 3
           AND bar = 'email@example.com'

<comment><USER8> Re uppercase: can't afford a syntax-highlighting editor?

<comment><USER9> It's true that there are _some_ editors which highlight SQL inside strings, but most don't.

</comment></comment></comment><comment><USER10> sqlparse comes to mind - [https://github.com/andialbrecht/sqlparse](https://github.com/andialbrecht/sqlparse)

I know the maintainer, they also run a service at [https://sqlformat.org/](https://sqlformat.org/)

You can try it on the command line e.g. on Fedora:

      $ sudo dnf install python3-sqlparse
      $ echo "select c1, c2, c3 from table1 join table2 t2 on t1.col2 = t2.col1 where 1=2 order by col2 limit 100" | sqlformat -k upper -i lower -sa -
      SELECT c1,
             c2,
             c3
        FROM table1
        JOIN table2 t2
          ON t1.col2 = t2.col1
       WHERE 1 = 2
       ORDER BY col2
       LIMIT 100

</comment><comment><USER11> Am I the only one who puts commas on the next line? I think of them as an operator analogous to AND or ON:

        select
            t1.col1   as col1
            , t2.col2 as col2
            , t2.col3 as col3

It makes commenting out columns painless.

<comment><USER12> > It makes commenting out columns painless.

No it does not. If you have to comment out the first column you'll have to remove the comma from the second column. It's the same problem that happens if you put the commas at the end of the line, except that the offending line will be the last column. So putting commas at the beginning just makes it look weird because it differs from how we use commas in natural language.

<comment><USER13> Exactly, You're also hiding the most important part of the line which is the variable name.

</comment></comment></comment><comment><USER14> Dunno if it's the quality of the posts here, but I find interesting to see that when we talk about SQL nobody complains about it : nobody says there are better alternative, nobody talks about the great schism between the last 2 major revisions of the SQL standard,...

(IMHO, SQL is one of the oldest languages and it is still super powerful _and_ used like hell in production environment, but that's just a point of view)

<comment><USER15> I have plenty of gripes about SQL but am not aware of _any_ real alternatives ... which I do find bizarre - in the realm of programming languages in general we live in a time of Cambrian explosion in terms of the number and type of languages being used and developed, and yet SQL sits aloof and unassailable on its pedestal.

There are a number of clear paths not taken:

1/ A new, better language that compiles down to SQL;

2/ A set of enhancements to SQL that compile down to regular SQL (<= best imo);

3/ A new language that compiles down to the same AST that is generated from SQL: this of course would need to be done by the database implementors.

That we don't see this I attribute to:

1/ Perception that SQL is "good enough". Which is true as far as it goes, but again odd compared with the endless innovation in the world "normal" programming languages;

2/ Innate conservativism of the database tech community;

3/ Wide use of tools that already sit on top of SQL - query builder APIs, ORMs etc.

<comment><USER16> I've wondered about this too. I think ORMs serve effectively the same purpose as Javascript transpilers (which gives you 1 & 2)

You can also write stored procedures in Postgres in other languages.

<comment><USER17> ORMs attempt to bridge object and relational models. (With results that vary from "works fairly well" to "screw it, give me a DB handle and I'll just write SQL".) I see what you're saying, but they operate at a different place than generators/translators.

Stored procedures are just that - they get a name and persistence. PLSQL has procedural extensions, but it is still SQL.

Fabian Pascal (who has made a career out of SQL criticism) proposed a replacement system called Raquel that would have a "real" set-theory-based query language. I don't think it went anywhere.

My best guess as to why there aren't many alternatives: SQL is both mature and Good Enough(tm), but importantly, also unsexy and complicated. Database engine development is more similar to kernel development than, say, web application development, and there are simply far fewer engineers qualified to do it. Building some framework in Javascript currently gets a ton of love, and in comparison is far easier than developing a SQL replacement that is roughly as performant as SQL and either less awkward linguistically or functionally superior.

People do take up those sorts of projects, but they're pretty lonely unless some combination of talent, luck, and timing turns into rock star status (Linus wasn't the only one writing unix clones at the time).

<comment><USER18> > Stored procedures are just that - they get a name and persistence. PLSQL has > procedural extensions, but it is still SQL.

PostgreSQL distributions come with support for PL/Python, PL/Tcl, PL/Perl and PL/pgSQL (a PostgreSQL specific PL/SQL clone). Other languages exist, but aren't included. See [https://www.postgresql.org/docs/9.6/static/external- pl.html](https://www.postgresql.org/docs/9.6/static/external-pl.html)

<comment><USER17> Yes. And PL/Perl is perversely fun. I don't think I've ever seen other languages used in production, though[1]; I think folks tend to stick to PLSQL because of defaults.

[1] I'm sure people do, but this discussion has an anecdata deficiency.

</comment></comment></comment></comment></comment></comment><comment><USER19> I make very liberal use of functions in SQL, as much as I would in other languages - any complex calculation or WHERE clause I'll usually abstract out into a function with a meaningful name. Postgres has nice syntactic sugar that makes these look pretty much like columns, so if your function takes a row type as an argument, you can just call it as `row.function_name` instead of `function_name(row)`. With the right hints performance is fine, and where it's not, it's possible to build indexes over function call results.

The article touches on CTEs, while mentioning they are on optimisation boundaries on some platforms (e.g. Postgres). This touches on my main annoyance with SQL - most of the abstractions are very costly. Even just phrasing a query in the simplest, most natural way is rarely optimal. I spend hours of my life wondering why query planners are so deliberately obtuse. And there are countless specific little annoyances, e.g. 'percentile_disc' seeming like a natural fit for calculating a median, but being wildly slower than more hacky solutions.

I would love to know what's next, to be honest. A readable query language, which captures the intention and semantics of a query clearly and minimally, is designed to allow abstractions to be composed together, and compiles to a mostly optimal query plan. I'd probably settle for SQL as-is, if there was an RDBMS with a query planner that was willing to go away and think for five minutes so I could just write the SQL I wanted without thinking too hard about the implementation.

Anyway, the formatting's important, but like any language, the way you can create and compose abstractions, and reveal the intention of your code is the biggest thing for readability.

</comment><comment><USER20> I prefer any formatting over no formatting. If had to choose then I would do this:

* Lowercase for tables & columns and upper case for syntax.

* Having commas first makes it easier to move lines around.

* I avoid small aliases to minimize conflicts when code is resused.

* Every column needs a table reference. Do not make me guess.

* Alias every column in the SELECT clause.

        SELECT
            table1.col1 AS table_col1
          , table2.col2 AS table_col2
          , table3.col3 AS table_col3
        FROM
            table1 table1
        INNER JOIN
            table2 table2
        ON
            table1.col2 = table2.col1
        INNER JOIN
            table3 table3
        ON
            table1.col3 = table3.col1
        AND table3.col2 = something_else
        WHERE
            table1.col1 > 0
        AND table2.col2 <> table1.col4
        ORDER BY
            table2.col2
        LIMIT 100;

</comment><comment><USER21> Is it just me, or are the code examples not monospaced ?

This doesn't help when talking about alignment.

<comment><USER22> It isn't just you, and indeed, the alignment examples make little sense with a proportional typeface.

I checked the CSS, and for some reason the code blocks use the exact same fonts as the rest of the text (albeit with a new font-family clause just for them).

</comment></comment><comment><USER23> If you're in the world of Microsoft SQL Server:

1\. [http://poorsql.com/](http://poorsql.com/)

2\. SSMS plug-in: [http://architectshack.com/PoorMansTSqlFormatter.ashx#Downloa...](http://architectshack.com/PoorMansTSqlFormatter.ashx#Download_5)

Your life reading and saving SQL will change forever.

</comment><comment><USER24> Of interest: [http://www.sqlstyle.guide/](http://www.sqlstyle.guide/)

<comment><USER25> It was on HN three weeks ago, here es is the link to the discussion:

[https://news.ycombinator.com/item?id=12671667](https://news.ycombinator.com/item?id=12671667) (146 comments)

</comment></comment><comment><USER26> My pet hate, directly out of SQL Server Management Studio, is how their code generation places commas. It generates code like this:

      select
          columnA
          ,columnB
          ,columnC
      from
          tableName

Whereas I want my commas AFTER the column names on the same line:

      select
          columnA,
          columnB,
          columnC
      from
          tableName

Or just looks so much neater.

<comment><USER27> Leading with commas makes it easier to refactor if you're prototyping a query. You're less likely to cause an error when removing a column from:

      SELECT
          first
        , second
        , third
      ...

than from

      SELECT
        first,
        second,
        third
      ...

Which becomes:

      SELECT
        first,
        second,
      ...

<comment><USER28> At best, that may shave off a few seconds of the time needed to refactor.

The trade-off is code that is harder to mentally parse, because we are used to trailing commas, not leading commas.

If you spend more time reading code than writing it (which I assume applies to the majority of development), then the trailing comma is a much, much better choice of style.

<comment><USER29> I spend a _lot_ of time writing ad hoc queries for analysis. That means I don't know what columns I want, I might be switching things up from aggregates to subsets and back. That's why you'll find things like:

        WHERE   1=1
        AND     a.id = 12
        --AND     a.Col1 > 23
        AND     a.Col1 = 23

Similarly the leading comma makes it faster to cut out things I'm not using anymore. Now obviously for production code you could argue my reasons are no longer valid - but probably they'll leak through because that's what all my shk hotkeys generate and I'm used to writing

</comment></comment></comment></comment><comment><USER30> I'd love to get HN feedback on a library I wrote to make SQL more manageable - [https://github.com/hashedin/jinjasql](https://github.com/hashedin/jinjasql).

The library is built on the Jinja template engine. You can create macros, functions and other reusable sql fragments, and then use them to create the query. You can also write loops and conditionals, so you can do all the things you routinely do to generate HTML.

The library tracks bind parameters, and doesn't let user input into the query. At the end of the day, you get the generated SQL and an array of bind parameters. You can use these two to execute the query using whatever database & driver combination you like.

</comment><comment><USER31> So I think it is much easier to read if you can line up like clauses:

      SELECT spf.blah_blah,
             count(*) AS cnt
        FROM jv_CTLG_ENTITY_ATTR_PROD_MAP prod_map
        JOIN jv_SSA_PRODUCT_FACT spf
             ON prod_map.prod_ref_id = spf.PROD_REF_ID
       WHERE prod_map.INVSBL_IND = '0' AND
             spf.LSTG_END_DT >= date_sub(from_unixtime(unix_timestamp()), 2) AND
             spf.LSTG_START_DT <= date_sub(from_unixtime(unix_timestamp()), 2) AND
             spf.lstg_site_id = 0 AND
             prod_map.ENTITY_ATTR_TYPE_DESC IN ('BMPN','GTIN') AND
             spf.CTLG_ID = 1075 AND
             spf.LSTG_TYPE_CD NOT IN (10,12,15)
      GROUP BY spf.blah_blah;

</comment><comment><USER32> Only tangentially related, but this reminds me of something I've wanted for a while: Are there any languages for relational queries, but with improved syntax (composability, epxression capture, static typing?) and which "compile" down to SQL?

Ideally, I imagine something that looks something like RethinkDB's ReQL, but DSL-ed up a bit beyond what's possible when it's "just" a JS library (eg, a nicer syntax for referencing table and row instead of "r.table('table name').row('row name')" and support for operator literals so you can write ">" instead of ".gt" or similar.).

<comment><USER33> There's Alf, which has a functional, pipeline-style, though I don't know if it's still active: [http://www.try-alf.org/blog/](http://www.try- alf.org/blog/)

<comment><USER32> Sweet, Alf seems to be _exactly_ what I wanted!

Shame it no longer seems to be under active development, but it seems to be pretty mature?

</comment></comment></comment><comment><USER34> I use the following indentation pattern and find it very useful:

        select
            t1.col1,
            t2.col1

        from
            table1 t1
            left join table2 t2 on t2.primarykey = t1.foreignkey

        where
            t1.somevalue is not null
            and isnull(t2.someothervalue, 0) > 0

        order by
            t1.someothervalue desc

By using this pattern I can easily locate columns, tables, criterias, grouping fields, orders etc. And it works well with more complicated queries as well given all the subqueries, cases etc. written in a similar fashion.

</comment><comment><USER35> Is there a good sql autoformatter? For cleaning up ORM-generated queries so I can read them. I've used python's sqlparse but it produces output that's often still unreadable.

<comment><USER36> Redgate's SQL Prompt has a great auto formatter with definable rule sets, if you use SSMS - and have the budget for it.

<comment><USER37> If you like the formatter in the current version of Prompt, wait until you see what's coming out in version 7.3. They've gone nuts. The new mechanisms for formatting are far beyond anything we've had so far. I'm pretty jazzed about it (disclosure: I work for Redgate).

</comment></comment></comment><comment><USER12> > CTEs

>First, yes they can be an optimisation boundary. But they can also make your query much more read-able and prevent you from doing the wrong thing because you couldn't reason about a query.

In my experience, CTEs may be simpler for the writer to reason about, but they make the queries complicated for the reader to understand. If you use a CTE because you find the problem too complicated, chances are that you are not yet understanding the problem well enough to describe it in a single plain SQL query.

<comment><USER38> Sometimes I understand the problem perfectly well, but a single beautiful query is not performant enough. Anything that can help to write and maintain big ugly queries without a cost in performance is welcome.

<comment><USER12> Care to elaborate on what situation would a CTE improve performance? Because the OP itself mentioned CTEs degrading performance.

<comment><USER38> It wouldn't improve performance, but it might improve readability without denigrating performance. I don't have much experience with CTEs, but I do have lots of experience trying to debug unreadable SQL.

<comment><USER12> > Sometimes I understand the problem perfectly well, but a single beautiful > query is not performant enough.

> It wouldn't improve performance, but it might improve readability without > denigrating performance.

These two statements of yours are negating each other, unless people started using "performant" as synonymous for readable now.

<comment><USER38> OK, a clarification.

My first attempt at a query is readable but performance is terrible. I fix the performance problem, but the query is now much less readable. I use a CTE as a compromise between performance and readability.

</comment></comment></comment></comment></comment></comment><comment><USER39> One thing missing that I can't recommend more highly - a comment in the SQL clause indicating where in the code it is being called from. These comments are invaluable when debugging or doing performance tuning of queries, especially when you have a large codebase.

i.e.

        SELECT *
        FROM students
        WHERE 1
        /* somemodule.somemethod */

As for query formatting, as with everything, consistency in style is more important than a dogmatic style guide. My time as a DB admin has given me some specific style guidelines, typically stolen from the formatting provided by the DB itself. More specifically, I match my style to what you see when you run a command like `SHOW CREATE TABLE students;`. I tend to reserve my indentation for things like subqueries.

<comment><USER40> I agree it would be great to show where the code is being called from, but often we have queries that are called from dozens of different places and it would be unwieldy to add all of those. Plus, if one time a developer starts using a query somewhere in the code and forgets to add that place to the query, all of the sudden all places where the query is called from becomes suspect. I think it is better to give your query block a unique name or namespace that allows you to quickly search all of your code for where that name is used.

</comment></comment><comment><USER41> Good post. I use one of Jetbrains IDEs and I am big fan of their auto- formatting. You select the dialect of your SQL (or connect it to the data source) and the IDE almost formats it ideally. Sometimes I enforce certain line breaks but for the most part it does a really good job.

<comment><USER42> DataGrip is pretty excellent from them. The only thing I'm not really happy with is it's support for diagramming table structure, but I haven't found anything that really does a good job of that.

</comment></comment><comment><USER43> I highly recommend Joe Celko's book, SQL Programming Style. [1] He does deal with formatting, but offers a comprehensive usage standard that goes beyond readability to discussing thorny issues like the taxonomy of words like "type," "category," and "code," as well as referencing relevant international standards for identifier naming.

[1] [https://www.amazon.com/Celkos-Programming-Kaufmann- Managemen...](https://www.amazon.com/Celkos-Programming-Kaufmann-Management- Systems/dp/0120887975/)

</comment><comment><USER44> I loathe wide lines. I think it's much easier to mentally parse vertical lists of things and I write my SQL much like this.

In PHP / Python / Go when inlining SQL I also line up sequential items indentation with spaces (which most editors do by default when hitting enter inside a multi line string).

Nice to see this codified. I really just wish I would have worked more in my career on teams that care as much about readability and comprehension in 6+ months as I do.

Hopefully more people will follow the advice in the article and write cleaner, easier to mentally parse SQL.

</comment><comment><USER45> This is how I write SQL:

      select
         col1
        ,col2
        ,col3
      from table1 a

      left join table 2 b
        on a.col1 = b.col2

      where 1=1
        and col1 = 'condition'
        and col2 = 'condition2'
      ;

     * everything lower case (except strings)
     * leading commas
     * conditions indented by two spaces
     * select columns indented by two spaces, except the first colunm which is indented by three.
     * where 1=1 for easier commenting/uncommenting of conditions

<comment><USER46> Came here to find out who else uses leading commas. I learned this several years ago at my current job and love it. I find it much more readable and also makes adding to the list clearer for some reason. Plus if you ever need to insert like 50 commas at the start of a bunch of lines in an ad hoc query it is much easier at the start of the line (yes, I am an animal).

</comment></comment><comment><USER47> I am a visual thinker. The method of listing columns as rows (i.e., the one line per column format) is too annoying to focus on the underlying code. Splitting a list is something like pagination or even regular text, so I suppose my mind just compensates for that without my thinking about it.

But I just can't do the columns as rows thing. I feel a little bit out in the cold because of it, but I'll just keep reformatting everybody else's code so I can read it. :-)

</comment><comment><USER24> The document styles make code blocks sans-serif, and then attempt to use monospace indentation—the end result looks _worse_ , not better, than no leading indentation.

</comment><comment><USER48> I while back I wrote a crappy SQL mapper that has an interesting SQL template language that uses SQL comments to make Jdbc place holders: [https://github.com/agentgt/jirm/blob/master/jirm- core/README...](https://github.com/agentgt/jirm/blob/master/jirm- core/README.md)

One of the interesting side effects of using the parser was easier to read SQL.

</comment><comment><USER49> One issue that bit me pretty badly wrt comments is either Perl's DBI or the ODBC layer, but when talking to SQL Server from a Perl script via ODBC, I had to remove all comments from a rather convoluted SQL query.

I ended up keeping the comments in my source code and removing them via a regex at runtime, but it took me quite a while to figure out why my Perl script failed with a query that ran perfectly when copied and pasted into SSMS.

</comment><comment><USER50> This is what is wrong with 'best practices'

`SELECT foo, bar FROM baz`

Is not at all more legible than:

`SELECT foo, bar FROM baz`

On first glance I even missed the 'bar' column completely and just saw it when compressing this line.

As things get longer it gets more important to make it legible, but saying that my first example is better than the second is just nonsense.

Don't worry so much about what you should or should not do, just use common sense.

<comment><USER50> Haha woops, multiline did not work.

The first example is supposed to read:

        SELECT foo,
            bar
        FROM baz

</comment></comment><comment><USER51> Am I the only one to see or missing obviously. The following is wrong, where clause has table name (baz)?

        SELECT foo,
           bar
        FROM baz
        WHERE foo > 3
          AND baz =  'firstname.lastname@example.com'

Edit: Technically you can have a column name exactly same as table name, however I am finding it hard to find difference between the two queries presented.

<comment><AUTHOR> Yeah, definitely a typo in the example, will fix.

</comment></comment><comment><USER52> _> CTEs: First, yes they can be an optimisation boundary._

Note that this varies by database engine. They are an optimisation fence in postgres, they generally aren't in MS SQL Server, I'm not sure about Oracle or DB2 but I think they can optimise predicate application over CTE boundaries too.

</comment><comment><USER53> This is all trivial. Simple queries are pretty easy to read as long as the formatting is vaguely sane. What we need to talk about is how to deal with queries with multiple nested subqueries (in the select clause and the where clause) and how to make that legible.

</comment><comment><USER54> I write my SQL as follows:

        SELECT `second_column`,
               `fourth_column`
          FROM `table_name`
         WHERE `first_column` = 'Value'
           AND `third_column` = 3
      ORDER BY `fifth_column` ASC
         LIMIT 1

<comment><USER55> Well that is cute. I find it odd that the second line of the where clause is on the same level as the where but a neat format otherwise. Tabs or spaces though?

</comment></comment><comment><USER56> Yes, readability is good, it makes any scripting easier. SQL is no exception. Hand in hand with this is calling things what they are and good comments for the 'why' rather than the 'what' parts of a statement.

</comment><comment><USER57> I prefer my own style where comma is placed before every column. It makes columns, subqueries and case expressions line up nicely, especially when you have 15 columns or more.

<comment><AUTHOR> Yeah, I've definitely seen this and tried it myself. Visually for some reason, it just pains me too much. It does make removing lines much easier though so I can understand the appeal.

</comment></comment><comment><USER58> Just use Redgate SQL Prompt. It's the easiest fix. I do not work for Redgate.

</comment><comment><USER59> I prefer keywords in their own line eg:

<code> SELECT foo, bar, blah FROM baz WHERE foo > 3 AND blah = 'dont use baz' </code>

</comment><comment><USER60> Would have been useful to see some thinking on joins and the naming conventions when you have the same column in both tables

<comment><USER61> Use aliases, and if you have more than two joins you should prefix every column, unless the column names are obvious.

</comment></comment><comment><USER62> I think that may be more compact, if the IDE can reflect the algebra beneath the SQL clauses.

</comment><comment><USER63> How do you handle indentation in python (especially if the line is already indented)?

<comment><USER39> Triple quoted strings. Since SQL doesn't care about whitespace, you can line up your SQL with the rest of your code quite neatly.

</comment></comment><comment><USER64> Anyone got some good Emacs advice for automated formatting?

</comment><comment><USER65> SQL is 'blighted' by inertia.

</comment><comment><USER66> Is there indent for SQL?

<comment><USER67> Poor Man's SQL Formatter for Notepad++ can do it, it leaves a lot to be desired though in terms of customization. It has saved me a lot of times, since I'd rather read Poor Man's code than the code of the other people.

<comment><USER68> Another vote for Poor Man's.

But I think it's an important caveat that the whole team use the same formatter and the same settings.

Otherwise diff's turn to useless noise* because Cubicle Bob has personalized his settings.

*Yes, I've tried the Winmerge plugin. It's helpful but not ideal.</comment></comment></comment>


Goldberg, lightweight CI server hits 1.0 - <AUTHOR> http://thechangelog.com/post/6001917999/goldberg-goldberg-is-a-lightweight-ci-server-that-unders

<comment><USER2> You should also take a look at bigtuna - <https://github.com/appelier/bigtuna>

Very stable for a 0.1.4 release! A good feature is multiple build scripts per project.</comment>


From Megaflops to Total Solutions: Cray and Supercomputing History [pdf] - <AUTHOR> http://ethw.org/images/7/76/Elzen_%26_MacKenzie,_From_Megaflops_to_Total_Solutions.pdf <comment><USER2> If you enjoyed this article, I highly recommend the book "The Supermen: The story of Seymour Cray and the technical wizards behind the supercomputer". It goes into a lot of detail regarding ERA before Cray, the creation of CDC (which is a fantastic start up story regarding how they got funded) along with a lot of specifics on Seymour and his thinking and development style. Seymour is my all time hero, and learning extensively about him and his architectures was what gave me my love of computer architecture and design, with this book being a fantastic information source.

<comment><USER3> I worked for Cray Research and its successors for many years, including a stint at Cray Computer Corporation in Colorado Springs on the Cray-3 project. I wrote the compiler's optimization and vectorization phase, and this gave me a chance to interact with Seymour on several questions and problems with the architecture. It remains a very fond memory.

</comment></comment><comment><USER4> Probably worth noting that the thesis of the article (that network effects and buyer lock-in would keep Cray from scumbing to competitors) didn't really pan. Both Cray founded companies went bankrupt a few years after the article was published.

<comment><USER5> One lesson I take away is how fragile a single-product company is. Each new Cray computer had to be either a total or good success, or the company would die. Like a shark, it had to keep swimming forward, and at Cray-3/4, it lost momentum and asphyxiated. Which is why now IBM builds so many supercomputers...

<comment><USER5> (Which is not to take away from Cray's accomplishments. It's not every engineer, or every industry, where it's possible to decide to increase the performance of a device by an order of magnitude and _do so_ something like 7 times in a row if you include Cray-3 and Cray-4 which apparently did physically exist, according to Wikipedia.)

</comment></comment></comment><comment><USER6> Should be tagged with a date of 1993, it isn't immediately clear what timeframe this was published other than after the "late 1980s".

<comment><USER7> Most recent reference is 1991 with many from 1990. I think it is safe to say (1991).

Edit: includes an internal reference to "late 1991", so maybe (1992) or (1993) is more accurate.

Edit2: and you were right (1993). Citation: Boelie Elzen and Donald MacKenzie, "From Megaflops to Total Solutions: The Changing Dynamics of Competitiveness in Supercomputing," in Technological Competitiveness: Contemporary and Historical Perspectives on Electrical, Electronics, and Computer Industries (Piscataway, NJ: IEEE Press, 1993), 119-151.

</comment></comment><comment><USER8> Amazing how far we've come. Now you can get 10.6 TFLOPS of FP32 in only 300W (reference: GP100 in the Nvidia DGX-1).

<comment><USER6> It isn't a completely fair comparison, but it is indeed amazing that you can buy a GPU for < $1000 that would, going by raw FLOPS, by itself be on the TOP500 in the early 2000s, and we use them to browse facebook and play League of Legends :)

<comment><USER9> They'll end up in phones and watches eventually, running CNNs for speech recognition and other useful things.</comment></comment></comment>


U.N. postal union clinches deal to keep U.S. in - <AUTHOR> http://reuters.com/article/us-un-postal/u-n-postal-union-clinches-deal-to-keep-u-s-in-club-idUSKBN1WA247 <comment><USER4> Good. It was insane that we were subsidizing shipping from China. This, more than anything, will shift to a more balanced manufacturing model.

It was more expensive to ship within the US and Canada than from China. Pretty much crushed the small retailers (I know I refused to spend $7 shipping for a $12 item). Now that that's improved the rates should more normalize, because they won't have to subsidize the loss on China shipping.

<comment><USER5> I often hear the claim that it's more expensive to ship within the US than from China but rarely see it backed up. I've yet to see anyone give a specific size box, weight, and locations for comparison, and the few times they have I find the US shipping rate is cheaper.

<comment> semi-extrinsic Here's an example off eBay for an item that measures 6"x4"x2", is fragile so has to be packaged well, and costs $2 _with free shipping_.

[https://www.ebay.com/itm/Acrylic-Transparent-Photo- Frame-6in...](https://www.ebay.com/itm/Acrylic-Transparent-Photo-Frame-6in-L- Shape-Photo-Picture-Frame-Home-Decor-DIY-S-/283304776438)

<comment><USER5> "This item does not ship to United States"

<comment><USER6> Perhaps a victim of Trump's trade war?

</comment></comment></comment></comment></comment><comment><USER7> Nice to see this getting addressed.

There's a great Planet Money episode explaining the brokenness of the existing system ([https://www.npr.org/sections/money/2018/08/01/634737852/epis...](https://www.npr.org/sections/money/2018/08/01/634737852/episode-857-the- postal-illuminati)). NPR ends up substantiating the claim of an entrepreneur who says that it costs him more to send a package across the street than it costs someone in China to send a package to that same address.

<comment><USER5> No they don't. They repeat a false claim uncritically.

If you look up the cheapest US shipping rates you'll find they're roughly the same range, and that almost all the comparisons purporting to show otherwise are cheating, typically by using retail pricing on a more expensive shipping option.

>So he turns to his shipping guy. And he asks, how much would it cost for us just to ship this mug, like, not across the ocean, just across the street?

>SMALDONE: He told me it's going to cost us about $6.30 to ship this item.

Amazon page for mighty mug says it's 12.6 oz shipping weight. [https://www.amazon.com/Might-Mug-1525-Mighty- Black/dp/B00FZD...](https://www.amazon.com/Might-Mug-1525-Mighty- Black/dp/B00FZDJHGK)

Round up to 13 oz, then look up rates for the cheapest shipping option for packages under a pound "parcel select lightweight". See [https://pe.usps.com/text/dmm300/Notice123.htm#_c139](https://pe.usps.com/text/dmm300/Notice123.htm#_c139)

The cheapest rate is $2.02 for 13 oz. This rate applies when mail is injected at the closest mailing point (DDU), which "mailing across the street" corresponds to.

<comment><USER8> Ok so you're right, you could drive to your local postal office and if you are commercially shipping stuff you can do destination delivery unit (DDU) and get a 13 oz mug to your next door neighbor for $2.02. So let's assume the fair cost of last mile delivery for a 13 oz mug is $2.02. The Chinese knockoff mug cost on ebay $5.69 including shipping from China. So if the Chinese seller was paying fair last-mile delivery (which they weren't), they would be manufacturing and shipping a 13 oz mug to a local postal office in America for $3.67.

<comment><USER9> FWIW you could ship a 40ft container of mugs (something like 20,000 of them individually packaged) from china to Seattle, say for a rough cost of about 10c per mug.

Bulk freight of nonperishable things is _cheap_.

<comment><USER8> But if you listen to the story, these were individually shipped by the postal service, from an ebay seller in china.

<comment><USER9> Right - but what I was pointing out is making that particular scenario more expensive doesn't shift the overall incentives that much of the COGS are significantly different.

</comment></comment></comment></comment></comment></comment><comment><USER10> If anyone else is interested in some of the history of how we got here, Wikipedia has a pretty decent summary:

"The 1874 treaty provided for the originating country to keep all of the postage revenue, without compensating the destination country for delivery. The idea was that each letter would generate a reply, so the postal flows would be in balance. However, other classes of mail had imbalanced flows. In 1906, the Italian postal service was delivering 325,000 periodicals mailed from other countries to Italy, while Italian publishers were mailing no periodicals to other countries. [...]

In 1969, the UPU introduced a system of terminal dues. When two countries had imbalanced mail flows, the country that sent more mail would have to pay a fee to the country that received more mail. The amount was based on the difference in the weight of mail sent and received."

[https://en.wikipedia.org/wiki/Universal_Postal_Union#Termina...](https://en.wikipedia.org/wiki/Universal_Postal_Union#Terminal_dues)

</comment><comment><USER11> A few years ago, as a joke, I bought the absolute cheapest phone case off of Aliexpress for a friend for $0.46 with free shipping. 1.5 months later, I did actually get it in the mail. It went from China, through several of the central Asian countries (the ones whose names end with "stan"), and was delivered to my mailbox. All for less than the cost of a first class postage stamp at the time ($0.47).

It blows my mind that Aliexpress was willing to take my money and act as an intermediary between me and the retailer/factory as I cannot imagine they made a profit on this transaction given the fixed cost of accepting credit card payments (i.e. the "$0.30" part of 2.9% + "$0.30"). It further blows my mind that a retailer/factory can profitably send me the case at all, even if they were to receive the entire $0.46.

</comment><comment><USER12> UPU terminal dues were up for renegotiation in 2018-2021 anyway.[1] That's done every 10 years. The end result of all the noise from the US seems to be the same thing as would have happened anyway - a rate change in 2021.

The UPU classifies countries by level of development, and there's a price break for underdeveloped countries.[2] China is currently in group 3, along with Chile and Lebanon, and was probably going to move up to group 2 in the 2021 round anyway.

So all this was mostly hype.

[1] [http://www.upu.int/en/activities/terminal-dues-and- transit-c...](http://www.upu.int/en/activities/terminal-dues-and-transit- charges/2018-2021-cycle.html)

[2] [https://www.uspsoig.gov/sites/default/files/document- library...](https://www.uspsoig.gov/sites/default/files/document-library- files/2015/ms-wp-14-002_0.pdf)

<comment><USER13> If I'm understanding the article correctly, the USPS can now unilaterally set its own rates, which is a pretty substantial change from the existing system where rates were determined by the decennial negotiations you're talking about.

</comment></comment><comment><USER14> This is one of those instances where playing chicken seems to have worked out (for the US).

Good news on this issue; although I'd feel more comfortable if there were fewer geopolitical games of chicken going on; it just takes one crash to wipe away the wins.

<comment><USER15> This was definitely a case of the US strong-arming the rest of the world, but in this case I think it was justified.

I hope European countries follow suit and stop subsidizing foreign mail.

It's absurd that we can order something on AliExpress, have it shipped halfway around the world, and pay 1 Dollar.

<comment><USER16> European countries mostly discourage this not through postal rates, but by applying VAT and customs charges even on small-scale individual importation. How uniformly this is done varies by country (some inspect and enforce more aggressively than others). In Denmark, for example, which is one of the more aggressive, you either need to have your package pre-cleared by arranging duties/VAT to be paid ahead of time, or the Danish post office will charge you a flat 160 DKK (about $23) for clearing it [1]. That makes it not cost- effective to order $20 items from China, even if the UPU rates are low.

[1] [https://www.postnord.dk/modtag/spoergsmaal-og- svar](https://www.postnord.dk/modtag/spoergsmaal-og-svar)

<comment><USER17> In the UK, consignments valued at £15 or less are free from Customs Duty and import VAT, so that doesn't do much to discourage small-scale individual purchases from China.

<comment><USER18> That exemption will be terminated EU-wide on Jan 1st 2021.

It will also get terminated immediately in UK if they leave without a deal, at least according to current UK government VAT guidance.

</comment></comment></comment></comment></comment><comment><USER19> Not pointed out is that this works in the opposite direction as well, and it doesn't look like _that_ part was fixed.

For example Australia post operates a service when you can buy US goods, have them shipped to a US address, and then have the parcels shipped in aggregate to Australia for arbitrage on shipping and licensing costs: [https://shopmate.auspost.com.au](https://shopmate.auspost.com.au)

</comment><comment><USER20> Worth noting that despite us not leaving the union, Trump is apparently getting what he wants. The union basically capitulated to his demands. At least that is my reading.

To be clear, I'm not saying one way or another whether this is a good thing. It's just, I felt the title somewhat implied that the USG had given up on its intentions. Whereas actually what happened was the opposite. I meant only to point this out for others who might be likewise confused.

<comment><USER21> Trump'e arguments weren't wrong: it didn't make sense for China to keep its below-average and below-cost fees for sending packages to the US.

I just wish he could get the USPS to stop seeing outbound international mail as a profit centre.

Plenty of Americans could be exporting a lot more internationally, but the USPS has chosen high prices and low volumes.

As a Canadian that sometimes talks Americans into selling to me on Ebay, they find it a painful and costly experience compared to US sales.

<comment><USER22> >Trump'e arguments weren't wrong

Just say "Trump was right". You will not be condemned by _bien-pensants_ as a thought-criminal. At least, not immediately.

>I just wish he could get the USPS to stop seeing outbound international mail as a profit centre.

In other words, you'd like to pay less when buying from the US.

(There's nothing wrong with such a wish, but let's be clear about what you mean.)

>Plenty of Americans could be exporting a lot more internationally, but the USPS has chosen high prices and low volumes.

I know of no evidence that the USPS charges more to ship internationally than Canada Post, notorious among Canadians for high prices. On the contrary, it's sometimes cheaper for Canadians to ship to elsewhere in Canada by mailing from the US. (Discussion: [https://www.reddit.com/r/canada/comments/6rcn0v/canada_post_...](https://www.reddit.com/r/canada/comments/6rcn0v/canada_post_is_so_expensive_that_it_is_cheaper/) )

>As a Canadian that sometimes talks Americans into selling to me on Ebay, they find it a painful and costly experience compared to US sales.

That's because it is, compared to mailing domestically. It'd be surprising otherwise, for any country.

I've sold on eBay and Amazon for years and have shipped often to Canada and elsewhere; the procedure isn't that much more cumbersome. The vast, vast, vast majority of sales are within the US, however.

It's quite possible for an American seller (whether on eBay or Amazon or with their own online sites) to make money solely from the US market. Canada is one ninth of the US and a smaller portion of potential sales for American sellers. A Canadian seller, on the other hand, knows that the American market is nine times larger than the domestic one, so has much more incentive to a) learn how to handle international orders, and b) be willing to pay the higher postage rates.

<comment><USER21> > In other words, you'd like to pay less when buying from the US.

Naw, I want USians to have better chances of getting my money. When I buy niche things that are available from the US and Asia, Asia keeps winning out. I'm willing to pay more for faster shipping, but I have my limits.

> I've sold on eBay and Amazon for years and have shipped often to Canada and > elsewhere; the procedure isn't that much more cumbersome. The vast, vast, > vast majority of sales are within the US, however.

Doesn't explain why most others don't bother. Is it still too cumbersome? Or is it just cultural where the rest-of-world is thought of as a scary and dangerous place?

> It's quite possible for an American seller (whether on eBay or Amazon or > with their own online sites) to make money solely from the US market. Canada > is one ninth of the US and a smaller portion of potential sales for American > sellers. A Canadian seller, on the other hand, knows that the American > market is nine times larger than the domestic one, so has much more > incentive to a) learn how to handle international orders, and b) be willing > to pay the higher postage rates.

> It's quite possible for an American seller (whether on eBay or Amazon or > with their own online sites) to make money solely from the US market. Canada > is one ninth of the US and a smaller portion of potential sales for American > sellers.

Dunno why a business would throw away an extra 11% in sales, or being able to sell their same inventory for higher prices. Depends on your product. Obviously a lot of Canadians _really_ benefit from FBA because postal prices are high enough to discourage a lot of non-FBA online ordering.

> A Canadian seller, on the other hand, knows that the American market is nine > times larger than the domestic one

My own experience was that selling to the world made me more money than just N. America, largely selling video games, DVDs and other small electronics.

Although I comment from the perspective of a Canadian, there's a whole world out there that USians could profitably benefit from selling to, IMO.

<comment><USER22> > USians

Ah yes, you're one of those who think that not calling the only country in the world with the word "America" in its name, "America", somehow strikes a mighty blow against American imperialism. You'll pardon me if I am skeptical of your claim of primarily wanting to help American businesses, as opposed to wanting to pay less (which, as I said, there is nothing wrong with wanting, in and of itself).

>Doesn't explain why most others don't bother. Is it still too cumbersome? Or is it just cultural where the rest-of-world is thought of as a scary and dangerous place?

Yes, indeed, one of those.

>Dunno why a business would throw away an extra 11% in sales

First, it's not "11% of sales"; the actual share is less because of natural friction, just as you didn't have nine times as many sales to Americans as Canadians.

Second, unless the item is very small, international shipping by USPS requires a larger-than-usual mailing label, in triplicate, and a special plastic pouch to put the extra forms in on the box's surface. Then there are the risks of complaints by customers who have to pay duty, and the much greater difficulty of accepting returns from international customers. I was willing to ship internationally despite these factors, but I cannot criticize others who decided that the additional revenue isn't worth the trouble.

>My own experience was that selling to the world made me more money than just N. America, largely selling video games, DVDs and other small electronics.

That's a given. But, again, as a Canadian you would have left _much, much, much_ more on the table by only selling to the domestic market than your American counterparts. I assure you that if American sellers could quintuple sales by selling to Canadians, they would do so even if the mailing process were three times as complicated. But they wouldn't, so they don't.

>My own experience was that selling to the world made me more money than just N. America, largely selling video games, DVDs and other small electronics.

Spare us the false veneer of kindly advice. You can't stand how the country next door to yours constantly has for sale items you want to buy at attractive prices but can't, at least not directly, despite sharing the same language and culture. Instead of trying to change things in your country to make it easier for such things to be sold there, you demand that the neighboring country seek to earn less money when transporting the items to you. Congratulations.

<comment><USER21> wat

</comment></comment></comment></comment></comment></comment><comment><USER23> >Under the phased agreement, high-volume importers of mail and packages would be allowed to begin imposing "self-declared rates" for distributing foreign mail from January 2021.

Does anybody have any idea what this means? Who is considered a "high-volume importer" and how do they set "self-declared rates"?

<comment><USER24> I translated that the United States imports more mail then it exports.

Backbone internet companies trade traffic with each other, but the trades aren't always equal so it makes sense for there to be money flowing more in one direction.

The US is saying that the current relationship has costs that exceed the benefits, so the US is going to be declaring their own interpretation of a "fair market rate" to import mail from other countries that aren't receiving the same volume of US mail in return.

</comment></comment><comment><USER25> Does this mean the field is leveled against Chinese shippers?

<comment><USER26> Maybe. Maybe China will start subsidizing their mail instead of having the US do it.

<comment><USER27> China would need to use their foreign reserve to do this subsidy. Ignoring belt and road all of China's internal industry subsidies use Yaun. Belt and Road use dollars but are "lent" thus in theory China is not reducing its foreign reserve.

Problem for China as we see in their capital controls is maintaining wealth in Yaun. Any subsidy which requires using foreign dollars, as paying the US postal tarrif would, weakens the states stability.

</comment></comment></comment><comment><USER28> >> agreed to reform its fee structure

And for decades before this moment it never occurred to any of the demagogues in chief to look into such mundane matters as trade imbalance, or subsidizing everybody in the world at the expense of our own businesses and manufacturing base, hollowing out large chunks of the country to make a quick buck.

This shows the downsides of electing lawyers who never did anything of material consequence in the real world, and don't understand or care how the business side of things works.

</comment><comment><USER29> So, would this apply to Europe too? I mean, it's insane that it cost me more to send a package to France than Import it from China.

<comment><USER30> It applies to everyone starting 2021, and to large volume shippers starting July 2020.

</comment></comment><comment><USER31> The decision was reached unanimously by all 190 some countries. It's good to see countries working together to reach a compromise.

</comment><comment><USER32> Glad to see China backed the compromise. Definitely the best outcome.

<comment><USER33> I noticed this and found it interesting. I wonder what the motivation is here. Is the amount China stands to lose from this so low that it wasn't a hill they cared to die on? Will they use this in trade negotiations with Trump as a sign that they're being reasonable?

<comment><USER34> Trump successfully telegraphed US intention to leave the IPU and impose punishing costs on delivery of Chinese parcels in the US, making acceptance of an equitable compromise the only palatable alternative for the Chinese.

Incidentally, every Chinese person I know absolutely adores Donald Trump _because_ he plays hard ball, whereas they didn't quite know what to think about Obama, who was totally inscrutable from the Chinese perspective. Trump lays out what he wants, and then he fights for it, and he usually gets it. As far as I can tell, people who grew up in China view that as the natural, normal, and proper way of conducting affairs.

<comment><USER35> > Chinese person I know absolutely adores Donald Trump because he plays hard > ball, whereas they didn't quite know what to think about Obama, who was > totally inscrutable from the Chinese perspective

I have read countless well-written articles arguing exactly the opposite, so I find this interesting.

<comment><USER34> There is certainly no shortage of impeccably composed essays dumping on Trump and developing a galaxy of identity-political rationales for why various people ought to dislike him. The story on the ground is distinctly at odds with the impression I get from American media and the BBC. I'm sure they feel they are advocating for a good cause in a situation so dire that all other concerns are overridden.

</comment></comment></comment></comment></comment><comment><USER36> More useful info here [http://news.upu.int/no_cache/nd/frequently-asked- questions-t...](http://news.upu.int/no_cache/nd/frequently-asked-questions- third-extraordinary-congress/)

</comment><comment><USER37> I wonder whether, in practice, sellers will apply the higher rates only to US destinations - or whether they'll just spread it across all their customers, so that the situation changes to non-US customers subsidising the US ones?

</comment><comment><USER38> What are "self declared rates" and how does this exactly change things?

I get the idea that international incoming shipments were subsidized but it's not clear what self declared rates really .. does?

<comment><USER33> I believe that the old rates were set by the UPU, and, in the case of China, were artificially low due to China's status as a developing nation. That status (conferred upon them 50+ years ago) has not been a reflection of reality for a long time. The new deal allows recipient countries to declare their own rates. The US will, almost certainly, declare a rate much higher than the current rate, such that the USPS will no longer be subsidizing shipments from China.

<comment><USER38> OH, got it, the receiving nations declare it.

It almost sounded like the sending were and of course they'd be all "oh yeah this is like a penny...".

</comment></comment></comment><comment><USER39> Anyone have a list of countries that do over 75,000 tonnes of imported mail a year?

</comment><comment><USER40> Excellent! China has been abusing this system far too long.

</comment><comment><USER41> This is weird because the postal union was the one wonky, deep in the weeds policy where even the globalist agreed with the populist that something needed to be done. Way I see it there were 3 options.

1\. Use international institutions like the WTO and UN to affect a change or enact a legal, narrow set of tarifs on bad actors without putting the wider, generally beneficial system at risk.

2\. Start subsidizing our own postal service. China does it because it's an economic multiplier that benefits a wide segment of society. Why not copy it.

3\. Burn the postal union treaty to the ground.

Trump picked 3 and has now pivoted to 1. I personally would have picked 2 but I don't think any of these options are crazy. 3 sucked but wasn't outrageous IMO.

<comment><USER42> Subsidizing own postal service would mean paying it with tax dollars. Why would those who never use this service should pay for those who use it more? Besides that (and its my own observation only) I have noticed that subsidies usually distort market and make service/product less sustainable and competitive.

<comment><USER41> Same reason I'm ok with the government building a road even though I don't personally drive. It's an economic multiplier. It increases opportunity overall by facilitating more transactions than were previously possible, and the net economic growth can flow back to me even though I didn't directly use it.

I'm not universally in favor of subsidies, just in certain specific instances where the economic multiplier is high and a large fraction of the public benefits directly (usually infrastructure).

<comment><USER43> Which is why I'm so surprised that people dislike farm subsidies so much since every single person in the US benefits from cheap corn being available.

</comment></comment></comment></comment><comment><USER44> Good. This might actually be the one good thing that Trump has accomplished.

Or that would have been my reaction until I read the article:

 _" Countries with more than 75,000 tonnes in post imported annually - <USER3> the United States - may apply their self-declared new rates from July 2020, UPU officials said."_

So does 'mainly the US' mean 'only the US'? I don't want an exception just for the US because they are too powerful to ignore, I want the same rule to hold for every EU country. Replacing a rule where rich countries subsidize long distance mail from (former) poor countries with a rule where only small rich countries have to pay for that subsidy is really not an improvement.

<comment><USER22> Trump is president of the United States, not of the EU. It is the EU and its member states' onus to obtain similar changes, should they believe them desirable.

That you begin with a snarky remark about Trump, and then go on to say that he is at fault for not helping Belgium or Austria win the kind of changes that the US needed to seriously threaten to leave the UPU for, says more about you than about the US or Trump.

<comment><USER44> I'm not sure how you think the UPU works, but Trump does not set UPU rules on his own. 200 countries are involved in those negotiations. If the UPU rules are inconsistent, that's not just on Trump, but on the UPU and the many parties negotiating in it, including the EU.

So I have no idea why you choose to read my complaint about the UPU negotiations as a complaint about Trump. I even started out by saying he is right in this one case. But this is an issue that's not unique to the US, but to all wealthy countries, and therefore should be handled evenly for all countries. That's what I pointed out in my comment. You're a bit too eager to read attacks where there are none.

Had the UPU made just a single exception for the US because of the US's power, that would have been inconsistent and a mistake by the UPU. But as others have explained elsewhere, that's not what happened. The rule is for everybody, it just starts 6 months early for the US, which I guess is a minor gesture to appease Trump. I'm fine with that. Starting in 2021, the situation will be fixed for everybody.

<comment><USER22> I love your rushing to pretend that you didn't write what you wrote:

>Good. This might actually be the one good thing that Trump has accomplished.

>Or that would have been my reaction until I read the article:

>"Countries with more than 75,000 tonnes in post imported annually - <USER3> the United States - may apply their self-declared new rates from July 2020, UPU officials said."

>So does 'mainly the US' mean 'only the US'? I don't want an exception just for the US because they are too powerful to ignore, I want the same rule to hold for every EU country. Replacing a rule where rich countries subsidize long distance mail from (former) poor countries with a rule where only small rich countries have to pay for that subsidy is really not an improvement.

In other words:

* Requisite snarky remark about Trump

* Complaint that the rule change is only for the US (written before you read the rest of the thread and realize that this refers to the US getting the rule change slightly earlier than other countries, as we can see by ...)

* Stating that "this is not an improvement" because other rich countries won't benefit from the rule change, again because you hadn't yet read the read of the thread. (Even were you correct, this would be an improvement _for the US_ , which is Trump's concern. As I said, he is not the president of the EU.)

<comment><USER44> I'm not pretending I didn't write what I wrote. I did write what I wrote. I didn't write what you _claim_ I wrote:

> _" then go on to say that he is at fault for not helping Belgium or > Austria"_

That is not something I wrote. I never said Trump is at fault for these results. That is something you're trying to put in my mouth, and I'm telling you not to do that, because it's a dishonest way of arguing.

If you're looking for bad things to blame on Trump, there's tons of that around. This is one of those very rare things where he actually did the right thing. And had the UPU only made this an exception for the US, and not changed the rules for everybody, that would have been on the UPU as a whole and presumably the EU members who failed to negotiate this properly. Fortunately that's not what happened; it was a misunderstanding on my part (based on a cursory reading of the article, so I was already hoping it was the article or my reading of it that was wrong).

<comment><USER22> >I never said Trump is at fault for these results.

No, but you blamed Trump for not getting the results for other countries. Let me repeat again what you wrote:

>Replacing a rule where rich countries subsidize long distance mail from (former) poor countries with a rule where only small rich countries have to pay for that subsidy is really not an improvement.

That you wrote the above without understanding the full ramifications of the change is immaterial, because you

* Take a swipe at Trump ("This might actually be the one good thing that Trump has accomplished")

* Then say, based on your misunderstanding, that this "is really not an improvement".

The implication is clear: Trump is at fault for not obtaining the same improvement he gained for the US for other, "small rich countries" as well. I reiterate my original reply to you:

>Trump is president of the United States, not of the EU. It is the EU and its member states' onus to obtain similar changes, should they believe them desirable.

>That you begin with a snarky remark about Trump, and then go on to say that he is at fault for not helping Belgium or Austria win the kind of changes that the US needed to seriously threaten to leave the UPU for, says more about you than about the US or Trump.

<comment><USER44> > _" No, but you blamed Trump for not getting the results for other > countries."_

As you can see from your own quote out of my comment, that is simply not the case:

> _" >Replacing a rule where rich countries subsidize long distance mail from > (former) poor countries with a rule where only small rich countries have to > pay for that subsidy is really not an improvement."_

Nowhere do I mention Trump. I'm not blaming this on Trump.

> _" Take a swipe at Trump ("This might actually be the one good thing that > Trump has accomplished")"_

Well, it is. There's not a lot of good he's accomplished in other areas, has he? He's mostly a disaster. This is the one truly good thing I can see that he has accomplished.

> _" Then say, based on your misunderstanding, that this "is really not an > improvement"."_

And indeed it wouldn't have been an improvement if it had only created an exception for the US. I'm glad that's not the result of these negotiations. I will absolutely credit Trump for this one good thing he has accomplished.

But if it hadn't been this good result, and it had only resulted in an exception for the US, he would not have accomplished this one good result. Surely that's clear, right? You can't claim credit for something that didn't happen (though I'm aware that Trump sees that differently).

However, had the result been not as good, that doesn't mean that Trump is automatically to blame. I understand the assumption, but he's not doing these negotiations on his own. It would be the whole of the UPU, and particularly the EU negotiators, that would have failed to replace the previous rule with a better universal rule, opting for an exception instead. That exception would probably have been good enough for Trump, so he'd still have gotten what he wanted, but this is an issue that's bigger than just the US, and I'm glad the UPU recognised that. I'm also glad Trump addressed this issue. Credit where it's due.

</comment></comment></comment></comment></comment></comment></comment><comment><USER45> >The U.N. agency coordinating postal systems worldwide on Wednesday reached a compromise to reform its fee structure, proposed by the United States,

</comment><comment><USER46> what a relief. of all the postal unions the USA could be in the global one is the best

</comment><comment><USER47> This is reasonably good news.

However I was kind of looking forward to the insanity that would follow from leaving this long term and fairly sensible pact! Change isn't always bad, sometimes change leads to new solutions.

I personally enjoy the ability to buy NEW parts for my 1914 sewing machine and have them sent directly from some mom and pop family stall in a Chinese village for $0.15 with free shipping.

But I also see the importance of encouraging American manufacturing, even though I also realize the long tail products I love so dearly and greatly appreciate the life support China's extended to them is valuable.

I also benefit from the ability to manufacture prototype PCB boards in China for new products just by sending off a webform request and for around 1/50 the cost stateside. Losing that ability might be damaging to domestic productivity since we really can't meet those prices, which makes doing frequent bugfix revs, or a small production product, untenable. For those with access to those highly superior Chinese facilities at low cost and quick turnaround, they might have the long term advantage. On the other hand why can't we locally have very modern robotic pick and place machines that don't cost hardly anything and have Joe Bob's fabrication of Arkansas pivot from custom tractor parts to producing clean room spec proto boards. These shops in China doing this stuff a lot are in rural areas and are small outfits run by a few people. We can do the same and would be more interesting for a lot of americans than meth and opioid despair. And yes we can do it.

Who knows though. What happens in the global economy and balance of tech is a delicate balancing game and difficult to predict long term outcomes past next year.

I do think our present administration is quite good at this game of take it or leave it hardball. The present outcome is a reasonable compromise. And is the new solution we may or may not have gotten from actually leaving.

<comment><USER48> "Joe Bob's fabrication of Arakansaw" has some licensing requirements his foreign competition might not. And some materials handling friction that's probably less costly elsewhere. His employees have overhead and administration costs which are again, higher than many other places.

<comment><USER47> Two possibilities:

1\. Maybe maybe not.

2\. I guess we should just give up then. Manufacturing will never return to America! It's hopeless.

Choose your own adventure.

</comment></comment></comment><comment><USER49> This is where Trump's "give no quarter" tactics has really yielded fruit. I wish we could find a more normal and balanced guy who was still willing to throw around the weight and leverage of the US.

<comment><USER28> More "normal" and "balanced" guy would be eaten alive by the establishment and mainstream press, and would achieve nothing at all.

<comment><USER49> Not at all, Reagan was a guy who managed to proudly use the strength of the US without being a moral degenerate.

<comment><USER28> Reagan too was called a total clown during his first election campaign and in his first term (he's in a good company, so was Lincoln). He was a much better public speaker, I'll give you that, but Trump is almost certainly a better negotiator, just from experience alone. I took some classes on negotiation, and did a bit of that myself, and I routinely see people misinterpret bog standard negotiation plays he does as his "missteps". Literally any book or course on negotiation will walk you through all of the techniques I've seen so far. It's getting tiresome. That's _the standard way_ of doing this shit, literally everyone who has successfully run any kind of business will see these tactics for what they are immediately.

As to "degenerate", that's the label you use when you've lost the rational argument. All I see is a talented businessman with a bit of Aspergers, strong Twitter game, and a profound lack of public speaking skills. None of that disqualifies him from the job he was elected to do.

[http://nymag.com/intelligencer/2016/05/ronald-reagan-was- onc...](http://nymag.com/intelligencer/2016/05/ronald-reagan-was-once-donald- trump.html?gtm=bottom)

<comment><USER49> No that's not what I mean by degenerate. I mean someone who says Mexicans are sending their rapists, their daughter is a "piece of ass," that they like soldiers who weren't captured, that pays off porn stars to cover their affairs, that tells foreign leaders to investigate their political opponents, etc. There are plenty of people who can get tough on immigration, China, and NATO without being a degenerate... perhaps a four star general. Yes, one can make the argument that a degenerate can be an effective President, and there is precedent for this (e.g. LBJ, Clinton) but I think that welcoming degenerates to the office is a bad long term idea.

<comment><USER28> Litmus test time: does this look like degenerate behavior to you? This is a presidential frontrunner and (at the time) an acting VP. He got his cokehead son $1.5B in Chinese money, too, for his "investment" firm, how that continues to escape the front page of WaPo and NYT is beyond me.

[https://www.youtube.com/watch?v=UXA-- dj2-CY](https://www.youtube.com/watch?v=UXA--dj2-CY)

Or are your morals selective enough to remain blind to this? Because it seems that the mainstream press is trying their hardest to not cover the story, and if it wasn't for Trump's "whistleblowing" (which I believe he orchestrated himself), nobody would know.

<comment><USER49> On the Washington-calibrated President degeneracy scale, bounded by George Washington at 0 and Donald Trump at 10, I'd give this a 5, Bill Clinton a 7, and Lyndon Johnson a 9.

</comment></comment></comment></comment></comment></comment></comment><comment><USER50> The reason rates are so cheap from China is because the system was intentionally designed to make it profitable to produce goods in China where labor is cheap. These kinds of attacks on the system are pretty interesting as they undermine the system the business community has loved since the 1990s. It's kind of amazing that Trump is actually attacking the system in order to feed his xenophobic platform. On the other hand, it's possible the business elite are suspicious of China's rising economic power and want to reduce dependence. In no scenario will ordinary people benefit so long as the elites are allowed to execute their plans as all roads lead to their own enrichment at our expense.

</comment><comment><USER51> Alternative headline: "China gets deal to continue having America subsidize it's shipping for another 7 months"...

I'm not impressed with the timeline associated with this deal.

I'm also not impressed by how the US seems to have only solved the problem for the US. It seems like Canada and most of Europe are in a nearly identical situation.

<comment><USER30> 7 months is very short when it comes to international agreements.

Also it applies to every country from 2021, i.e. Canada and EU will be able to set their own rates as well.

<comment><USER51> 7 months is only fast when you ignore the 12 months leading up to this.

> Also it applies to every country from 2021, i.e. Canada and EU will be able > to set their own rates as well.

Oh, I must have misread the article, that's good to hear.

<comment><USER33> 19 months is still a pretty reasonable timeframe for modifying a huge international treaty that around 200 countries are party to.

Regardless, I don't think it's fair to include the preceding 12 months; there was nothing actionable for any country to do to prepare for the changes until now. I would actually consider seven months to be impressively fast.

<comment><USER44> Yeah, I'm quite impressed by how fast and smoothly this happened. Considering practically every country in the world is party to this, and it's going to impact nearly all global mail traffic, I expected more talk and slower implementation.</comment></comment></comment></comment></comment>


Ask HN: Feedback about ServerBCC.com - <AUTHOR>

We're building ServerBCC which allows you to write BCC rules for your incoming and outgoing mails. Some of the benefits are:
* keep your colleagues, partners, bosses in the loop.
* Monitor your team, subordinates or your entire organization. * Keep your CRM and project management tools in sync with your email conversations * Archive all your mails or a subset of your mails based on your own rules * Add conditional footers to your outgoing mails for compliance and branding
How it works: * Write rules or filters in our web interface like you do in outlook, outlook express, eudora, thunderbird * Configure your mail server to have your incoming and outgoing mails pass via ServerBCC SMTP servers. * ServerBCC does the aliasing or bcc part transparently and automatically based on your BCC rules.
Do you have requirements for such a software? Would you prefer a hosted version or an in premise version?
Let us know your opinions. <comment><USER2> This is an interesting idea. Have you thought of using Sieve [1] to let people manage the rules directly from their mail client? Depending on how you set this up server-side it might not be possible, or indeed useful.

As a sysadmin my initial thought is that I would rather do this myself on a mail server I control, but I can definitely see value in both a hosted and on- premise version.

EDIT: I hope you don't mind some constructive criticism on the logo. Conceptually it works very well, but there is too much whitespace. I appreciate this is a landing page, so perhaps you have something else planned already.

[1] <http://www.ietf.org/rfc/rfc3028.txt>

<comment><AUTHOR> Intially we are thinking of a web ui to control the filtering rules though Sieve as a mail filtering language might work with some modifications like envelope sender/recipient based filtering and filtering by attachment names. I guess we have to wait and see what kind of power users would want.

Sieve/other mail server filtering implementations currently only target incoming mails, so I would be interested in knowing how you manage outgoing mail filtering if at all ?

From your emphasis on "a mailserver I control" I guess you are leaning towards the in premise version if you ever need this.

About the logo, as you guessed correctly it was a quick selection to get up and running and not the final version !

</comment></comment><comment><USER3> > Do you have requirements for such a software?

Hmmm... no _immediate_ need here, but sounds kind of interesting.

> Would you prefer a hosted version or an in premise version?

If at all we use it, would certainly prefer an in premise version.

HTH

<comment><AUTHOR> A hosted version would be preferrable for google apps and other cloud based mail solutions.

But an in premise version is easier due to no need for ip reputation, queue management, server cpu and ram resources and also helps the customer to be in control.

</comment></comment><comment><USER4> Hope Patrick or someone in the HN crowd doesn't mistake it for Bingo Card Creator ;)

</comment><comment><AUTHOR> clickable: <http://www.serverbcc.com></comment>


Study: A universal basic income would grow the economy - <AUTHOR> https://www.vox.com/policy-and-politics/2017/8/30/16220134/universal-basic-income-roosevelt-institute-economic-growth <comment><USER2> A couple of things right off the bat. This study assumes that:

\- There is zero effect on propensity to work

\- The national debt has no secondary effects on the economy

\- Changes in taxation do not affect consumption or investment behavior, at any tax level.

Those first two right there are incredibly massive assumptions, and they amount to two of the biggest criticisms of these proposals in the first place. And the third is flat out wrong, with enormous amounts of data available to debunk it.

Moreover, the third assumption ("Increasing government revenue by increasing taxes levied on households does not change household behavior") is actually at odds with their end conclusion! If there were truly no change in household behavior (whether at the margin or in the aggregate), then there could be no primary mechanism for this policy to have an impact in the first place. (And because this study explicitly ignores secondary impacts, without a primary impact, what are they actually claiming to measure?)

So I'm not sure what the value is in a study that basically says, "If we ignore the biggest and most commonly criticized negative effects, the effect of this policy will be positive".

<comment><USER3> Exactly, and no mention if this would affect welfare and other social programs. So if someone still gets all the aid they do today _and_ $1K per month, then there is more money to spend but are there more people who want to work where that money is spent?

I think it likely that this would cause low end job wages to rise, not necessarily increase employment.

<comment><USER4> > and no mention if this would affect welfare and other social programs.

Which is quite surprising because every, and I mean every, UBI proposal talks up how much money we'd _save_ because welfare would be eliminated. I just don't see how that's possible, because inevitably there are going to be a lot of people with real or self-imposed crises crying about how they don't have enough money to pay rent or buy food, and what is the government going to do, tell them "tough shit, you should've managed your UBI better"? Uh, I doubt it. We'll end up stuck with welfare programs as a UBI safety net and then people will inevitably game the system by crying broke every single month.

This whole thing is such a ridiculous leftist fantasy, the biggest giveaway is that it completely ignores basic human behavior.

<comment><USER5> One wonders which humans you surround yourself with to consider that "basic human behavior".

<comment><USER4> Trying to maximize earnings is basic human behavior, sorry to break it to you. Welfare scams occur regularly, and that's before UBI.

And you're dodging the bigger question: I'm on UBI and my money runs out, can't afford to feed the kids. Multiply that by at least several thousand people every month. Now what?

<comment><USER6> Same as now. You don't get more food stamps just because you ran out.

<comment><USER4> The difference is it's earmarked money today. There's no potential to spend your food money on a phone and then claim you can't buy food at the end of the month.

<comment><USER7> Most countries just give cash to people without income, they don't bother with a separate food program. That seems to work fine.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> Another missing element in the model: People who need it most are renting. You hand everyone $1000 per month and I guarantee there will be a large uptick in rents. This will short circuit economic activity and just push the money straight to those who own rental property, thereby increasing the wealth gap while raising the cost of living. I won't all go into this effect, but certainly a lot of it will.

<comment><USER9> The moment I get my monthly cheddar, I'm moving to a nicer place with lower cost of living.

The USA has more housing than people. Alas, that excess supply isn't near the jobs.

<comment><USER8> So you'd move to one of those places with cheap housing and no jobs? Does that mean you'd not be working?

Of course the influx of people to low cost areas with no jobs would create some jobs in those places and raise prices on everything from housing to pizza.

<comment><USER9> Given broadband and strong coffee, I'll make the jobs.

</comment></comment></comment></comment><comment><USER10> _" But a $12,000 a year per adult basic income is another matter. The Roosevelt paper finds that paying for it would require increasing household tax revenue by 120 percent — a more than doubling. To do that, it assumes that all but the poorest 40 percent pay more in taxes. The middle quintile (households with an income between $48,300 and $85,600, per the Tax Policy Center) would see their average tax rate go from 14 percent to 25 percent; the top one percent would see its average tax rate go from 32.9 percent to 67.9 percent."_

Well, this idea is dead in the water then.

<comment> norea-armozel Yeah, more likely the rich would just self-fund fascist paramilitaries to keep "the poors" in line like they've always done.

<comment> norea-armozel It's weird how my comment really struck the nerve that it did since it's partly in jest. But I will say this much, historically the rich have always favored military solutions rather than economic (or social) ones in dealing with class warfare. If the rich of today want to take a page out of history, they should be more like Otto von Bismarck and pay off the poor and disenfranchised. Meaning that some kind of reformed and expansive welfare state is something that's needed more than Uberizing every facet of life (the most recent one that's really annoyed me is the monetization of game mods by Bethesda; it's a hobby, not a job.). Whether or not that includes basic income remains to be seen, but the fact is all the opposition to any kind of welfare under capitalism will doom capitalism to be overthrown more violently than it had been in the early 20th century by communists.

<comment><USER11> It has nothing to do with nerves being struck and everything to do with your 150 year out of date social analysis being so absurd that it's not even wrong.

By the way, the lower class is striking back, but it looks more like a fake tan and a combover than the image of St. Petersburg in 1917 you seem to lust for.

<comment> norea-armozel >It has nothing to do with nerves being struck and everything to do with your 150 year out of date social analysis being so absurd that it's not even wrong.

Tell that to the US DSA which is seeing record membership increases. And tell that to Kamala Harris who's an astute politician that co-signed Sander's single-payer bill. If the winds of change aren't blowing leftward then explain the current trend.

Also, Trump's ascendancy is the result of the capitalists not the working class. Robert Mercer (one of Trump's key supporters) has as much in common with you and me than does a mouse with a moose. Essentially, Trump is the carefully created result of decades of right wing propaganda and concerted destruction of the welfare state. Want to see less of Trump? Then tax the living heck out of the super rich and/or ban their right to fund any kind of think tank or PAC forever (down to a constitution amendment if necessary).

<comment><USER11> The winds may blow leftward, but that's a far cry from a 1917-style workers uprising.

Some bad news: Bernie Sanders' support is substantially middle class. His policies are only very generously described as socialism at all, crucially he does not even begin to propose a fundamental break with private property or capitalism.

The rise of Bernie Sanders may be a nice development, and his hypothetical election might well bring benefits. But it's not going to be a workers revolution in any meaningful 20th century sense of the word.

Trump may be all that, but he was elected by appealing to the working class. Bernie Sanders has as much in common with you and I as a mouse has with a slightly smaller moose. Few of the revolutionary icons of the 20th century were themselves working class (Marx himself was remarkably posh). The important metric for a working class uprising is what the working class _does_ (specifically, that it rises up), not the class background of the person they rise behind.

</comment></comment></comment></comment></comment></comment><comment><USER11> > They find that enacting any of these policies by growing the federal debt — > that is, without raising taxes to pay for it — would substantially grow the > economy. The effect fades away within eight years, but GDP is left > permanently higher. The big, $12,000 per year per adult policy, they find, > would permanently grow the economy by 12.56 to 13.10 percent — or about $2.5 > trillion come 2025. It would also, they find, increase the percentage of > Americans with jobs by about 2 percent, and expand the labor force to the > tune of 4.5 to 4.7 million people.

> They also model the impact of the plan if it's paid for with taxes. That > amounts to large-scale income redistribution, which, the authors argue, > would stimulate the economy, because lower-income people are likelier to > spend their money in the near-term than rich people are. Thus, they find > that a full $12,000 a year per adult basic income, paid for with progressive > income taxes, would grow the economy by about 2.62 percent ($515 billion) > and expand the labor force by about 1.1 million people.

So, borrowing and spending 300 million adults * $12,000/adult/year = $3.6 trillion/year would grow the economy by $2.5 trillion? And raising it in taxes would grow the economy by just half a trillion?

Or what am I missing?

Also this:

> because lower-income people are likelier to spend their money in the near- > term than rich people are

But what about the long term? We can debate the finer points about when and how much etc, but it remains uncontroversial that rich people invest nontrivial amounts in long term stuff. With near-70% top average (not marginal!) tax rates, this will go down by _a lot_. How will this redistribution from long-term investments to near-term spending affect the economy over the long term? Yes, fewer yachts and private jets (there are also people employed supporting those, and the net employment benefit suggested is already quite modest), but would an Elon Musk or Jeff Bezos subject to a 70% tax rate invest in the next SpaceX/Blue Origin (not to mention thousands of other startups backed by angels and personal/friends&family savings)?

<comment><USER12> I did my bachelors in economics, and one of our textbooks taught that all other things being equal (ceteris paribus), more wealth equalisation (taking from the richer and giving to the poorer) means less wealth creation in the long term. Why? Wealth will naturally concentrate in the hands of those more capable of creating it: if Jo is making 2% per annum return and Jane is making 4% per annum return, and they both start with the same amount, then Jane's share of the total wealth pool will continuously increase relative to Jo. The key thing to note is that as Jane's producing twice as much from her wealth as Jo, if we take resources from Jane to give to Jo then they'll be used less effectively, slowing overall growth.

To illustrate, imagine they both start with $1000 each. The total wealth pool is hence $2000, and they both have 50% each, perfect equality. Now, let's look 50 years in the future, assuming the previously mentioned interest rates per annum compounding annually. According to[http://www.moneychimp.com/calculator/compound_interest_calcu...](http://www.moneychimp.com/calculator/compound_interest_calculator.htm), Jo will have $2,691.59 and Jane will have $7,106.68. The total wealth pool is $9,798.27. Jo hence now has 27.47%, and Jane has 72.53%. They're both less equal, but they're also both wealthier, and the overall wealth pool has increased.

Now, let's look ahead another 50 years. If no wealth transfer occurs, Jane will have $50,504.92 and Jo will have $7,244.65, with the total wealth pool being $57,749.57. If we equalise wealth, however, such that both have $4,899.13, then in 50 years Jane will have $34,816.57 and Jo will have $13,186.44, for a total wealth pool of $48,003.01. This is 83.12% of the total wealth pool that there would be if no wealth transfer took place. This effect is applies similarly if wealth redistribution happens every year through redistribution of income.

In this sense there is hence a direct tradeoff between economic growth and wealth transfers from richer to poorer in the long term (all other things being equal).

<comment><USER13> Good thing our society doesn't optimize for maximum absolute wealth growth in a vacuum, else we'd have 1 person with all of the country's wealth.

> If we equalise wealth, however, such that both have $4,899.13, then in 50 > years Jane will have $34,816.57 and Jo will have $13,186.44, for a total > wealth pool of $48,003.01

Have you considered second order effects here? What if additional wealth allows "Jo" to increase their per annum return because they invest it in a business or education?

> In this sense there is hence a direct tradeoff between economic growth and > wealth transfers from richer to poorer in the long term (all other things > being equal).

I have a BA in Economics as well, and ceteris paribus models stop being useful past the 2nd year of study. I don't think they're ever useful except to illustrate the most basic concepts to freshmen and laymen. When you apply such models to the real world, you end up with a situation I described in the 1st paragraph.

In this case, the condition assumes that the rate of wealth creation is fixed and unalterable on a scale of 50 years. It also falsely assumes (just world fallacy) that wealth is already allocated in such a way as to belong to people with high (unalterable) wealth creation potential.

<comment><USER12> >Good thing our society doesn't optimize for maximum absolute wealth growth in a vacuum, else we'd have 1 person with all of the country's wealth.

The person must be trading with others somehow to be gaining those 4% returns; they could only end up with all the wealth if literally nobody else saved any money. And if nobody else saved any money, there'd be no economic growth at all if not for the person with all the wealth.

>Have you considered second order effects here? What if additional wealth allows "Jo" to increase their per annum return because they invest it in a business or education?

Jo started with the same amount of wealth as Jane; he had no less opportunity to invest it in a business/education, invest it in something to increase in something that increased his investment returns, than she did.

>In this case, the condition assumes that the rate of wealth creation is fixed and unalterable on a scale of 50 years. It also falsely assumes (just world fallacy) that wealth is already allocated in such a way as to belong to people with high (unalterable) wealth creation potential.

It doesn't assume the latter, it assumes Jane and Jo started with the same amount of wealth, and shows that given this condition it will result in more wealth being allocated to the people with more wealth creation potential. Starting from the same point, Jane and Jo have equal chance to increase their ability to create wealth.

</comment></comment></comment></comment><comment><USER14> We need to await the results of the Finnish study[1]. As an aside, I wish all politics would take an experimental scientific approach as the Finnish are doing. They are randomly selecting 2000 unemployed in a specific area and trialling the basic income for two years. I hope they have also selected a control population. At the end of two years they will assess how the scheme affects cost and employment status of that group.

[1][http://basicincome.org/news/2017/05/finland-first-results- ba...](http://basicincome.org/news/2017/05/finland-first-results-basic-income- pilot-not-exactly/)

</comment><comment><USER9> "Economy" is the movement of money.

Of course wealth redistribution via progressive taxation, in this case via UBI (or negative income tax) increases the economy.

Conflating wealth growth (aggregation, transferring, hording) with economic activity is how we got into our current mess (accelerating inequity).

</comment><comment><USER15> Giving people money they did not earn will have exactly the same effect as giving people paper fans, bottled water, rain ponchos, etc.

The given commodity becomes an oft-wasted resource. (i.e. inflation is a result.)</comment>