
An Introduction to C and GUI Programming - AlexeyBrin
https://www.raspberrypi.org/blog/an-introduction-to-c-gui-programming-the-new-book-from-raspberry-pi-press/
======
billsix
Immediate mode gui frameworks make for a pleasant programming experience

[https://github.com/vurtun/nuklear](https://github.com/vurtun/nuklear)

~~~
plopz
Whats the benefit of immediate mode libs? I haven't had the opportunity to use
one before. I'm hopeful for libui in the future, but maybe I should consider
immediate mode libraries?

[https://github.com/andlabs/libui](https://github.com/andlabs/libui)

~~~
billsix
No callbacks, so no forced heap allocation nor lifetime management . "oh you
want to use FooGUI? First let me tell you about the object hierarchy and
object lifecycle". No mvc. No custom, required data structures.

The programmer just copies and pastes from the demos, makes small
modifications, and it just works.

(No offense intended towards your framework, I've used gtk, qt, and swing and
have never understood them like I understand nuklear and dearimgui)

------
jononor
C for GUI programming? GTK2 for starting a new project today? I think new
learners would be much better off with Python 3 and GTK3 (or Qt5)...

~~~
spectramax
I disagree. There is always value in learning something simple and master it
than learning something complex and barely scratching the surface.

It teaches you fundamentals, especially on an embedded system such as R-Pi.

The first language I learned was C on an ARM processor. Learning about
registers, bit manipulation, seeing how compiler optimizes the code based on
GCC flags, understanding pointers, memory management, the whole thing is
difficult for a beginner but to me, it was immensely helpful. I also love
Python/Julia/Java/JavaScript but man it makes you appreciate neat things
higher languages offer.

One day I want to build my own 8-bit computer from discrete gates. I’m sure it
won’t be a waste of time.

~~~
sdegutis
The embedded environment is what makes this setup make sense. But in the
general case, C is less than ideal for GUI programming compared to what's
available in other languages, because of lack of first class closures and more
complex data types (or at least classes). Otherwise you are basically in the
80s doing Win32 GUI programming all over again.

~~~
freshm087
There's a school of thought which considers complex data types to be more a
part of problem then a solution. You may disagree with it, but nevertheless
one certainly doesn't need complex data types to write GUI (or anything)
effectively.

Also, in this universe Win32 API was released in 90s, not 80s.

~~~
sdegutis
The complexity should be the same no matter what language you use, but how you
structure and organize that complexity changes drastically. Hence in Ruby it
takes only 2-3 lines of code to accomplish what in Java requires a few
ItemFactories.

------
rjammala
Download link: [https://www.raspberrypi.org/magpi-
issues/C_GUI_Programming.p...](https://www.raspberrypi.org/magpi-
issues/C_GUI_Programming.pdf)

------
ingve
The author speaks highly of the book "C for Yourself". An electronic version
of the book from the Microsoft Programmer’s Library 1.3 CD-ROM has been posted
[0] on the truly excellent PCjs Machines [1] website, where a lot of other
older programming information can also be read [2].

[0]
[https://www.pcjs.org/pubs/pc/reference/microsoft/mspl13/c/c4...](https://www.pcjs.org/pubs/pc/reference/microsoft/mspl13/c/c4yrself/)

[1] [https://www.pcjs.org/](https://www.pcjs.org/)

[2] [https://www.pcjs.org/pubs/](https://www.pcjs.org/pubs/)

------
chewyland
Whoa, this little book just arrived in my mailbox in my Bulgarian village
apartment. Can't wait to crack it open.

------
cozzyd
For a raspberry pi which is unlikely to be plugged into a monitor it seems
like a better gui for most usecases would be a simple webserver.

~~~
badsectoracula
Raspberry Pi was made from the beginning to be used as a cheap desktop
computer that people can play around with and students can buy with their own
money, pretty much like the BBC micros and ZX Spectrums in the 80s. From day
one it came with a full Linux desktop system and was meant to be used by
itself as a proper computer.

