As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
We're funding a new Acquisitions Incorporated series on Kickstarter right now! Check it out at https://www.kickstarter.com/projects/pennyarcade/acquisitions-incorporated-the-series-2

#define THREAD_TITLE "PA Programming Thread"

1171820222362

Posts

  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited July 2010
    This picture is accurate.

    Jasconius on
  • StarfuckStarfuck Registered User, ClubPA regular
    edited July 2010
    javascript has good parts?







    my js fu is weak

    Starfuck on
    jackfaces
    "If you're going to play tiddly winks, play it with man hole covers."
    - John McCallum
  • LoneIgadzraLoneIgadzra Registered User regular
    edited July 2010
    Starfuck wrote: »
    javascript has good parts?







    my js fu is weak

    Prototypal inheritance can suck a big one. Okay maybe it makes sense for a minimal language, but from a productivity standpoint it just gives me a headache and leaves me with no obvious recourse for duplicating the most powerful features of OOP, or at least in any way that I can figure out what the fuck is going on. (With any other language, the answer is usually to forget about what you know and play to that language's strengths. The cool thing about javascript is it has no strengths.)

    LoneIgadzra on
  • SenjutsuSenjutsu thot enthusiast Registered User regular
    edited July 2010
    Crockford's book is fantastic

    Senjutsu on
  • Smug DucklingSmug Duckling Registered User regular
    edited July 2010
    Starfuck wrote: »
    javascript has good parts?







    my js fu is weak

    Prototypal inheritance can suck a big one. Okay maybe it makes sense for a minimal language, but from a productivity standpoint it just gives me a headache and leaves me with no obvious recourse for duplicating the most powerful features of OOP, or at least in any way that I can figure out what the fuck is going on. (With any other language, the answer is usually to forget about what you know and play to that language's strengths. The cool thing about javascript is it has no strengths.)

    It does have at least one strength: excellent and natural threading and events.

    Smug Duckling on
    smugduckling,pc,days.png
  • bowenbowen How you doin'? Registered User regular
    edited July 2010
    Phyphor wrote: »
    Jasconius wrote: »
    Most games are not C#. In fact I challenge anyone to find a serious retail-shelf game written in C#.

    And then check to see if it was published by Microsoft.

    Well, like Duckling said it is used in XNA development, but even Microsoft won't use it for major games. Also, every developer position I've ever seen for game companies has wanted C/C++ experience but never C#

    From as far as I can tell, the only part of most modern games that's written in .NET is the launcher. After that it's off to the native exes.

    That said, there is no reason why a hobbyist programmer can't program in with .NET over native. The only real benefit is speed, but, it may not be worth it to learn all that underlying bullshit to get to that point. Especially if you want to use networking.

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited July 2010
    As far as I'm concerned, javascript has 2 awesome features.
    • The fact that it's a standard in all modern web browsers (minor vendor-specific differences aside), so you don't have to depend on your users installing some plugin to make your app work.
    • JSON

    Halibut on
  • NightslyrNightslyr Registered User regular
    edited July 2010
    Starfuck wrote: »
    javascript has good parts?







    my js fu is weak

    Prototypal inheritance can suck a big one. Okay maybe it makes sense for a minimal language, but from a productivity standpoint it just gives me a headache and leaves me with no obvious recourse for duplicating the most powerful features of OOP, or at least in any way that I can figure out what the fuck is going on. (With any other language, the answer is usually to forget about what you know and play to that language's strengths. The cool thing about javascript is it has no strengths.)

    This is why one uses a framework that does the dirty work of coaxing prototypal inheritance into a more normal hierarchical form of inheritance....

    http://mootools.net/
    http://www.prototypejs.org/

    No one codes straight JS, unless it's for something small. Frameworks exist to remove cross-browser bullshit issues and provide functionality (like 'normal' OOP) you just can't get out of the box. Learn to love them.

    Nightslyr on
    PSN/XBL/Nintendo/Origin/Steam: Nightslyr 3DS: 1607-1682-2948
    Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
  • DVGDVG No. 1 Honor Student Nether Institute, Evil AcademyRegistered User regular
    edited July 2010
    Any iOS developers know where I can find a decent example on fetched properties?

    DVG on
    Diablo 3 - DVG#1857
  • InfidelInfidel Heretic Registered User regular
    edited July 2010
    Nightslyr wrote: »
    No one codes straight JS

    Coding Javascript without jquery/prototype is like writing C without standard libraries, Python without imports, etc.

    Sure you could probably do it but why the fuck would you. Just use them!

    My latest hobby project is possible only due to jquery, fuck trying to get this working in the major browsers without it. I still have to add a few exceptions for IE.

    Infidel on
    OrokosPA.png
  • LoneIgadzraLoneIgadzra Registered User regular
    edited July 2010
    Nightslyr wrote: »
    Starfuck wrote: »
    javascript has good parts?







    my js fu is weak

    Prototypal inheritance can suck a big one. Okay maybe it makes sense for a minimal language, but from a productivity standpoint it just gives me a headache and leaves me with no obvious recourse for duplicating the most powerful features of OOP, or at least in any way that I can figure out what the fuck is going on. (With any other language, the answer is usually to forget about what you know and play to that language's strengths. The cool thing about javascript is it has no strengths.)

    This is why one uses a framework that does the dirty work of coaxing prototypal inheritance into a more normal hierarchical form of inheritance....

    http://mootools.net/
    http://www.prototypejs.org/

    No one codes straight JS, unless it's for something small. Frameworks exist to remove cross-browser bullshit issues and provide functionality (like 'normal' OOP) you just can't get out of the box. Learn to love them.

    I use dojo. It's nice. It's not as nice as having real inheritance, since methods can still break in fantastic ways by being called in a context other than the owner object, and the meaning of "this" is constantly changing when using inline objects and functions.

    I kind of hate prototype. Out of all the libraries out there, it seems to offer the messiest API and least improvement over "vanillia" JS for the most download size.

    LoneIgadzra on
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited July 2010
    Infidel wrote: »
    Nightslyr wrote: »
    No one codes straight JS

    Coding Javascript without jquery/prototype is like writing C without standard libraries, Python without imports, etc.

    Sure you could probably do it but why the fuck would you. Just use them!

    My latest hobby project is possible only due to jquery, fuck trying to get this working in the major browsers without it. I still have to add a few exceptions for IE.

    Pfft, it's not programming unless you write your own C library... and your own window manager, filesystem, device drivers and OS!

    Phyphor on
  • StarfuckStarfuck Registered User, ClubPA regular
    edited July 2010
    Hey, I use dojo for my js stuff too
    yay, I don't feel like such a loser
    it has a pretty datagrid

    Starfuck on
    jackfaces
    "If you're going to play tiddly winks, play it with man hole covers."
    - John McCallum
  • templewulftemplewulf The Team Chump USARegistered User regular
    edited July 2010
    Infidel wrote: »
    Nightslyr wrote: »
    No one codes straight JS

    Coding Javascript without jquery/prototype is like writing C without standard libraries, Python without imports, etc.

    Sure you could probably do it but why the fuck would you. Just use them!

    My latest hobby project is possible only due to jquery, fuck trying to get this working in the major browsers without it. I still have to add a few exceptions for IE.

    I don't really care for jQuery, but I do like how is it is to bind elements and send off an ajax request. Now I just have to figure out how to store the results of the request for later inspection...

    templewulf on
    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • LoneIgadzraLoneIgadzra Registered User regular
    edited July 2010
    I like jQuery because of how it simplifies javascript programming at the same time as adding a bunch of great functionality, but jQuery UI is pretty bad compared to the competition IMHO.

    LoneIgadzra on
  • ArchsorcererArchsorcerer Registered User regular
    edited July 2010
    Senjutsu wrote: »
    Jasconius wrote: »
    It's good to hear Facebook app development hasn't changed in the last few years.

    I finally got it working but jesus what a clown-shoes operation they're running

    In case you are working with PHP take a look at:
    http://code.google.com/p/facebook-fbml-writer/

    Watched the guy's (Paterlini) conference in Argentina trough the web. I can see where the troubles come from.

    Archsorcerer on
    XBL - ArchSilversmith

    "We have years of struggle ahead, mostly within ourselves." - Made in USA
  • InfidelInfidel Heretic Registered User regular
    edited July 2010
    I like jQuery because of how it simplifies javascript programming, but jQuery UI is pretty bad compared to the competition IMHO.

    Yeah, I took a look at it and rolled my own. :lol:

    Infidel on
    OrokosPA.png
  • NightslyrNightslyr Registered User regular
    edited July 2010
    I haven't done a lot of JS UI work. What are some good non-jQuery UI frameworks?

    Nightslyr on
    PSN/XBL/Nintendo/Origin/Steam: Nightslyr 3DS: 1607-1682-2948
    Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
  • templewulftemplewulf The Team Chump USARegistered User regular
    edited July 2010
    Nightslyr wrote: »
    I haven't done a lot of JS UI work. What are some good non-jQuery UI frameworks?

    Since we're on javascript, does anyone know how to do Google Data API authentication from javascript? I know there's a library for it in java, but I'm pretty lost as to how this is supposed to work in JS.

    edit:
    wait, this looks promising: http://code.google.com/apis/gdata/docs/auth/overview.html#ClientLogin

    templewulf on
    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • DeathPrawnDeathPrawn Registered User regular
    edited July 2010
    Infidel wrote: »
    I like jQuery because of how it simplifies javascript programming, but jQuery UI is pretty bad compared to the competition IMHO.

    Yeah, I took a look at it and rolled my own. :lol:

    This. When I find myself needing some sort of JS UI widget, my instinct has become to roll my own using jQuery. If you take the time to make 'em fairly generalizable when you're first writing 'em, you find yourself with a pretty good stockpile of reusable elements.

    DeathPrawn on
    Signature not found.
  • InfidelInfidel Heretic Registered User regular
    edited July 2010
    DeathPrawn wrote: »
    Infidel wrote: »
    I like jQuery because of how it simplifies javascript programming, but jQuery UI is pretty bad compared to the competition IMHO.

    Yeah, I took a look at it and rolled my own. :lol:

    This. When I find myself needing some sort of JS UI widget, my instinct has become to roll my own using jQuery. If you take the time to make 'em fairly generalizable when you're first writing 'em, you find yourself with a pretty good stockpile of reusable elements.

    Yeah, with HTML/CSS and the jquery builtins for effects where needed, it's straightforward to define most things and just the way you want them.

    Infidel on
    OrokosPA.png
  • LoneIgadzraLoneIgadzra Registered User regular
    edited July 2010
    That sounds like a lot of work to me. That's why I use dojo. I have enough work just sorting out the conceptual mishmash of markup, script, and server interface.

    LoneIgadzra on
  • InfidelInfidel Heretic Registered User regular
    edited July 2010
    I would have spent more time trying to adapt the UI frameworks I looked at to doing what I wanted than just coding up my own.

    This one may be more of an edge case though since it's a game-like UI, more flash-without-the-flash.

    Infidel on
    OrokosPA.png
  • Smug DucklingSmug Duckling Registered User regular
    edited July 2010
    Lately I've been using Google Web Toolkit at work, and I have to say I quite like it. It's not quite as polished as jQuery at doing animations and stuff, but man, it's nice having true Java-style object orientation. It's so much easier to be organized with it.

    Smug Duckling on
    smugduckling,pc,days.png
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited July 2010
    As a former javascript guy I will side with the sentiment that most of the UI frameworks are bad.

    any UI framework will, in general, just spit out the same 5 or 6 effects in some different combinations, which can be easily replicated and faster, more suited to the task.

    I'll be a rebel here and suggest that Adobe Spry actually has the most creative and expansive interface framework.

    The only downside is that it is among the most gigantic in file weight and also the one that receives the fewest updates.

    Also I believe it runs off of Scriptaculous, which doesn't play nice with jQuery.

    Another case of Adobe squandering opportunity in a market it could actually lead in.

    and as a final sidenote: jQuery is nice, but poorly used jQuery is devastating to the speed of an app. I've found that the more I learned about core javascript, the more ridiculous many aspects of jQuery seemed outside of the core selector suite.

    Jasconius on
  • InfidelInfidel Heretic Registered User regular
    edited July 2010
    Jasconius wrote: »
    As a former javascript guy I will side with the sentiment that most of the UI frameworks are bad.

    any UI framework will, in general, just spit out the same 5 or 6 effects in some different combinations, which can be easily replicated and faster, more suited to the task.

    I'll be a rebel here and suggest that Adobe Spry actually has the most creative and expansive interface framework.

    The only downside is that it is among the most gigantic in file weight and also the one that receives the fewest updates.

    Also I believe it runs off of Scriptaculous, which doesn't play nice with jQuery.

    Another case of Adobe squandering opportunity in a market it could actually lead in.

    and as a final sidenote: jQuery is nice, but poorly used jQuery is devastating to the speed of an app. I've found that the more I learned about core javascript, the more ridiculous many aspects of jQuery seemed outside of the core selector suite.

    Really all Javascript needs to make my code manageable is (mostly) browser agnostic features. I don't have to worry about which browser it is for my accessing of a CSS attribute, or to hook an event function, etc. etc.

    The development time and readability is magnitudes better than how it used to be without the basic js frameworks out there. I actually remember some of my sites that detected between IE and Netscape, feature-wise.

    Infidel on
    OrokosPA.png
  • KlorgnumKlorgnum Registered User regular
    edited July 2010
    I have a programming-related question.

    If I look at the source code for some open-source projects to find out how they solved a problem, then used their solutions (but not their implementation, if that makes sense) in my code, would that constitute a derivative work under the terms of the GPL? I don't want to copy and paste their code, I just want to know how they did it and see if a similar solution would work in my project.

    Klorgnum on
  • bowenbowen How you doin'? Registered User regular
    edited July 2010
    Klorgnum wrote: »
    I have a programming-related question.

    If I look at the source code for some open-source projects to find out how they solved a problem, then used their solutions (but not their implementation, if that makes sense) in my code, would that constitute a derivative work under the terms of the GPL? I don't want to copy and paste their code, I just want to know how they did it and see if a similar solution would work in my project.

    I imagine it would. However, what kind of application is your end?

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • InfidelInfidel Heretic Registered User regular
    edited July 2010
    IANAL and can't really answer that. I have my opinions but that's not really useful.

    Is this a project that you're releasing at all? Or personal just?

    Infidel on
    OrokosPA.png
  • jothkijothki Registered User regular
    edited July 2010
    If you were taking a programming class, were stuck on a problem, and looked at open source projects to see how they solved it without actually copying their implementation, would that constitute cheating? I suspect the two have pretty much the same answer.

    I personally wouldn't care if someone copied part of my program's back end, as long as the new program wasn't actually trying to compete with mine functionality-wise in any way.

    jothki on
  • KlorgnumKlorgnum Registered User regular
    edited July 2010
    bowen wrote: »
    Klorgnum wrote: »
    I have a programming-related question.

    If I look at the source code for some open-source projects to find out how they solved a problem, then used their solutions (but not their implementation, if that makes sense) in my code, would that constitute a derivative work under the terms of the GPL? I don't want to copy and paste their code, I just want to know how they did it and see if a similar solution would work in my project.

    I imagine it would. However, what kind of application is your end?

    Ideally, commercial, though that's really just a pipe dream at this point.

    EDIT: I'm aware I could do this and release a commercial product under the GPL, but I don't really want to go that route.

    Klorgnum on
  • jothkijothki Registered User regular
    edited July 2010
    Klorgnum wrote: »
    bowen wrote: »
    Klorgnum wrote: »
    I have a programming-related question.

    If I look at the source code for some open-source projects to find out how they solved a problem, then used their solutions (but not their implementation, if that makes sense) in my code, would that constitute a derivative work under the terms of the GPL? I don't want to copy and paste their code, I just want to know how they did it and see if a similar solution would work in my project.

    I imagine it would. However, what kind of application is your end?

    Ideally, commercial, though that's really just a pipe dream at this point.

    Hmm, commercial is different. I'd suggest getting all of your plagiarism out of the way now, so that when you're trying to make a profit, you can honestly claim to be building off of your own experience.

    jothki on
  • bowenbowen How you doin'? Registered User regular
    edited July 2010
    You can use it, just give credit where it's due, and I think in terms of GPL, you have to include the original source code that you used. If it's a unique solution. If it's a way to implement a doubly linked list in memory, fuck, you'll have to worry about competing with LSI for the patent rights for that. I mean, you'll probably have more luck doing some google searches for the exact type of algorithm you want to use and look at a code-project page.

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited July 2010
    Actually, if you use GPL code all code in your project must also be GPL, it's very silly that way

    Phyphor on
  • ecco the dolphinecco the dolphin Registered User regular
    edited July 2010
    Phyphor wrote: »
    Actually, if you use GPL code all code in your project must also be GPL, it's very silly that way

    I thought you could get around that via dynamic libraries?

    i.e. create a dynamic library that is fully GPL, but your app which uses the library dynamically is still happily proprietary?

    Or am I thinking of the LGPL instead?

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • bowenbowen How you doin'? Registered User regular
    edited July 2010
    That's LGPL I think. But I think the newest version of GPL makes a distinction that you don't have to virally give out your source code as long as you document and give credit.

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited July 2010
    Phyphor wrote: »
    Actually, if you use GPL code all code in your project must also be GPL, it's very silly that way

    I thought you could get around that via dynamic libraries?

    i.e. create a dynamic library that is fully GPL, but your app which uses the library dynamically is still happily proprietary?

    Or am I thinking of the LGPL instead?

    Well here's the appropriate sections of their FAQ:

    http://www.gnu.org/licenses/gpl-faq.html#MereAggregation
    http://www.gnu.org/licenses/gpl-faq.html#GPLInProprietarySystem
    http://www.gnu.org/licenses/gpl-faq.html#GPLWrapper

    So, in general, probably not, although you might find a way around it. Specifically from the third one (which is exactly this case), "The fact that proprietary module A communicates with GPL-covered module C only through X11-licensed module B is legally irrelevant; what matters is the fact that module C is included in the whole. "

    Phyphor on
  • peterdevorepeterdevore Registered User regular
    edited July 2010
    You don't have to give credit to anyone for just using the same approach or algorithm to a programming problem. As long as you don't copy the code, copyright does not apply. The idea that algorithms or mathematics can be proprietary is a silly thing that people in the GPL world are fighting against, not for. Software patent cases against small companies are unheard of as far as I know.

    The 'viral' nature of the GPL was a necessity at the time it was created, much like books, code had the danger of being lost over time. People still distributed everything as a binary since the source code was so huge in comparison. It was designed to make immortal, free code, basically.

    peterdevore on
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited July 2010
    Well, regardless of the necessity of it's viral nature at creation, every subsequent version has also included those provisions. Personally, I just don't use anything under the full GPL license and any code I write and want to explicitly be open source is just under the New BSD license.

    Phyphor on
  • rfaliasrfalias Registered User regular
    edited July 2010
    So C# question; having issues with changing a Form element, say a label, from outside the forms class.

    If I have class 'form' and class 'a', how can class 'a' modify form.label.text?
    If I make a new 'form' object in class a, and set label.text, nothing happens because it's a new form object...

    So how can you pass the label.text from class a, to the existing form object???

    Does that make sense?
    I was able to accomplish it by using Controls.Find, but that seems rather cumbersome...

    rfalias on
This discussion has been closed.