SQL queries don't start with SELECT - <AUTHOR> https://jvns.ca/blog/2019/10/03/sql-queries-don-t-start-with-select/ <comment><USER2> Optimizer nuances aside, I agree with this and think it's helpful for anyone writing SQL. I've trained a lot of non-developers (and new-developers) to use SQL, and one of my favorite tips is, "Start with FROM."

Even sooner than "start with FROM" is "What does each row of the result mean?" Is it a sale? A month of sales? A customer? If you can answer what you _want_ , then it's usually easy to start there. Especially if your answer corresponds to an existing table, put that in the FROM, and then add whatever joins you need. You can even think about the joins "imperatively".

Thinking imperatively about JOINs is also a helpful way of understanding a mistake I call "too many outer joins", which I wrote about here: [https://illuminatedcomputing.com/posts/2015/02/too_many_oute...](https://illuminatedcomputing.com/posts/2015/02/too_many_outer_joins/) If you don't know about this mistake, it's easy to get the wrong answer from aggregate functions like AVG or COUNT. (EDIT: I should probably call this "too many joins" instead, since it's not really specific to outer joins. But in practice I find outer joins are more often used in these sort of situations.)

<comment><USER3> For updates, and deletes on the other hand I try to start with the where clause. Learnt the lesson after running a update query once before i typed the where to cause something like 40k worth of damage

<comment><USER4> Good advice. I also break up the statement so that an incomplete highlight and execute will fail, e.g.

        DELETE FROM
          Customers WHERE
          Name='Gude' AND
          Area='Tama'
          ;

Much harder to leave off half the clause doing this kind of thing.

<comment><USER5> I've forced the habit upon myself to first compose a SELECT statement and verify that it will give me exactly the dataset that I want to run my operation on. Then I wrap that statement into a CTE and run the DELETE / UPDATE on the CTE.

It doesn't save me time, but a lot of nerves.

<comment><USER6> I'm used to writing the SELECT query and adding the commented-out DELETE just below the SELECT line.

      SELECT *
      -- DELETE
      FROM Sales
      WHERE Customer = 1

Next, selecting the whole query and executing it. If results are satisfactory - selecting only the DELETE part.

<comment><USER7> This is the one I use too. Tiny difference - I write

       select * -- delete
       from sales
       where customer = 1

so it's even harder to accidentally highlight the 'delete' part.

Although I've switched to DBeaver for a year now, and it automatically pops up a warning when it detects a DELETE query without a WHERE, which is very nice.

<comment><USER8> DBeaver has something even better, albeit sometimes annoying: you can define a connection as "Production" (highlighted red) and "Test" (green). On Production systems, DBeaver will ask you for confirmation for every write statement.

</comment></comment></comment></comment></comment></comment></comment><comment><USER9> This is one of the things MS Entity Framework gets right - it enforces the "start with FROM". It actually _ends_ with SELECT, which makes so much more sense.

Seriously, between navigational properties, group-with-children, EF to me hammers home how _bad_ SQL is. EF is a square peg in a round hole but it does a great job at makign some trivial improvements over SQL, while still remaining true to the principles of relational databases.

Of course, the framework is a hairy mess for other reasons (lazy loading, untranslateable methods, ugly generated queries) but the alternative to SQL it presents is _lovely_.

<comment><USER10> What do you mean SQL is bad? SQL is very good and some dialects can do some amazing things. I don't think EF is much better, and EF (older Linq2Sql as well) has some gotchas because it converts your expression into SQL, except for when it doesn't and throws a runtime error that it couldn't. And there are some edge cases where you think a C# expression would convert to SQL but alas, it wont.

<comment><USER11> The point is that LINQ expressions (in the query syntax) can be more readable and straightforward than the equivalent statement in SQL.

EF is just an ORM that benefits from using the LINQ syntax and operators available in .NET/C#.

<comment><USER10> Thanks. Even on just that point, I disagree. I think they are equally readable. Just like Python and C# are equally readable to the respective cohorts that are used to programming in those languages.

Yes, EF queries are more readable to many developers who know C# well but don't want to get used to SQL. But the problem with that is DB apathy + EF leads to some real performance problems as systems scale that grinds the application to a halt with SQL queries longer than dissertations, to which the developers need a quick hack to fix. The query plan for those beasts is intractable. Which of the 10 table scans or index scans to tackle first? And how do you tackle it?

They discover "indexed views" and all is well until you start to have locking problems, so more hacks are needed. etc. By writing the damn SQL to begin with they'd have to tame the beast earlier on and address the design flaws in their schema and/or application.

Ok this is a bit of a strawman (although it is based on experience) but I think saying SQL is less readable is a red herring. It is more readable for a lot of use cases. It's a DSL designed for the job, you really can't get much better (except for Elastic Search use cases, etc.). It's slightly old fashioned but that's just fashion.

<comment><USER11> This isn't about ORMs or database performance. It's just a comparison of query languages, with LINQ being more natural for data models with lots of joins and nested records that are common today (especially since that's how people work with objects inside their programming language).

SQL is far from perfect. It would be nice to see some modern SQL dialects that follow the LINQ syntax and are natively supported by RDBMS.

<comment><USER12> Linq is horrible for outer joins, the syntax is completely unintuitive to the point that I'll just use raw sql.

</comment></comment></comment></comment></comment></comment><comment><USER13> The author has been posting some pretty awesome SQL content on Twitter recently. I'm a data scientist who uses SQL pretty frequently, and I'm learning lots of stuff - from random tidbits like this that clarify something I think I intuitively knew to things that immediately became useful to me.

[https://twitter.com/b0rk](https://twitter.com/b0rk)

</comment><comment><USER14> Unless I'm writing 'select *', I always do the select portion of a SQL query last. Starting with from enables helps with autocomplete on most editors too. I actually with 'select' was at the bottom. The only reason it would be useful at the top would be if it allowed you to use the new/computed column names as aliases later in the query, which doesn't work with most databases.

<comment><USER15> > The only reason it would be useful at the top would be if it allowed you to > use the new/computed column names as aliases later in the query

I'm soooo gonna miss that when we have to add MSSQL support soonish. Having to repeat myself is tedious, especial for non-trivial expressions.

<comment><USER16> As far as I know, it supports the WITH keyword, so you can reuse those expressions.

<comment><USER17> Which you probably shouldnt, because you are just writing the subquery each time - a temp table in MSSQL is a much better solution than CTEs 99/100 times.

<comment><USER16> It's not any different than selecting from a view.

Are CTEs an optimization barrier in MSSQL? I would've thought that the query planner could move the execution plan nodes across the CTEs.

<comment><USER18> > Are CTEs an optimization barrier in MSSQL?

They are not. They are, however, in Postgres.

<comment><USER19> They are not (or at least less likely to be) in Postgres 12, as they are inlined in a wide variety of cases.

</comment></comment></comment></comment></comment></comment></comment><comment><USER20> I really like jvns's work but I have to say I found this diagram misleading when I first saw it! SQL queries "happen" in whatever order the database optimiser decides.

I'm really glad the accompanying article has a bunch of qualifications of the form "Database engines don't actually literally run queries in this order" but a lot of the beauty of these diagrams is that they work on their own.

I wish the title of the picture said something more like "SQL queries are interpreted in this order" to make it clear we're talking about semantics and not what actually takes place.

<comment><USER21> Concerning the database optimizer:

is it only my (wrong) subjective feeling, or did the one of Oracle become much more stubborn about following "hints"? [https://en.wikipedia.org/wiki/Hint_(SQL)](https://en.wikipedia.org/wiki/Hint_\(SQL\))

Reason: I started dealing with Oracle when it was at v8 and I think up to including v9 when I specified a hint it was usually followed. Then later with v10 and v11 it progressively became more difficult and nowadays with v12 I'm having a really hard time (I usually have to use some "tricks" that don't change the logic of the SQL but do change its technical execution, like placing somewhere a useless but tactical "distinct", to confuse it enough so that my hints are more or less followed/used).

Btw., if you want to state something like "using hints is wrong" then in general I agree (with some exceptions for special cases) but currently I'm taking care of a very old app that uses often quite big SQLs (involving up to ~15 tables) and as the maintenance budget is limited and the app will anyway be decommissioned in 1-2 years I cannot start rewriting half of the application to break down and improve the statements => when once per quarter the data distribution/quantity/etc... change and the optimizer thinks that it has a new brilliant idea about how to exec some SQL and then of course the SQL hangs then I usually just try to spend 1-2 hours trying to find some hint(s) that will bring back the old execution plan, but since we upgraded to Oracle12 I often see no change in the exec plan unless I do what I mentioned above.

<comment> munk-a > Btw., if you want to state something like "using hints is wrong" then in > general I agree (with some exceptions for special cases) but currently I'm > taking care of a very old app that uses often quite big SQLs (involving up > to ~15 tables) and as the maintenance budget is limited

This is a very common truth, I've been in similar situations where budgets are tight and things are working so don't touch a thing. I think it's actually just a specific example of a very common problem pattern in tech - the way I usually push back on it is "The stuff that is is and I'm not going to waste time fixing it - but any stuff I'm adding a feature to or fixing a bug in, it's not worth the company's time to fix it the wrong way because it'll end up costing more when another bug or feature requires an adjustment near this in a year." All that said, especially within MySQL (and I haven't worked in Oracle so maybe there too) the query planner is a bit dumb, so sometime you really need to help it along.

<comment><USER21> > _especially within MySQL (and I haven 't worked in Oracle so maybe there > too) the query planner is a bit dumb, so sometime you really need to help it > along._

Yeah, I've seen it as well last year when working with MariaDB (but I'd guess that MySQL might be a bit more clever as maybe Oracle might have improved it a bit).

</comment></comment></comment></comment><comment> ainar-g In general, I _love_ SQL. It's one of my favourite languages (or rather, language families) to play and tinker with. But the fact that SELECT comes before FROM has always ground my gears. Thanks to this article, I now finally have a better explanation than "Dunno, feels weird" :-)

<comment><USER19> SELECT before FROM makes sense when writing, especially fairly simple, queries in terms of designing results first.

OTOH FROM first is better for tooling.

Really, there's no really good reason for a mandatory order of clauses in an SQL statement.

<comment><USER22> > SELECT before FROM makes sense when writing, especially fairly simple, > queries in terms of designing results first.

The thing I always imagine is a bunch of people in the 1970ies sitting around designing this stuff, and reading it out loud in a Captain Kirk voice

"Computer, SELECT course WHERE Klingons IS zero!"

</comment></comment></comment><comment><USER23> I pretty much always start typing SQL queries with "SELECT *" because I know I'll come back and figure that part out later.

It's similar to how I write Python list comprehensions. I almost always type "x for x in" from muscle memory, then get the collection part at the end correct, then go back and fix the beginning. My brain just won't think in the other direction.

<comment><USER24> Oh yeah I agree - the forward reference to attributes before the source is stated does feel backwards when writing the expression.

Compare scala's for-comprehension that feels more natural: `for (x <\- xs) yield x + 1;`

Perhaps there's an argument that the shape of the result is defined up front, so it might be easier to comprehend the result if not the implementation.

</comment></comment><comment> munk-a I've actually found myself more and more disappointed that FROM isn't the first clause in the query, it'd be really nice to express those queries as WITH, FROM, GROUP BY, HAVING, WHERE, SELECT, ORDER BY, LIMIT as that's usually the way I consider queries - granting HAVING is sort of a free card here, I don't use it enough to place it accurately, but being near WHERE or GROUP BY makes a lot of sense.

<comment><USER25> A professor I took a databases course from in college was convinced XML was the next big thing, so he made us also learn the XQuery language [1], which does things in roughly the order you described.

I don't remember the specifics, just that the acronym was something like "flower" and you started with your from clause and ended with what you would return.

[1] [https://www.w3schools.com/XML/xquery_flwor.asp](https://www.w3schools.com/XML/xquery_flwor.asp)

<comment><USER26> FLOWR - from, let, order by, where, return.

<comment><USER27> Or flows just replace the r with the s for select

</comment></comment></comment></comment><comment><USER28> I learned this and more earlier from [https://blog.jooq.org/2016/03/17/10-easy-steps-to-a- complete...](https://blog.jooq.org/2016/03/17/10-easy-steps-to-a-complete- understanding-of-sql/) my goto guide and recommendation for people with practical SQL experience who want to improve their understanding. (I first read it via Hadley Wickham's tidy data writeup.)

It leaves out SQL window functions though.

</comment><comment><USER29> I usually begin my queries by typing "SELECT * FROM", and then go back to the * after I've done everything else.

There's a bonus in doing that - you get auto completion from the editors on many cases if you've filled the from first.

<comment><USER30> I do this too, so the autocomplete in SeekWell automatically does this, check it out:

[https://www.loom.com/share/9c7979a163eb4513b3320e6e90c66079](https://www.loom.com/share/9c7979a163eb4513b3320e6e90c66079)

If you type just a table name into an empty cell it will autocomplete with a full SELECT statement. e.g. if you typed "pubuser" and selected "public.users" it would autocomplete with:

      SELECT pu.*
      FROM public.users AS pu
      WHERE 1=1

Disclaimer: I built this.

</comment></comment><comment><USER31> The posts, tutorials and zines of Julia Evans are amazing. She has a knack for explaining things. This one is also quite great, isn't it? It doesn't talk about relational algebras, sets, cartesian products etc but explains things in a very easy to understand fashion while pointing out common problems and pitfalls.

I wish she did a monad one, you bet it wouldn't be "it's just a monoid in the category of endofunctors, what's the problem".

<comment><USER32> There are already many, many monad tutorials. If you want something visual, perhaps this one?

[http://adit.io/posts/2013-04-17-functors,_applicatives,_and_...](http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html)

<comment><USER33> This looks like a bunch of jibberish to me, mostly pretending it's easy by making it look like a comic.

<comment><USER31> I didn't want to be the one to say that... this is a terrible tutorial.

</comment></comment></comment></comment><comment><USER11> The reason why is historical. SQL (structured query language) originally came from SEQUEL (structured _english_ query language) and was designed to emulate a normal English sentence as a query.

 _' SELECT columns FROM table'_ makes sense when you're asking it literally. However SQL and relational DB's have evolved since then and the English grammar is now awkward. It would be nice to see newer dialects accept the inverse order to help with tooling and structure.

<comment><USER34> I'm a native English speaker and both "from the top shelf select a book" and "select a book from the top shelf" are perfectly valid syntax, even if the second one is more common.

</comment></comment><comment><USER35> This is why I like Linq in C#. The syntax order corresponds to the logical order. This also makes queries more composable.

And a very practical advantage is that the editor can support syntax completion. SQL syntax cannot support that since you write the projection before the from-clause.

<comment><USER36> Have you checked out the LINQ expression support in F#? They cover all (I'm pretty sure) LINQ operators within an expression style (AKA not the method- call syntax).

<comment><USER37> This looks much better than the way it is done in C#.

I absolutely hate the SQL-ish LINQ expressions in C# code. It's really awkward when you make a query and need to materialize it. You either store the Queryable<> in a temporary variable and then convert it to a list or an array or whatever, or you have to glom parentheses around a big LINQ expression.

<comment><USER36> I prefer the approach of LINQ expressions over LINQ method chains, but in C# very few LINQ operators are exposed to the LINQ expression syntax. So if you start with expressions you often end up with a terrible hybrid of both.

</comment></comment></comment></comment><comment><USER38> Maybe I'm just showing my age here, but has use of SQL really fallen so far out of favour that very few developers know it well? I'm honestly surprised.

<comment><USER39> I've wrote CRUD apps for 5 years very long time ago. Then I was spending weeks debugging business logic in stored procedures and views, fine-tuning big query execution plans, you name it.

At my current work nobody talks about SQL, literally every discussion starts with "We will create this new Rails model". Indexes are not created deliberately - we are adding them only when the need is obvious, because some functionality is plain slow. No one talks about SQL, plain SQL queries in code are considered really bad practice - in cases where the query generated by Rails is complex and slow and a plain SQL query is PR-ed, the code reviews discussions are pretty long.

I am not saying this is good or bad, in fact all looks OK, but I was really really surprised at the beginning.

<comment><USER40> I once worked with a guy who would generate SQL queries via a series of multiple regex transformations. Even now that's still up there as one of the most terrifying things I've seen a developer do.

<comment><USER38> Why terrifying? Sounds like he saw that the structure of much of what he was doing was boilerplate and created a bespoke code generator to save himself time. As long as the resulting queries are readable and effective I don't see a problem. Unless I'm missing something, understanding his code generator is not (necessarily) a pre-requisite for understanding the resulting code.

<comment><USER40> > _Why terrifying?_

Because you're leaving an unmaintainable mess. Nobody else can rationalise the code aside himself. It's harder to debug because even he cannot account for every edge case his regex might throw up -- which also makes it less secure. Also regex is comparatively slow so transforming an SQL query using multiple regex search and replace patterns is not the way to write hot code hit by literally millions of visitors each hour.

> _understanding his code generator is not (necessarily) a pre-requisite for > understanding the resulting code._

Oh it absolutely is if you want maintainable and secure code. I get some situations call for complexity but when you're generating SQL on a public facing web application with a centralised database backend, you want to be damn sure you can rationalise the SQL being generated. The best ways of doing that is to either not to try to be too clever with your generation (KISS) or to put your confidence into an established and well tested existing ORM or equivalent.

</comment></comment></comment></comment></comment><comment><USER41> In my experience the execution order isn't obvious to most sql users. You'll find a lot of people using sql who don't understand why something from SELECT can be used in ORDER BY but not WHERE or HAVING for example. It takes a slightly more advanced SQL understanding to be able to explain these kinds of errors in thinking. Thats why a good ORM can often be the best choice for users.

<comment><USER42> Can't you though?

        SELECT 2+2 as num FROM <table> HAVING num > 3;

this will return as many 4s as there are rows in the table

        SELECT 2+2 as num FROM <table> HAVING num > 4;

this will return 0 rows. How is this not using something from SELECT in a HAVING clause?

<comment><USER41> Like with many SQL questions this depends on what implementation you're using.

In MySQL you can use HAVING, ORDER BY, and GROUP BY with column aliases but not WHERE: [https://stackoverflow.com/questions/942571/using-column- alia...](https://stackoverflow.com/questions/942571/using-column-alias-in- where-clause-of-mysql-query-produces-an-error)

In PostgreSQL you can not use the column alias within WHERE or HAVING but you can use it in ORDER BY and GROUP BY: [https://dba.stackexchange.com/questions/225874/using- column-...](https://dba.stackexchange.com/questions/225874/using-column-alias- in-a-where-clause-doesnt-work)

Similarly in Microsoft SQL server you cannot use it in WHERE, HAVING, or GROUP BY but you can use it in ORDER BY.

In SQLite you can use column aliases within WHERE, HAVING, ORDER BY and GROUP BY: [https://stackoverflow.com/questions/10923107/using-a- column-...](https://stackoverflow.com/questions/10923107/using-a-column-alias- in-sqlite3-where-clause)

In Google Bigquery you can use them in GROUP BY and ORDER BY but in Hive you can only use them in ORDER BY.

As far as I know the standard only defines that you cannot use column aliases in the WHERE clause. I'm sure someone else can chime in with what the standard says about column aliases in ORDER BY, GROUP BY and HAVING.

</comment></comment></comment><comment><USER43> A minor thing, but adding the non-image version is a really nice touch!

Great article, thanks.

</comment><comment><USER44> More depth and detail in this post a couple of year ago on Lukas Eder's excellent SQL blog [https://blog.jooq.org/2016/12/09/a-beginners-guide-to-the- tr...](https://blog.jooq.org/2016/12/09/a-beginners-guide-to-the-true-order- of-sql-operations/)

</comment><comment><USER45> >LINQ (a querying syntax in C# and VB.NET) uses the order FROM ... WHERE ... SELECT

The reason is for that is Intellisense, you cannot show columns for SELECT unless you already know the table(s) you're selecting the columns for.

<comment><USER46> Came here to say this. It makes a heck of a lot of sense when you think about it!

</comment></comment><comment><USER47> Actually I've got bad news. The where clause should be run before the select but for reasons of, I guess cheating at the benchmarks, oracle doesn't do that and MSSQL followed that. It is particulary nasty as it _mostly_ works, so this (CTE to not clutter your schema)

      with data as
      (
       select *
       from
       (
        values(1), (2), (0), (4)
       ) as abc(d)
      )
      select 1 / d
      from data
      -- where d <> 0

gives divide by zero. If you uncomment the where it then seems to work correctly.

Well it doesn't. You cannot rely on this for MSSQL2005 or later. When the expressin grows more complex it blows up - I am saying this from losing days of work by finding out the hard way.

I'll repeat myself, the expressions in the select and that in the where can be evaluated in parallel. Thank you Microsoft.

Microsoft's solution to this is to expect the programmer to deal with it by skipping the evaluation of the expression

      with data as
      (
       select *
       from
       (
        values(1), (2), (0), (4)
       ) as abc(d)
      )
      select case when d <> 0 then 1 / d else null end
      from data
      where d <> 0;

The case prevents any possible division by zero.

I've had this behaviour confirmed by Microsoft, and the supposed fix was their solution.

Not coincidentally I'm looking at learning postgres. For this and other reasons I don't want to work with MSSQL any more.

</comment><comment><USER48> I'm a bit of surprised by how shallow people's understanding of database is. Especially for someone have literally wrote thousands of sql queries. The query engine implementation is/should be covered by some extent in any of the database courses, thus I assume anyone with a CS degree shouldn't be surprised that a queries doesn't execute from SELECT(how's that even possible). Perhaps nowadays the major users of SQL don't really have a CS background.

<comment><USER49> We live in a large N-Dimensional world of knowledge. Everyone at some point is guaranteed to have missed something "they should know", both according to themselves and according to others.

Many times you encounter such knowledge when you are not ready for it, so you forget having encountered it. A good way to convince yourself of this is to start opening up some of your old college text books and look at the chapter introductions and conclusions. You will find some insights that you simply missed regardless of how you performed in the classes.

<comment><USER50> In my development as a software engineer, there was a noticeable "level up" after 3-4 years where I had accumulated enough knowledge across the various abstraction levels to the point where new concepts integrated cleanly into my mental model of software systems.

During the first few years of exposure to computer science, I definitely lacked the necessary context to understand certain concepts when I encountered them for the first time. For example, I had a theory of computation course that was all about regular expressions, regular languages, context free grammars, etc. At the same time as I took this course, I was also building my first iPhone app, and I often thought "none of this seems applicable". And then two years later I wrote a compiler to implement a subset of Java and I massively reassessed my opinion on the value of understanding the theory of computation and programming languages.

</comment></comment></comment><comment><USER51> I really wish SQL syntax was in this order.

<comment><USER52> Why do SQL clauses need to be ordered, anyway? Is there anything that would be impossible to parse if the order was not defined?

<comment><USER53> To be logical to beginners. So that autocomplete can help you (which it cannot if it doesn't know what tables you are querying).

<comment><USER54> But the syntax is in the wrong order for autocomplete to help you.

If from was first, autocomplete could help you with the names of columns, like RStudio does with dplyr:

        data_frame_name %>% select(column_name)

Because you start by piping the data reference into your select function, RStudio can inspect the data and autocomplete the column names in the select statement, completely opposite of what is possible inSQL

With a free order, you'd be able to start SQL queries with `FROM table_name SELECT ...` and have columns autocompleted.

<comment><USER53> Sorry, I didn't mean that in defense of SELECT being first. I agree with the article that SELECT must come toward the end. And the first thing I tell people I teach SQL to is that they have to read SELECT last.

<comment><USER54> Then I misunderstood you post.

</comment></comment></comment></comment></comment></comment><comment><USER55> > (I really want to find a more accurate way of phrasing this than "sql > queries happen/run in this order" but I haven't figured it out yet)

Maybe "Order of Operations"? Similar to order of operations in math where you do (), then * and /, then + and -, ...

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

</comment><comment><USER56> > Can I filter based on the results of a window function? (no! window > functions happen in SELECT, which happens after both WHERE and GROUP BY)

Yes, you can by wrapping the entire SELECT in another SELECT (or use WITH)

        select *
        from (select ...) as x
        where ...

This works because the result of a SELECT is a (virtual) table on its own. It was an eye opener when I saw it for the first time.

<comment><USER57> It's surprising to me that someone can run into window functions earlier than subqueries. I guess my background with MySQL which only recently supported window functions affected my perspective there.

<comment><USER58> Her question that starts the post is about doing it in a single query (no subqueries.) I kinda had this misunderstanding on Twitter too when responding to an earlier diagram of hers [https://twitter.com/firasd/status/1172874054002307073](https://twitter.com/firasd/status/1172874054002307073)

</comment></comment></comment><comment><USER59> I'm always surprised how apparently not-deterministic SQL Server appears to be when it comes to performance.

We use for our apps Kendo grids at work which allows you to create any report by dynamically choosing the filters and columns you want. On the server side a query is composed from the parameters the user chooses, including only the columns that are necessary. The data source for the query is a inline table valued function (TVF).

At one point we had trouble with performance after going live, and it could not be explained by changes to the TVF. Even when we reverted the released TVF changes the issues kept happening.

A day or so later I was with a database expert one day long optimising the query (may I plug the excellent free Sentry One tool here?). Eventually we had optimised the query. However, when we put the query back into the TVF performance was down again. The slightest things that changed affected the performance.

<comment><USER60> This is something that affects every RDBMS that exposes SQL. The SQL language describes _what_ and not _how_ , how specifically to retrieve your data is left to the implementation.

The most common causes for this in MySQL (and I expect SQL Server too) is that often your query can be resolved on multiple indexes, and picking which one is a matter of a heuristic. On MySQL changing table statistics can change which index is used, which can drastically affect query performance.

So a common poweruser optimization strategy (which should be used very carefully) is FORCE INDEX, also known as "I know better which index to use". More often than not I've found uses of FORCE INDEX that were more harmful than not.

But an ever more insidious version of this is queries that retrieve cached data being faster. This is something you can generally only observe in production because what's in cache is a matter of _other_ traffic on the server.

So you can easily get cases where something looks much worse under EXPLAIN, but is faster. E.g. it can be faster to execute a "worse" query with no indexes than one with, if the one with no indexes happens to need data that's already in memory v.s. sitting on disk.

</comment></comment><comment> d--b Of course they don't start with SELECT, which is also why SQL is a terrible language.

When you type the fields you want to select, there is zero context as to what those fields apply to, meaning that there is zero contextual help that you could get from know the table and group by ahead of typing select.

</comment><comment><USER61> Relational database queries are supposed to be _declarative_. As a user, you're not supposed to think about the mechanics of execution because the database system is supposed to be able to decide how to execute your query using whatever magic it wants, as long as it satisfies the contract that it gives you the right answer.

It's absolutely useful as a debugging tool to build up some semantic understanding of what the query means, and I encourage every database user to learn to use EXPLAIN, but relying on a mental execution model is borderline dangerous.

<comment><USER62> The author makes it crystal clear that she is not advocating this as a mental model for the execution of the query:

 _Database engines don't actually literally run queries in this order because they implement a bunch of optimizations to make queries run faster – we'll get to that a little later in the post._

 _So:_

 _\- you can use this diagram when you just want to understand which queries are valid and how to reason about what results of a given query will be_

 _\- you shouldn't use this diagram to reason about query performance or anything involving indexes, that's a much more complicated thing with a lot more variables_

She claims this is a useful tool to understand the denotational semantics of the query and which kinds of queries are allowed vs. not allowed—and she's absolutely right.

</comment></comment><comment><USER42> I'm confused, this doesn't seem right. This article, and several of the comments here, suggest that you cannot reference things calculated during SELECT in the HAVING field. But you can.

As a quick demo, pick your favorite table and run:

        SELECT 2+2 as num FROM <table> HAVING num > 3;

this will return as many 4s as there are rows in the table

        SELECT 2+2 as num FROM <table> HAVING num > 4;

this will return 0 rows.

<comment><USER63> I was thinking the same thing. HAVING must be after SELECT. It doesn't really make sense otherwise.

<comment><USER41> Long story short, relying on HAVING to run after SELECT is not a standard SQL behavior it is dependent on the implementation and what the optimizer thinks is best (more discussion below: [https://news.ycombinator.com/item?id=21153870](https://news.ycombinator.com/item?id=21153870)).

The diagram in the OP is a pretty good general/semantic understanding of SQL execution order for writing queries.

</comment></comment></comment><comment><USER64> Elixir's ORM, Ecto, appears to be a lot like LINQ. You write pseudo-SQL queries starting with from. E.g.

      from u in User, where: u.id = 1, select: u.name

</comment><comment><USER65> In my undergrad class, I was thought that the order is "FWGHOS" (pronounced, "fwog hose"), i.e., FROM, WHERE, GROUP BY, HAVING, ORDER BY, SELECT. (LIMIT was omitted from this.)

This acronym has "ORDER BY" happen before "SELECT", but this article have them the other way around. Does this difference ever matter?

<comment><USER66> You don't have to include the orderby field in the result set so I'd say O is before S.

</comment></comment><comment><USER67> Yes, this is particularly annoying for autocompleting column names when writing SELECT (and DELETE)

with INSERT and UPDATE the user provides a table as context for autocompletion of the column list.

There's been a billion revisions of ANSI SQL and they've never provided alternate ordering options. Who cares about users?

</comment><comment><USER68> "SQL queries don't start [optimizing] with SELECT"

The title is missing a word. Interestingly, part of the industry is moving towards databases that optimize themselves (ex Snowflake & Oracle Autonomous Database), plus projects that do it for you (Apache Calcite).

<comment> munk-a With a bit of an exception for the era where we were all hard wiring indexes in MySQL using hints... that's what databases should be doing. DB interactions are supposed to be done using a purely declarative language - postgres has stuck by this the strongest and has been able to make the biggest optimizations in (IMO) a large part due to how little of the internals they've exposed. With pg12 they're making the optimization fences in WITH clauses an accepted give on this point and the discussion on whether to do this or not went back and forth quite a bit.

</comment></comment><comment><USER69> I came to this realization by accident shortly after using various ORMs and database mapping tools.

Being able to break down and compose a query in your own defined order while leveraging a library to transform it into a valid query is quite nice for that way of thinking.

</comment><comment><USER70> so this depends on the database engine and while in general it may follow a pattern there are no guarantees.

To dig deeper: [https://en.wikipedia.org/wiki/Query_plan](https://en.wikipedia.org/wiki/Query_plan) [https://www.khanacademy.org/computing/computer- programming/s...](https://www.khanacademy.org/computing/computer- programming/sql/relational-queries-in-sql/a/more-efficient-sql-with-query- planning-and-optimization)

so, SQL is not about how you're going to get the results it's about what results you want.

</comment><comment><USER71> For bonus confusion points, DISTINCT happens after SELECT and before ORDER BY (and DISTINCT affects the usage rules for ORDER BY). Personally keep a printed copy of the actual logical order of operations, it comes in handy.

</comment><comment><USER72> SQL is the most WTF notation/language I've ever seen... How the hell did someone _start from the beauty of relational algebra and end up with the this misordered confusing and verbose abomination that we 've all standardized upon?!_

...even Mongo's JSON-based query language has more elegance to it. SQL seems _designed on purpose_ to be annoying to write, hard to read, and never look like anything, not the math logic, not any query operations that could ever be executed. I may be superficially similar to English, but English is horrible, why would you model a notation after that?!

Everytime I see someone yelling that Haskell or Lisp syntax is weird and unintuitive I think they need to have their face bashed into a printout of a complex SQL query!

<comment><USER73> I suspect you're asking more figuratively, but I saw this PDF from Stonebraker on the developer of databases and query languages that literally answers your question[0].

I've always done data heavy work, but as a recently hired data engineer, I'm really diving deeply into this layer that previously I had taken for granted. In doing so, I find SQL highly expressive and beautiful for data work; much moreso than Python, my other primary language.

Which languages do you feel manipulate data beautifully?

[0] - [https://people.cs.umass.edu/~yanlei/courses/CS691LL-f06/pape...](https://people.cs.umass.edu/~yanlei/courses/CS691LL-f06/papers/SH05.pdf)

<comment><USER72> They all suck. C#'s Linq seems cool but I don't live in that ecosystem. Also Cypher fro graph DBs or better still Gremlin are nice and more elegant.

But I'd just want to write code like:

        (employees * addresses)[employee.name, address.city.name]
        | filter{address.city.name = "London"}

...that would match rel algebra notation nicely, and extend to complex cases more like:

        ( employees e *{e.id = a.employee_id} addresses a )
        | filter{a.city.name = "London"}
        | [e.name, a.city.name]

...you can replace operators with words of course. Or you could represent this as a JSON structure, even better imo. But the point would be to have a notation highlighting the idea of a "product", of restricting and specializing that product or specifying how it's made, and of indexing into its fields. The way I see it in my mind is like taking "a (maybe generalized) cartesian product" of different things, then filtering this, then zooming on each dot/point/object and filtering its fields etc. And obviously focusing on piping/chaining stuff.

Maybe the notation I suggest is not a good one, but I'd care more about making the concepts obvious and readable and composable.

</comment></comment></comment><comment><USER74> I have long wondered why we can write "ORDER BY 1" (meaning to order by the values in the first column), but it's illegal to say "GROUP BY 1". This article shows why that is.

<comment><USER75> `group by 1` is actually allowed in several SQL implementations, and there's no reason it can't be -- the same as with column aliases the db engine can just rewrite

      select name, count(*) from table group by 1

as

      select name, count(*) from table group by name

before executing the query

<comment><USER76> I will never forget Percona telling us

      ORDER BY NULL

would defeat something MySQL was getting wrong in a query that already wasn't ordered by anything. A coworker put it as "waving a dead chicken that doesn't even exist".

</comment></comment></comment><comment><USER77> My SQL queries generally start with _WITH_.

Or they did when I was using Oracle.

<comment><USER78> To be honest I don't think the article highlights very well where this applies. I am a SQL Developer with SQL Server right now and in the past using Teradata I vaguely remember an aliased column could be referenced in the where clause if you didn't use the AS keyword.

</comment></comment><comment><USER79> This totally makes sense, as from a cognitive perspective the table you will extract information is the first place you take a look

</comment><comment><USER80> I teach a first year introduction to sql course and this is _exactly_ how we tell our students to construct their queries.

</comment><comment><USER81> Fuck this opacity. When will a database add seamless translation of Pandas to SQL? It is a thousand times the better syntax.

<comment><USER82> Like spark has? personally I found it just confusing. Why would I need a "no sql" syntax, when sql has such a perfect syntax for what it does?

I generally dislike having multiple ways to achieve the same end result.

</comment></comment><comment><USER83> Interesting stuff. One of those things you don't really think about, but when it's explained, it seems intuitive.

</comment><comment><USER84> My database professor in university always used to say "the FROM, not the SELECT, is the most important".

</comment><comment><USER85> Developers these days truly don't know SQL. This blog post getting 500+ points on HN is a proof.

<comment><USER12> One blog post getting 500+ points is about as much "proof" that developers don't know sql as a comment that cites that as evidence is proof that HN users don't understand statistics....

</comment></comment><comment><USER86> Of course not, they start with WITH! Preferably 8 withs that reference each other.

</comment><comment><USER87> Funny. Iirc, the ejb1 query language was like "from xxx". Not entirely sure though

<comment><USER87> Oh wait I think it was hql from hibernate

</comment></comment><comment><USER88> Is this specific to Microsoft SQL server or is it the same for every database?

<comment><USER89> Every database. It's because of logical order of execution, as explained in article. Eg. you cannot use `having` before `where` even if syntax of SQL is allowing you to do so.

</comment></comment><comment><USER90> If you use SQL server you can inspect the query plan, very useful.

</comment><comment><USER91> I wish SQL would die as a query language. This is one of the reasons why, writing a query in the syntactic order is counter to how you should reason about getting and shaping your data.

</comment><comment><USER92> Well, processing doesn't but the beauty of the language is that it starts with what the user wants as the output and the details of how it is pulled follows later.

</comment><comment><USER93> That explains linq syntax.

</comment><comment><USER94> No, no, that's wrong

</comment><comment><USER95> Qualify ?

</comment><comment><USER15> Title is misleading as far as I can tell. The author was just surprised to realize that the syntax for SQL queries did not mirror the execution order of the various elements of the query.

It is a bit of a "well, duh" thing, but I've had my fair share of those with SQL through the years so I won't hold it against the author.

One of my more recent random discoveries was that I could join a subquery, ie

       select x.a, y.b, y.c
       from tableX x
       join (
         select id, sum(b) as b, count(b) as c
         from tableY group by id
       ) as y on y.id = x.id

Again nothing special, just hadn't had the need for it before so didn't even think about the possibility.

<comment><USER35> Everywhere you can have a table expression, you can replace it with a subquery.

<comment><USER96> Indeed one can think of a table expression as the trivial subquery

        SELECT * FROM table

…well, modulo the fact that in a concrete sense that substitution would lead to infinite recursion!

</comment></comment></comment><comment><USER97> I thought this was obvious? (Serious, not snark)

You start explaining what you need and work backwards, on the other end, they work in reverse, because that's how it's stored.

Conceptually, it's like piping in bash, "find | grep | cut". Start with finding the files(tables), grep for the row data (where), cut the fields you want returned (select).

</comment><comment><USER98>
      drop schema if exists *

Doesn't start with select; you never have to write sql again; you're probably fired

<comment><USER99> I did this, on a very very large set of DBs.The boss moved me to the backup team.

<comment><USER98> I didn't drop a schema, but I did, um, accidentally get over aggressive with a merge-purge duplicate process. By which I mean that I merged every single record, all of them, into a single record.

I was very fortunate, we had backups and restoring went smoothly, and my boss very calmly asked me one thing: "did you learn from this?" I assured him that I had.

</comment></comment></comment><comment><USER100> _You can even think about the joins "imperatively"._

JOINs _are_ imperative.

<comment><USER101> How would you describe the joining of two tables more declaratively than how SQL does it?

<comment><USER23> Perhaps a "fake table" (e.g. a view) that is the result of two tables being joined but presents itself as a normal table with the expected columns? That would be a very declarative way of querying joined tables, but yeah, you'd still have to create the views or have some means of declaring the appropriate relationships between tables. ORMs sort of let you do this, like in Django where you declare that a User has many Permissions and the ORM knows how to generate that JOIN query for you.

<comment><USER102> Something like SQL's NATURAL JOIN? Essentially a relational "AND" [https://en.wikipedia.org/wiki/Join_(SQL)#Natural_join](https://en.wikipedia.org/wiki/Join_\(SQL\)#Natural_join)</comment></comment></comment></comment>


Exposure to Air Pollution in China Tied to Increase in Coronary Calcium - <AUTHOR> https://www.tctmd.com/news/exposure-air-pollution-china-tied-increase-coronary-calcium <comment><AUTHOR> [http://maps.who.int/airpollution/](http://maps.who.int/airpollution/)</comment>


ICE has access to use facial recognition on Maryland driver's license records - <AUTHOR> https://www.baltimoresun.com/politics/bs-md-pol-ice-mva-bill-20200227-rsgqqajmwne4hollsz4svgpa6m-story.html <comment><USER2> > Unfortunately, our website is currently unavailable in most European > countries. We are engaged on the issue and committed to looking at options > that support our full range of digital offerings to the EU market. We > continue to identify technical compliance solutions that will provide all > readers with our award-winning journalism.

</comment><comment><USER3> Everyone be sure to favorite this and throw it in the face of anyone who says "What's the harm of government having your data"</comment>


Tabs versus Spaces - <AUTHOR> http://www.jwz.org/doc/tabs-vs-spaces.html <comment><USER2> Always, always with the tabs, never spaces.

The main reason is that on my widescreen monitor, indents of 4 characters or less are hard to visually parse in dense areas of code.

If the original author of this code (the actual code I am setting fire to myself over right now) had used tabs instead, then I could set my editor to display indents as 8 or 12 spaces instead, and he can still use 2 spaces if he wants. This is strictly a display issue - he can use 2 and I can use 8, and the file is not different between our two computers.

With spaces, I'm stuck with whatever number of spaces he chose to use for indentation instead of being able to make the code easy to read on my machine.

We're not using 40-column terminals anymore folks. It's all right to uses tabs for indentation.

<comment><USER3> How about simply setting your editor to convert spaces to tabs and save tabs as spaces? Problem fixed right there.

This post is brilliant exactly because it separates holy war from technical issue. Your problem sounds like a technical issue.

<comment><USER2> That's just throwing complexity (IDE or SCM has to support that functionality) at a problem that doesn't need to be there in the first place (just use tabs instead of spaces).

Even so, I would still need to tell my editor how many spaces to convert to a single tab, and use the same number to convert tabs to spaces when I save or commit. God help us all if someone else forgets to do that too...</comment></comment></comment>


The number one predictor of software bugs is organizational complexity: study - <AUTHOR> https://augustl.com/blog/2019/microsoft_predicts_software_bugs/ <comment><USER2> > The distance to decision makers and the number of developers working on a > project is clearly and unambiguously the issue that is the best predictor of > future problems with a code base.

</comment><comment><USER3> Could a mod please update the title to make it less click-bait?

"According to Microsoft, the number one predictor of software bugs is" sounds like all those side/bottom extra articles.

<comment><USER4> I took a crack at it, but the article has been flagged at this point so it's a bit moot.

</comment></comment><comment><USER5> Take Conway's Law into account and it's maybe not so surprising.

[https://en.wikipedia.org/wiki/Conway's_law](https://en.wikipedia.org/wiki/Conway's_law)

<comment><USER6> The original paper on which this blog post is based is actually an explicit experimental test of Conway's law (and it's also a paper which happens to have found significant validity for Conway's law in the data they analyzed).

</comment></comment><comment><USER7> > Another shocking discovery for me personally, is that the only one that I've > actually used myself - code coverage - has the lowest recall. In other > words, almost all the issues it predicted turned out to not be real issues.

sounds like survivorship bias to me

<comment><USER5> I'd be willing to bet that it was sloppy coverage and those false positives were along component/team boundaries.

</comment></comment><comment><USER8> The original tech report is from 2008. Anything newer?

<comment><USER9> Here is Google's take on bug prediction from a while back: [https://google- engtools.blogspot.com/2011/12/bug-prediction-...](https://google- engtools.blogspot.com/2011/12/bug-prediction-at-google.html?m=1)

</comment></comment><comment><USER10> clickbait level: buzzfeed</comment>


New and different ways schools innovate with time - <AUTHOR> https://unlockingtime.org/time-strategies-for-schools <comment><USER2> Something I didn't see here is allowing students to earn credit for classes by demonstrating mastery. This is often called _competency-based learning_ , but that term encompasses a wide variety of approaches. The larger point of this approach is that students earn credit when they've demonstrated that they have learned a certain body of knowledge, and developed skills to a certain level of proficiency.

This can be as simple as testing out of some classes, and can involve more holistic portfolio-based assessment practices.

The school I most recently taught at implemented an approach along these lines. It was really interesting that it didn't actually change much for a lot of students, but the option to go more at your own pace relaxed almost everyone in a really healthy way. Students were less anxious, but got way more done and enjoyed their learning much more than they had been previously.

</comment><comment><USER3> We had a 7-period system at my high school, but rather than shortening classes, or extending the length of the day, we continued to have 6-periods a day and then had a floating period that occurred at a different time each day. It was announced over the intercom so there wasn't much confusion about what class you were going to. For example:

      Mon 1 2 3 4 5 6
      Tue 7 2 3 4 5 6
      Wed 1 7 3 4 5 6
      Thu 1 2 7 4 5 6
      Fri 1 2 3 7 5 6
      Mon 1 2 3 4 7 6
      Tue 1 2 3 4 5 7
      Repeat

I loved it. Keeping classes the full duration was more efficient (especially for classes with fixed setup/cleanup time, like band or science labs). Since the floating period was always an elective, it felt you were getting a "break" when it landed on a class you didn't like.

But most importantly it gave you an extra elective. Over the years, as requirements have continued to increase the number of electives that students can take have declined significantly. I think this is a huge loss. We need to be doing more to help students figure out what they want to do when they graduate, and providing exposure to things beyond core curriculum is an essential part of that.

</comment><comment><USER4> When I was in high school we experimented with block scheduling, which was a fad at the time. We only had three classes a day, for two hours each, and then we changed even or odd each day.

The science classes loved it, because we could do longer more involved experiments that would take more than the usual 50 minutes, and the students liked it because it meant for example only doing math homework every other night.

It was extra awesome for me in senior year. I had a normal second period class, but my 4th period was teaching at the local elementary school and my 6th period was Academic decathlon, which became "at home study hall" in the Spring after we were eliminated from the competition. So in spring of my senior year, I'd go to school for two hours, hang out at the elementary school for two hours teaching kids, which was super fun and didn't have any homework or stress, and then go home at lunch time and be done. On "even" weeks, it meant that I did that three times in a week, and was off by noon on Fridays. It was a pretty sweet deal.

I also like the block schedule because I liked only dealing with half as many classes for twice as long. I felt the same in college -- I loved doing summer school because we'd go twice as long each day for only 8 weeks instead of 16.

</comment><comment><USER5> Interesting. But the recommendation to limit the number of AP classes a student may take is unrealistic: with enough AP credits a student can get through college in 3.5 or even 3 years. This saves lots of tuition, and potentially relieves students' debt burdens.

If tuition were free/cheap this situation would be different.

<comment><USER6> Yes, but at what cost? Students these days have an enormous amount of stress. There may be reasons to limit the number of AP courses they are "allowed" to take so that they can maintain a healthy balance in life.

<comment><USER7> It's an awkward discussion because really, it's on a per-student basis, based on

skill (if most AP courses are easy...),

background (if I already get tutored in half my AP courses, before even starting them..),

home-life (if I'm already anti-social/introverted, being stressed by AP courses is preferable than being stressed by forced social activities),

hobbies/knowledge (if I have programming as a hobby, then I probably wouldn't count think of AP programming course as particularly stressful, or even difficult; that AP statistics course on the other hand...),

quality of the AP course itself (AP stats might be harder for _everyone_ than AP english, meaning AP english is overvalued (or AP stats undervalued) against the limit),

etc, so it's to claim there's really an appropriate "limit". And even if you find that there is an easy limit, and simply override the special cases, you have the issue/philosophy that the limit might have been increased had you applied that pressure.

Really, its the same as college; you're free to take as many "difficult" (or perhaps, interesting) courses as you'd like, and you'll be better off in the long run for having done more (lower students/teacher ratio, better teachers, faster/higher quality learning, more interesting/specific subjects, etc)

The main difference is that its the parent who has the responsibility pre- college, whereas its the student post-college. To determine what's appropriate, and to judge what can be handled.

Perhaps better than an arbitrary limit is greater fluidity in transitioning - eg make it easy to drop from AP to normal courses within a semester, when it's determined the workload is too much. Or better metrics for evaluating workload as the problem, versus other issues. Or maybe even target the parents for improvement (if they're failing to detect and react to issue).

That is, the ideal solution would really be that the system can dynamically re-arrange itself as necessary, based on the input of the student/teacher/parent, instead of hardcoding arbitrary limitations.

And its not an area that really deserves a simple, good-enough solution, because as the GP said, the decision can be monetarily significant. And as I've claimed, the decision can also have significant impact on the student's future education. It's perhaps too important to impose a limit for "child's sanity's sake", and be done with matter.</comment></comment></comment>


Dear startups, stop being afraid to show a phone number on your website - <AUTHOR> http://blog.aircall.io/post/79448368657/dear-startups-stop-being-afraid-to-show-a-phone-number

<comment><USER2> A lot of the reason why a phone number isn't used is because of the unpredictable and immediate nature that comes with that channel of communication. Not every company has enough people or time to be constantly distracted by phone calls. That plus society has taught us that a ringing phone must be answered if you're around or it is considered rude, whereas an email can be left for a while, digested, and replied to at a later point in time without being rude. More simply, I can answer many more emails, more accurately than the time it takes to handle an unknown, untriaged phone call that will likely require another call or email to followup the initial conversation anyway.

That being said. For those that need a phone number, this is a nice-looking service! :)

<comment><USER3> A phone call is by definition a conversation. With emails, you need many of them to create a conversation so you will probably not get the shit done with one email. With a phone call at the time you hang up, it's done.

<comment><USER4> In my experience, most support calls are not conversations.

</comment></comment></comment><comment><USER5> Why don't we list our phone numbers?

Because our company doesnt pay engineers 6 figures to answer support calls.

 _edit_ =

but your product looks awesome :)

</comment><comment><USER6> Agree with this on many levels, however:

* Right now (as with many startups) we don't have the bandwidth to take out a 30 minute gap to speak with an interested customer - even if we wanted to! We just physically don't have enough people and can't hire fast enough already

* The cost of senior developers doesn't work for support or sales calls. And we don't want to have junior developers on the team this early because of the management overhead

* Talking on the phone _effectively_ and _efficiently_ requires a whole different skillset to technical, and it comes with experience and training

* The temptation is to outsource call handling in the early days, but from first hand experience, I know how easily these sub-par 'virtual assistants' can kill your brand as an educated customer will quickly see through the veil of BS that these sort of people put up. This one is a total no-no for tech startups. If there was a virtual assistant who specifically worked with tech startups, and had great product knowledge across the industry and could speak the language, now THAT I would pay for

* The prices and margins we're talking about don't always make sense for a sales call. How can I justify a 1 hour sales call on a $9 /mo subscription service? Forgetting all customer acquisition costs, hosting costs etc. I'd have to keep that user for 10 months just to break even on that very first phone call

I personally think the different business model of SaaS means traditional sales methods like phone calls where the customer decides the time of the call just don't work. One-to-many methods like webinars and screencasts, and pre- scheduled Skype calls for BIG leads, are the only things that make sense.

For support via phone, that's something which we CAN accommodate but as an upsell incentive. For example, on our $299+ plan, yeah sure you get a private support number, because I can justify the $90 per hour it costs for that engineer to speak with you.

Sorry to disagree on as many points as I'd agree on. However, I'd STRONGLY suggest looking into the "Tech Startup Friendly Call Answering" service with your Beta users as a possible pivot. An end-to-end solution, rather than a sexy PBX solution, would catapult the relevance of this to startups in my opinion and puts you as a market leader rather than in a market with 10+ strong competitiors

</comment><comment><USER7> Says the business in the business of business calls.

</comment><comment><USER8> You know what I miss for instant support? IRC. It combines with instant gratification of phone calls with the crowd-support of forums or community support portals.

IRC obviously isn't mainstream and lacks features that some other systems have, but whenever I'm working on something and want a quick question answered that I can't get via google, I look for an IRC channel first.

<comment><USER9> A lot of services(slack,hipchat) are nowadays allowing guest-joins; basically it's like IRC, but with only channels(public , private) for your team/customers.

</comment></comment><comment><USER10> I saw AirCall popup ProductHunt a few days ago. Any chance I could ask for an early-invite? We're using a big of a hacked-together Twilio + Google Voice solution right now to route calls to the right employee at the moment.

<comment><USER9> [https://twitter.com/OlivierPailhes](https://twitter.com/OlivierPailhes) is the CEO and he's super nice, get in touch with him and he'll give you early access very likely!

<comment><USER11> kind of interesting you posted his twitter instead of his phone number.

<comment><USER12> Reach me out on +1 646 776 5948 (to be honest you may reach me or cascade to our CTO or any available member of team - but all will be happy to talk to you)

</comment></comment></comment></comment><comment><USER13> i set up a google voice # for sales and support inquiries, which gets routed to my cell phone.

if anyone cares enough to want to speak with a company rep, as the CEO i'm more than happy to be that person. in fact i should be, for as long as i possibly can. you need to know your customers, and how else can you effectively train your sales and support reps?

anecdotally: Adora Cheung learned the cleaning biz as a cleaner. after raising $30M, she posed as a secret cleaner on Thanksgiving as a way of expressing gratitude. literally got her hands dirty. ;>

</comment><comment><USER14> The profile of the phone in the AirCall icon looks really unergonomic and disturbing to me. It's like the illustrator has never held an old-school phone before

</comment><comment><USER15> Way ahead of you.

[http://www.fogbeam.com/contact.html](http://www.fogbeam.com/contact.html)

</comment><comment><USER16> I know it is still beta but did not see these information on the main site. Which 40 countries? Estimated pricing?

<comment><USER12> we cover most OECD countries, South & Latam americas, Pacific area and some in Africa/middle east. For details and pricing, the best is to register to our beta on [http://aircall.io](http://aircall.io). I'll get you onboard and give you more details when you've seen our product!

</comment></comment><comment><USER17> It's cool that they have a phone number on their website. But how about pricing and contact email as well?

<comment><USER12> register to our beta to get in touch with me or mail me firstname.lastname@example.com. We're still finetuning our pricing but i'll give you details when you're on board :-)

</comment></comment><comment><USER18> awesome build</comment>


Do respond to every email - <AUTHOR> http://jessepollak.me/2012/06/21/do-respond-to-every-email/

<comment><USER2> Definitely agree.

I think it's the little things like that that can make a huge difference. Even if it's just a short, quick reply like you mention, it is still very satisfying to at least be acknowledged by someone!

Also, on a slightly similar note, I remember reading that the guys at Pinterest sent out thousands of emails to the initial users of their site. Now, I'm not saying that that was the sole reason for Pinterest's massive success, but it definitely didn't hurt 'em!</comment>


Enterprise Cybersecurity Study Guide - <AUTHOR> https://itbook.store/books/9781484232576 <comment><USER2> Every submit for this site is just a daily ad for Amazon affiliate linked books (tag=itbook.store-20).

There is no "store". Even the descriptions are ripped from the Amazon pages.</comment>


There will be code - <AUTHOR> http://blog.objectmentor.com/articles/2008/08/28/there-will-be-code <comment><USER2> Early stage computer science research is not an area I'm familiar with, but I would be curious to know where the current research is headed in terms of radically rethinking the way we think about and represent code.

That said as an admittedly very naive observer, it would seem to me that it's very difficult to get away from the basic building blocks we've come to know, not only from a social standpoint (i.e. several generations of programmers think in these terms now). But also because the hardware hasn't changed fundamentally. While capacity and compute speed have gone up, today's computers still work the same way at their core as their predecessors. The math they use is the same, the basic components are the same (until memristors hit the scene I guess). The operations microprocessors can carry out and the way they need to access data forces you to implement the core of a programming language a certain way. Once that happens, then all the abstractions on top of that start to inherit many of those semantics. When you get right down to it, processors shove binary data around and permute it based on a set of well- defined mathematical principles. Until they start doing things differently, I feel like we're "stuck" with those "if" statements (or their logical equivalents) and all their cousins for a while.

</comment><comment><USER3> I had to look up MDA just to see what it is. It sounds like one of the technologies people making "enterprise" software would use. It does not sound like it would actually make software easier to create. That said, I do think that visual programming languages have merit, but they require the same sort of logical thought process as any other sort of programming.

What the article seems to be arguing against is that some magical technology will come along and make it so that programmers aren't needed. I don't think anything short of human-level AI will do that. COBOL was supposed to do that.

</comment><comment><USER4> Remember all those graphical workflow generators such as <http://www.activevos.com/community-open-source.php> and [http://www.oracle.com/technology/products/integration/workfl...](http://www.oracle.com/technology/products/integration/workflow/workflow_fov.html) that were supposed to replace the need for coders? I don't have a problem with EAI. I think it's great. I just don't agree with the overselling of what EAI can do.

</comment><comment><USER5> The products we build are quite different. Someone invented GUIs to take up developer's time. Instead of simple procedural programs that start at the top and run to the bottom (with some loops and conditions) we have event driven, multi-window, complex applications.</comment>


Functional Programming in JavaScript? More Like Dysfunctional - <AUTHOR> http://ilikekillnerds.com/2016/09/functional-programming-javascript-like-dysfunctional/ <comment><USER2> nah, you're the lazy one</comment>


Gwern answers 'Ask gwern: Who are you?' - <AUTHOR> https://pastee.org/bebat <comment><USER2> It's sad that our personal info can be used with such malice in this day and age when we're supposed to celebrate the accessibility and transparency of information. That people still cannot be freely outspoken under their real identities because some spiteful person who disagrees with them might call up their bosses to try to get them fired (or worse). When people on the Internet cross the line and make things personal because they feel a sense of power in hiding behind their anonymous computer screen and having someone else's vulnerable and real identity in their hands.

Gwern, thanks for the humble reply and all your writings. Maybe one day we will be able to celebrate your talent as part of your identity.

<comment><USER3> _"people still cannot be freely outspoken under their real identities"_

Sure they can, and millions of us are. If people couldn't be, Facebook wouldn't exist.

 _"When people on the Internet cross the line"_

That's not a given. I never hide my identity and it has only worked out positive for me. There are assholes online and offline, I sure as hell won't let any of them limit what I say or do.

<comment><USER4> People on facebook barely ever have interesting conversation, exactly because of "what are your friends gonna think?".

Part of the reason HN is successful is pseudonymity.

<comment><USER5> Many of the most interesting HNers have accounts strongly tied to real world identities.

<comment><USER6> But isn't it great that we can choose?

</comment></comment></comment></comment></comment><comment><USER7> The donations have kept coming in, as have Bitcoin donations. If you're one of the ones who sent me bitcoin, why don't you ring me up at firstname.lastname@example.com - what did you like so much that you were willing to donate?

<comment><USER8> You are asking, gwern, a question about what people like about your writings. My answer, I hope, will be taken as a friendly suggestion about how to make your writings even better and more likeable. One area of research interest you and I share is the nature of human intelligence and what might be possible to do to improve human intelligence at the individual level. Having read extensively about this issue since 1993 (arguably since 1989, when I began extensive research on early childhood education), I been collecting bibliographies of the best sources on this topic for a long time.

When I started editing Wikipedia as a registered Wikipedian a few years ago, I soon discovered that many articles there on related topics are compiled in complete ignorance of the best sources on those topics. To do something about that, I have been compiling a bibliography in Wikipedia user space on IQ and human intelligence,

[http://en.wikipedia.org/wiki/User:WeijiBaikeBianji/Intellige...](http://en.wikipedia.org/wiki/User:WeijiBaikeBianji/IntelligenceCitations)

and I encourage you to look there for recommendations of up-to-date reliable secondary sources. (I am updating that bibliography as I do more research, so there may be new entries added there fairly soon.) It would be interesting to see what new paths your writings will take after more digestion of the previous literature on our shared topic of interest.

Another friendly comment is that many of your readers are glad to see your statistical approach to some of the issues you write about. I too like well writings that apply statistical analysis to data once they are gathered. I like even better writings that apply statistics to examine whether data are adequate to the task of answering the question posed by a researcher, as statistics is the science of data,

<http://statland.org/MyPapers/MAAFIXED.PDF>

and what I have found out by participating in the University of Minnesota's journal club in behavior genetics with leading researchers on that subject is that many findings on human behavior now need to be reexamined as statistically astute psychology researchers reexamine the quality of data in old studies. Being aware of issues of validity of inference

<http://www.escholarship.org/uc/item/6hb3k0nz>

and how researchers can fool themselves

<http://calteches.library.caltech.edu/51/2/CargoCult.pdf>

is even more important than applying statistical manipulations to a data set after the data set is gathered. In their best use, statistics can help show which data sets need to be reexamined to make sure that a study inference is really warranted by data.

<http://www.p-curve.com/>

<comment><USER7> > and I encourage you to look there for recommendations of up-to-date reliable > secondary sources. (I am updating that bibliography as I do more research, > so there may be new entries added there fairly soon.) It would be > interesting to see what new paths your writings will take after more > digestion of the previous literature on our shared topic of interest.

I already know of that page, actually. I have been compiling citations for a while on 3 topics I'd like to write more about (the relationship of IQ & Big Five Conscientiousness, practical real-world correlates of IQ, and the net economic value of IQ points on the margin) and found a link to it. I don't think any of the entries proved helpful because I'm looking at such niche topics that I generally have to go to the original papers just to start.

> I like even better writings that apply statistics to examine whether data > are adequate to the task of answering the question posed by a researcher, as > statistics is the science of data,

A topic of considerably interest to myself, as well: I compile my own thoughts in [http://www.gwern.net/DNB%20FAQ#flaws-in-mainstream- science-a...](http://www.gwern.net/DNB%20FAQ#flaws-in-mainstream-science-and- psychology) but I'll take a look at your links.

> many findings on human behavior now need to be reexamined as statistically > astute psychology researchers reexamine the quality of data in old studies.

True enough, but there's a lot of limits to this sort of thing: GIGO. For many psych studies, I think the same thing I do in arguments about the genetics of IQ: "why are we _still_ arguing over this? there is no more meat on these bones. We _know_ how to resolve these questions, _we have the technology_ (to either replicate the experiments or look directly at the genetics), so why can't we just _do_ it‽"

</comment></comment></comment><comment><AUTHOR> gwern himself answered it in the original thread, but it was marked dead (probably because of linking to certain sites set off HN's spam filters).

<comment><USER9> Someone fixed that; here it is:

<https://news.ycombinator.com/item?id=5659278>

</comment></comment><comment><USER10> I met Gwern once or twice at a Less Wrong meetup. I don't think he particularly stood out from the other folks there.

<comment><USER7> To be fair, the one OB-NYC meetup I attended wasn't that great so I didn't have much to say. (Being hearing-impaired hardly helps either.)

<comment><USER10> It wasn't supposed to be a negative statement. ;) Though I see how it could be taken that way.

FWIW you did seem to have it a bit more together than some of the folks there. And you are clearly more productive than a lot of Less Wrongers. All I meant in my last comment was that you didn't seem like an international figure of mystery or anything.

<comment><USER11> Good thing you clarified that, because the only way I could see to take the previous comment was negative (just a heads up).

</comment></comment></comment></comment><comment><USER12> Can someone explain what this is about?

</comment><comment><USER13> For those not in the know & looking for context:

Gwern is a popular analyst of the Silk Road, the infamous anonymous marketplace on the Tor network.

<http://www.gwern.net/Silk%20Road>

<http://en.wikipedia.org/wiki/Silk_Road_(marketplace)>

</comment><comment><USER14> who is gwern?

<comment><USER15> Someone who writes interesting things (often with a lot of statistical analysis) on <http://www.gwern.net> and Less Wrong.

<comment><USER16> I have visited Gwern's site a number of times, mainly regarding the anime "Death Note" discussions. I wish I was a few more years further along in my business plan and had the means to offer a consulting gig to him or her. Gwern would keep us honest and weird and brilliant.

</comment></comment></comment><comment><USER17> A DNS WHOIS lookup reports who registered gwern.net. Isn't that who he is?

<comment><USER18> I would be shocked if most WHOIS data was legitimate. I myself have made up various people to play host to my domains.

<comment><USER19> For most popular TLDs, that is a breach of terms and may get your domain name terminated at any point. It seems like it would be better to just use the registrar's privacy service for this.

<comment><USER18> I realise, but the "privacy" services tend give up people's details upon casual request. It makes them absolutely worthless.

</comment></comment></comment></comment><comment><USER20> I really really hope that discussion about revenue is not seen as grounds to cancel those accounts.

I understand that Google is very touchy about people talking about ad revenue.

<comment><USER7> I originally provided a CSV export of my AdSense history but then it was pointed out to me by an acquaintance that the ToS strictly forbids it; it does permit talking about 'aggregates', IIRC, so hopefully there won't be any problems.

(Another acquaintance then pointed out to me that I am apparently a Famous Person now and lots of Googlers read Hacker News, so I always have the option of getting real customer service that way... which doesn't make me too happy - you shouldn't have to be that rare geek who frequents one particular niche site to get problems with Google fixed!)

</comment></comment><comment><USER21> How did gwern gain fame around here?

<comment><USER22> He (or she?) has had a couple essays rise to the top of HN. In my memory, one this week about predicting Google product shutdowns, and one a while back about determining whether a leaked film script was legitimate.

<comment><USER7> I believe besides those two, my Silk Road essay ( <http://www.gwern.net/Silk%20Road> ) hit the front page sometime in the past year.

</comment></comment></comment><comment><USER23> you are... a person somehow associated with singinst that I met with Jasen a while back? Your writing was interesting enough that I noticed your SN after, which is something like a compliment... otherwise, this pastee is 404ing for me so...

</comment><comment><USER24> pastee doesn't work here (hk), I guess time out?

</comment><comment> cupcake-unicorn I'm such a Gwern fangirl. Pics or it didn't happen!</comment>


Native Socket.IO and Android - <AUTHOR> http://socket.io/blog/native-socket-io-and-android/

<comment><USER2> I've been using Socket.IO on Android for 6+ months now to do real-time communication with our backend, and it works well for our needs. I was happy to see a well-written Android client come along with Socket.IO v1.0. The namespacing functionality makes it super easy to send different messages to different groups of clients.

</comment><comment><USER3> This is pretty cool.

On a similar note, anyone know of equivalent options for iOS? I see a few open source implementations, but none that are actively developed. There's SocketRocket, but that's just vanilla WebSockets.

<comment><USER2> There is a similar Socket.IO library for iOS hidden within the FAQ.

[http://socket.io/docs/faq/](http://socket.io/docs/faq/)

</comment></comment><comment><USER4> Wow.

I've just had a heated debate about this at work. I think it's pretty cool, my colleague thinks it's the worst idea ever.

Does this actually work in the real world? What if i'm moving?

<comment><USER5> What are the opposing viewpoints?

</comment></comment><comment><USER6> Since almost all platforms support Websocket, is it necessary to use Socket.io?

<comment><USER7> On top of its transport layer abstraction, socket.io adds various useful features including events, rooms, namespacing, efficient/convenient (de)serialization and network callbacks. I've been using it in websockets-only mode for various projects, because I don't care for slower / less reliable transports but still want the extra features.

</comment></comment><comment><USER8> So its basically SingalR for Android? Seems like a cool idea to me.

<comment><USER9> I don't believe so. I believe SignalR is more synonymous with node's implementation of socket.io. This would be like someone getting SignalR to work natively with an Android client.

</comment></comment><comment><USER10> Grande Guille!</comment>


Doctors discover empty space where part of man's brain should be - <AUTHOR> https://globalnews.ca/news/4080127/air-pocket-skull-stroke/ <comment><USER3> A tension pneumothorax is sort of similar when this happens in the chest - <USER2> suppose this is a tension pneumocranium.</comment>


Heroku Sandy Situation Room - <AUTHOR> https://status.heroku.com/incidents/460

<comment><USER2> I really feel for the Amazon employees working in the us-east data center this week. Not only do they have to worry about the safety of their families, but half the internet will be watching them if anything goes down. I can't even imagine all the contingencies they have to prepare for (e.g. engineer gets paged, but has no power at home, or can't drive in due to flooded streets). Best of luck to them.

</comment><comment><USER3> I have pressureNET running on EC2 in US-East. It's collecting data about Sandy from a bunch of Android users in the region, and I only realized a few hours ago that...it's gonna get hit by Sandy. I'm not sure what to do.

The Android app has a hardcoded server URL to the DNS of my instance. If the server goes down, and I prepare a backup, all my users will still be sending to the old, dead server (assuming Sandy takes out AWS in that region). So I can also update the app and give it a new server url. But I'm going to lose many hours of valuable hurricane data as users take time to get the update, etc.

Does anyone have any thoughts on how I can handle this?

I realize my mistakes and know how to fix them for next time, and my current data is obviously backed up. But for incoming data...am I screwed?

Edit: I have an idea. I'll update the app and give it a backup URL to use only if the main one is non-responsive. Then I'll publish the update and cross my fingers.

<comment><USER4> Edit: Rewrote my entire comment...

The delay on the app side should only be 15-30 minutes. Use a replication database (much like the Postgres follower system on Heroku) to ensure no loss of data and you should be fine.

</comment></comment><comment><USER5> "We recommend customers with production databases (Crane and up) create a follower running in us-west-2 using the --region flag (this is an alpha feature we are exposing ahead of schedule to prepare for this incident)"

Finally! Excited multi-AZ support is coming to Heroku.

<comment><USER6> Regions are comprised of multiple Availability Zones. Heroku has always been running on multiple AZs.

<comment><USER5> Thanks for the clarification. Meant to say regions.

</comment></comment></comment><comment><USER7> Those on EC2 might want to read <http://alestic.com/2010/10/ec2-ami-copy> for their own disaster preparations. (Though ideally you should have been on it before now...)

</comment><comment><USER8> I was hoping <http://blog.linode.com/> would mention risk assessment/strategy on Newark center.

This is a good summary of data centers at risk: [http://readwrite.com/2012/10/29/hurricane-sandy-vs-the- inter...](http://readwrite.com/2012/10/29/hurricane-sandy-vs-the-internet-in- the-path-of-frankenstorm)

<comment><USER9> You were hoping for transparency from Linode? I've been a long time Linode customer (and don't have any plans to change that any time soon), but Linode has never been great about transparency, and that has only gotten worse over the past few years...

</comment></comment><comment><USER10> A few Heroku add-ons have also high availability options. Along with a new add-on status page <http://status.addons.heroku.com/>

RedisToGo - <http://blog.togo.io/status/redistogo-hurricane-preparation/>

MongoHQ - [http://blog.mongohq.com/blog/2012/10/29/monitoring-the- weath...](http://blog.mongohq.com/blog/2012/10/29/monitoring-the-weather- situation-with-hurricane-sandy/)

</comment><comment><USER11> Why aren't there more data centers in the solid craton part of the content far from these inevitable coastal problems? Genuinely curious as to why Minnesota or something is the datacenter capital of the US.

<comment><USER12> The datacenter where most of my servers are is not too far from Philly, but I have 0 worries about it. Why? It was properly designed and maintained from the start.

Not only is the first floor 6 feet above the ground, but it is at the top of a gentle slope that naturally drains all water away to lower areas. The water level locally, would have to be about 20 feet for the first inch of water to push its way through the doors.

There is absolutely NO reason that any datacenter in VA should be having problems, aside from either shoddy facilities management or poor initial choice of the site. Don't let anyone tell you differently.

</comment></comment><comment><USER13> I never thought of that- they don't just have aws availability to worry about, they have the availability of 79 external service providers, totally out of their hands, to worry about.

<comment><USER14> it wouldn't matter as much. if your primary app and workers via Heroku is down (which presumably are the ones using the add-ons) none of the end users are going to notice the add-ons being down.

<comment><USER13> On the other hand, Heroku could do everything in its power to keep its main system up, but the failure of a highly used addon, totally out of their control, could cause nearly as much of a problem for them.

</comment></comment></comment><comment><USER12> We are complimenting companies for not having redundant setups but telling us about it, when they have been claiming all along, that they have redundant setups?

<comment><USER12> It is funny to see the points on the parent comment, "oscillate", going from 2 or 3 up to its current zero.

</comment></comment><comment><USER15> Is US-east the least reliable of all AWS data centres? Arguably, Virginia is more susceptible to natural disasters than Oregon or Northern California (while we wait for that 1 in a 100 year earthquake).

<comment><USER16> I prefer Dallas (Colo4, specifically). They've been incredible. Only one significant outage in 7 years. They're nearly half way between coasts too, so they're a great latency compromise if you're stuck with a single DC.

<comment><USER2> Rackspace also has a big data center in DFW. I only remember one or two outages in the last several years.

</comment></comment></comment><comment><USER17> This great that Heroku is doing this. It's nice to know that your cloud provider is aware of and preparing for disasters like this.

<comment><USER13> Heroku has had enough really high profile failures, due to their reliance on aws in the past that I would expect nothing less. If they haven't learned from amazon's mistakes yet then there is something wrong.</comment></comment>


Tesla now worth half GM's value - <AUTHOR> http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2009/05/22/BUU117O7UC.DTL <comment><USER2> This isn't saying that Tesla is worth much, just that GM is worth next to nothing. At this point, it looks like a foregone conclusion that GM shareholders will be wiped out in a month or two. GM's obligations seem worth more than its assets and its costs (parts, labor, etc.) are greater than its revenues which makes it unlikely they shall ever meet those obligations in the future.

To be honest, I'm surprised GM is worth a whole billion dollars. All of the plans - from the President's plan to award 50% of the company to the treasury, 40% to the UAW, and 10% to creditors to bankruptcy which would see all common shares voided - would see any stake in common stock worth nothing. Are there people who think GM is going to get a scenario where they are able to pay off their creditors, the UAW, and the government in order to avoid wiping out common shareholders?

</comment><comment><USER3> GM's value is zero. The stock price represents a nervous dance between shorts and longs who try to force sqeezes. (And I suppose there are gamblers who are betting that the government will bail them out without a ch 11 style reorg.)

<comment><USER4> If GM's value speculative then Telsa's valuation is completely pulled out of thin air. Just a few months ago Tesla was actually losing money on every car they sold. Now they're asking for government money to stay afloat and promising a 50k sedan for the masses. Let me get this straight... at the moment, they cant build a miata sized roadster with a sparse interior on an existing platform for less than 90k, but in 2 years they're going to have a profitable full-sized sedan to go up against cars like the Lexus GS, BMW 5 and Mercedes E selling for half that?

I love Tesla, but if I had to place my bets, I'd think it more likely that you'll be able to buy a Corvette in 10 years than a Tesla roadster.

<comment><USER5> A value "pulled out of thin air" is still better than "almost certainly zero via bankruptcy". And even if Corvettes rather than Teslas are still on sale 10 years from now, that might not mean any value flows to current GM stockholders.

The most likely discontinuity ahead for GM is a zeroing-out of all current stockholders. For Tesla, there are certain discontinuities -- such as acquisition for technology -- that pay off stockholders even if the nameplate disappears.

</comment></comment></comment><comment><USER6> > "It's sort of amusing," remarked Daimler co-founder, Martin Eberhard.

He's actually the cofounder of Tesla. There's a reason the SF Gate is going out of business:(

<comment><USER7> I'm pretty sure that the SF Chronicle isn't facing bankruptcy because they occasionally make mistakes.

After all, _everyone_ knows that the internet is a 100% factual replacement for newspapers.

<comment><USER6> > I'm pretty sure that the SF Chronicle isn't facing bankruptcy because they > occasionally make mistakes.

Agreed, but shoddy reporting and a lack of fact checking certainly has helped lead it down the path towards bankruptcy.

</comment></comment></comment><comment><USER8> Why do people insist on making these stupid comparisons? It reminds me of how drama-queenish techcrunch was when the markets were free falling. GOOGLE LOSES HALF ITS VALUE!!!! it's a pointless exercise. market cap isn't the be all and end all of a company's value. And the valuation agreed upon by a single investor and a company is even less of an indicator of that company's real value.

<comment><USER9> yeah its like that old idea that Facebook had 16 billion dollar valuation which supposedly made them larger than Ford.

GM's Corvette's Brand Value is probably more than Tesla's actual value.

</comment></comment><comment> aka- GM sold 8.35 million vehicles last year. Tesla less than 200. How surreal.

<comment><USER5> You can't make up a loss on every vehicle through volume, except maybe by being "too big to fail". And even that is unlikely to help the GM stockholders (as opposed to the staff and unions and warrantyholders).

</comment></comment><comment><USER10> How many Tesla cars does America drive (in total?)

That and does anyone know what Tesla's current net profit figures are? I know it's a private company but I'm wondering if anyone has general figures.

</comment><comment><USER11> quick, bury this article! we can't let people know that if giant companies collapse that new companies will compete with new and/or improved products!

If everyone gets wind of this we won't be able to justify massive bailouts anymore...

</comment><comment><USER12> Bad analysis - can't forget $54 billion in debt. Minus $11 billion in cash plus the equity, so enterprise value of GM is $44 billion according to the latest financials.

</comment><comment><USER13> Welcome to the rotten fruits of crony capitalism 2.0. The millionaires who own Tesla got a $350 million loan from the U.S. government this year. Taxpayers only get downside, while a bunch of insiders and now a foreign carmaker capture all the upside.

<http://www.redherring.com/Home/25831>

<comment><USER14> As opposed to what? The millionaires in charge of GM that got billions? Sounds like Uncle Sam is just hedging his automotive bet. If I didn't know any better I'd say that (cough) _made sense_.

</comment></comment><comment><USER15> I'd rather own Tesla.

</comment><comment><USER16> Valuating the mess that is GM ... now there is something worthy of a Doctorate from Wharton, heh</comment>


RedHat BootHole Update Causes System to Hang After Post - <AUTHOR> https://access.redhat.com/solutions/5272311 <comment><AUTHOR> Applies to RHEL, CentOS 7 and CentOS 8 packages.

The actual bug report is here - [https://bugzilla.redhat.com/show_bug.cgi?id=1861977](https://bugzilla.redhat.com/show_bug.cgi?id=1861977)</comment>


Ask HN: Seeking/have summer opportunities for undergraduate engineers? - <AUTHOR> I was recently asked about suggestions for summer experiences for an undergraduate CS/Applied math student.
I'd like to see something that informs and encourages the engineering path, amps up her enthusiasm, and that provides some real world (industry or academic) experience.
I have some ideas: internship programs at large companies in my industry (biotech-ish); summer of code projects; and generally the kind of things I can find via my personal network and a search engine.  I'm sure that I'm missing more than I'm digging up.
I suspect that there are probably:
- other folks in my situation who would love to hear about nerdy opportunities, perhaps with different emphases (e.g. contributing to a peer reviewed paper, or ...); and
- folks with opportunities who would love to get the word out.
If you have actionable ideas or opportunities to promote, please share them.  Tell us what you're looking for, what you have to offer, if you're focusing on particular communities, if you offer support, and anything else that seems relevant. <comment><USER2> If you're interested in summer of code projects, there's a good number of orgs in this year's google summer of code [https://summerofcode.withgoogle.com/organizations/](https://summerofcode.withgoogle.com/organizations/)

This year I'm helping mentor the ZynAddSubFX organization [https://summerofcode.withgoogle.com/organizations/6487755463...](https://summerofcode.withgoogle.com/organizations/6487755463327744/) . Zyn is an open source musical synthesizer, so there's skills that are used in a number of domains, ranging from technical writing skills, to user experience knowhow, to musical backgrounds, user interface coding, hard realtime programming practices, to digital signal processing.

It's zyn's first year in GSoC, so it's going to be a learning experience on both sides, but it should be a good time. Outside of the official GSoC project we're always looking for contributors who are interested in learning new things.

</comment><comment><USER3> I have a "summer of code" project. I'm a founder of Distribute Aid [1], a Swedish ngo that builds tech tools for refugee aid groups. We're an open source project [2] and are looking for people who can contribute.

There are opportunities to join us on the ground in Europe, or to volunteer remotely. We try to take a people-first approach and will match volunteers up with tasks / projects that they are most interested in. It's a great fit for students looking to build their resume while making substantial contributions to an important project.

If anyone is interested in learning more, shoot me an email at taylor /at/ distributeaid.org

[1]: [https://distributeaid.org](https://distributeaid.org)

[2]: [https://gitlab.com/users/distribute- aid/projects](https://gitlab.com/users/distribute-aid/projects)</comment>