[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
Do function pointers make C a functional language? Do void pointers
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: 33
Thread images: 4
File: 9ee0381eb1d4b1d946.jpg (6 KB, 170x250) Image search: [Google]
9ee0381eb1d4b1d946.jpg
6 KB, 170x250
Do function pointers make C a functional language?

Do void pointers enable generic programming in C?

Also doesn't C support OOP?
>inb4 /v/ poster doesn't know about GTK+

Now, what's the point of all these new languages that don't actually have anything more to offer than C does, and C does it faster and with a longer proven track record.
>>
>>54347124
Of course not. C doesn;t support OOP. But you can "Emulate" it using function pointers as struct members. (they still need a reference to the object tho.).
>>
Function pointers don't make it functional, but they did make it more functional than its contemporaries such as Pascal.
Void pointers permit genericity in a very vague, but technically unsafe way. Preprocessor hacks permit genericity in a more statically-analyzable but uglier, clunkier way.
OOP is entirely doable (see: glib) but using C these days is a statement against modern "wisdom", so why would you?
>>
File: cee.png (64 KB, 1074x220) Image search: [Google]
cee.png
64 KB, 1074x220
Nice language faggot

Let's see if you can even average two ints without fucking up
>>
>>54347488
>C is the only language with floating point numbers

Nice bait
>>
>>54347519
Why not have working numbers instead of floating numbers?
>>
File: pyy.png (8 KB, 391x169) Image search: [Google]
pyy.png
8 KB, 391x169
>>54347519
>>
>>54347535
>I don't know how computers represent numbers in binary
>>
>>54347563
>on some systems
>>
>>54347563
>on some systems
>>
>>54347592
>implying the C way is the only way
Mathematica gets that right
>>
>>54347697
>IEEE 754
>"the C way"
It's always the fags who know jack shit about computers complaining about C
>>
>>54347757
Nice try but after Googling a bit I found out both were invented by the ISO standards commite

C is ISO/IEC 9899:1990

This "floating point" is ISO/IEC/IEEE 60559:2011
>>
>>54347697
Mathematica
>an interpreted language for math abstractions
C
>a compiled language designed to replace assembly programming

I wonder which one has to conform to the way CPUs deal with numbers.
>>
>>54347950
This just proves C is obsolete
>>
>>54347984
Yeah let's just program kernels in Mathematica, it'll work better
>>
>>54348037
How many kernels have you been paid to code anon?
>>
>>54347124
>be cs junior
>have no idea whats going on in this thread
am i fucked
>>
>>54348053
>moving the goal posts
>>
>>54347124
No, C has side effects
C is not a functional language
case closed
delete this thread
>>
>>54348082
Haskell has side effects too
>>
>>54348144
And your point is? Haskell is a not a functional language if you include the use of its features that allow for side effects or require it.

There's a reason why no 'pure' functional languages are in use because they are useless.
>>
>>54347347
Neither does Java support OOP
>>
>>54347124
>Do function pointers make C a functional language?
What the fuck are you on about?
No, it makes it object oriented.
>>
>>54351140
You shitcorn fuck, do you not understand how method calls in C++ actually work?
>>
>>54348172
you literally argued against yourself.

very impressive
>>
>>54347124
bumping one of the two interesting threads on /g/ right now
>>
>>54347124
The reason why we have languages other than C is because most people are retarded and computers are now fast enough that we can trade performance for ease-of-programming. The number of CS grads who can't even concatenatenate two strings in C without using strcat is staggering.
>>
>>54348144
>Haskell
>side effects
Pick one and only one, faggot. Despite what you may think, the IO monad is pure.
>>
>>54352519
>le C is the pefect langage may-may
>>
>>54347347

That doesn't make it OOP... It also increases verbosity for nothing.
>>
>>54347124
>don't have anything more to offer than C
kek, summerfag, go take a decent CS course and get back to us
>>
>>54347347
OOP isn't defined as "methods inside a class accessed with a '.'" you moron.
Thread replies: 33
Thread images: 4

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.