Heroku



  • @morbiuswilters said:

    Millions of people listen to Taylor Swift. What the fuck is your point? Most people are stupider than cattle, just less delicious.

    Morbs, quit spouting your ignorant opinions all over the place.

    At least half of all people are definitely at least as delicious as cow; some possibly more.



  • @blakeyrat said:

    @Soviut said:
    Incidentally, Heroku can also host Python frameworks like Django and Flask,

    Another minor WTF: one of the Heroku sites Idiot-We-Fired set up was entirely PHP. But he ran it in Heroku anyway, even though Heroku doesn't support PHP. Apparently the solution was extremely hacky.

    And yes, again, I brought up the whole, "why are we paying more and getting less with this Heroku bullshit? Especially when AWS instances can run PHP with literally zero configuration?" What an idiot.

    Heroku was a pretty clever marketing move.

    Basically, there was a lot of shit flinging in the Rails community over deployment, server config, etc, and Heroku picked one way, then said "Hey, easy deployment over here!" and a lot of people wandered over.

    The admin style does make a lot of sense, in that everything is divvied up into sites you have rather than servers you have.

    Is it worth the money? Fuck no. I keep a Heroku account hanging around, but it's only used for occasionally flinging a demo app up on the free hosting tier.



  • @aihtdikh said:

    @morbiuswilters said:
    Millions of people listen to Taylor Swift. What the fuck is your point? Most people are stupider than cattle, just less delicious.

    Morbs, quit spouting your ignorant opinions all over the place.

    At least half of all people are definitely at least as delicious as cow; some possibly more.

    I agree, most people would do excellent as burgers.



  • @morbiuswilters said:

    Disqus (never heard of it)
     

    Disqus is a pretty good drop-in&forget commenting system. [RECOMENDED]

     



  • @arh said:

    I agree, most people would do excellent as burgers.
     

    Ha ha, 'burger' is the Dutch word for 'civilian', and—

    ...oh



  • @dhromed said:

    Disqus is a pretty good drop-in&forget commenting system. [RECOMENDED]
    Except that half of the time it doesn't load.



  • @ender said:

    Except that half of the time it doesn't load.
     

    No repro.


  • Discourse touched me in a no-no place

    @dhromed said:

    @ender said:
    Except that half of the time it doesn't load.
    No repro.
    The times I've had a problem with it, it's usually been NoScript blocking some obscure site that's been added since the last time I tried commenting using it.



  • Disqus never works for me because I have third-party cookies disabled. Why don't they get with the times and make themselves an iframe rather then a drop-in script?



  • @morbiuswilters said:

    @notromda said:
    Heroku is not just a virtual host provider, they provide an easy to manage way to deploy rails applications - and so you probably need to know the whole ecosystem of rails for it to make sense.

    @notromda said:

    https://devcenter.heroku.com/articles/heroku-postgres-import-export

    Rails? Postgres? Wow, Heroku really wanted their name to be a metonym for absolute failure, didn't they?

    I see you throwing Postgres out there as an example of bad software all the time; have you ever taken the time to explain why? My experience with Postgres is somewhat limited: I support a single, largely unused production application that has a Postgres back end. However, this experience has been almost entirely positive. Postgresql reminds me of Oracle in a lot of ways. If I were going to pick a program to be an example of "worst database product," I'd probably go with Sqlite (or Access, or MySQL, or IMS...) before Postgres. If I were just looking for an example of terrible software of any sort, I'd go with something like SAP, Sharepoint, or BizTalk. Or, I might select something from the rich tapestry of shitty version control systems out there. Postgres doesn't come close to the level of stupidity evident in PVCS, for example.



  • @MiffTheFox said:

    @Soviut said:
    How exactly is Rails an absolute failure? Thousands of successful, high profile sites are powered by it. Basecamp, Hulu, SlideShare, GitHub, Shopify, Zendesk, etc. Even .NET darling Jeff Atwood, co-creator of Stack Overflow, has chosen to use Rails instead of .NET to build the new Discourse forum software. Meanwhile we get to wallow in this beautifully architected .NET Community Server forum.

    I'm not even a Rails developer, nor do I hate .NET, but I'm not willfully ignorant to the fact that Rails is a huge success just because it's isn't the platform I develop for.

    You see there's actually two different technologies called ASP.NET. One, ASP.NET MVC, is a pretty good platform for developing on the web (although the latest version seems to be going down the "do everything with models" route, which is pretty much negating MVC entirely). The other, WebForms, is pretty much the point'n'click hellspawn of the web development world.

    Guess which one Community Server's written in.

    You know, my own personal impression of WebForms is pretty positive. It basically tries to be VB6 for the browser and largely succeeds. Do people do all sorts of ill-advised things in an effort to make WebForms be things it isn't? Absolutely; but that's no worse than ASP.NET MVC, which is a really stifling architecture with poor tool support.



  • @bridget99 said:

    @MiffTheFox said:
    @Soviut said:
    How exactly is Rails an absolute failure? Thousands of successful, high profile sites are powered by it. Basecamp, Hulu, SlideShare, GitHub, Shopify, Zendesk, etc. Even .NET darling Jeff Atwood, co-creator of Stack Overflow, has chosen to use Rails instead of .NET to build the new Discourse forum software. Meanwhile we get to wallow in this beautifully architected .NET Community Server forum.

    I'm not even a Rails developer, nor do I hate .NET, but I'm not willfully ignorant to the fact that Rails is a huge success just because it's isn't the platform I develop for.

    You see there's actually two different technologies called ASP.NET. One, ASP.NET MVC, is a pretty good platform for developing on the web (although the latest version seems to be going down the "do everything with models" route, which is pretty much negating MVC entirely). The other, WebForms, is pretty much the point'n'click hellspawn of the web development world.

    Guess which one Community Server's written in.

    You know, my own personal impression of WebForms is pretty positive. It basically tries to be VB6 for the browser and largely succeeds. Do people do all sorts of ill-advised things in an effort to make WebForms be things it isn't? Absolutely; but that's no worse than ASP.NET MVC, which is a really stifling architecture with poor tool support.

    WebForms is the reason every post takes several seconds while it uploads a megabyte of tags. phpBB is less wtf-y than that*.



  • Heroku seemed like a pretty neat idea, I just wasn't fond of how if something went really wrong you were screwed until Heroku figured it out.  That's okay for a startup but when you have real customers who need the app to do real business (let's say you have some SaaS hosted CRM), they aren't going to like being told there's nothing you can do to fix the site being down.

    On Rails, it's a great framework from what I recall when I was dabbling in it; my issue with it was always that it kept moving way too quickly so by the time you got a solid knowledge of one version, there was a new version.  That and a lot of Rails guys were instrumental is pushing really new trends or coming up with new frameworks to abstract away X so it's less code to write.  They focus a lot more on developer productivity than useful tools.  I always found Rails to feel better than Django though, for whatever reason.  I coud never really get into Django despite it being like Rails without the "paint by numbers" things (many of which have since gone away), and I'm not really sure why.  Rails seemed more suited to LOB apps while Django seemed more appropriate for content-based systems (probably because it was created for a newspaper).

    Nowadays though I'd probably stick with ASP.NET MVC; it's come a long way and is very Rails-like without a lot of the "magic", but not as strange as Django feels.  Plus you can tap into the other .NET things (think WCF) if you need to, and in my general area .NET skills are in-demand while Ruby/Rails, Python and others are virtually unknown except maybe in a startup or two, so I could have the best of both worlds by honing up on C#/.NET but tapping into MVC.  The only real issue with MVC is that it is largely not adopted yet, so you run the issue of knowing all the good stuff with .NET and being forced to deal with WebForms garbage in the workforce.

    WebForms itself isn't TERRIBLE if you use it correctly (i.e. use some kind of Model-View-Presenter/ViewModel/Supervising Controller pattern) with a nice GUI frontend using components like Telerik.  It's good if you are mimicking an event-driven "thick" client that 15+ years ago would have been a desktop or MS Access forms app.  It's too easy IMO to fall into the trap of relying on events and code-behind though and ending up with unmaintainable garbage.



  • @MiffTheFox said:

    Disqus never works for me because I have third-party cookies disabled. Why don't they get with the times and make themselves an iframe rather then a drop-in script?

    Because an iframe can't expand its own borders. Also it can't (well depending on domain) make DOM calls to the rest of the page, and Discus does that for several features.



  • I am the only one who uses ASP.net without WebForms or MVC?

    I got pissed at Idiot-Who-Was-Fired and wrote a nastygram to him when he claimed that my using ASP.net for a webAPI would create huge ViewStates and (somehow?) mess with CSS. He just assumed ASP.net == WebForms.



  • Genuinely curious how do you use ASP.NET with neither WebForms nor MVC?  I know they have the Web API or whatever it's called but I haven't looked too much into that, and I've done some things by just writing HTTP Handlers (.ashx files) where I needed to get data back but didn't need a full web page (for some hacky AJAX stuff at a past job where I couldn't use REST or JSON). 



  • @ObiWayneKenobi said:

    Genuinely curious how do you use ASP.NET with neither WebForms nor MVC?  I know they have the Web API or whatever it's called

    There's an MVC API, but I found it way overkill for what I was writing.

    @ObiWayneKenobi said:

    and I've done some things by just writing HTTP Handlers (.ashx files) where I needed to get data back but didn't need a full web page (for some hacky AJAX stuff at a past job where I couldn't use REST or JSON).

    I'm doing basically exactly that (although I am sending JSON.) The meat of the solution is all in HTML & JavaScript, so the server component basically just does user authentication and returns database queries in JSON form. It's all .ashx files (and a couple classes, one that handles JSONP and CORS for browsers which support that and another which "wraps" the JSON passing so in theory I could write an XML or HTML version of the API in a few minutes if the need ever comes up.)

    My auth might be insecure though. I dunno for sure, I haven't had someone look at it yet.



  • That's actually pretty neat.  I know when I was first looking into using the ASHX solution, it occurred to me that I could design the UIs entirely with HTML+Javascript without needing any of the ASP.NET controls, and that seemed like a great solution for say a distributed environment.  The ASHX way of doing things is just a bit nasty though since as I recall you can only have the one method per file (although I suppose you could pass some kind of command arg and call the appropriate method based on that).  I seem to recall that I ended up breaking them into logical groupings with each ASHX representing an action, grouped under a folder which represented the "Controller".  It seemed fairly messy.


  • Considered Harmful

    @ObiWayneKenobi said:

    That's actually pretty neat.  I know when I was first looking into using the ASHX solution, it occurred to me that I could design the UIs entirely with HTML+Javascript without needing any of the ASP.NET controls, and that seemed like a great solution for say a distributed environment.  The ASHX way of doing things is just a bit nasty though since as I recall you can only have the one method per file (although I suppose you could pass some kind of command arg and call the appropriate method based on that).  I seem to recall that I ended up breaking them into logical groupings with each ASHX representing an action, grouped under a folder which represented the "Controller".  It seemed fairly messy.

    .asmx services are good for web services, you can have multiple methods, and it handles the JSON de/serialization for you if you specify the correct attributes.



  • @blakeyrat said:

    The meat of the solution is all in HTML & JavaScript, so the server component basically just does user authentication and returns database queries in JSON form. It's all .ashx files (and a couple classes, one that handles JSONP and CORS for browsers which support that and another which "wraps" the JSON passing so in theory I could write an XML or HTML version of the API in a few minutes if the need ever comes up.)

    Well that's how Twitter does it. I think that's the modern definition of "web standard".



  • @ObiWayneKenobi said:

    I know when I was first looking into using the ASHX solution, it occurred to me that I could design the UIs entirely with HTML+Javascript without needing any of the ASP.NET controls, and that seemed like a great solution for say a distributed environment.

    That's exactly why I'm doing it. There's no better way to scale-out.

    @ObiWayneKenobi said:

    The ASHX way of doing things is just a bit nasty though since as I recall you can only have the one method per file

    So?

    My files are all like: ListProfiles.ashx, ListReports.ashx, RetrieveReport.ashx, etc. They all do just one thing. I think it would be pretty WTF-y to have them do more than one thing frankly.

    @ObiWayneKenobi said:

    It seemed fairly messy.

    If you say so.

    If anybody cares, the Interface looks like this. So individual API calls only need to fill in CreateResponseData and nothing else.



  • @MiffTheFox said:

    Well that's how Twitter does it. I think that's the modern definition of "web standard".

    Twitter used to, but they've actually moved things back server-side a bit. I'm not sure why, because it worked more reliably before-- for example, the New New New Twitter (how many "news" are they up to now?) frequently "forgets" to update the feed with new tweets. (Until you post one, then suddenly you find out you were 4 dozen behind.)


  • Considered Harmful

    Your implementation of jsonp has an XSS vulnerability. You just spit the query string value straight into your script. Whether this is exploitable depends on the rest of your code but for defense in-depth, you can check that it contains only characters valid in a Javascript identifier.



  • @blakeyrat said:

    @MiffTheFox said:
    Well that's how Twitter does it. I think that's the modern definition of "web standard".

    Twitter used to, but they've actually moved things back server-side a bit. I'm not sure why, because it worked more reliably before-- for example, the New New New Twitter (how many "news" are they up to now?) frequently "forgets" to update the feed with new tweets. (Until you post one, then suddenly you find out you were 4 dozen behind.)

    Oh no, that's not an issue with the code. That's an issue with however they distribute their database, it takes a while for data to migrate between the different db servers and posting tends to "kick it out of the pipeline" as it were.



  • @joe.edwards said:

    Your implementation of jsonp has an XSS vulnerability. You just spit the query string value straight into your script. Whether this is exploitable depends on the rest of your code but for defense in-depth, you can check that it contains only characters valid in a Javascript identifier.

    Thanks, I'll fix that now. Like I said, I haven't had any security people go over this yet.

    What's the correct response to an invalid JSONP request? 500 status?



  • @blakeyrat said:

    There is the whole "I don't really give a fuck" issue as well.

    That attitude is only valid if you didn't already spend the time becoming the original poster of the topic. Just saying.



  • @blakeyrat said:

    My files are all like: ListProfiles.ashx, ListReports.ashx, RetrieveReport.ashx, etc. They all do just one thing. I think it would be pretty WTF-y to have them do more than one thing frankly.
     

    Pretty much how I did it as well.  I had a folder that represented whatever that "module" was (e.g. Customers) and then I had like ListCustomers.ashx, ShowCustomer.ashx, NewCustomer.ashx (for creating) etc.

     


  • Considered Harmful

    @blakeyrat said:

    What's the correct response to an invalid JSONP request? 500 status?

    Errors in the 400 block indicate that the client did something wrong (sent a malformed/malicious parameter, for example); 500 block is for server errors. I'd think either 400 Bad Request or 422 Unprocessable Entity (see below).

    @RFC 3261 said:
    21.4.1 400 Bad Request

    The request could not be understood due to malformed syntax. The Reason-Phrase SHOULD identify the syntax problem in more detail, for example, "Missing Call-ID header field".

    @RFC 4918 said:
    11.2 422 Unprocessable Entity

    The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions.



  • @MiffTheFox said:

    @Ben L. said:
    @morbiuswilters said:
    @gu3st said:
    @blakeyrat said:
    There is the whole "I don't really give a fuck" issue as well.

    Ignorance is the enemy of progress.

    This presumes all knowledge is equivalent in its value. Obviously, this is not true.

    Photons, like all quantum objects, exhibit both wave-like and particle-like properties.

    This text is blue.

    [Pipe]

    Ceci n'est pas une pipe.

     

    Ceci n'est pas une lune.

     



  • @bridget99 said:

    I see you throwing Postgres out there as an example of bad software all the time; have you ever taken the time to explain why?

    Yes, numerous times. In short:

    • Fewer asinine bugs and more "enterprise" features than MySQL

    • Substantially worse scalability than MySQL

    • Laughably stupid "replication" which makes MySQL look like a cakewalk

    Admittedly, for a small, internal app where you don't care about HA, Postgres can do okay. For anything needing HA or high performance, it's a non-starter.



  • @blakeyrat said:

    What's the correct response to an invalid JSONP request? 500 status?

    I would use 400 Bad Request. The 5xx codes imply the error was server-side and some stupid clients will violate the spec and keep retrying hoping to get a valid response.



  • @morbiuswilters said:

    @bridget99 said:
    I see you throwing Postgres out there as an example of bad software all the time; have you ever taken the time to explain why?

    Yes, numerous times. In short:

    • Fewer asinine bugs and more "enterprise" features than MySQL

    • Substantially worse scalability than MySQL

    • Laughably stupid "replication" which makes MySQL look like a cakewalk

    Admittedly, for a small, internal app where you don't care about HA, Postgres can do okay. For anything needing HA or high performance, it's a non-starter.

     

    Since we're comparing databases, how WTFfy is Firebird by comparison? They claim to be a much better database feature-wise than MySQL, but how well does that claim hold up to reality?



  • @Mason Wheeler said:

    @morbiuswilters said:

    @bridget99 said:
    I see you throwing Postgres out there as an example of bad software all the time; have you ever taken the time to explain why?

    Yes, numerous times. In short:

    • Fewer asinine bugs and more "enterprise" features than MySQL

    • Substantially worse scalability than MySQL

    • Laughably stupid "replication" which makes MySQL look like a cakewalk

    Admittedly, for a small, internal app where you don't care about HA, Postgres can do okay. For anything needing HA or high performance, it's a non-starter.

     

    Since we're comparing databases, how WTFfy is Firebird by comparison? They claim to be a much better database feature-wise than MySQL, but how well does that claim hold up to reality?

    I have never used Firebird. It looks like it could be okay. It's hard to imagine a "quirkier" DB than MySQL, but I really have no clue.



  • @morbiuswilters said:

    No, they aren't. Birds descended from dinosaurs.
    There are species of birds alive today that were flying around along with the dinosaurs, they literally are dinosaurs; you have probably seen a dinosaur with your own eyes, and you probably have eaten (albeit one genetically modified via selective breeding ...) them as well!

    @dhromed said:
    Yes, we know. What are you trying to say?
    That they aren't lizards, and still exist today!

    There are probably a number of related XKCD comics, but I am too lazy to try to find any of them.



  • @morbiuswilters said:

    @Mason Wheeler said:
    Since we're comparing databases, how WTFfy is Firebird by comparison? They claim to be a much better database feature-wise than MySQL, but how well does that claim hold up to reality?

    I have never used Firebird. It looks like it could be okay. It's hard to imagine a "quirkier" DB than MySQL, but I really have no clue.

     

    I've used it, and I like it so far, mostly.  It's got a few annoying syntactical quirks that make writing certain types of DB update scripts way more work than they ought to be, but aside from that it seems really nice.

    My main basis for comparison is MS SQL Server, which we use at work.  SQL Server supports SEQUENCE columns (a generator/autoinc sort of thing) but no good way to make use of them with an atomic insert/query operation.

    In Firebird, I can write:

    insert into MY_TABLE

    (X, Y, Z)

    values (:x, :y, :z)

    returning ID

    where ID is a column with a generator attached, and get back the generated ID as a result as if I had run a SELECT.  AFAIK there's no good way to do that in SQL Server, which makes concurrent inserts into a table with a generator a lot more difficult to deal with than it should be if you want to get the generated value back and keep working with it.

    The other thing I really like is its sproc syntax for iterative loops.  Yes, I know SQL is set-based, and iteration is evil and should be avoided, but sometimes (particularly in stored procedures) there's really no good wy to do things in a non-iterative way.  In SQL Server, you have to do this big complicated voodoo syntax involving cursors.  (Anyone who's worked with them will know exactly what I mean.)

    In Firebird, you write it like this:

    for select X, Y, Z

    from MY_TABLE

    where ID between :foo and :bar

    into :x, :y, :z do --x, y, and z declared elsewhere as local variables

    begin

      -- whatever

    end


    Very clean, readable and intuitive.  But I haven't really used it enough to know where the WTFs lie, except of course for the update script issues  Anyone with experience have some (helpful) criticism to toss in here?


  • @Mason Wheeler said:

    AFAIK there's no good way to do that in SQL Server, which makes concurrent inserts into a table with a generator a lot more difficult to deal with than it should be if you want to get the generated value back and keep working with it.

    I'm no SQL Server guru, but wouldn't SCOPE_IDENTITY() accomplish that? It seems to work exactly the same as LAST_INSERT_ID() in MySQL.



  • @morbiuswilters said:

    I'm no SQL Server guru, but wouldn't SCOPE_IDENTITY() accomplish that? It seems to work exactly the same as LAST_INSERT_ID() in MySQL.

    Yes it would.

    Also: SQL Server has UPSERT syntax now, so you shouldn't ever, ever, ever be writing a loop or otherwise using procedural code.

    Also: even if you do want procedural code, you don't have to use Cursors, you know. You can use a good old fashioned While loop for example.

    Also: the Firebird syntax for Cursors doesn't look much more compact or readable than the MS SQL syntax to me. Slightly I guess. But it's a construct you should never use. So.

    I wager Mason Wheeler is using like SQL Server 2000 or something.



  • @esoterik said:

    @morbiuswilters said:
    No, they aren't. Birds descended from dinosaurs.
    There are species of birds alive today that were flying around along with the dinosaurs, they literally are dinosaurs; you have probably seen a dinosaur with your own eyes, and you probably have eaten (albeit one genetically modified via selective breeding ...) them as well!

    @dhromed said:
    Yes, we know. What are you trying to say?
    That they aren't lizards, and still exist today!

    There are probably a number of related XKCD comics, but I am too lazy to try to find any of them.

    Relevant.



  • @morbiuswilters said:

    @Mason Wheeler said:
    AFAIK there's no good way to do that in SQL Server, which makes concurrent inserts into a table with a generator a lot more difficult to deal with than it should be if you want to get the generated value back and keep working with it.

    I'm no SQL Server guru, but wouldn't SCOPE_IDENTITY() accomplish that? It seems to work exactly the same as LAST_INSERT_ID() in MySQL.

     

    Apparently I'm not either, because I've never heard of it. :P

    Looking it up, though, the MSDN documentation seems to suggest that SCOPE_IDENTITY is a T-SQL function to be used inside of stored procs and functions.  But Firebird's INSERT INTO ... RETURNING syntax can be used in any context you would use a normal INSERT.  It's basically "perform an INSERT, just like normal, and then tack a SELECT onto the end of it, over the row you just inserted" as a single atomic operation.  I'm currently building a web server with a FB backend (and I promise to submit the site to TDWTF for approval the most brutal QA review imaginable once we enter a public beta) and I use INSERT INTO ... RETURNING in queries from the server-side scripts a whole lot, because of how convenient it makes certain operations.





  • @blakeyrat said:

    @morbiuswilters said:
    I'm no SQL Server guru, but wouldn't SCOPE_IDENTITY() accomplish that? It seems to work exactly the same as LAST_INSERT_ID() in MySQL.

    Yes it would.

    Also: SQL Server has UPSERT syntax now, so you shouldn't ever, ever, ever be writing a loop or otherwise using procedural code.

    Also: even if you do want procedural code, you don't have to use Cursors, you know. You can use a good old fashioned While loop for example.

    Also: the Firebird syntax for Cursors doesn't look much more compact or readable than the MS SQL syntax to me. Slightly I guess. But it's a construct you should never use. So.

    I wager Mason Wheeler is using like SQL Server 2000 or something.

     

    We're using SQL Server 2008, (except for a few clients who are still on a really old version of our product, using SQL Server 2005,) and what does UPSERT (SQL Server's perfectly cromulent name for an UPDATE OR INSERT query) have to do with writing or not writing loops?

    I generally use loops for abstraction.  I've got a handful of sprocs that look like this:

    for select x, y z

    from MY_TABLE

    where ID between :foo and :bar

    into :x, :y, :z do

       execute procedure SUB_PROC(:x, :y, :z);

     

    There's really no good way to do that in a set-based style, and expanding SUB_PROC inline here isn't such a good idea when it gets called from multiple different places, and is still under development.  Encapsulation FTW!

     



  • @Mason Wheeler said:

    what does UPSERT (SQL Server's perfectly cromulent name for an UPDATE OR INSERT query) have to do with writing or not writing loops?

    Why else would you be writing loops?

    @Mason Wheeler said:

    I generally use loops for abstraction. I've got a handful of sprocs that look like this:

    for select x, y z

    from MY_TABLE

    where ID between :foo and :bar

    into :x, :y, :z do

       execute procedure SUB_PROC(:x, :y, :z);

    ... dear Christ.



  • @blakeyrat said:

    @Mason Wheeler said:
    what does UPSERT (SQL Server's perfectly cromulent name for an UPDATE OR INSERT query) have to do with writing or not writing loops?

    Why else would you be writing loops?

    @Mason Wheeler said:

    I generally use loops for abstraction. I've got a handful of sprocs that look like this:

    for select x, y z

    from MY_TABLE

    where ID between :foo and :bar

    into :x, :y, :z do

       execute procedure SUB_PROC(:x, :y, :z);

    ... dear Christ.

     

    I see.  If I were to take a wild guess, I'd say you subscribe to the "business logic should never ever go in the database" ideology?

    I don't.  There are certain cases where it's much simpler to put certain functionality into a stored proc than to try to express it in application or script code.

     



  • @blakeyrat said:

    More relevant.

    The thing I love about the Super Mario Bros. movie is that they wasted absolutely no time taking a shit on the entire franchise. I mean, it was like a dude who loaded up his roast beef with half a cup of horsey sauce and, halfway through it, was overcome with the overwhelming, immediate, desperate need to expel everything in his bowels. This is a guy, who, if his mad dash can propel him into the Arby's restroom before he publicly poops his pants, is not going to waste a single second on formalities. He's not even going to bother latching the stall, both hands will be so busy trying to yank the lower half of his clothing clear of the unstoppable diarrheal freight train.

    The first 60 seconds of the movie are just like that, with Dan Castellaneta's voice serving as the involuntary rectal spasms--irregular and halting, in a way that would be medically alarming if his mind were capable of seeing more than a second or two into the future--which forcibly eject any promise that a Mario Bros. movie might have had, leaving nothing but splatters of dashed hopes and partially-digested dreams all over the tile floor, walls and dripping from his torso.

    And, like the the minimum-wage Arby's employee who is given the Sisyphean task of sanitizing as much of the Men's room as modern science will allow, we are left to spend the next 103 minutes pondering the cruel nature of fate and the folly of a company which provides both public restrooms and a condiment that is 3/4ths nearly-spoiled mayonnaise and 1/4ths industrial-grade laxative. "Surely there is another way," you think, "a way for society to organize itself so that nobody must suffer the indignity of [trying to scrub bits of masticated curly fry out from out between the tile / watching John Leguizamo's Luigi]!!"

    But you are wrong, for this is no justice in the world. Only suffering and the final, Dennis-Hopper-free peace of the grave.



  •  I liked that movie.

     OK, it's a bad movie, but I still liked it.



  • @Mason Wheeler said:

    Looking it up, though, the MSDN documentation seems to suggest that SCOPE_IDENTITY is a T-SQL function to be used inside of stored procs and functions.  But Firebird's INSERT INTO ... RETURNING syntax can be used in any context you would use a normal INSERT.  It's basically "perform an INSERT, just like normal, and then tack a SELECT onto the end of it, over the row you just inserted" as a single atomic operation.  I'm currently building a web server with a FB backend (and I promise to submit the site to TDWTF for approval the most brutal QA review imaginable once we enter a public beta) and I use INSERT INTO ... RETURNING in queries from the server-side scripts a whole lot, because of how convenient it makes certain operations.

    T-SQL has something similar to INSERT INTO ... RETURNING, the OUTPUT clause.



  • @spamcourt said:

     I liked that movie.

     OK, it's a bad movie, but I still liked it.

    I never said I didn't like it, I just said lethal diarrhea was better.


Log in to reply