A question about the 3DS and programming

Discussion in '3DS - Homebrew Development and Emulators' started by 1Zero, Sep 18, 2015.

  1. 1Zero
    OP

    1Zero Advanced Member

    Newcomer
    51
    1
    Sep 18, 2015
    Venezuela
    This might sound stupid, but should a complete beginner who's interested in 3DS homebrew, learn how to program with C++ or Python ?
     
  2. Lucar

    Lucar GBAtemp Advanced Fan

    Member
    508
    1,033
    Sep 12, 2015
    Canada
    LUA would be best, C is way out of a beginners league. Plus, LUA is like Python in some ways, so it would make it easier to learn python earlier.
     
  3. zoogie

    zoogie simple pimp tool

    Member
    6,508
    8,382
    Nov 30, 2014
    United States
    C++ or C.
    You can't even use python on 3ds yet.
     
  4. sup3rgh0st

    sup3rgh0st Top Tier Ghost

    Member
    292
    183
    Apr 22, 2010
    United States
    You should learn C, which is used with Smea's Homebrew Launcher. Take a look at his samples here: https://github.com/smealum/ctrulib/tree/master/examples : as well as the Pixel program that comes with DevKitARM/CitruLIB.
    You can go a long way by just copy-pasting from samples and modifying numbers. When in doubt, look at other peoples source : http://www.3dbrew.org/wiki/Homebrew_Applications : to learn how to make the basics, then expand on what you learned. While I'm sure people would say my code is sloppy and terrible, feel free to look at the source for a simpler game I made : https://github.com/sup3rgh0st/Chroma-Cannon :.
     
  5. 730

    730 Professional Shitposter

    Member
    465
    377
    Apr 2, 2015
    Argentina
    I've only used Lua (lpp-3DS) and it's reaaaaally easy, you can do really neat stuff like playing sound or drawing fonts with 2-5 lines of code. Eventually I want to learn (and migrate to, if possible) C/C++, but yeah, I'll take it easy.
     
  6. ~Poke~

    ~Poke~ GBAtemp Regular

    Member
    260
    55
    Aug 18, 2015
    Lua is probably a lot better for a beginner. I have some experience coding JavaScript so I thought I'd be ok jumping into C. That was silly considering the differences, but I think I'm getting there... That said, there's a lot to know about C and a lot of formalities that you can completely skip with a scripting language like Lua. C code will end up running more efficiently IF you get it right, but that's a big if and in a lot of cases it isn't worth it. Meanwhile Lua should allow you to code your program more easily and efficiently. It also looks like there are a lot of functions built in to lpp that there aren't 3ds C libraries for, though maybe I just haven't found them :P
     
  7. Aidan25

    Aidan25 Advanced Member

    Newcomer
    59
    88
    Oct 2, 2015
    Down Under
    What sort of things can you code with Lua? Also where can I learn it?
     
  8. dfsa3fdvc1

    dfsa3fdvc1 GBAtemp Regular

    Member
    215
    94
    Jan 3, 2015
    Albania
  9. TheCruel

    TheCruel Developer

    Banned
    1,351
    2,884
    Dec 6, 2013
    United States
    If you plan on making anything substantial, learn C++
     
  10. Aidan25

    Aidan25 Advanced Member

    Newcomer
    59
    88
    Oct 2, 2015
    Down Under
    Where's the best place I can learn this or what can I do to use my current programming skills to teach myself it?
     
  11. keanutah

    keanutah GBAtemp Regular

    Member
    173
    130
    Sep 18, 2015
    United States
    As someone who is pretty decent at C, start with Lua. I've been writing Lua myself and it's perfect for small programs and games, and Lua Player Plus has a pretty damn good library to give you access to common 3DS functionality, so you won't really be missing out on much unless you're trying to do something more advanced.
     
    Aidan25 likes this.
  12. Aidan25

    Aidan25 Advanced Member

    Newcomer
    59
    88
    Oct 2, 2015
    Down Under
    Interesting. Where can I download the IDE or compiler/interpreter?
     
  13. keanutah

    keanutah GBAtemp Regular

    Member
    173
    130
    Sep 18, 2015
    United States
    Aidan25 likes this.
  14. Aidan25

    Aidan25 Advanced Member

    Newcomer
    59
    88
    Oct 2, 2015
    Down Under
    Thank you.
     
  15. TheCruel

    TheCruel Developer

    Banned
    1,351
    2,884
    Dec 6, 2013
    United States
    It really depends how you want to learn things. These days there are a lot of interactive sites I think are fun to learn languages (e.g. codecademy.com) so you can try that, and others, if you want.

    I personally wouldn't start programming for the 3ds. It's harder and more frustrating than common programming for PC and you can't do as much. But that's your call.
     
  16. Aidan25

    Aidan25 Advanced Member

    Newcomer
    59
    88
    Oct 2, 2015
    Down Under
    I guess I could try one of them. Yeah well I've done a bit of PC programming, simple programs mainly in a language that is obsolete and no one uses that we learned programming on at school. I think I can transfer my skills though to C or C++ even though FutureBASIC (the aforementioned language) is not object oriented/a 4GL.
     
  17. legofan623

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    I actually learned lua from making Garry's Mod addons!
     
  18. Aidan25

    Aidan25 Advanced Member

    Newcomer
    59
    88
    Oct 2, 2015
    Down Under
    I don't even have Garry's Mod haha. I hardly game on my computer as it is, I prefer console (but I am a strong advocator for the PC master race xP)
     
    legofan623 likes this.
  19. The_Meistro

    The_Meistro GBATemp's "Official" Hank Hill

    Banned
    633
    336
    Aug 22, 2015
    The Magic School Bus
    Ok I'm gonna use lua
     
  20. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    12,299
    5,324
    Mar 17, 2010
    Norway
    Alola
    Lua is definitely the easiest to get into if you have never programmed before, but C/C++ is more useful knowledge to have since it's used on virtually every operating system and device and is a lot faster than scripting, and if you ever want to have a job in programming it's a very useful language to know.

    If you end up going with C/C++ it would be best to start with programming something simple for PC before you try making 3DS homebrew, since the libraries there are a lot more mature making programming for the platform easier, and you could use a library like for example SDL to make game development easier. Once you are familiar with C/C++ programming for PC, it will be easier to get used to it for 3DS.

    Otherwise Lua is not a bad choice if you are fine with just making simple 2D games and don't care about programming beyond 3DS homebrew.
     
    Last edited by The Real Jdbye, Oct 5, 2015