So you want to learn to program?

Discussion in 'Computer Programming, Emulation, and Game Modding' started by FAST6191, Sep 9, 2014.

  1. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United States

    So you want to learn to program then, this is good as it is a great skill to have and we are probably still a few years out from human language style programming.

    As far as most around here are concerned there are going to be three types of programming

    1) The hardcore/traditional knowing what is happening at the CPU level and everything up from there. A lot of games related programming will fall under this, certainly if you want to hack games you would probably want to have an appreciation for it.

    2) "I just need to make this document/picture/small database turn into this format so another program can use it".

    3) I want to do websites. Technically you can do a lot of 2) with many website programming languages/methods as well.

    All three are valid things to be doing, all three make people lots of money though it is seldom easy money.

    For the most part around here we will suggest you go in for 2) as you can do most things with it, 1) is really only necessary when you need lots of speed and for the most part 3) amounts to learn some PHP, HTML, CSS and just install wordpress or some script that does what you want (there probably is one already).

    Still this is not being very helpful so onto the meat of the subject.

    Enough of the setup, get to the links

    Programming is done in so called programming languages, there are hundreds of them but this list narrows down considerably if you only include the ones in common use (and you probably should). It is often possible to mix languages within a program, typically this is done when something needs to be faster or when a new programmer takes over and is more comfortable in another language.
    There are endless distinctions between different languages, many of which are of limited use, but the main one would probably be high level and low level.
    High level languages take away some of the fiddly concepts associated with lower level languages, provide you a lot of premade means to do lots of different/common tasks and will generally be able to be ported between different operating systems far more easily than others. They come at the cost of being slower than some lower level languages (not so much of a problem in the modern world), maybe not integrating as tightly with the operating system and not teaching people about the lower level aspects of their code. However they can also come with the benefits of being more secure owing to said low level concepts being easy to mess up and they do work so people use them.

    If you are learning to program we highly suggest this playlist
    and this site

    More generally the languages of choice are

    1) C and C++
    C is very old but used extensively in operating systems, video encoder/filter programming, driver development and other high performance tasks. It is not suggested here as a language to learn with but if you plan to do high end coding, such as those fields mentioned in the previous sentence, you might wish to go back and learn it afterwards.
    C++ is newer, though still old compared to a lot of other things on this list, and has many uses within those three as well.
    Above this looms assembly language. This is often a slightly more readable version of what the processor does (which is a lot of quite simple instructions that make up a complex task), very few code in it any more and nobody really codes full programs in it (mainly small sections that have to run fast). Naturally different processors and even different operating systems have different ways of setting about assembly programming.

    Related to this would be objective C. Objective C was pioneered by Apple and is what they suggest for coding programs to run on OSX, and is was the main language used (other than web programming) for ios (ipods/ipads/iphones and similar things) though these days there is also swift.

    2) Python, C# (see also .net), Java, Ruby, Perl and Lua (used for a lot of emulators) has links for all of these.
    C# technically works outside Windows but most consider it more for Windows based programming, see mono if you want C# on other platforms. All the others are largely platform agnostic and if you code it right then the software written in them will run happily on other operating systems.
    Java is very popular among business software developers, possibly because it got in there first and caught the market (business software has a very long lifetime). Owing to some security issues it has fallen out of favour among some people, however it is very popular and can get things done.
    Ruby is more commonly seen in web development (as Ruby on Rails) but is made so it works well as a normal programming language.
    Python is very popular as a scripting language and is often considered the glue that holds modern computing together. If you have to get two things to talk to each other it is probably written in python.
    Perl once rivalled python in popularity but python grew faster. It works in kind of similar ways to python (though it has differences in others). If you have text that needs editing then this is what a lot of people look at.
    Lua is much like Python and Perl, however it has found many fans among game and emulator authors for plugins and scripts.

    3) HTML, CSS, PHP and javascript.
    HTML and CSS are not programming languages, however they are what web browsers render. At one time they were separate entities but today they are basically indivisible and we would shy away from anybody that wants to consider them separately.
    Javascript is a programming language and generally runs on the user's computer.
    Actual web programming back on server can be done by any number of languages (though many seen in 2) are seen again here) but the big two are
    Not liked by some it is still a popular programming language for web use, also one of the easier languages to jump in and start getting stuff done with.

    This is Microsoft's language of choice for their servers, fairly closely related to C#/.net. As you have to pay for Microsoft operating systems to run this on servers where Linux based ones may come for free it is not quite as common in many circles, especially not free and/or open source software, but it can be worth looking at, especially if you otherwise have Microsoft servers and want your website to talk to those.

    You may also want a database for your server, or indeed the program you are using will use one. There are many database formats but the main three are
    MySQL (and other SQL related languages), PostgreSQL and Oracle.
    Oracle tends to be used by companies needing high end performance and you are not likely to encounter it in the free software world. MySQL is mostly free and very popular, however it has some odd licensing parts so there is something of a push to go to another type of database. If you learn general SQL then most other vendor specific extensions will be like learning a slightly different dialect of a human langauge.

    There is also XML to consider both as part of database/info rendering and general web programming. XML is a way of writing data so other things can look at it (parse it to use programming terminology). Going further still you might like to read up on .htaccess

    You can run normal programs on web servers, and have the web server program run said CGI programs on command. The most common method for this would be "CGI" and "fastCGI". Equally many Linux/BSD based servers will have so called "cron jobs" which run at set periods (including once a minute) to do certain tasks, other servers also have similar functionality.

    What to type my program in?
    Programming languages are usually text based so any text editor that spits out plain text can do it. Many will choose to have more programming related editors and even full programming suites commonly referred to as IDE (integrated development environments).
    Many IDEs are geared towards a given language and you can look at them once you have found a language you want to learn. Some resist using and avoid suggesting, or even suggest avoiding, IDEs as they can encourage lesser code by virtue of helping the programmer out. There is a certain logic to this but not one we can really get behind.

    If you just want a basic text editor for windows with a few programming extras most will say you can not really go wrong with notepad++
    On linux much of the notepad++ functionality is available in "Geany".

    If you want a basic kind of IDE for C and C++ then code::blocks

    Eclipse is one of the more noted Java IDEs

    Microsoft have their own coding tools, ones that are highly respected, in the form of visual studio.

    Apple tend to use Xcode

    Python is kind of its own IDE when you install it.

    For HTML, CSS and javascript you may also want a debugger for your web browser. Most modern browsers will come with a basic one. For firefox the firebug addon comes highly recommended

    Programming for kids and academics.
    The 1) 2) and 3) list is aimed more at people that need to get things done. If you want to have your child (or you are one) and you want an easy in to programming then there are options.
    Programming languages aimed at kids have been around for decades (see things like Logo) but these days most would probably point people at Scratch and tell them to give that a go.
    It is quite visually driven and that seems to work well as far as teaching concepts.

    The academic side of programming has a long and strange history, though there is some crossover into the real world stuff there is also much that barely makes it outside of academic fields. You are encouraged to see if there is one for your field (there is often some piece of legacy software written in a very old or not so common language, however as it does what it needs to do then it has stuck around -- business software may run for decades but academic can be even longer). Not wishing to go too far into that we shall instead stick to academic coding discussions. Much like general linguistics will compare and contrast human languages, sometimes with the aim of creating purer concepts within them, there comes academic programming languages that aim to teach, be able to be extended easily and ease certain types of development. Lofty goals but ones that are actually often achieved if you know what you are doing.
    The most popular languages here are Scheme and Lisp, though things like Haskell are also popular and older languages like Pascal also still appear.

    I want to make robots and electrical devices
    General electronics is probably outside the scope of this thread, it is covered extensively elsewhere on the internet though.
    Both of these tasks tend to want programming nowadays. There are typically three classes of device to do this with, possibly 4 depending upon how you want to view things.
    King of the hill really. They are often the fastest, they often have the most resources for the current draw/purchase price and they are the most extensible of all of them (you can quite literally remake electrical devices/chips that work the same as the originals if you have enough gates to do it). Consequently they can be an absolute pig to program and use, though modern stuff is getting to be quite nice.
    Two links that form a good introduction to FPGAs
    Though there are some higher level options these days the classical programming languages used by them were VHDL and Verilog.
    Some also found them useful in certain types of high performance computing -- aspects of password cracking, bitcoin mining (for a while anyway), various people in high speed stock trading... all have been seen to use FPGAs to great effect.

    Slightly less powerful than a FPGA (CPLDs are also nowhere near as good at replicating devices as FPGAs) but arguably more than a microcontroller. Their domain is being somewhat encroached upon by microcontrollers at the lower and the easier to use versions of FPGAs at the higher one. Classically though they were less powerful than FPGAs but did more than microcontrollers, however they may have also been easier to use during this period.

    The two big makers/brands of these are the Microchip Technology "PIC" and Atmel "AVR", you may have even heard of them before. They are not great at doing lots of maths, not great at taking wide ranges of inputs, typically not fast enough to drive many outputs (including video) and can consume a reasonable amount of power for what they do, though this power is still well within "good runtimes on a cheap and cheerful battery" range. However if you just need to take a few inputs (digital or analogue), put out a few outputs, do some basic number crunching/logic on the pins (if these two pins have a signal then output this pattern to another pin and...) they do very well. They are also quite nice to program for.

    High level microcontrollers and minicomputers.
    Various groups, most popularly things like the arduino and teensy++. Arduino got in there early and most things that followed are clones (though being open source hardware that is considered quite acceptable) and adaptations of it.
    It should be noted that this all kicked off a general trend so there are more easily programmable development boards available for FPGAs and such. Equally one of the big strengths of things like the arduino is that people can make "shields" for it which allow you to buy in devices to do a task (networking, motors, infrared, bluetooth.... and list goes on an on).

    At the slightly higher level are minicomputers. Earlier variations on the theme included things like the beagleboard but these days the most popular is probably the raspberry pi set of computers. They often run full graphical operating systems but as they have easily accessible IO pins you can take signals in and put signals out from them then they also play in this field. Bonus is with full operating systems you can often even program in the languages you see elsewhere (it is quite possible to program in python on a raspberry pi and output to pins to drive a robot or some electrical device). Save for cost, the lack of input/output pins and the power they draw you may well be able to go toe to toe with a FPGA in a lot of cases if you use one of these, certainly you will have an easier time if you wish to interact with it via network.

    Other important programming related concepts

    Related to this all this is licensing and the concept of open source. Software is a copyrightable work in all of the world, this means if you write it then you can direct its use like other copyrighted works. Much to the disapproval of many there are also software patents in a few places (though these few places do include the USA and Japan) but let us not get onto that. Though software is subject to copyright not everybody wants to lock down the users of their software and in doing so they often release it as open source, now this is technically a different concept to public domain (where works no longer have copyright and can be used by any) but the concepts brush up against each other. has some popular means by which to release your software to allow others to use it.
    There are different theories as to what constitutes open source but in general open source is code that anybody can download, edit and make a version of to release by themselves. A lot of the time you will have to release your changes upon request; this is one of the bigger differences between the popular GPL and BSD families of licences, though read them carefully before you pick as things like LGPL specifically remove this aspect in some cases.
    Also for some programs you might have to make your own icons/name. For instance the popular web browser known as firefox restricts people from using the name and logo of their project but allows people to use all of the underlying code, hence things like iceweasel.

    A further field is code repositories. If you have been to websites like sourceforge, google code and github you would have seen the frontend to them. As code is typically text based you can treat it like text files. Code repositories allow you to upload files, note the changes, sometimes do automatic building and testing, make new projects based on existing code (a concept known as forking) and generally make things easier to manage. There are many methods here as well and different people have their favourites. The big three in most of open source works, and arguably in general, are

    Considered old and outdated by some it still has a huge legacy following as it has been around a long time.

    SVN (Subversion)
    When CVS was getting a bit long in the tooth this rose up and captured a lot of the market, today some consider it to be long in the tooth.

    The new hot stuff in source code management, it is extremely powerful and some find its concepts a bit harder to get used to. It is well worth knowing about though and its power is actually useful once you know how it works. If you are not using one of the other two from another project we would suggest this one.

    A further two might be Mercurial and Fossil.

    You mainly want to know about them as they will allow you to download the source code, possibly contribute back and have it all set up for most open source projects.

    Programming for mobile devices.
    Mobile devices are popular these days and people like to program for them. Though you can do web related stuff for all three they tend to want you to use their chosen languages.
    The big three operating systems in mobile are

    Helmed by Google and the chosen programming language is typically Java.
    To get programs onto your device you just need to set it up to allow development. To get it onto everybody else's device (assuming they do not want to use developer mode and related things) you want to get it into the google play store. This takes a one time payment to register for.

    IOS (Apple iphone, ipad, ipod and some of the other non-desktop/laptop Apple devices)
    Software for Apple mobile devices is typically coded in a variation on C called objective C, however Apple somewhat recently introduced a somewhat higher level language called Swift, both are also available for normal desktop programming on Apple devices.
    Once the most popular mobile OS it has since lost lots of market share to Android. It is also notable for wanting people to have fairly new versions of Apple's desktop operating system OSX (technically only available on their hardware) to be able to make programs. You also have to register with Apple to get it on their store, it costs $99 USD a year.

    Not as popular as IOS and Android it does still see quite a bit of use in some circles, mainly business environments (though the other two are not slouches there either). has more.

    Programming a highly varied field and this has barely scratched the surface (barely anything was mentioned about security for instance), however this should hopefully give you the means by which to get started.
  2. migles

    migles All my gbatemp friends are now mods, except for me

    GBAtemp Patron
    migles is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Sep 19, 2013
    some questions i'd like to ask

    whats the difference between C and C++ ? what is special\best things on either?
    are they best suitable for some type of software than the other?
  3. marcus134

    marcus134 GBAtemp Advanced Fan

    May 7, 2011
  4. migles

    migles All my gbatemp friends are now mods, except for me

    GBAtemp Patron
    migles is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Sep 19, 2013
    does this mean, if i want to learn a low level language, C would be outdated and i should just learn c++ since its an upgraded\dated language it doesnt make much sense learning C in this "era"?
  5. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United States
    Sorry I meant to say that this and the other two threads that have followed (operating systems and multimedia) were just guides/overviews I dashed out to help with the new sections you see before you. However rather than leaving them languishing on my hard drive/in a staff section like such things usually do I thought I might as well leave them out for suggestions/comment. I know I need to format it better though.

    Anyway mostly what marcus134 said. C is not necessarily outdated but its usefulness in general day to day programming is less useful, C++ very much stealing its crown and it being crept up upon in turn but the likes of python, java and ruby. However C is used a lot in very high end programming (drivers, kernels, video encoding, high performance graphics work, general high performance...) and its legacy is such that it will probably never go away. If you want an example of the legacy of C then see something like K&R C (basically the original C standard) -- it is not quite as lucrative as being a good COBOL programmer is today (COBOL is a language that rose to serious prominence in the business world back in the 1970s and 1980s, only for it to stop being taught and the supply programmers that know it to dry up, today they are drag people out of retirement, pay them telephone numbers for a few months work and consider it a bargain at twice the price) but ones that know and can handle K&R C can do very well for themselves.

    I can not really say I would suggest people learn it off the bat a their first and primary use language in 2014, there are worse things you can do (like learning some form of Basic) but C is hard for a lot of things and if you mainly want to make programs that mortals have to know about then maybe not. If you want to hang out with those that make drivers, make the linux/BSD kernels, make ultra fast video encoding/filtering software, maybe some emulator stuff, general high performance software, maybe some electronics (though that probably falls under drivers) and play with porting old games then yeah eventually think about learning C of some form. If you know K&R C then you also have an option in dealing with legacy business software, I can't say it appeals much to me but there are those that would chase a paycheck.

    Learn it alongside the stuff as the UNSW/Richard Buckland course teaches it, that is good stuff. Learn the ropes of it after you have C++ and another even higher level language (python, java, maybe one of the academic ones) and it will probably benefit you as a programmer.
  6. nando

    nando GBAtemp Addict

    Jan 1, 2008
    United States
    objective c is not just for ios, it is mac os x and it is now swift.
  7. Foxi4

    Foxi4 On the hunt...

    Global Moderator
    Sep 13, 2009
    Gaming Grotto
    The most important difference is the introduction of Classes and Objects which are pretty commonplace in contemporary "object-oriented" programming. You can program in an "object-oriented" way in C using structs, but it's hardly "standard" wheras in C++ Classes and Objects are native and intuitive.
    Xabring likes this.
  8. cracker

    cracker Nyah!

    Aug 24, 2005
    United States
    Dammit, FAST, you make me want to OCR that image to see if there is a hidden message in that binary!

    If you want to learn a low level language then learn some ASM (ARM would be a good choice since that is what most phones, handhelds -- GBA/3/DS/i, mobile devices, set top boxes -- like the Raspberry Pi, co-processors, etc. use currently). Anything that uses normal human words and is structured isn't a low level language. It is good for learning program flow and for learning how to tweak code to make it as fast as possible but it isn't practical for doing large projects in. With compilers having progressed so far you can often get almost as tight code (or more so depending on the programmer) as hand coding it. Also, for diversity you could program in 68K for calculator, Genesis, old Mac, etc. It is very similar to programming an ARM.
  9. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United States
    It should just be 0101010, if there is a message it is a happy accident.

    On objective C I did mean to make that distinction, editing ensures.
  10. marcus134

    marcus134 GBAtemp Advanced Fan

    May 7, 2011
    latest C revision was in 2011 (C11)
    I can't say if it's true or not, but C is perceived to be closer to metal than c++ which makes it better to code things like an OS, and compiler/interpreter for other programming language.

    I'll have to point out that C++ will never be overtaken by Python and Ruby as they are interpreted languages and are very slow and inefficient, ie: you'll never get a good 3d engine , they're nice cause you can script things fast and do all sorts of things. Java is compiled in a byte code that is executed by JVM , it's faster but still has a lot of overhead compared to many other languages, but has the advantages of being portable without recompiling.
    migles likes this.
  11. Dr Eggman

    Dr Eggman I am THE Eggman.

    Jul 12, 2008
    Eggmanland! (Toronto IRL)
    I have a question. I learned C (or at least, began to learn) in an introductory course last semester at school. I ended up loving programming. Problem is, I feel that C isn't really that useful in this day and age, but I do have the experience and grasp the concepts - I did very well in the course too!

    This is my question - C (at least to my knowledge) is good for backends and stuff but not for GUI apps. It seems, that it takes a lot of knowledge to make a graphical app. I want to know what's the fastest, most versatile way I can get there. Mobile programming (iOS, Android) is an area of huge interest to me. What direction can I go that would get me writing those / desktop programs, etc.? I tried learning Objective-C but I'm not really well self-disciplined and don't learn well on my own. The other thing is, since I learned a procedural language first, it's hard for me to grasp the concepts of object oriented programming.

    Thanks everyone.
  12. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United States
    You can make good GUIs with C, though you may wish to look into a GUI library/framework to do it as it is a pig if you have to do it all yourself ( might be an example)
    Fastest and most versatile... that would depend upon how you want to code your C program. The most rapid GUI development I have seen tends to come from the flash world, though I can also say things like autoIT ( ) and possibly things like do well. All of those should happily speak command line, use DLL files and even be able to do a bit of their own logic (if you want to make a batch option then those are good for it). Beyond that what about making it a web directed program? Web is all about the GUI/look and feel and if you look up things like CGI ( ) you do not even have to do something crazy like have a webserver that speaks/runs on C, barring something crazy with HTML5 (or possibly flash) you will be hard pressed to do something video or waveform related but it can certainly do text editing, click buttons, spit out lines of text and more.

    With all that said Java, which is used by android, can also make a GUI in fairly short order. Python ( ) also does quite well.

    I will also have to say that GUI/general interface design is actually something of a separate concept in programming, it is also why a lot of programmer oriented tools are a pig to use as many would be good programmers do not seem to care to learn GUI design. I am not really sure what resources I have for GUI design, other than web design anyway, that I would care to link. I am sure you could find something though.

    As for things not taking over from C I am going to better on increased power makes for less resource concerned coders, perhaps not ideal but enough that the volume will tip. Equally some of the stuff WebGL is doing for 3d (which runs of the back of javascript) would rather dent the interpreted is not going to make good 3d argument.
    Dr Eggman likes this.
  13. Zanoab

    Zanoab GBAtemp Regular

    Dec 4, 2009
    United States
    I'm disturbed by the lack of

    It provides interactive lessons for a handful of scripting languages (python, js, ruby, etc.) and walks you through each language one new element at a time. My favorite part is being able to create and share lessons for other users.

    For Android, I'll believe you since I've never worked on the platform. For desktop programs, I'll have to say you are lying. If anything, the GUI toolkits available for Java are bloated and hell to get good at.

    I have a friend who would use Java for everything because it is the only language he learned and felt like nothing else was better. I gave him a short lesson of Python and shown him how to do Hello World with wxPython using the interpreter. He jumped ship right away and spent the entire night learning how to program in Python. He even converted a few of his personal Java programs into Python and operated them via command-line. Within the next few days, he converted all programs and gave them a full GUI with far better functionality than the original Java versions. I literally told him to slow down as soon as he told me he started messing with Django to produce some web-based tools (his primary goal for programming) to share with his EVE friends.
  14. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United States
    I have never got along especially well with codeacademy, however that might be more because I am not what they are aiming for. I have had success with the things I linked, the only other stuff would have been the apress beginning ? series but you can do most of this for free so I left that out.

    On java building a gui fairly quickly I was mainly going off that I have seen it done on several occasions, however the ones I saw do that were seriously good coders (as in spent their days doing device drivers and other such crazy things) so I may end up revising that one, equally first and sole language as java may also say a bit. Bloated and full of specifics.... doesn't that just describe Java in general? Beyond that there are things like netbeans, probably not the best if we are trying to teach how everything works but a big of drag and drop doesn't half speed things up.
  15. grossaffe

    grossaffe GBAtemp Addict

    May 5, 2013
    United States
    Don't be put off by the age of C, there's a reason it's stuck around; its a very powerful language. It treats you like you know what you're doing rather than abstracting everything away and adding another layer of guesswork in how the machine interprets your code. It allows you to manipulate memory, and you can treat data types however you wish; Want to treat that character as an integer instead? Have at it.

    I've had many a headache working with languages that abstract things away (curse you, python) that try to guess what I'm trying to do instead of letting me just do it. I tolerate Java's abstraction because it comes with a lot of useful libraries, but when it did give me a rather big headache one time when I was creating a class dealing with generics, as I wanted to forgo their built-in arrayList structure and create the back-end on my own with a generic array. It worked for one class, but then when I tried to do the same with another class it didn't work as apparently a generic type and a node of generic type are treated differently, as one is saved through run-time, while the other experiences type-erasure. Took hours of research to what made the implementation for these seemingly identical cases work for one and not the other, and it was some weird, unintuitive quirk in the language, and even after finding the reason why it didin't work, the solution to the problem was equally difficult to find.

    Long story short, <3 C. Its used to program operating systems (it was actually developed for the purpose of coding the Unix kernel). Chances are that if you're coding to a microcontroller, you'll be working in C. It's a serious language for serious programmers. If you want do work on graphical front-ends, learn the GTK+ framework, it's nice if you can get the hang of it.

    And speaking of languages that expect you to know what you're doing but reward you for it, using VHDL when working with FPGAs or CPLDs is great, but it's certainly not for the feint of heart. It's about as different from the other languages as you can get, but what else would you expect from something that is actually meant for creating a hardware design rather than software design? Very powerful for the right applications.
    Monado_III likes this.
  16. Pagio94

    Pagio94 GBAtemp Regular

    Jul 28, 2014
    C is not much object oriented, C++ is. Also C has a lot of functions that let you take control of the hardware, it's the nearest language to assembly (though you can use the same functions in c++, c++ is 100% compatible with every c istruction) while c++ is more high ended
  17. FPSRussi4

    FPSRussi4 Clean up your act and cut the crap.

    Dec 1, 2013
    Another text editor(that I personally use) is Sublime. It's available for both Windows and Linux(Mac I assume as well). It allows you to set the syntax for the language you wish to code in (C, Java, Python etc) and then automatically follows that languages syntax standards and conventions,as well as highlights statements and loops, which can save a lot of time. I find it very helpful as I am a lazy programmer(code comes first, then conventions for me), and sublime helps a lot by organizing my code to the proper standards.
    pwsincd likes this.
  18. shakirmoledina

    shakirmoledina Legend

    Oct 23, 2004
    Dar es Salaam
    lovely intro to everything, probably this info can be updated with more details (hidden or redirecting to somewhere else on the forum)?
  19. flame1234

    flame1234 GBAtemp Advanced Fan

    May 17, 2009
    United States
    Maybe you should mention a debugger or debugging program. Maybe you should mention a disassembler program. Sometimes (always?) the debugger and disassembler are the same program.
    You would use a disassembler if there is some program, probably a game, that you want to change the behavior of. The disassembler will help you understand the program function and break (pause execution) of the program at certain points.
    I'm not familiar enough with the topic to know what a debugging program does.
    Margen67 likes this.
  20. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United States
    That is probably off topic and we have other threads on hacking. Most of the big IDEs (several were mentioned) will have a measure of debugging support you can use for the languages they support. To be useful in the modern world I would also have to go through the various anti hacking measures that code often employs

    If you want some more on that have a look up some analysis (or indeed even try to do what they ask) for so called "hackmes" -- they are little programs people make that are deliberately made to be hacked and others are encouraged to do so. They usually will try to trip you up in certain ways that mirror the real world, commonly in things like executable packing. Naturally I will also point people at hacking conferences as they have great stuff too and for anything I mention in this reply there will probably be an example of something very fancy, and probably also a nice introduction to the concepts, in said conferences.

    Debugging program
    Twofold really. On the one hand you have programs like GDB that are part of dev kits and if you compile with debug capabilities then you can get all sorts of info about the internal state of things. Most code released to the public will disable the debug flags though. You can attach GDB and co to normal programs but their functionality it more limited if you do not have a program with debug options enabled.

    On the other hand you have tools like radare2 ( ) and the king of all debugging/hacking tools known as IDA ( ). These are aimed at looking at compiled code, even encrypted and obfuscated stuff (more on that later) and retrieving lots of info about the program and helping anybody pull something apart to figure out how it works (or indeed how it is not working but where you might lack the source code).

    A disassembler is just an aspect of all this, it is not mandatory for a debugger to feature one but it is a very simple type of program to make if you have the CPU info, and provides very useful info when used properly, so most will sport one. Code is usually compiled from human readable language (runtime scripting like a lot of Java being the big exception) into the binary that runs upon the CPU (or GPU or whatever). Though there have been some very nice advancements in recent years in the field it is still very hard to decompile something that is not a scripting language, see the Halting problem, but you can convert this binary into the more human readable instructions easily enough (assembly is just the human readable form of these instructions, give or a take a couple of niceties). Not all code is instructions and with modern programming you will also find code can be packed into other things, compressed, encrypted and decrypted in stages or into memory to run and the purposes of various portions of the code having their meaning/functionality obscured (known as obfuscation).
    loco365 likes this.