[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Find a flaw
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 167
Thread images: 6
File: c.jpg (16 KB, 260x341) Image search: [Google]
c.jpg
16 KB, 260x341
Find a flaw
>>
>>55148585
It's shit.
>>
Not sharp enough
>>
Too perfect
>>
>>55148585

C programmers
>>
doesnt teach the lowest layer assembly or how is the memory managed in the OS
>>
>>55148585
unsafe by design
>>
>>55148585
itt: butthurt webdev's
don't you guys have another bloated web framework to go learn?
>>
>>55148585
It has the power of assembly with the portability of assembly.
>>
>>55148585
Teaches unsafe coding practices. Avoid like the plague.

The language itself is the source of 99% vulnerabilities because that's how prone it is to write unsafe code.
>>
>>55148585
Programming language is an instrument - it's good only for its use cases.
>>
depend on what u trying to achieve.
>>
>>55149034
y the h8 m8?
>>
i bought a copy of this and its just sitting here. is this book still up to date? has C not evolved since whenever the second edition was released?
>>
>>55148585
No containers of any kind.
>>
>>55149857
It teaches ANSI C, which is still the most common standard. The additions in C99 and C11 are relatively small.
>>
>>55148585
gets()
>>
>>55148585
You need to become a trashman in order to be able to use it.

Feels bad man.
>>
Best book for leading C ?
>>
>>55150102
Go back to Java pajeet
>>
>>55148585
it turns college dropouts into smug assholes.
>>
>>55150337
xD
>>
>>55149425
What unsafe coding practices?
>>
>>55150447
Overflows and friends. You have to watch for every single one of them.
>>
does anyone have learn C the hard way in a pdf? libgen only has mobi and epub.
>>
>>55150594
seconded
>>
>>55150594
>learn C the hard way
That book is absolute garbage.
>>
>>55149018
>doesn't teach the lower layer assembly
How could it? That's not in the C specification
>how is the memory managed in the OS
How could it? That's not in the C specification...

Oh wait, you're just spewing memes because you actually know nothing about programming.
>>
>>55150630
>Oh wait, you're just spewing memes because you actually know nothing about programming.
Focus on yourself, not on others, you easily upset babby
>>
>>55148585

Oh man. I have several complaints with C itself. In no particular order.

1) arrays are unlike anything else in the language. You can't explicitly pass an array of known size into or out of a function. If you try do, you will implicitly convert it to a pointer. C could originally only take arguments or return values that could fit in a single register. Later this restriction was removed and C gained the ability to pass structs by value but not arrays.

2) the implicit conversions are sometimes value-based and sometimes reinterpretations.

int -> float and float -> int are value-based. An integer will be converted to the float that is numerically closest to it (and vice versa).

int -> uint and uint -> int are reinterpretations.

If you have -2 as an int it gets cast to to some large integer rather than to 0 (the closest unsigned integer to -2 by value)

It would be nice if we just got rid of implicit conversion. Or do what Ada does and separate conversions and reinterpretations (I don't know Ada at all).

3) declaration reflects use leads to awful syntax for types like `int arr[4];` and `extern void (*signal(int, void(*)(int)))(int);` (source: http://stackoverflow.com/questions/1591361/understanding-typedefs-for-function-pointers-in-c)

It would be better to make all of your type constructors (okay they're not called type constructors in C, but that's what they are) appear before the type, like in Go.

4) undefined behavior is not confined to any particular part of the language.

Some simple things like signed overflow are undefined (to allow for one's complement machines).

I think it would be a better approach to have a "core" of the language that does not have gratuitous undefined behavior and a larger inventory of types. That way you can make "potentially faster but unsafe" types that allow for more aggressive optimizations. That way undefined behavior is always opt-in and you can tell where it is.

The book is cool though. A+++.
>>
>>55149032
>unsafe by design
Babby needs his hand held. Guess you're a Microsoft cuck then?
>>
>>55151114
>sometimes value-based and sometimes reinterpretations
you're clueless m8; they're always conversions
>-2 as an int it gets cast to to some large integer
the conversion algorithm is documented
>source stackoverflow
ah, you're a """html programmer""" at heart
>simple things like signed overflow are undefined
yes
>(to allow for one's complement machines)
no; if it were only for that, it would be unspecified, just like the integer representation, you fucking ignorant
>to have a "core" of the language
yes, "JS: the good parts" was made for you
>gratuitous undefined behavior
you're completely retarded if you think it's gratuitous
>you can tell where it is
you'd obviously be incapable, if you can't "tell where it is" right now, when it's documented in the standard
>>
>>55151677
You're autistic
>>
>>55152586
>I got told
you sure did :^)
>>
>>55148585
There are no flaws to be found
>>
>>55152586
>getting embarrassed
>>
To perfect?
C & C++ kick Java's ass
>>
>>55153828
>C++
Don't lump that trash in with C.
>>
>>55153885
Still better than Java ONCE you learn it properly (Which will take fucking forever)
>>
>>55150326
C Programming: A modern approach. By far the best. Better than K&C for beginners IMO.
>>
>>55148925
Underrated
>>
>>55151114
>If you have -2 as an int it gets cast to to some large integer rather than to 0 (the closest unsigned integer to -2 by value)
It takes it modulo 2^N, donnit? -2 == M-2 (mod M) in normal arithmetic.
>>
no namespaces
no classes
no templates
no references

if it had these things, the language would be perfect
>>
>>55155469
>no namespaces
wrong
>no classes
no need, struct
>no templates
no need, macros
>no references
no need, pointers are more powerful
>if it had these things
let me guess, you're a webcuck
>>
>>55155860
If you think "struct X" "enum Y" is a substitute for namespaces, you are retarded. If you think putting static in front of declaration and preventing linking, you're also retarded.

If you think macros are a substitute for templates you are utterly retarded.
>>
>no actual string type
>>
I really used to love C, but now I hate it. In theory, the language should be perfect...but it's too cumbersome to program large amounts of anything in it. If you are doing algorithms, you are better off with functional languages, and if you are doing a lot of string parsing and data handling you're better off with OO languages. So what is C good for? Maybe System Development, but that's like 5% of all coding. Most people I know who like C can't handle programs that are more than 12 files or more than 10,000 lines of code total. Maybe that's because C starts tripping over itself without having vigorous sets of eyes catching insecure pointers instead of it being done automagically in OO. For most code written, the issue is feasibility, maintenance and security...not speed. That's why C doesn't make sense for most applications.
>>
>>55155877
>backpedaling
>damage control
sounds like you got told and rekt good, m8
>>
>>55148585
strings
>>
>>55155956
>Maybe System Development, but that's like 5% of all coding
First of all, "coding"? What are you? Some kind of Karlie Kloss web dev?

Secondly, some of us spend 100% of their time doing systems development and firmware development.
>>
>>55155912
>no actual json type
that's how retarded you sound
>>
>>55155469
>no namespaces
Fucks with the ABI
>no classes
No need. Data and functions are separate things.
>no templates
Far too complicated of a system for it to be appropriate for C, making it far too difficult to implement C. I assume you're talking about C++-like templates.
>no references
Come on. References are just shitty pointers.
>>
>>55155979
It's my first post in this thread, how can I be back-pedalling?
>>
>>55156006
>le there exists something simpler so why the need for abstractions

why not go all the way down to a byte type while we are at it and have nothing else
>>
>>55156037
>to a byte type
Yes. It's called 'char'.
>>
>>55156011
>No need. Data and functions are separate things.
That's fine, but having memory cleanup in the destructor is convenient
>>
The book? It's pretty good.

The language? It's archaic and designed for 70s mainframes, requires you to manually manage memory and it's responsible for most security problems in today's code and the standard library is too small and as a side effect almost every project ends up reinventing the wheel.
>>
>>55156054
REKT
E
K
T
>>
>>55156011
I'm >>55155877

How does namespaces fuck with the ABI? In my world the ABI is short for "application binary interface" which is basically stuff like "the first argument goes into RAX, the second into RBX and the rest is pushed on the stack, while the return value is stored in RAX"... How the fuck does namespaces, a syntactic element of the programming language (aka compiler input) fuck with the ABI (aka the compiler output)?

>No need. Data and functions are separate things.
You obviously haven't seen the light that is functional programming.

>Far too complicated of a system for it to be appropriate for C, making it far too difficult to implement C. I assume you're talking about C++-like templates.
It's a valid argument for why not including it in C, but the question was flaws with C.

>Come on. References are just shitty pointers.
While references are synthesised to pointers, references are still good at ensuring code correctness. But I agree, no references is not a big deal.
>>
>>55156055
>muh convenience
>muh css
fuck off webshit
>>
Why can't people realize that no language is one size fits all? C is better at some things, Python better at others. For every task you have there is a language that would be better suited for it.
>>
>>55156054
>>55156037
>>55156006
>>55155912
You're both missing the point. A string type is a glorified buffer type. String literals in C can be stored in different memory than data, where as string data types are buffer wrappers that copy string literals from that memory into data memory in runtime.
>>
>>55156075
>How the fuck does namespaces, a syntactic element of the programming language (aka compiler input) fuck with the ABI (aka the compiler output)?
What exactly are you going to call the external symbol when a namespace is used?
In normal C:
void my_fn(void);
is just "my_fn".
What does
void crap::my_fn(void);
become?
>>
>>55156090
If you dislike convenience, why are you programming in C instead of assembly?
>>
>>55156104
>where as string data types are buffer wrappers that copy string literals from that memory into data memory in runtime.
strcpy
>>
>>55156115
who said I program in C? are you fucking mentally ill?
>>
>>55156110
The same, this is resolved at the linker stage. The ABI remains exactly the same.
>>
>>55156147
>The same
>I'm literally retarded
anon...
>>
>>55156147
>The same, this is resolved at the linker stage
That's exactly what I'm talking about: the linker.
Do you even understand what you're talking about?
>>
>>55156126
Your point being? Do you think that strcpy has no overhead?

>>55156159
The ABI is literally "use this register for that, that register for this, return values goes into here" etc.

Linking functions into different memory addresses has nothing to do with the ABI.
>>
>>55156168
See >>55156181

How does namespaces affect the ABI?
>>
>>55156181
>Your point being? Do you think that strcpy has no overhead?
do you think the string type has no overhead when it has to allocate memory from the heap?

buddy...
>>
>>55156181
>Linking functions into different memory addresses has nothing to do with the ABI.
How is "what symbol you jump to" not part of the ABI?
Why do you think that practically every language can easily link with C, but hardly anything can with C++ (and it's usually shoddy at best)?
>>
>>55156181
>The ABI is literally
you don't know what the fuck you're talking about
>etc
that etc includes symbol names, you dumb shit
>>
>>55156215
>do you think the string type has no overhead when it has to allocate memory from the heap?
No, my point was the fucking opposite... That a string type HAS overhead.

>>55156220
>How is "what symbol you jump to" not part of the ABI?
It's not part of the ABI, because you don't jump to fucking symbols. Symbols are created by the compiler in order to do linking at a later stage.

You can strip your executable entirely of symbols, the ABI would stay the same.

>Why do you think that practically every language can easily link with C, but hardly anything can with C++ (and it's usually shoddy at best)?
Firstly, this has nothing to do with the ABI
Secondly, it's not at all hard to link with C++. crap::my_fn would expand to __crap_my_fn in GCC and something slightly different with clang.
>>
>>55156054
so why bother having an int type where you can just have char[4]
>>
>>55156257
>something slightly different
>different
you don't say!
>>
>>55156267
because an int varies in size depending on the machine
>>
>>55156257
>It's not part of the ABI, but then again I'm a webshit so I don't know what I'm talking about
>>
>>55156289
>>55156278
Oh wow, you guys sure told me with that greentext.
>>
>>55156301
yeah, you got told pretty hard; try not to be retarded next time
>>
>>55156286
Does an int remain the same size if you use a 32-bit or 64-bit OS?
>>
>>55155999
holy fuck you are autistic
>>
>>55156316
it depends
>>
>>55156286
nothing a good #define MACHINE_INT_SIZE 4 can't fix ;^)
>>
>>55156317
>systems programming is only 5% of development therefore I will spend 5% of my time doing it
>>
>>55156355
i'm not even him but you are clearly autistic
>>
>>55156317
>muh codes
>>
>>55156355
Who are you quoting?
>>
>>55151476
t. senior fizzbuzz developer
>>
>>55156382
>>55155956
>>
>>55156370
>not-him-but meme
ishyggy
>>
>>55156396
But I didn't even write that!
>>
>>55156450
Why the fuck are you replying out of context and making up stuff then?
>>
>>55156480
Because It's the Internet and I can do whatever the fuck I want, shitbag.
>>
>>55156069
>It's archaic and designed for 70s mainframes
I don't like the "70s mainframes" excuse. PL/I is from the 60s and used for systems programming and it isn't susceptible to a lot of these problems. The Multics kernel and tools were written in PL/I so it can be used for all the things C is used for.

>and it's responsible for most security problems in today's code
The makers of Unix used PL/I when working on Multics before they made C, but Unix wasn't designed to be secure because it wasn't a professional project. Crashing was fine because it was their own software they had the source to, so they could fix problems whenever they wanted.

This is worth reading.
http://hack.org/mc/texts/classic-multics.pdf
>>
>>55151677

>you're clueless m8; they're always conversions

I don't think I explained my point very well. Sometimes you are applying a different interpretation to the underlying bit pattern. For instance, the conversion from signed to unsigned integer. In order to get the same behavior when converting a float to an integral type you have to do something like this:

i = * (long *) &y;

The implicit conversions between floats and integral types are different. A float will get cast to an integer of the given width/signedness that it is closest to numerically and vice versa.

> yes, "JS: the good parts" was made for you
> you're completely retarded if you think it's gratuitous
> you'd obviously be incapable, if you can't "tell where it is" right now, when it's documented in the standard
There's no need to be rude. Undefined behavior allows the mapping from C to the instruction set of the machine you are working on to be simpler, at the cost of some loss of portability.

It is not simple to analyze a C program and see where a conforming compiler could do something completely different from what you're expecting. Hence you get weird shit like bugs that only occur at higher optimization levels.
>>
>>55156712
What's PL/I like? How does it differ from C?
>>
>>55148585
array decay, i.e., mandatory conversions of sized arrays to raw pointer when passed to/from functions.

to all you morons, this is not the same thing as missing dynamic bounds checking on random access indexes.
>>
>>55156893

Are there languages that are similarly low-level to C that lack array decay but allow you to write functions that are generic in the length of the array?

IIRC pascal allows you to pass arrays into and out of functions, but an array of 10 ints and an array of 9 ints are completely separate types.
>>
>>55156840
>different interpretation to the underlying bit pattern
no, you don't know what the fuck you're talking about
>the conversion from signed to unsigned integer
it's not reinterpretation of the bit pattern, you idiot! it's just that you're an ignorant and only know about 2's complement and came up with a retarded conclusion about the signed->unsigned conversion
>you have to do something like this
no, you don't, that's undefined behavior
>implicit conversions between floats and integral types are different
again, you're a moron that doesn't understand the word "conversion"; ALL conversion CAN change the representation; even conversion from an int pointer to a void pointer can change the bit pattern, but I'm sure this is the first time you've heard it
>where a conforming compiler could do something completely different from what you're expecting
what the fuck are you still blabbering about? you just don't know C! learn it or stfu; what the fuck are you "expecting"? some stuff you imagined? have you actually learned the language? no? this isn't html where you get to try random shit until "it works in IE tho"
>you get weird shit like bugs
I don't, because I know C; you on the other hand, are clearly out of your element
>>
You people are never satisfied with any language.
>>
>>55156840

C generally does not care about the underlying bit representation. It produces the same output values reliably regardless of endianness, casting, bit shifting etc.

Signed and unsigned int are literally the same type except for a simple sign bit. Their underlying bit representation never changes, nor does C's interpretation of them really change either. The only difference is whether or not you're getting a positive or negative number outputted on the screen.
>>
>>55157098

Is this undefined behavior?

long val = 0xff352134;
char* ptr = (char*)&val;
>>
>>55157098

You're right that I don't know C very well. I'm probably misusing some jargon. You could still be a little more constructive instead of being mad that someone is wrong on the internet.

> again, you're a moron that doesn't understand the word "conversion"; ALL conversion CAN change the representation; even conversion from an int pointer to a void pointer can change the bit pattern, but I'm sure this is the first time you've heard it

Okay, that's interesting. What exactly do you mean?
>>
>>55156886
These are mostly written in PL/I.
http://web.mit.edu/multics-history/source/Multics_Internet_Server/Multics_sources.html
>>
>>55148585
used mostly by uneducated pajeet-tier programmers that don't know how to properly design and implement software.
>>
>>55151476
You're the babby. Probably never written a big software.
>>
>>55157273
of course not, you monkey! don't you know anything?
>>
>>55157750

Then why would what he posted be?
>>
>>55157865
because the standard says so
>>
>>55157910

I'm probably just confused because of the lacking type information
>>
Faggot LOL XD
>>
File: session.png (7 KB, 473x454) Image search: [Google]
session.png
7 KB, 473x454
>>55156840
>A float will get cast to an integer of the given width/signedness that it is closest to numerically and vice versa.
Numerically a negative integer is closest (exactly equal) to the large unsigned integer its cast as because we are working in a finite ring of integers. Makes way more sense than sending them to 0 I'll tell you hwat.
>>
>>55157998
Except you're not actually usually the finite field structure of 0 .. 2^m - 1 most of the time.

Take integer division for instance. It gives you the quotient (either rounding towards zero or rounding down, depending on the implementation) rather than performing field division.

Most of the time you are treating integral types as integers and ignoring the fact that they sometimes silently overflow.
>>
>>55148585
It should be renamed to C-- since it's basically C++ without all the good features.
>>
>>55158120
relating to this. i always wonderd why there is no way to check the intager overflow flag in flag register in c.
>>
>>55157998
>exactly equal
there's no equality between negative integers and unsigned integers; there's only conversion from signed to unsigned
>depending on the implementation
no, it's always rounded towards 0
>silently overflow
overflow is undefined behavior
>>55158206
>check the intager overflow flag
because overflow is undefined behavior; by the time you get to check, all bets are off anyway
>>
>>55148585
Unintelligent programmers can't use it effectively.

Oh yeah mister 129 IQ might be able to bang out a full application that has but one memory leak and fix that after testing, but the average programmer is a bumbling idiot if you hand them C. The long, drawn out, dated stanzas of ifs, fors, and whiles, are too much for their working memory to comprehend. They need terse, uh, "elegant", languages, and not lisp, because the unintuitive prefix notation and purer FP style still will fry a python/js norp's brain.

When ritchie, kernighan, pike, linus, et al say that C is fine, it's like lance armstrong telling you that biking to work uphill is no problem.

>inb4 blub
Bikes are blub compared to cars, but a fit enough person doesn't care enough about the difference if they can pedal at the speed limit. They'd rather have the simpler, more reliable machine. Imagine for a moment that you can pedal your skinny ass up to 75mph so this analogy works.
>>
>>55150086
Isn't C99 the first to allow C++ style for-loops? i.e. where the counter variable can be declared within the for statement? I'd say that's a pretty big difference.

>>55150625
Why?

>>55158180
C-- doesn't mean "one less than C++". It means two less than C++. I think what you really meant was something along the lines of C++--.
>>
>>55158262
>The long, drawn out, dated stanzas of ifs, fors, and whiles, are too much for their working memory to comprehend. They need terse, uh, "elegant", languages, and not lisp, because the unintuitive prefix notation and purer FP style still will fry a python/js norp's brain.
How are C conditionals or loops harder to understand than those in JS or Python? JS literally even uses the same syntax!
>>
>>55158289
I know what I said, nigger.
>>
>>55148585
>Find a flaw
I see...
>>
>>55158227

/ does not always round towards zero.

/ and % must collectively satisfy the identity the following identity:

q = a / b;
r = a % b;
q*b + r == a

> These functions are redundant when GNU CC is used, because in GNU C the ‘/’ operator always rounds towards zero. But in other C implementations, ‘/’ may round differently with negative arguments. div and ldiv are useful because they specify how to round the quotient: towards zero. The remainder has the same sign as the numerator.

> These functions are specified to return a result r such that the value r.quot*denominator + r.rem equals numerator.

https://www.gnu.org/software/libc/manual/html_node/Integer-Division.html
>>
>>55158180
C-- is an IR and only vaguely C like.
>>
>>55148585
well what flaw?

C89 is shit. for sure.
I mean if you're talking strictly C spec a lot is wrong with it. But then you have shit like what GNU does and that's not really C anymore.
your question is confusing.
>>
>>55158508
>/ does not always round towards zero.
you don't know what the fuck you're talking about; the C standard is explicit that it rounds towards zero
>>
>>55158685

My mistake. You are indeed correct.

> The result of the / operator is the quotient from the division of the first operand by the second; the result of the % operator is the remainder. In both operations, if the value of the second operand is zero, the behavior is undefined.

> 6 When integers are divided, the result of the / operator is the algebraic quotient with any fractional part discarded.90) If the quotient a/b is representable, the expression (a/b)*b + a%b shall equal a.

> Footnote:
> 90) This is often called ‘‘truncation toward zero’’.

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
>>
>>55149425
Leaves up to the user to do important tasks like defining the max amount of bytes in an array when requesting an array.
>>
>>55148585
it's a scripting language
>>
>>55156257
please don't argue about something you don't know much about, name manging IS part of the ABI
>>
>>55160113
I'm not that guy, but arguing about stuff without knowing much about it seems like a good way to learn. Form hypothesis -> watch more knowledgeable members of the community tear it to shreds.
>>
>>55160113
*name mangling, and to add onto what i said
"Other ABIs standardize details such as the C++ name mangling,[2] exception propagation,[3] and calling convention between compilers on the same platform, but do not require cross-platform compatibility."
https://en.wikipedia.org/wiki/Application_binary_interface
>>55160208
in general yes, but he used his limited knowledge to infer things and then insisted on being right instead of asking why he's wrong.
>>
>>55148585
OP made a post about it.
>>
>>55152598
>using the smiley with a carat nose
>>
>>55158289
I don't think declaration of variables in the initialization statement of a for loop is a particularly big change. It's quite useful to be able to use the counter variable after the loop has finished. If limiting scope is a concern then you can start a new block of code prior to the for loop like this.
{int i; for (i = 0; i < n; i++) {}}
>>
>>55160344
> his limited knowledge to infer things and then insisted on being right instead of asking why he's wrong

Heh. I do this all the time, maybe it's a character flaw. It helps to have the sense beaten into you every so often, then you actually know what you need to learn into to reach the next level.
>>
>>55148585
Not purely functional
>>
>>55148585
>every program has to have an "int main(void) {}" function to compile
I don't like programming languages telling me what I can and can't do. What if I don't want an "int main(void) {}" function in my program? This is why I only write my code in machine code. Not even assembly, R a w M a c h i n e C o d e.
>>
>>55156054
no, it's called unsigned char
>>
File: 1466116666461.jpg (24 KB, 496x499) Image search: [Google]
1466116666461.jpg
24 KB, 496x499
What would I need to code a platform independent Application with a GUI in C? I like C the most of all languages, I symphasize with the syntax and its speed.

So far I know about Qt, which is based on C++, but that isn't C and its also object oriented.

I am insane and I do not want the object orientation.

There is C#, which can be used with e.g. Monodevelop or MS Visual Studio. But same goes here: OO and I would prefer Qt, I guess, although I like the C# style more than the C++ style. But Qt is a real cutie. So there's that.

The only OO language which I really do like is Obj-C, but it's only suitable for iPhones, iPads and Mac OS X, which became a no go for me.
>>
>>55164380
>I am insane and I do not want the object orientation.
You could use gtk, but it's literally C emulating objects. Like any GUI library really, there is at least one legitimate usage of OOP and that's GUI.
>>
File: 1465729556689.jpg (45 KB, 592x592) Image search: [Google]
1465729556689.jpg
45 KB, 592x592
>>55164442
>Like any GUI library really, there is at least one legitimate usage of OOP and that's GUI.
Would you mind explaining that to me?

E.g. there is an object, like a text box with nothing in it, but as it is a text box it can have more than one attribute like text field text and text field text size. Is that why object orientation is mandatory for GUI programming?
I could never really wrap my head around why I would need OOP, I always managed to do it in some normal and procedural way.

And already thank you for your answer, you nearly got quads, nice.
>>
>>55158262
Goddamnit, I guess you are right.

I will just use python and deal with being laughed at and use HTML, CSS and JS.
Nowadays so much can already be done with that. C is really nice and elegant, but I'm just too dumb for it.
>>
>>55164528
Programming paradigms are never strictly "needed".

> E.g. there is an object, like a text box with nothing in it, but as it is a text box it can have more than one attribute like text field text and text field text size. Is that why object orientation is mandatory for GUI programming?

Typically a text box needs many member functions too, ways to change its contents, manage if it can be edited or not, update its appearance on the display, etc...

Now if you look at GTK and it's GtkEntry data type, you have a load of these kind of functions:

void    gtk_entry_set_visibility ()
void gtk_entry_set_invisible_char ()
void gtk_entry_unset_invisible_char ()
void gtk_entry_set_max_length ()
gboolean gtk_entry_get_activates_default ()
gboolean gtk_entry_get_has_frame ()
const GtkBorder * gtk_entry_get_inner_border ()
gint gtk_entry_get_width_chars ()
gint gtk_entry_get_max_width_chars ()
void gtk_entry_set_activates_default ()
void gtk_entry_set_has_frame ()
void gtk_entry_set_inner_border ()
void gtk_entry_set_width_chars ()
void gtk_entry_set_max_width_chars ()
gunichar gtk_entry_get_invisible_char ()


Each taking a GtkEntry * as their first param. In C++ this would be a GtkEntry object and all the functions were members.

Now look at how it looks like in gtkmm and how it also plays nicely with inheritance.

https://developer.gnome.org/gtkmm/stable/classGtk_1_1Entry.html
>>
>>55164701
Wow thank you so much, sir. I did not expect such detailed help so quickly.

I am baffled at how high the skill level is, at which so many programmers/software developers are doing their work at.

But I still do not understand. I do not know what you mean with 'members'. I will try to understand with learning by doing. It's like vector calculus, I never got that either.
But I am tired of wasting my time on this planet, so gotta go fast, I guess.
>>
>>55148585
It's not written for people who are new to programming, yet people won't get off its dick.
>>
>>55151114
Passing pointers instead of the entire array is much better? Copying an entire array is expensive.
>>
>>55150594
Terrible way to learn C to be honest. I was typing the code but wasn't comprehending any of it. I had to read K&R and just Google questions as I thought of them to get a grasp.
>>
>>55155469
wew
>>
>>55149034
THIS GUY GET IT!

i love you man... "Bloated framework" HA
that's hilarious.. that's why i've been dragging my ass through this industry not giving two fucks. cashing out and saying fuck you to the client...
Fuck those goddamn frameworks. i hate them.

C is where it's at... i was thinking C++ for a while, but fuck it. I need to master it all. C ...

right now javascript is only good for node.js on ethereum ... that's it... that's it...
and once i get popular enough on that, i'm converting it all to C... it' will be glorious. and i will have harness every last processing cycle on earth
>>
>>55150337
that was cold bro... that was cold
>>
>>55151114
i'm sorry. can you not abstract all the complexity away or... or what? i mean... you really didn't give a good reason because all that complexity you can abstract away...
you don't have to remember all the tedious rules if you have a solid abstraction framework on top of it.
>>
>>55155877
if you cant create a system in C to abstract something for namespaces/templates/classes/holding-your-hand before you send your files to a compiler... YOU'RE A FUCKING MORONIC KEKSHIT.
>>
>>55148585
No standard GUI
No standard networking
No standard threads
shitty pre-processer (could be argued as good)
No standard exception handling
>>
File: le-comf-way.png (440 KB, 600x579) Image search: [Google]
le-comf-way.png
440 KB, 600x579
C is important because it is a low level language that can be compiled on all systems in the world.

with crypto currencies/networks... well shit. that's all you need to know. don't be deturred by dumb shit...

if you're a true programmer. and you're in this because you know it's your goddamn mission, then you fucking get comfy
>>
>>55150655
>preaches to focus on yourself, not others
>focuses on others
K
>>
>>55150655
Way to refute the argument, dipshit
>>
>>55156110
Why not "namespace_crap_my_fun"?

>>55157997
gb2/middleschool/

>>55159930
"no"

>>55160981
Purely functional languages have no I/O and cannot be used to create non-trivial programs.
>>
unix should've died a long time ago
>>
>>55165951
>No standard GUI
>No standard networking
>No standard threads
I lol'd a bit. Networking and threads are available through POSIX, but GUI man? Seriously? We're talking compiled languages here. Maintaining a STDLIB for multiple platforms is enough of a burden and you'd like to add GUI to the mix?
>>
>>55166386
It is already dead. Last was Research Unix, 10th Edition. Bell Labs killed it long ago. Unix is not the same as Unix-based.
>>
>>55166425
I shouldn't have to rely on POSIX

> We're talking compiled languages here.
I'm sorry, but are you actually implying compiled languages can't have GUIs or is in some how not made for compiled langauges?

You do realize GUIs existed long before scripted & interpreted languages even became popular.
>>
>>55166496
Interpreted languages were popular in the 80s. GUIs were not in widespread use back then. Even VDTs were fairly new.
>>
>>55166496
You shouldn't have to rely on POSIX? If not POSIX, what then? POSIX is widely supported by operating systems (except for Windows, obviously) so what else would you need?

Regarding the GUI, I meant that the effort of maintaining a standard GUI toolkit, over different platforms would quickly take so much work it might as well be a project of it's own becouse operating systems do not share a display/input interface, so you cannot really write a cross platform GUI toolkit, only a GUI toolkit that has the same interface but different implementations on different platforms.
>>
>>55148585
Minor quibbles. Dusty corners.
But it's clearly the best system invented so far.
>>
>>55166676
>You shouldn't have to rely on POSIX? If not POSIX, what then? POSIX is widely supported by operating systems (except for Windows, obviously) so what else would you need?
So what are you supposed to use on Windows?
Thread replies: 167
Thread images: 6

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.