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/

[Programming] Thread: Fixed last bug in 5 month thread

ecco the dolphinecco the dolphin Registered User regular
As part of best practice, we programmers often reuse OPs - such as the one from this old thread:

This is the PA programming thread, home to programmers everywhere. Here we talk about cats, ponies, synergised high-efficiency software cloud platforms, and occasionally programming. Apparently the old OP is, well, old, so we've constructed a revolutionary new cost-effective commercial-grade solution for all your enterprise needs.
padevnet.png
PADev.net is a project started up by this thread to support PA developers. A discussion about shared hosting turns into an idea to have hosting and a community to support those working on hobby programs and web services and what not.

Some things require a dedicated VPS but the bar of entry isn't that low. The cost is not extravagant but the know-how required to manage one is daunting for many. PAdev.net provides a share of hosting and support, a $5 monthly fee nets you a shell account on the hub server and the expertise of your peers.

Community members looking to help out can request an account for the website, where all members can create and maintain guides and share project updates. There is no cost to have a community account, just contact an administrator. Also available are you@padev.net email accounts or forwarders.

Current administrators: @Infidel

Languages
  • Python - One of the most popular scripting languages around, Python is the go-to language for...just about everything, actually. Its high scalability and widespread support through third-party libraries make it useful for many applications, from simple five-minute jobs to complex Web servers. Python can also be embedded or bound into lower-level languages such as C, letting you write performance-critical code as well as providing access to libraries written for those languages.
  • Ruby - Another popular scripting language, Ruby is best known as the basis for Ruby on Rails, a framework for Web development that competes with its Python equivalent, Django. While not quite as famous as the juggernaut that is Python, Ruby is nonetheless prolific - modern versions of RPG Maker use it as their scripting language, for instance. And, of course, it can be embedded into other applications, much like Python.
  • Lua - Yet another scripting language. Lua is built on two principles: simplicity and minimalism. Designed with embedding in mind, Lua's overhead is tiny (it can be counted in hundreds of kilobytes at most) and the language itself only provides a handful of constructs...until you master the black arts of tables and metatables. Those who have done so claim to have seen the face of God; these claims are as yet unsubstantiated. What we do know, however is that in recent years Lua has garnered much attention thanks to LuaJIT, a project that provides not only a just-in-time compiler for Lua (granting a massive speed boost - almost C-like performance, in fact), but also an FFI (foreign function interface) library, allowing Lua scripts to directly call C functions without the hassle of writing boilerplate C bindings.
  • C and C++ The Ones Who Came Before. C and C++ are old, clunky, archaic...and the most popular languages in existence. C was conceived in an era when memory was limited and programs were generally written in non-portable assembly languages. The underlying concept (which persists to this day) was that a compiler would take C code, turn it into assembly, and then turn that into an executable or library. Thus, programmers now only had to port most of the codebase instead of all of it! (the situation has improved considerably since then, of course - these days, only the really low-level stuff has a tough time being cross-platform). C++ came some time later, and shook things up significantly with the concepts of classes and generics. Modern C++ also includes the Standard Template Library, or STL, which provides all sorts of useful functionality to make life almost painless. These days most people will learn something simpler like Python before these guys, but make no mistake - everything from your operating system to your favourite video games to your microwave can trace its roots back to one of the two.
  • C# - The poster boy for Microsoft's .NET Framework, C# is a JIT-compiled language modelled after C++, but without any of the associated pain. Though initially developed as a robust alternative for Windows development, Microsoft makes the specifications available at no cost, which has led to other implementations popping up - the most well-known being the cross-platform Mono. The main draw of C# is its ease of use: with a ridiculous number of APIs available by default and the ability to call into native code, you'll have a tough time finding something higher-level that you can't do in C#. The fact that Visual Studio, one of the best IDEs around, also supports C#, is just icing on the cake.
  • Android - Directly responsible for bringing this OP into the 21st century, Android is a pseudo-operating system framework which runs on top of Linux. Android is primarily written in Java, though it also combines elements of C, C++ and sometimes even Python, and is designed for mobile devices. The Android application framework represents an almost entirely event-driven paradigm written primarily in Java which heavily utilises usage of background services, model-view-controller, and sub-classing as a method of changing behaviour of standard pieces. Also, it runs on your phone!
  • Java - :rotate:
  • PHP - :rotate:

(Credit: Original OP here)

Penny Arcade Developers at PADev.net.
ecco the dolphin on
«13456799

Posts

  • bowenbowen How you doin'? Registered User regular
    YOU'RE NOT MY REAL DAD

    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
  • bowenbowen How you doin'? Registered User regular
    Also debugging php is a pain in my ass.

    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
  • bowenbowen How you doin'? Registered User regular
    Ecco always breaking the thread tags

    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
  • NightslyrNightslyr Registered User regular
    bowen wrote: »
    Also debugging php is a pain in my ass.

    How're you trying to debug it?

  • ecco the dolphinecco the dolphin Registered User regular
    bowen wrote: »
    Ecco always breaking the thread tags

    File a jira. We'll get around to it next sprint.

    Penny Arcade Developers at PADev.net.
  • TofystedethTofystedeth Registered User regular
    //This OP incorporates the PA coding style rules
    public class StyleOP : OP
    {
       public StyleOP()
       {
          base.DisplayContent();
          DisplayStyleGuide();
       }
       private void DisplayStyleGuide()
       {
          throw NotImplementedException;
       }
    }
    

    steam_sig.png
  • bowenbowen How you doin'? Registered User regular
    Nightslyr wrote: »
    bowen wrote: »
    Also debugging php is a pain in my ass.

    How're you trying to debug it?

    Right now, with errors/warnings turned on the web server.

    Change document, redeploy with git, check to see if it works.

    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
  • gavindelgavindel The reason all your software is brokenRegistered User regular
    Aaah, that new thread smell. Either that, or my graphics card is on fire.

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • NightslyrNightslyr Registered User regular
    edited March 2015
    bowen wrote: »
    Nightslyr wrote: »
    bowen wrote: »
    Also debugging php is a pain in my ass.

    How're you trying to debug it?

    Right now, with errors/warnings turned on the web server.

    Change document, redeploy with git, check to see if it works.

    Ugh, that's like the worst way to do it.

    Can you get your hands on a copy of PhpStorm? It has debugging built in (with a little bit of setup). Breakpoints, the whole nine.

    EDIT: You need the xdebug PHP module installed to run it, however. That said, it's a very popular module, and trivial to install.

    Nightslyr on
  • RendRend Registered User regular
    A project manager, a hardware engineer, and a programmer are riding to a trade show. They crest a hill and the breaks on the car give out. After a terrifying descent, they manage to reach the bottom of the hill and coast to a stop. They get out of the car and begin discussing how to solve this issue.

    The project manager says "we need to schedule a meeting and form a team to deal with this car issue. I'll take initiative on this by preparing a roadmap and some initial deadlines."

    The hardware engineer responds, "we don't need any of that. Just give me a screwdriver and a couple hours and I'll have this thing up and running again no problem."

    The programmer interjects "first we should probably roll the car back up the hill to see if it happens again."

  • SpawnbrokerSpawnbroker Registered User regular
    I'm going upstate this weekend, and I bought Enemy Within on my ipad for the trip. 13 bucks for one of my favorite games on a portable touch screen interface? Firaxis, you're too good to me.

    I don't know what this has to do with programming. Except that more people need to port my favorite games to ipad.

    Steam: Spawnbroker
  • bowenbowen How you doin'? Registered User regular
    Nightslyr wrote: »
    bowen wrote: »
    Nightslyr wrote: »
    bowen wrote: »
    Also debugging php is a pain in my ass.

    How're you trying to debug it?

    Right now, with errors/warnings turned on the web server.

    Change document, redeploy with git, check to see if it works.

    Ugh, that's like the worst way to do it.

    Can you get your hands on a copy of PhpStorm? It has debugging built in (with a little bit of setup). Breakpoints, the whole nine.

    EDIT: You need the xdebug PHP module installed to run it, however. That said, it's a very popular module, and trivial to install.

    You're telling me.

    I completely forgot about phpstorm, god this would make my life so much easier.

    Breakpoints would be a godsend right now.

    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
  • NightslyrNightslyr Registered User regular
    bowen wrote: »
    Nightslyr wrote: »
    bowen wrote: »
    Nightslyr wrote: »
    bowen wrote: »
    Also debugging php is a pain in my ass.

    How're you trying to debug it?

    Right now, with errors/warnings turned on the web server.

    Change document, redeploy with git, check to see if it works.

    Ugh, that's like the worst way to do it.

    Can you get your hands on a copy of PhpStorm? It has debugging built in (with a little bit of setup). Breakpoints, the whole nine.

    EDIT: You need the xdebug PHP module installed to run it, however. That said, it's a very popular module, and trivial to install.

    You're telling me.

    I completely forgot about phpstorm, god this would make my life so much easier.

    Breakpoints would be a godsend right now.

    If you're going to do non-trivial PHP work for any length of time, I highly recommend you get it. A new personal license is $99, which is totally justifiable.

  • bowenbowen How you doin'? Registered User regular
    Gonna get my boss to spring for it.

    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
  • templewulftemplewulf The Team Chump USARegistered User regular
    Nightslyr wrote: »
    bowen wrote: »
    Nightslyr wrote: »
    bowen wrote: »
    Nightslyr wrote: »
    bowen wrote: »
    Also debugging php is a pain in my ass.

    How're you trying to debug it?

    Right now, with errors/warnings turned on the web server.

    Change document, redeploy with git, check to see if it works.

    Ugh, that's like the worst way to do it.

    Can you get your hands on a copy of PhpStorm? It has debugging built in (with a little bit of setup). Breakpoints, the whole nine.

    EDIT: You need the xdebug PHP module installed to run it, however. That said, it's a very popular module, and trivial to install.

    You're telling me.

    I completely forgot about phpstorm, god this would make my life so much easier.

    Breakpoints would be a godsend right now.

    If you're going to do non-trivial PHP work for any length of time, I highly recommend you get it. A new personal license is $99, which is totally justifiable.

    I'm using RubyMine, and after an initial adjustment period (coming from Sublime Text and cmd line), I absolutely cannot endorse their products enough. I thought $100 was steep, but it really pays for its own productivity.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • DyasAlureDyasAlure SeattleRegistered User regular
    Incindium wrote: »
    Using the smallest type expected right now leads to problems in the future. I've had to implement fairly substantial changes to switch from INT to BIGINT in SQL Server for identity fields (and int to int64 in C# code) because no one thought about having that many rows over the lifetime of a database.

    google didn't think videos would get to high of watches . . . I wonder where that got them.
    wait, am I referenced in the thread title? Wow, I feel honored.

    Update on the forking:
    I will commit the fork to the home project on Saturday morning. After 2 days in debug, all the extraneous code has been removed, and the executable is working great. One bug we hope to work out is the sound. The only thing that seems to be emitting from the speakers is a loud crying sound. The parent classes are working hard to get a function to pass to the child so the sound can be more legible.

    My%20Steam.png?psid=1My%20Twitch%20-%20Mass%20Effect.png?psid=1=1My%20Youtube.png?psid=1
  • TofystedethTofystedeth Registered User regular
    It's possible the child class actually needs to be more tightly coupled.

    steam_sig.png
  • NightslyrNightslyr Registered User regular
    edited March 2015
    bowen wrote: »
    Gonna get my boss to spring for it.

    When you do get it, follow these instructions (http://blog.jetbrains.com/webide/2011/02/zero-configuration-debugging-with-xdebug-and-phpstorm-2-0/) in order to setup the debugger. Yeah, the blog post is a few years old (way back with version 2.0 of PhpStorm), but the setup is pretty much the same now in version 8.0.3.
    templewulf wrote: »
    I'm using RubyMine, and after an initial adjustment period (coming from Sublime Text and cmd line), I absolutely cannot endorse their products enough. I thought $100 was steep, but it really pays for its own productivity.

    Yeah, JetBrains' stuff is really high quality. And they add a bunch of new quality of life additions every version. Plus, each editor has a shitload of extensions they can install, too.

    Nightslyr on
  • templewulftemplewulf The Team Chump USARegistered User regular
    Nightslyr wrote: »
    bowen wrote: »
    Gonna get my boss to spring for it.

    When you do get it, follow these instructions (http://blog.jetbrains.com/webide/2011/02/zero-configuration-debugging-with-xdebug-and-phpstorm-2-0/) in order to setup the debugger. Yeah, the blog post is a few years old (way back with version 2.0 of PhpStorm), but the setup is pretty much the same now in version 8.0.3.
    templewulf wrote: »
    I'm using RubyMine, and after an initial adjustment period (coming from Sublime Text and cmd line), I absolutely cannot endorse their products enough. I thought $100 was steep, but it really pays for its own productivity.

    Yeah, JetBrains' stuff is really high quality. And they add a bunch of new quality of life additions every version. Plus, each editor has a shitload of extensions they can install, too.

    Yeah, I'm a fan of the markdown addon, and the ability to debug controllers with authorization so easily is life-changing.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • DyasAlureDyasAlure SeattleRegistered User regular
    It's possible the child class actually needs to be more tightly coupled.

    I considered virtualizing the "audible" function from the parent class into the child class. But the problem was the child class didn't seem to interface with the virtual function in an.... audible way?

    My%20Steam.png?psid=1My%20Twitch%20-%20Mass%20Effect.png?psid=1=1My%20Youtube.png?psid=1
  • DyasAlureDyasAlure SeattleRegistered User regular
    Commit successful:

    Luke%20Alure%20thumb.jpg?psid=1

    He is home, and he has my eyes.

    My%20Steam.png?psid=1My%20Twitch%20-%20Mass%20Effect.png?psid=1=1My%20Youtube.png?psid=1
  • electricitylikesmeelectricitylikesme Registered User regular
    DyasAlure wrote: »
    Commit successful:

    Luke%20Alure%20thumb.jpg?psid=1

    He is home, and he has my eyes.

    Rejected. Please break it up into more manageable patches.

  • DyasAlureDyasAlure SeattleRegistered User regular
    Rejected. Please break it up into more manageable patches.
    You made me laugh.

    My%20Steam.png?psid=1My%20Twitch%20-%20Mass%20Effect.png?psid=1=1My%20Youtube.png?psid=1
  • urahonkyurahonky Registered User regular
    Oh dip, congrats Dyas! My wife is about a week away from popping. I'm pretty terrified at this point in my life but it'll all work out... I hope.

  • ecco the dolphinecco the dolphin Registered User regular
    urahonky wrote: »
    Oh dip, congrats Dyas! My wife is about a week away from popping. I'm pretty terrified at this point in my life but it'll all work out... I hope.

    Hang on a sec

    Didn't we already have a Honky 2.0 a few years ago?

    Is this... Honky 3.0?!?!

    Penny Arcade Developers at PADev.net.
  • LD50LD50 Registered User regular
    Honky 2.1.2 Newish and slightly improved.

  • MNC DoverMNC Dover Full-time Voice Actor Kirkland, WARegistered User regular
    Working on the next lesson in the Udacity Intro to CS class. Two things I noticed that were weird;

    1) We are learning functions but the instructor calls them procedures. My wife explained that at her job, procedures are usually for doing something without returning value while functions do something and return value(s). Is that common for you guys?

    2) The instructor has all the variable and functions names spelled out with underscores. Like, first_number instead of the camel case firstNumber. Which do you prefer? I'm used to camel case and the wife agrees that it's usually better.

    Anyway, back to your high level programming shit.

    Need a voice actor? Hire me at bengrayVO.com
    Legends of Runeterra: MNCdover #moc
    Switch ID: MNC Dover SW-1154-3107-1051
    Steam ID
    Twitch Page
  • hippofanthippofant ティンク Registered User regular
    MNC Dover wrote: »
    Working on the next lesson in the Udacity Intro to CS class. Two things I noticed that were weird;

    1) We are learning functions but the instructor calls them procedures. My wife explained that at her job, procedures are usually for doing something without returning value while functions do something and return value(s). Is that common for you guys?

    2) The instructor has all the variable and functions names spelled out with underscores. Like, first_number instead of the camel case firstNumber. Which do you prefer? I'm used to camel case and the wife agrees that it's usually better.

    Anyway, back to your high level programming shit.

    I think the answers to both are, "Depends on your programming language (and its culture)."

  • urahonkyurahonky Registered User regular
    urahonky wrote: »
    Oh dip, congrats Dyas! My wife is about a week away from popping. I'm pretty terrified at this point in my life but it'll all work out... I hope.

    Hang on a sec

    Didn't we already have a Honky 2.0 a few years ago?

    Is this... Honky 3.0?!?!

    Yep. My daughter is almost 2 now and my son is -1 week old!

  • AnteCantelopeAnteCantelope Registered User regular
    MNC Dover wrote: »
    Working on the next lesson in the Udacity Intro to CS class. Two things I noticed that were weird;

    1) We are learning functions but the instructor calls them procedures. My wife explained that at her job, procedures are usually for doing something without returning value while functions do something and return value(s). Is that common for you guys?

    2) The instructor has all the variable and functions names spelled out with underscores. Like, first_number instead of the camel case firstNumber. Which do you prefer? I'm used to camel case and the wife agrees that it's usually better.

    Anyway, back to your high level programming shit.

    Technically your wife is right. In practice they're the same, and are used interchangeably.

    Most places seem to use camel case, but in Python you're meant to use CamelCase for class names and under_scores for methods, fields, and variables. I don't know why, that's just the convention.

  • SaerisSaeris Borb Enthusiast flapflapflapflapRegistered User regular
    I have some kind of mental block which prevents me from reading underscore_variables without an awkward mental pause at every underscore. To me, the underscore has an English sentence period's worth of pause, and even after ten years I still cannot shake that.

    If I read underscore code long enough, it gets even worse. I start mentally inserting that pause after every syllable too, not just at every underscore. It becomes nigh unreadable. Most Ruby code is a nightmare.

    That's probably just me, though.

    borb_sig.png
  • AnteCantelopeAnteCantelope Registered User regular
    I don't like it, just because the key's out of the way, and with variables needing them, and methods often needing several, you end up reaching over there a lot, really breaking up the flow of typing. I don't normally think typing is a significant part of programming, but if I have to frequently stop and think about typing, even for something as small as reaching for the underscore key, it can distract me enough to disrupt my flow of thought.

  • ecco the dolphinecco the dolphin Registered User regular
    urahonky wrote: »
    urahonky wrote: »
    Oh dip, congrats Dyas! My wife is about a week away from popping. I'm pretty terrified at this point in my life but it'll all work out... I hope.

    Hang on a sec

    Didn't we already have a Honky 2.0 a few years ago?

    Is this... Honky 3.0?!?!

    Yep. My daughter is almost 2 now and my son is -1 week old!

    Oh man

    You're in your final sprint!

    Have you figured out your user stories yet??!

    Penny Arcade Developers at PADev.net.
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    urahonky wrote: »
    urahonky wrote: »
    Oh dip, congrats Dyas! My wife is about a week away from popping. I'm pretty terrified at this point in my life but it'll all work out... I hope.

    Hang on a sec

    Didn't we already have a Honky 2.0 a few years ago?

    Is this... Honky 3.0?!?!

    Yep. My daughter is almost 2 now and my son is -1 week old!

    Oh man

    You're in your final sprint!

    Have you figured out your user stories yet??!

    The only time when "Clean this shit up" is considered an appropriate user story.

  • DehumanizedDehumanized Registered User regular
    I don't like underscores because one of the toolkits I need to interact with strips them from table names so I am staring at a class named like this:

    VendorTable1000ShippingItemsSchedule

    which represents a table like this:

    VendorTable_1000_ShippingItems_Schedule

    and to refer back to the database if I'm running like, an ad-hoc query to see what the data in it looks like I've gotta guess how many and where the underscores are

  • ASimPersonASimPerson Cold... and hard.Registered User regular
    I dislike camelcase pretty thoroughly.

  • Alistair HuttonAlistair Hutton Dr EdinburghRegistered User regular
    MNC Dover wrote: »
    Working on the next lesson in the Udacity Intro to CS class. Two things I noticed that were weird;

    1) We are learning functions but the instructor calls them procedures. My wife explained that at her job, procedures are usually for doing something without returning value while functions do something and return value(s). Is that common for you guys?

    2) The instructor has all the variable and functions names spelled out with underscores. Like, first_number instead of the camel case firstNumber. Which do you prefer? I'm used to camel case and the wife agrees that it's usually better.

    Anyway, back to your high level programming shit.

    Technically your wife is right. In practice they're the same, and are used interchangeably.
    <Pedant alert>
    Ada would like to have a word with you.
    </Pedant alert>

    I have a thoughtful and infrequently updated blog about games http://whatithinkaboutwhenithinkaboutgames.wordpress.com/

    I made a game, it has penguins in it. It's pay what you like on Gumroad.

    Currently Ebaying Nothing at all but I might do in the future.
  • ecco the dolphinecco the dolphin Registered User regular
    ASimPerson wrote: »
    I dislike camelcase pretty thoroughly.

    *narrows eyes*

    We shall have to agree to disagree on this matter, you otherwise rather froody dude. =P

    Penny Arcade Developers at PADev.net.
  • GrobianGrobian What's on sale? Pliers!Registered User regular
    I feel like for many of us the great coding debates (camel case vs underscores vs ..., tabs vs spaces, curly brackets on their own line or not etc) mostly come down to our first programming teacher. Those are all hard habits to break when you get used to a specific way.

  • bowenbowen How you doin'? Registered User regular
    edited March 2015
    CamelCase->IsGreat();

    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
This discussion has been closed.