if (selection_mode) { gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.edit-cancel", null_accels);
switch (mode) { case PHOTOS_WINDOW_MODE_COLLECTION_VIEW: case PHOTOS_WINDOW_MODE_COLLECTIONS: case PHOTOS_WINDOW_MODE_FAVORITES: case PHOTOS_WINDOW_MODE_OVERVIEW: case PHOTOS_WINDOW_MODE_SEARCH: gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.import-cancel", null_accels); gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.selection-mode", cancel_accels); break;
switch (mode) { case PHOTOS_WINDOW_MODE_COLLECTION_VIEW: case PHOTOS_WINDOW_MODE_COLLECTIONS: case PHOTOS_WINDOW_MODE_FAVORITES: case PHOTOS_WINDOW_MODE_IMPORT: case PHOTOS_WINDOW_MODE_OVERVIEW: case PHOTOS_WINDOW_MODE_PREVIEW: case PHOTOS_WINDOW_MODE_SEARCH: gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.edit-cancel", null_accels); break;
case PHOTOS_WINDOW_MODE_EDIT: gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.edit-cancel", cancel_accels); break;
case PHOTOS_WINDOW_MODE_NONE: default: g_assert_not_reached (); break; } }
can_open = FALSE; can_trash = selection != NULL; for (l = selection; l != NULL; l = l->next) { PhotosBaseItem *selected_item; const gchar *urn = (gchar *) l->data;
Jack Brooks
/* When PhotosItemManager::items-changed is emitted, a selected * item can potentially be removed from the item manager. */ selected_item = PHOTOS_BASE_ITEM (photos_base_manager_get_object_by_id (self->state->item_mngr, urn)); if (selected_item == NULL) continue;
C applications fucking suck. Most just poorly re-implement C++'s OOP features with base-structs in macros and pointer casting and all that bullshit.
It's like seeing someone insisting on using a rock to drive nails instead of a hammer and insisting this is somehow "more efficient", even when you show them what code gets created and how a C++ compiler does better due to abstraction, where the compiler actually understands what you're trying to do.
Henry Morris
This. People are just afraid old dogs like Linus, Stallman, and their thousands of bitch suck-ups will bully them if they use non-meme languages.
Zachary Martinez
C is good if you want your project to take 1000x as long to complete (probably not even exaggerating), have bugs and security issues unique to the language (stack overflows, buffers overflows, memory leaks) and want to end up with an unreadable mess that follows no coding standards and patterns whatsoever, so that nobody else has any chance to ever understand what your code does - especially if you go crazy with macros, which is what C developers LOVE to do, in order to poorly re-invent features other languages already have.
ever wondered why people dislike GLib and GTK? ever wondered why Gnome is such trash?
Xavier Hall
this. Gtk sux
Tyler Kelly
>Have you seen the comparison images between GNU source and OpenBSD? No, post it.
Caleb Butler
Yes and I'm not projecting. That is a horrible 9000 line program. There is no reason at all for 9000 line programs to exist.
Luke Martin
Not him but just open up BSD and GNU side by side and compare common apps like ls, cat, time, etc
Benjamin Lee
I don't see what the issue here is, have you ever developed a stateful GUI application before?
Do you think porting it to C++, Rust, Javascript, Go, or whatever meme language you like would make the logic any less complicated?
Do you think splitting the function across 12 files would make it any easier to read or change?
Would you prefer they did stuff like "#define g_simple_action_set_enabled E" at the top of the function so it technically becomes shorter?
Adrian Bennett
The issue is the logic gets wasted in the convoluted C syntax.
Grayson Rodriguez
The funny thing is that Linux itself does use many object oriented techniques, see lwn.net/Articles/444910/ Also, the kernel got much better, code quality-wise, after Linus started simply limiting himself to approve/reject commits. Not to mention that most of the criticisms by these "old dogs" refers to C++ before the C++11 standard, which massively improved the language.
Aiden Cruz
>object oriented techniques >C I don't wanna hear about it
Angel Stewart
Did you even read the article he linked? OOP is used in C way more often than most people care to admit.
Evan Butler
To be quite frank, I'm too lazy at the current moment.
Luke Diaz
i'd rather define the UI in markup and glue it together with something high level, it's pointless doing it imperatively in C
Luis Foster
>Do you think splitting the function across 12 files would make it any easier to read or change? yes and yes
Evan James
>a bunch of boolean expressions >convoluted syntax ???
Way to out yourself as a clueless webshit
Then go do that, submit it as a patch and see what they say
John Sanchez
> be you > a lamer > can't code > doesn't understand C you'll fit right in here on Jow Forums
Cameron Ward
>Then go do that, submit it as a patch and see what they say they would thank me for organizing their pajeet tier code
Carter Ross
gtk sucks, big news
Dominic Sanchez
>Then go do that, submit it as a patch and see what they say im sure the conversation would go like this: > NICE WORK, FAGGOT. > submissions: laughed at and deleted
Jaxon Green
>t. writes code not even he himself can understand Retards
Luke King
C++ syntax is fucking disgusting unless you use Qt though
Samuel Barnes
> be you > retarded > so illiterate that reading is impossible that code is so simple to understand. you haven't seen much C code before have you, faggot? or had to deal with gtk? this is nothing. you fucking morons think anything greater than microsoft BASIC or python is TOO COMPLEX TO UNDERSTAND. my fucking sides.
Logan Harris
It's not complex, it's trash. 90% of C code ever is just syntax and single-character variable names. Good riddance.
Caleb Edwards
you think we think this is complex but we fucking don't you absolute faggot the code is just garbage
>pajeet webdev since when does a pajeet web dev care about minimizing lines of code? get your memes right sœybœy
Jason Phillips
>thinks it's too hard to write good C >can't understand C >wants to use more pajeet tier languages >not a pajeet webdev
Brandon Flores
Just getting into PIC controllers. Any /PIC/ bois got any cool projects or tips to share?
Jaxson Perry
>>thinks it's too hard to write good C >>can't understand C holy fuck you're insecure af
Jaxon Cruz
make a PIC based arduino, promptly shove it into your ass
Josiah Sanders
Why does C make kiddos so mad?
Joshua Jenkins
I have a question. I'm looking through this code and can't really think of a good way of decomposing it other than *maybe* splitting things up into general categories, and going from there.
How would you guys have designed it? Because I do agree, this looks like a pain in the butt to debug.
Owen Nguyen
>>>thinks it's too hard to write good C >>can't understand C
>C is good if you want your project to take 1000x as long to complete (probably not even exaggerating), have bugs and security issues unique to the language (stack overflows, buffers overflows, memory leaks) and want to end up with an unreadable mess that follows no coding standards and patterns whatsoever, so that nobody else has any chance to ever understand what your code does - especially if you go crazy with macros, which is what C developers LOVE to do, in order to poorly re-invent features other languages already have. >The issue is the logic gets wasted in the convoluted C syntax.
Sebastian Rivera
>stack overflows >buffers overflows >memory leaks >bugs and security issues unique to the language whoever wrote that your mom's a hoe
Oliver Howard
>The issue is the logic gets wasted in the convoluted C syntax. >GTK's shit API is the same as C's syntax
breaking news gtk devs are shit nothing new under the sun, delete your thread read x264 source code if you want to see good C. If you still find it shit, you're not qualified to have an opinion on the matter.
Owen Jenkins
Even fucking Racket can do something WAY more elegant than this. This is just diarrhea.
Dylan Hughes
STMicroelectronics cuck here tfw running on battery but only 16 MHz
Jace Campbell
The rust language itself offers nothing new and is poorly implemented. So what's left besides marketing wank and the community full of shills who harass everyone.
Ethan Lewis
yeah, lets just ignore the fact that higher-level languages like Haskell and Python compile to/are interpreted in C.
>how a C++ compiler does better due to abstraction C intentionally keeps abstraction to minimum because it's supposed to be "close to the metal" in terms of how the machine code it compiles into actually runs.
Developers who implement the abstractions that languages like C++ provide are using the language wrong. If you do want to write programs with decent levels of abstraction, which is perfectly reasonable, then you shouldn't be writing in C.