6 ms·
With the correct abstractions, you can definitely run tests on save. SQL is rather readable these days. It's obviously not as easy to read as ruby or python an
by phereford 10y ago
With the correct abstractions, you can definitely run tests on save.
SQL is rather readable these days. It's obviously not as easy to read as ruby or python and is slightly more verbose, but it is certainly readable.
Mileage will vary of course. There are cost/benefit trade offs with every architectural decision made.
- kofejnik 10y ago>> With the correct abstractions, you can definitely run tests on save. You definitely can, but you'll have to roll your own watcher and sync, there's no Guard equivalent that I'm aware of. >> SQL is rather readable these days. Used to think so as well. But then I had to read some pretty nasty sp's which calculated discounts depending on what user already has, and geolocation, and time of day, and day of month, and tons of other stuff, and the return value had to be a complex hierarchy of categories/products. So what would be 2 pages of python turns into 500 lines of SQL with some statements 80 lines long, plus it was still a pain to json-encode in python. The only positive thing about it was that I wasn't the one who had to write it.
- oelmekki 10y ago> You definitely can, but you'll have to roll your own watcher and sync, there's no Guard equivalent that I'm aware of. [shameless plug] here's mine :) https://github.com/oelmekki/pgrebase https://github.com/oelmekki/pgrebase EDIT: sqitch is also often mentioned in that field http://sqitch.org/ http://sqitch.org/
- kofejnik 10y agopgrebase seems very nice, thanks!
- josteink 10y ago> SQL is rather readable these days. It's obviously not as easy to read as ruby As someone who can't read Ruby but can handle "any level" of SQL fluently, that's obviously not a very objective statement.
- phereford 10y agoI made a very broad assumption based on my past experiences with engineers and I apologize if I offended you. Most engineers I have met in my career have really depended on an ORM to do all of their heavy lifting. They can write some of the most eloquent ActiveRecord queries but would be unable to create the same functionality using raw SQL. Again, deeply sorry if I offended. It was not my intention.
- kofejnik 10y agoWow, is this really the norm? I mean, not knowing SQL and working purely with ORM. This seems weird to me, as I learned SQL first.
- phereford 10y agoI don't know if it's the norm or not, but leveraging an ORM without knowing SQL is a thing. ORMs have so many benefits (query parameterization just to name one). That and people can stay in their comfort zone language (Ruby, Python, Haskell, etc) and let the ORM do the heavy lifting instead of having to dip down into SQL. Those that are really good with an ORM can generally go into SQL with ease. The above is not meant to be objective, just my general observations.
- josteink 10y agoTo be clear I'm not against the use of ORMs. They are a fine tool, but I find it weird that people are using them without knowing the underlying technology which they are based on. And you also don't need ORMs to do query parameterization.
- phereford 10y agoAlso, think of the various boot camps (General Assembly, Launch Academy, etc). Those do not teach SQL, but do teach some ORM.
- majewsky 10y ago