[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: nested_function.png (86 KB, 2228x776)
86 KB PNG
Why do C fanboys defend the left format and think the right format is bad? Is something genuinely wrong with their brains?
>>
Yes, but not for that reason.
>>
>>109782057
For what reason?
>>
>>109781960
both are wrong
you should be using allman style
>>
>>109782195
Allman style doesn't give you nested functions.
>>
>>109782195
This. Allman style + snake case for everything for best readability.
>>
>>109782205
why not?
>>
Both look equally retarded
>>
>>109782195
All 3 look equally stupid.
>>
>>109782223
Because it sucks. It would if it didn't suck.
>>
>>109782345
it does doe
plus : your mom sucks

>>109782342
yours too btw
>>
There’s probably something wrong with your code if it needs to repeat twice except for one bool
>>
>>109781960
that's what c++ lambda functions are for
>>
>>109781960
I believe in unreadable and brilliant spagetti code, always have. Fuck you all. Fuck open source fuck everything you troons think you know.
>>
>>109781960
Standard C does not have nested functions, period. It's not a matter of "fanboyism", you objectively can't do it in fully standards-compliant C code.

Now, some compilers (e.g. gcc) do provide nested functions as an extension, but that of course makes the code not portable to platforms not supporting said extension.
>>
>>109783446
>can't do it in fully standards-compliant C code
Yeah but C fanboys will defend this and argue that it's a good thing and that nested functions don't belong in C. Just like they'll argue that (FuckYouStructName69){1,2} is better than just {1,2}
>>
>>109783549
>Just like they'll argue that (FuckYouStructName69){1,2} is better than just {1,2}
Nobody does that.
>Yeah but C fanboys will defend this and argue that it's a good thing and that nested functions don't belong in C
Nobody does that either. GCC even has an extension for this.
>>
>>109783563
They will argue that C11 or even C99 is the ideal and that C shouldn't be changed in any way. There's even a guy in the C committee or whatever doing his best to prevent the language from changing.
>>
>>109783639
Committee is retarded. I'll give you that. But neither me nor any C dev I know defended any of what you said.
>>
>>109783639
C89 is the only fully supported standard and nothing added after it has any real use case
>>
cniles hate garbage collectors because they are personally threatened
>>
>>109782195
How do I get that colorscheme in vim?
>>
>>109781960
for the same reason C fanboys defend toasters and think microoven are bad.
>>
>>109781960
There's no need to use nested functions, in C you can chose what functions have external visibility or not, just use static functions for internal logic. Nested functions would be a nice addition to C but only if are implemented as syntactic sugar, real nested functions can't be implemented without fucking up the stack.
>>
>>109783839
i stuff three cniles into my thrash bin every week
>>
File: 1768716547773286.jpg (274 KB, 1908x986)
274 KB JPG
>>109781960
>C fanboys defend the left
>>109783839
>cniles hate garbage collectors

a social statistician in a tech-related Qs is more retarded than anything else. "cniles" created the garbage collector btw, as well as left or right variants.

i once wanted to define a function inside another function, i thought it will only reduce the visibility but the way it is made "as an extension" >>109783446 is not about visibility but is about anonymous function, it generates the function's body somewhere on the stack or whatever.

so these "nested" functions are obviously not the same as clean-code style helpers.

i want to gas and hammer knock the skull of every retard who is obsessed with "jews", "chinks", "indians" and other grouptalk >>109783563 are this goatfucker from EU or where do you reside?
>>
>>109781960
>Defining functions inside of functions
FUCK YOU. Its simply significantly harder to track whats going on and the scope of the functions and variables are accessible.
Theres a reason NASA banned recursive functions.
>>
>>109784633
cniles dread the trashman
>>
>>109784725
>"cniles" created the garbage collector btw
do c fags actually believe this
>>
>>109785740
The first garbage collector was programmed in javascript.
>>
>>109783549
C is meant to have an extremely simplified syntax. If you wanted something more complex, use C++ or Rust.
>>
>>109785795
They're arguing for the more complex thing though.
>>
>>109785795
>C is meant to have an extremely simplified syntax.
No, it has complex syntax rules. Pascal is much more simple.
>>
>>109784725
>"cniles" created the garbage collector btw
Wrong. Lisp invented garbage collection
>>
>>109783446
>Now, some compilers (e.g. gcc) do provide nested functions as an extension, but that of course makes the code not portable to platforms not supporting said extension.
Get fucking real anon. Very little C is actually fully standard following. All compilers have extensions that are widely used. Also with You really don't have to worry about portability since GCC supports more ISAs then basically any other compiler.
>>
>>109785795
>C is meant to have an extremely simplified syntax.
The base of it, sure. But its a language meant to be expanded upon by design.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.