CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    Jun 2017
    Posts
    5

    Best languages/programs for GUI design?

    Hi all. I'm looking for some advice regarding which languages to learn for developing a GUI.

    Say if someone approached you and said ‘I have designed a handheld game console that has a digital screen that’s going to be manufactured, but it needs the GUI designed’. How would you design the GUI (in what languages & using what programs) so that it could be implemented on the product?

    Thanks for any advice.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Best languages/programs for GUI design?

    What is the target OS?

  3. #3
    Join Date
    Jun 2017
    Posts
    5

    Re: Best languages/programs for GUI design?

    Quote Originally Posted by Arjay View Post
    What is the target OS?
    I don't understand since it would be a device that could connect to a windows or Mac computer and act as a USB storage device in order to upload/download files

  4. #4
    Join Date
    Feb 2017
    Posts
    677

    Re: Best languages/programs for GUI design?

    Quote Originally Posted by manufacturer View Post
    I don't understand since it would be a device
    I guess Arjay is asking what OS there is on the device.

    This OS will manage all software running on your device. For example there must be a program that makes the device act as a USB storage. And there will be another program (with the GUI you are asking about) that will communicate with users of your device.

    OS means operating system and there must always be one on a device. It may be something very simple and rudimentary you write yourself, or it can be very advanced like Windows or Linux, or it can be something in between.

    If your device doesn't have an OS you either write one or select one from the shelf and port it to the device. Your requirements probably will be things like it has a small footprint, has USB support, has GUI support and is cheap. Here's a link I just found that shows some options,

    http://www.hongkiat.com/blog/lesser-...ating-systems/

    When writing your own systems software for a device and/or porting an OS, the programming languages you will be using are C and the Assembly language of the processor. Once the OS is up and running you may optionally use other languages that are available on that OS.

    Finally I must warn you. This is not for the fainthearted. You may want to consult an expert or hire a professional programmer or both.
    Last edited by wolle; June 15th, 2017 at 12:17 AM.

  5. #5
    Join Date
    Jun 2017
    Posts
    5

    Re: Best languages/programs for GUI design?

    Quote Originally Posted by wolle View Post
    I guess Arjay is asking what OS there is on the device.

    This OS will manage all software running on your device. For example there must be a program that makes the device act as a USB storage. And there will be another program (with the GUI you are asking about) that will communicate with users of your device.

    OS means operating system and there must always be one on a device. It may be something very simple and rudimentary you write yourself, or it can be very advanced like Windows or Linux, or it can be something in between.

    If your device doesn't have an OS you either write one or select one from the shelf and port it to the device. Your requirements probably will be things like it has a small footprint, has USB support, has GUI support and is cheap. Here's a link I just found that shows some options,

    http://www.hongkiat.com/blog/lesser-...ating-systems/

    When writing your own systems software for a device and/or porting an OS, the programming languages you will be using are C and the Assembly language of the processor. Once the OS is up and running you may optionally use other languages that are available on that OS.

    Finally I must warn you. This is not for the fainthearted. You may want to consult an expert or hire a professional programmer or both.

    Really interesting comment! I’m now curious as it seems like an OS may need to be written from scratch. You said either write a new OS or select one from the shelf - I assume ‘off the shelf’ means use an existing one like windows or linux or some open source OS? Are there any you’d recommend?

    I assume assembly is the only language to write an OS in - or are there more? Because I thought I heard assembly may be outdated.

    I also assume C is a language of the programs (e.g. the GUI) that communicate with the OS? Or are there other languages that could be used to make the applications (like C++)?

    Thanks for your help!

  6. #6
    Join Date
    Feb 2017
    Posts
    677

    Re: Best languages/programs for GUI design?

    Quote Originally Posted by manufacturer View Post
    Are there any you’d recommend?
    Well, since I don't know what your device looks like I can only give general advice. I'm kind of assuming it's like a small computer with a processor, RAM and ROM memory and I/O hardware? In that case you can use the Raspberry Pi as a model to learn from,

    https://en.wikipedia.org/wiki/Raspberry_Pi

    You find lots of info on the net and here's an article about building your own OS for Raspberry Pi,

    https://www.raspberrypi.org/blog/bui...spberry-pi-os/

    So writing your own OS is a possibility but porting an existing OS may still be the better option. It depends, I cannot say more than that. I suggest you form your own opinion by studying the Raspberry PI.

    http://lifehacker.com/the-best-opera...jec-1774669829

    ---

    Every processor has an instruction set called machine language. Just a notch above the machine language is the Assembly language, a different one for each family of processors. It will never be outdated since this is how you code for a specific processor at the very lowest level. The next higher language is C. Almost all close-to-the-processor coding takes place in a mixture of C and Assembly. The more C you use the better since it's more general and at a higher conceptual level than Assembly.

    Once an OS is in place you can use any language that has support (compilers, linkers, libraries, runtime systems etcetera) for that OS/processor combination. So C will work but depending on the OS other languages will work too.

    Note that you don't need to do any actual programming on the device itself. Instead a machine code image is prepared outside the device on another computer (a host). The image is transferred somehow onto the device and stored somewhere in memory of some sort. A permanent so called bootstrap program on the device then can be asked to set up and start executing the image. The image could contain both the OS (of your own making or someone else's) and all application software (such as the user GUI interface). This kind of host-device developments require special tools such a cross-compilers.

    ---

    Finally I suggest you consider basing your device not only on an existing OS but on an existing single-board computer. This will improve you quality of life immensely . But again, everything depends on the nature and purpose of your device of which I know nothing. And again, I urge you to seek expert advice.
    Last edited by wolle; June 16th, 2017 at 03:21 AM.

  7. #7
    Join Date
    Jun 2017
    Posts
    5

    Re: Best languages/programs for GUI design?

    Quote Originally Posted by wolle View Post
    I'm kind of assuming it's like a small computer with a processor, RAM and ROM memory and I/O hardware?
    That's right

    Quote Originally Posted by wolle View Post
    writing your own OS is a possibility but porting an existing OS may still be the better option
    Raspberry PI sounds interesting and I will definitely have a deep look into this.

    Quote Originally Posted by wolle View Post
    Every processor has an instruction set called machine language. Just a notch above the machine language is the Assembly language, a different one for each family of processors. It will never be outdated since this is how you code for a specific processor at the very lowest level. The next higher language is C. Almost all close-to-the-processor coding takes place in a mixture of C and Assembly. The more C you use the better since it's more general and at a higher conceptual level than Assembly.
    Sounds like having knowledge of assembly and C will be useful then. I also suppose knowing a language like C is similar to C++ and C# etc and may make it not too difficult to learn a higher level language.

    I assume 'machine language' is the most primitive language with hardware and gadgets etc. A hierarchy sounds like this: machine language (instructions for the CPU) > assembly (writing the OS) > C (& others compatible with the OS - writing the GUI & applications)?

    Quote Originally Posted by wolle View Post
    I urge you to seek expert advice
    I will. Really appreciate all your advice

  8. #8
    Join Date
    Feb 2017
    Posts
    677

    Re: Best languages/programs for GUI design?

    Quote Originally Posted by manufacturer View Post
    Sounds like having knowledge of assembly and C will be useful then. I also suppose knowing a language like C is similar to C++ and C# etc and may make it not too difficult to learn a higher level language.
    C and Assembly (for the processor in question) will definitely be used to write an OS or to port an OS. C can also be used to program the user interface (with a GUI) and all other systems software you will want on the device.

    Another important aspect of C is that it's a part of C++ so by learning C you have also learned the basics of C++. In addition, C is not part of but has influenced many other languages including C# and Java.

    So considering your project I can say without hesitation that C is the language for you to learn.

    I assume 'machine language' is the most primitive language with hardware and gadgets etc. A hierarchy sounds like this: machine language (instructions for the CPU) > assembly (writing the OS) > C (& others compatible with the OS - writing the GUI & applications)?
    That's correct but I would use a slightly different terminology.

    Machine language is the most concrete and specific of languages since it's how a certain processor (a CPU) is physically controlled. All other languages are generalisations and abstractions in various ways and to various degrees.

    No one really programs in machine language, instead an Assembly language is used. At the next higher level is C. One could call it the mother of all Assembly languages. It's much more convenient for the programmer and there's always a C compiler available that can turn any C program into a corresponding Assembly program (and ultimately machine language) for any processor known to man. A slight exaggeration maybe but that's how all-important C is.

    Good luck with your project!
    Last edited by wolle; June 16th, 2017 at 10:24 AM.

  9. #9
    Join Date
    Jun 2017
    Posts
    5

    Re: Best languages/programs for GUI design?

    Definitely sounds like C is the best language to learn!

    Quote Originally Posted by wolle View Post
    No one really programs in machine language, instead an Assembly language is used. At the next higher level is C. One could call it the mother of all Assembly languages. It's much more convenient for the programmer and there's always a C compiler available that can turn any C program into a corresponding Assembly program (and ultimately machine language) for any processor known to man. A slight exaggeration maybe but that's how all-important C is.
    Does this mean that assembly is not really necessary to learn if it can just be converted from C?

  10. #10
    Join Date
    Feb 2017
    Posts
    677

    Re: Best languages/programs for GUI design?

    Quote Originally Posted by manufacturer View Post
    Definitely sounds like C is the best language to learn!

    Does this mean that assembly is not really necessary to learn if it can just be converted from C?
    Yes, for your current project C is the best language to learn and a good grounding for whatever languages you may consider in the future.

    Most C compilers take a C program and converts it into the Assembly language of the target processor. Then in a second step the Assembly language program is further compiled into machine language.

    The main reason you may want to bypass C and write code directly in Assembly language is efficiency. Even though C compilers are very smart there are situations when a clever programmer can beat them. The best approach in my view is to start with a C version and then resort to Assembly only when there's a performance issue. This is a strategy that works well in all of programming. Stay on top as much as possible and go native only when you absolutely have to. Another reason for learning Assembly is because you may need to understand existing code written by someone else.
    Last edited by wolle; June 17th, 2017 at 12:48 AM.

  11. #11
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,824

    Re: Best languages/programs for GUI design?

    The best approach in my view is to start with a C version and then resort to Assembly only when there's a performance issue.
    In the case of an OS, there could be circumstances whereby you need to code directly in assembler language because the required sequence of machine instructions can't be generated from c code. For some assembler languages (eg for x86 but not x64), this can be done by 'in-line' assembler code within a c program. Also, if you are going to write an OS or similar, then you also need to think about debugging. Debugging an OS or similar is at a whole different level than debugging a c application within an IDE!

    IMO for this type (OS, GUI subsystem etc) then you should at the very least have a good understanding of the processor architecture and the assembler/machine code. Whilst you may not need to actually write much assembler code, you almost certainly will need to understand it sufficiently to debug at the machine code level.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  12. #12
    Join Date
    Apr 2017
    Posts
    9

    Re: Best languages/programs for GUI design?

    C is the best and basic programming language to learn, and for MAC native swift and cocoa are the best..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured