Hacker News new | past | comments | ask | show | jobs | submit | more TedDallas's comments login

At a certain level of complexity it is easier to write the damn SQL than it is to explain your query to GPT.


In the end, the one who possesses knowledge will turn it into value going the most obvious and straightforward way: writing a piece of useful SQL or code hot from the head.

GPT is a tool for learners, and they will keep shooting them feet until they learn, just the weapon is different now.

Look at the law system, written in natural language. It is misleading and doesn't work well, so we have to gather thousands of people around courts doing non-deterministic work in order to process them. Natural language is a tool for learning, not making systems. You have to shrink your vocabulary down to code at some point in order to make systems, and you can do it much faster and better than GPT.


True. The goal would be write the complex SQL query once, then file it away as golden SQL so that in the future a similarly complex query could be done in natural language.


Nice to see a cool looking cross platform editor written in Free Pascal with Lazarus. Pascal is a surprisingly expressive language.


Ex-Delphi code here, and I have to loudly disagree about Pascal being expressive (at least in the context of more modern languages). But I was, and remain, very fond of it.

(to the downvoter: my fave lang is Scala. That's expressive)


Do you remember good old TSyntaxMemo?


Agile cargo cult software development there. Got to get that 4 byte change in this sprint in order to prove that the team's fantasy points are burning down.


To game this, I have started literally splitting tickets into two: 1) implementation and 2) rollout.

This sometimes even lets me present the same win for two sprints.


Uh oh sounds like someone is due for hours of alignment meetings defining “definition of done” :p


We had those, multiple times. Our Jira tickets now contain a DoD checklist no one ever ticks something on or checks. We have just stopped talking about it.


I was just being sarcastic but yeah that’s basically what happened in some of my old teams too.


Does it support a syntax for recursive queries? In T-SQL we use recursive CTEs which are ugly as hell.

This is very cool though. There are lot of features that would make my life easier. Group By All is noice.


It does, DuckDB supports recursive CTEs


What do you use recursive queries for?


If you liked Delphi then Lazarus is a great open source alternative for WYSIWYG Linux and Windows forms based application programming.

Recently I used it to create a little SQL editor with syntax highlighting for Maria DB. It only took a few hours which was mostly due to me trying to remember my Pascal syntax.

Lazarus also has a nice online package manager with a 1.5 zillion components available.

Object Pascal can feel antiquated. But Free Pascal remains fast, stable, and reasonably feature rich without much syntax bloat over the years.


Er ... SQL Server Management Studio is based on Visual Studio shell, and it does a fine job debugging stored procedures. I also code in C# and agree it also works well for that.


Recursion in SQL is one of the questions I always ask Data Engineers during interviews. The answer in MS T-SQL is to use a recursive CTE. It is not a common problem, but it comes up once in a while. Using a CTE is a better solution than calling an SP recursively because you can only nest 32 calls deep. In the MS Azure SQL Data Warehouse product you are simply fucked if you need to do recursion.


> SP recursively because you can only nest 32 calls deep

T-SQL only gives you 100 calls deep. Also, having CTEs calling other CTEs can create a very slow query plan, which takes unrolling each CTE into either a table variable or temp table to resolve.


> Recursion in SQL is one of the questions I always ask Data Engineers during interviews

Everyone always asks that in every language at every interview and it is rarely used in practice - ahhh interviews.


I think it depends on the developers style of how they reason. I use recursion a lot when dealing with loose data, to clean it up. Recursion is one of my go to's for deduplicating list.


Nice documentation. Ada looks a lot like Pascal. It is interesting that SPARK is a subset of subset of Ada.


It's Pascal inspired but certainly not any of Wirth's syntaxes, like 1/2 line if's, semi colons in weird places making blocks look odd. Ada has a more inclusive syntax, whereby "is" or "begin" and "end" encases what is inside it. Compare Modula's:

    MODULE X;
        ...
    END MODULE X.
and Ada's:

    package X is
       ...
    end X;
Ada's package feels like one statement containing others, whereby Modula's looks like it ends on the first line.


That difference may be due to ";" being considered a statement separator in Pascal, and a statement terminator in Ada. https://wiki.haskell.org/Terminator_vs._separator


Yeah when I learned Ada in college it seemed like it was a better Pascal, including fixing the quirky inconsistent termination.


Pascal-like syntax seemed to have been popular around the time. Outside the Writh languages(Pascal, Modula, Oberon) and Ada, I was reading about CHILL[0] the other day, which is supposedly similar to Ada, but was rather domain specific. Sadly I don't think any modern, free implementations exist.

[0]https://en.m.wikipedia.org/wiki/CHILL


Pascal is a simplification from ALGOL, so it is actually most ALGOL derived languages.

C description tends to refer to ALGOL influence, but it just boils down to structured programming and the data types. Syntax has nothing from ALGOL.


VHDL has a quite similar syntax, too.


Indeed VHDL is supposedly based as much as possible on Ada syntax. Naturally you would have several differences due to the purpose of the languages, but they are _very_ similar IMO


--A T-SQL version

  Select Case When SomeNumber % 3 = 0 and SomeNumber % 5 = 0 Then 'FizzBuzz'
              When SomeNumber % 3 = 0 Then 'Fizz'
              When SomeNumber % 5 = 0 Then 'Buzz'
              Else Convert(VarChar(10), SomeNumber)
              End As Answer
  From (
      Select Top 100 
          SomeNumber = Row_Number() Over (Order By [object_id]) 
      From sys.all_objects
  ) as Answers


Data structures - knowing your basic data structures will help you chose the right path for the use case. Even in SQL it is helpful to understand B-Trees.


Yep. I worked with programmers who used compared all users to all users to check for pairs of users close to one another; they had no knowledge of spatial search trees. The job that calculated all those pairs dropped from hours to seconds.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: