-2

I have an application written in C. I have to develop a GUI for it. This application will be connected to the internet and will send and receive requests and responses through the network.

One way is to write the code in PHP to send and receive requests and responses by POST or something, and compile the C code into an executable, and then use PHP's shell_exec() function to run that exe. Is this good approach?

I am a beginner and I want to know what would be the best way to go about this kind of thing. Performance is definitely important, but modern look and feel of GUI is also very important.

2
  • Are you asking how to do GUI over network? Commented Apr 8, 2017 at 21:14
  • What is the architecture you have so far? Are you going to be hosting this application on a web server (such as Apache or IIS), or is this on a small computer (Raspberry Pi) that you are going to be connecting to the network. Are you thinking about exposing the app's functionality as services? Commented Apr 13, 2017 at 1:30

1 Answer 1

2

You have added label, probably, this is the answer: just use GTK and you will get pure C app. As bonus you will be able to run your app on several platforms (of course: crossplatform is not painless).

The other option — QT library.

Embed C module

There is the other approach — use C module as core, and NodeJS or Python (Java/C#/...) for writing UI and other application-logic:

  • UI code in python/javascript/java/C#...
  • application logic (parse arguments, load DB, event-handling, signals..) implemented in python/js/java/C#
  • time-consuming things could be implemented in C and compiled as module for corresponding language (don't forget: a lot of things already implemented, and exist like packages on NPM and PyPI)

Probably, this approach should reduce development time, bcz native C application (entirely in C: UI+core+whistles) will take A LOT OF YOUR TIME. But if you are not familiar with other languages or you want to learn C ­— this is not for you.


One important thing for junior-coders: avoid to create your own scooter, when there are a lot of guru, who have created awesome bicycles already. At least look, which pitfalls they have avoided already;)

8
  • Thank you. I am also familiar with Java. I am way better at Java than I am at C actually. Commented Apr 8, 2017 at 19:39
  • And thank you especially for that advice in the end. I'll follow it, the only challenge is that beginners don't always know about the bicycles that exist, and which ones to choose among the ones that they know the names of.. Commented Apr 8, 2017 at 19:41
  • 1
    @Solace, thanks god, there is google)) it is doesn't matter how long you are in coding-industry, you will google and read a lot of articles, A LOOOOT Commented Apr 8, 2017 at 20:07
  • 1
    All this years I tried to avoid PHP-coding, all possible ways. So today, I know: there is PHP, and guys write code on PHP. But also I know: there is a lot of mess in PHP, and you must be very accurate and rigorous to became a good PHP-coder. Commented Apr 8, 2017 at 20:11
  • 2
    Anyway: PHP is for web. This is its main purpose, even today. Commented Apr 8, 2017 at 20:12

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.