Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!

SELECT * FROM posts WHERE tid = 'PA PROGRAMMING THREAD'

16566687071100

Posts

  • Jimmy KingJimmy King Registered User regular
    Awesome link there @saeris. I'm going to have to keep that handy. I've done just enough PHP work to know it's terrible and have talked to enough developers who are way smarter than me who tell me the same thing, but that knowledge has kept me from using it enough to be able really expound on why it sucks. Now I can just give people that URL and call it a day.

    import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.stringreturners.StringStringReturner;
  • InfidelInfidel It's not Infidel, it's INNNNNFIDELRegistered User regular
    The whole int > INT_MAX thing is something I saw frequently. While marking student assignments.

    Go PHP go!

    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
    Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • bowenbowen Registered User regular
    Hm... not sure if serious or a way to mindfuck me with that code.

  • centraldogmacentraldogma Registered User regular
    Judging from everyone’s reaction to Java and PHP, I can only imagine your opinions on JSP.

    signaturecreation.gif
  • bowenbowen Registered User regular
    JSP :rotate:

  • Joe KJoe K Registered User regular
    Judging from everyone’s reaction to Java and PHP, I can only imagine your opinions on JSP.

    JSP and STRUTS? Nuke it from orbit. Only way to be sure.

  • Jimmy KingJimmy King Registered User regular
    I've tried to learn JSP several times. Every time I try, I look at a bunch of tutorials and can't believe that their way of doing web front ends apparently hasn't evolved since 1998. All that mixing code and markup and ewwwwww.

    import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.stringreturners.StringStringReturner;
  • GnomeTankGnomeTank Registered User regular
    Does anyone know if there is a WebSockets implementation for the .NET platform? Server side I mean, the client side I'll do through JavaScript.

    I'm playing around with a stupid simple HTML5 front end, using Canvas for simple 2D drawing, and I want to try some server side communication. This is completely a toy project, will never make it beyond a week or two of me playing with it.

    I was thinking of doing an ASP.NET MVC4 backend and just doing RESTful AJAX calls for the server side communication, but that requires an async challenge/response architecture which doesn't seem great even for a simple game. WebSockets allowing UDP style burst/multicast packet communication between a web page and a web server.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • NightslyrNightslyr Registered User regular
    Hehe, that link is great. The more I mod over at PHPFreaks, the more I realize I really don't like the language. It's just an ugly, ugly language. I'm currently learning Ruby so I can jump ship and develop in Rails when not doing C#/MVC.

    My PA, PSN, XBL, Origin, and Steam names are the same. 3DS Friend Code: 1607-1682-2948
    steam_sig-400.png
    Stack Exchange | http://www.mpdevblog.blogspot.com
  • GnomeTankGnomeTank Registered User regular
    Has Java even gotten on the MVC band wagon yet? Is there any sort of MVC framework that works with the current Java web stack? And I don't mean half assey either, I mean with the level of functionality that Rails, Django and ASP.NET MVC offer.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • bowenbowen Registered User regular
    Gnome I think typical sockets work in ASP.NET ? You can juts use the same protocol as websockets from HTML5/JS eh?

  • GnomeTankGnomeTank Registered User regular
    edited April 2012
    bowen wrote: »
    Gnome I think typical sockets work in ASP.NET ? You can juts use the same protocol as websockets from HTML5/JS eh?

    I suppose I could? Most browsers get very cranky when you try and open raw sockets in JavaScript. It's a huge security red flag.

    e: Question answered: .NET 4.5 has WebSockets built in to ASP.NET. This is good, since I am doing all this with VS 11/.NET 4.5/ASP.NET MVC 4.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • bowenbowen Registered User regular
    http://stackoverflow.com/a/2212752

    You should still be able to use websockets client side and then server side whatever combination you want? If I'm understanding you right.

  • Joe KJoe K Registered User regular
    GnomeTank wrote: »
    Has Java even gotten on the MVC band wagon yet? Is there any sort of MVC framework that works with the current Java web stack? And I don't mean half assey either, I mean with the level of functionality that Rails, Django and ASP.NET MVC offer.

    MVC is a design pattern, and JSP/Struts/Beans sorta kinda did it... As did plain old ASP. As did most "good" client server apps...

  • GnomeTankGnomeTank Registered User regular
    edited April 2012
    Joe K wrote: »
    GnomeTank wrote: »
    Has Java even gotten on the MVC band wagon yet? Is there any sort of MVC framework that works with the current Java web stack? And I don't mean half assey either, I mean with the level of functionality that Rails, Django and ASP.NET MVC offer.

    MVC is a design pattern, and JSP/Struts/Beans sorta kinda did it... As did plain old ASP. As did most "good" client server apps...

    I am aware of what MVC is, I do MVC/MVVM/MVP all day, every day, at work. The point is there are frameworks built around the concept, that make it a breeze to do. Classic ASP did not do this, nor did ASP.NET, nor does JSP/Struts/Beans.

    Go look at a serious MVC framework like Rails and see everything that it does to make it "real MVC". It's more than just a way to structure code.

    My question wasn't "Can you do MVC with Java", it was "Has the Java world provided a competent MVC framework yet".

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • NightslyrNightslyr Registered User regular
    I do have a question about the INT_MAX thing in PHP - is the problem that, if the integer in question is already bigger than INT_MAX, then it will actually be some other, lesser value due to the overflow, since nothing can be bigger than INT_MAX? Or is it merely PHP happily returning null, allowing the environment in which the overflow occurred to continue running without any kind of error/log about it? Or both?

    My PA, PSN, XBL, Origin, and Steam names are the same. 3DS Friend Code: 1607-1682-2948
    steam_sig-400.png
    Stack Exchange | http://www.mpdevblog.blogspot.com
  • GnomeTankGnomeTank Registered User regular
    bowen wrote: »
    http://stackoverflow.com/a/2212752

    You should still be able to use websockets client side and then server side whatever combination you want? If I'm understanding you right.

    WebSockets aren't regular sockets, you don't connect to an IP and a port. You make calls to a web URL. The server either has to support that at some level, or you have to do some crazy URL re-writing magic to route the calls (which is certainly possible, and very likely what Node and ASP.NET 4.5 do on the backside).

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • Jimmy KingJimmy King Registered User regular
    GnomeTank wrote: »
    Has Java even gotten on the MVC band wagon yet? Is there any sort of MVC framework that works with the current Java web stack? And I don't mean half assey either, I mean with the level of functionality that Rails, Django and ASP.NET MVC offer.

    I think Play! is the goto java (and scala) Django/Rails/.Net MVC like solution. I haven't used it, but have heard good things about it. Some day I'm going to tinker with it using their Scala API.

    import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.stringreturners.StringStringReturner;
  • bowenbowen Registered User regular
    That link shows how to handle a websocket? It appears to function just like an HTTP web request of sorts, so your server would just need to handle those.

  • Joe KJoe K Registered User regular
    GnomeTank wrote: »
    Joe K wrote: »
    GnomeTank wrote: »
    Has Java even gotten on the MVC band wagon yet? Is there any sort of MVC framework that works with the current Java web stack? And I don't mean half assey either, I mean with the level of functionality that Rails, Django and ASP.NET MVC offer.

    MVC is a design pattern, and JSP/Struts/Beans sorta kinda did it... As did plain old ASP. As did most "good" client server apps...

    I am aware of what MVC is, I do MVC/MVVM/MVP all day, every day, at work. The point is there are frameworks built around the concept, that make it a breeze to do. Classic ASP did not do this, nor did ASP.NET, nor does JSP/Struts/Beans.

    Go look at a serious MVC framework like Rails and see everything that it does to make it "real MVC". It's more than just a way to structure code.

    My question wasn't "Can you do MVC with Java", it was "Has the Java world provided a competent MVC framework yet".

    The Play! framework does a pretty good job of this. Of course, it leans heavily on scala, and the 1.x series had a python pre-compiler to turn your scala into java, but hey, whatever, its a reasonable Java based framework.

  • GnomeTankGnomeTank Registered User regular
    Joe K wrote: »
    GnomeTank wrote: »
    Joe K wrote: »
    GnomeTank wrote: »
    Has Java even gotten on the MVC band wagon yet? Is there any sort of MVC framework that works with the current Java web stack? And I don't mean half assey either, I mean with the level of functionality that Rails, Django and ASP.NET MVC offer.

    MVC is a design pattern, and JSP/Struts/Beans sorta kinda did it... As did plain old ASP. As did most "good" client server apps...

    I am aware of what MVC is, I do MVC/MVVM/MVP all day, every day, at work. The point is there are frameworks built around the concept, that make it a breeze to do. Classic ASP did not do this, nor did ASP.NET, nor does JSP/Struts/Beans.

    Go look at a serious MVC framework like Rails and see everything that it does to make it "real MVC". It's more than just a way to structure code.

    My question wasn't "Can you do MVC with Java", it was "Has the Java world provided a competent MVC framework yet".

    The Play! framework does a pretty good job of this. Of course, it leans heavily on scala, and the 1.x series had a python pre-compiler to turn your scala into java, but hey, whatever, its a reasonable Java based framework.

    Cool. I hate Java, but I will look in to this anyway, because I like to at least glance at every MV* framework out there, as they all have little tricks and such that the others don't do. Since I maintain our MVVM framework at work, it's cool to see the stuff other people do so I can roll that in to the next public release of our framework to the rest of the agency.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • GnomeTankGnomeTank Registered User regular
    bowen wrote: »
    That link shows how to handle a websocket? It appears to function just like an HTTP web request of sorts, so your server would just need to handle those.

    It's still a bit different than you're thinking, but it's kind of moot, because ASP.NET 4.5 has WebSocket support, so we're good.

    Now to learn HTML5 Canvas...

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • Joe KJoe K Registered User regular
    GnomeTank wrote: »
    Joe K wrote: »
    GnomeTank wrote: »
    Joe K wrote: »
    GnomeTank wrote: »
    Has Java even gotten on the MVC band wagon yet? Is there any sort of MVC framework that works with the current Java web stack? And I don't mean half assey either, I mean with the level of functionality that Rails, Django and ASP.NET MVC offer.

    MVC is a design pattern, and JSP/Struts/Beans sorta kinda did it... As did plain old ASP. As did most "good" client server apps...

    I am aware of what MVC is, I do MVC/MVVM/MVP all day, every day, at work. The point is there are frameworks built around the concept, that make it a breeze to do. Classic ASP did not do this, nor did ASP.NET, nor does JSP/Struts/Beans.

    Go look at a serious MVC framework like Rails and see everything that it does to make it "real MVC". It's more than just a way to structure code.

    My question wasn't "Can you do MVC with Java", it was "Has the Java world provided a competent MVC framework yet".

    The Play! framework does a pretty good job of this. Of course, it leans heavily on scala, and the 1.x series had a python pre-compiler to turn your scala into java, but hey, whatever, its a reasonable Java based framework.

    Cool. I hate Java, but I will look in to this anyway, because I like to at least glance at every MV* framework out there, as they all have little tricks and such that the others don't do. Since I maintain our MVVM framework at work, it's cool to see the stuff other people do so I can roll that in to the next public release of our framework to the rest of the agency.

    well, I hate java too, and apparently the Play! guys do as well, which is why it's all scala based. :-)

  • Jimmy KingJimmy King Registered User regular
    grumble grumble. django-celery's DatabaseScheduler for scheduling recurring tasks in the db using django's built in admin is broken and doesn't work right yet with Django 1.4's USE_TZ turned on.

    import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.stringreturners.StringStringReturner;
  • WeretacoWeretaco Cubicle Gangster Registered User regular
    Code I'm dealing with of the day
         TDY = '31ý28ý31ý30ý31ý30ý31ý31ý30ý31ý30ý31'
         DATX = OCONV(DATC,'D2-')
         LYR = OCONV(DATC,'DY')
         LYF = REM(LYR,4)
         IF LYF EQ 0 THEN TDY<1,2> = '29'
    

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • admanbadmanb the bored genie Seattle, WARegistered User regular
    Seems like an elegant way to deal with month lengths and leap years.
    Spoiler:

    twitter, github, resume/portfolio, if you like to play or host boardgames online, check out handtracker
  • zeenyzeeny Registered User regular
    Saeris wrote: »
    admanb wrote: »
    It is important to distinguish between languages like Perl (and C) which is a fine language that makes it easy to do bad things, and PHP, which is a bad language.

    I cannot resist linking to PHP: a fractal of bad design.

    A shitload of nitpicking on that page to go with a lot of awful design issues. Still, the wide access, ease of installation and the quantity of code currently in use will keep it near the top in popularity for a while.
    Saying "It's bad, don't learn about it." is not a good idea and should rather be "Don't learn from it.".
    It is still possible to produce sensible PHP code as long as you establish consistent development conventions and environment. Using it as instructional tool? No. Using it as production tool? Not such an obvious scratch.

  • GnomeTankGnomeTank Registered User regular
    I can produce bad code in any language. This is not unique to PHP and never has been. In fact, I can produce an order of magnitude worse code in C than I can in PHP, just because C is so much closer to the metal.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • DranythDranyth Surf ColoradoRegistered User regular
    On the subject of that PHP article, while I have some decent experience using it for what I consider it to be sort of good at, that is, doing some relatively quick server-side calculation for web forms and such... I definitely realized some of that stuff as I ran across it here and there.

    I mean, I used PHP.net as a resource a lot to look up functions and the comments usually had something relating to what I was trying to do in them. Which is a good thing because typically I'd see that, oh, there's another random exception to the way this function works.

    And I definitely noticed all the functions that do the same thing but are named slightly differently, very annoying to try to figure out which one is the proper one to use, typically you could figure it out by seeing which had the most recent comments, though not always.

    I had started to look into OO PHP earlier in the year and the info I could find on that was somewhat sparse and confusing.


    I'm learning C# at present, and the further I get into it, the more it makes sense. The Head First book is really quite nice, though I'll have to start thinking of what books to go for next after I finish this one.

  • IncindiumIncindium Registered User regular
    edited April 2012
    GnomeTank wrote: »
    bowen wrote: »
    That link shows how to handle a websocket? It appears to function just like an HTTP web request of sorts, so your server would just need to handle those.

    It's still a bit different than you're thinking, but it's kind of moot, because ASP.NET 4.5 has WebSocket support, so we're good.

    Now to learn HTML5 Canvas...

    So just a question regarding that. I thought the websocket support in ASP.NET 4.5 is reliant on IIS 8? So are you running Windows 8 or Windows 8 server beta then to do this new development work?

    Incindium on
  • GnomeTankGnomeTank Registered User regular
    Incindium wrote: »
    GnomeTank wrote: »
    bowen wrote: »
    That link shows how to handle a websocket? It appears to function just like an HTTP web request of sorts, so your server would just need to handle those.

    It's still a bit different than you're thinking, but it's kind of moot, because ASP.NET 4.5 has WebSocket support, so we're good.

    Now to learn HTML5 Canvas...

    So just a question regarding that. I thought the websocket support in ASP.NET 4.5 is reliant on IIS 8? So are you running Windows 8 or Windows 8 server beta then to do this new development work?

    For production it does, but for development, the VS11 dev server supports it out of the box.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • jackaljackal Registered User regular
    Not all programming language are created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

  • IncindiumIncindium Registered User regular
    edited April 2012
    GnomeTank wrote: »
    Incindium wrote: »
    GnomeTank wrote: »
    bowen wrote: »
    That link shows how to handle a websocket? It appears to function just like an HTTP web request of sorts, so your server would just need to handle those.

    It's still a bit different than you're thinking, but it's kind of moot, because ASP.NET 4.5 has WebSocket support, so we're good.

    Now to learn HTML5 Canvas...

    So just a question regarding that. I thought the websocket support in ASP.NET 4.5 is reliant on IIS 8? So are you running Windows 8 or Windows 8 server beta then to do this new development work?

    For production it does, but for development, the VS11 dev server supports it out of the box.

    Ah so you are just targeting the build to VS11's self hosting facility... I always forget about that because we just setup IIS on all of our dev machines.

    Incindium on
  • InfidelInfidel It's not Infidel, it's INNNNNFIDELRegistered User regular
    Weretaco wrote: »
    Code I'm dealing with of the day
         TDY = '31ý28ý31ý30ý31ý30ý31ý31ý30ý31ý30ý31'
         DATX = OCONV(DATC,'D2-')
         LYR = OCONV(DATC,'DY')
         LYF = REM(LYR,4)
         IF LYF EQ 0 THEN TDY<1,2> = '29'
    

    Looks like it screws up the % 100 (and not % 400) case, Microsoft style!

    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Phalla discussion and Secret Santas :: PhallAX 2013
    Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • zeenyzeeny Registered User regular
    edited April 2012
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    zeeny on
  • GnomeTankGnomeTank Registered User regular
    Especially since PHP isn't even that bad. There are much, much worse languages out there. They just aren't as popular as PHP.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • GnomeTankGnomeTank Registered User regular
    Incindium wrote: »
    GnomeTank wrote: »
    Incindium wrote: »
    GnomeTank wrote: »
    bowen wrote: »
    That link shows how to handle a websocket? It appears to function just like an HTTP web request of sorts, so your server would just need to handle those.

    It's still a bit different than you're thinking, but it's kind of moot, because ASP.NET 4.5 has WebSocket support, so we're good.

    Now to learn HTML5 Canvas...

    So just a question regarding that. I thought the websocket support in ASP.NET 4.5 is reliant on IIS 8? So are you running Windows 8 or Windows 8 server beta then to do this new development work?

    For production it does, but for development, the VS11 dev server supports it out of the box.

    Ah so you are just targeting the build to VS11's self hosting facility... I always forget about that because we just setup IIS on all of our dev machines.

    Well, this is at home. I'm just playing with it, so yeah. I am not going to install Windows 8 just to get websockets on a toy project, hehe.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • bowenbowen Registered User regular
    I have never really had an issue with PHP so I dunno. You guys must work on some terrible projects or something. I put it up there with C++. The Class syntax is fucking atrocious, but otherwise it's okay.

    Like getting angry because you use C and fuck those guys using C++.

    I mean, it's not like it's Java or something, seriously.
    Spoiler:

  • GnomeTankGnomeTank Registered User regular
    It's very much like C++. Yes, there are ways you can hang yourself with a silk noose in C++....but isn't learning how to avoid those things part of being a good programmer? Have we all gotten so lazy that we can't balance the "power v. safety" of programming languages anymore?

    I mean, I love that C# hides a lot of low level details from me, because I can spend more time on actual app code...but I still understand those low level details, and I understand how to avoid issues in closer to the metal languages.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, D3: Brainling#1998, NintendoID: Brainling
  • Joe KJoe K Registered User regular
    zeeny wrote: »
    jackal wrote: »
    Not all programming language re created equal. It is perfectly valid to say "don't learn PHP" when there are plenty of perfectly good languages that don't try to kick you in the balls at every turn.

    I can't accept don't learn X for valid advice, especially towards young programmers, when we are talking about one of the most heavily represented languages on the job market. Kudos to anybody who can.

    PHP is a kiddie toy, and the 3 top in use languages are C, Java, C++. It's a shame that Java is there, as I think it teaches poor practices as well.

    PHP falls in the catoegory of "meh, i'd prefer not to, but i'm sure that i can make a mod for you in it" category... It's not really worth "studying", and there are better techs out there. No, it doesn't have that big of an extension base, no it's community isn't that big, why haven't they made the language sensible yet?

    If I were *teaching* programming (not computer science), pre-college, I would prbly start off with Python. If you're in a tech college/eng program, C for you.

    And if you're @Kambing, I'll be sure to refer them to you as the crazy old professor who swears that every programming task can be done functionally.

This discussion has been closed.