[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
Why aren't you programming in C right now ?
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

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

Thread replies: 272
Thread images: 19
File: 600px-Capital_C.png (14 KB, 600x600) Image search: [iqdb] [SauceNao] [Google]
600px-Capital_C.png
14 KB, 600x600
Why aren't you programming in C right now ?

Are you afraid of pointer arithmetic ?
Do you hate minimal execution time ?
Do you hate crafting every bit of your program ?
Do you hate the most efficient procedural language ever made ?
Do you hate one of the greatest monument to the glory of the human mind ?
>>
Your average CS student does not know what a pointer or what a bit is, especially if they need to use for programming.

> inb4 cannot find C.jar
>>
Because I'm sitting in a Java class at the uni.
>>
Because I'm afraid of hackers
>>
>>45187887
>Do you hate crafting every bit of your program ?
that's a bingo

everything else about C is great tho
>>
>>45187887
Woah there buddy, feel free to pull Ritchie's dick out your mouth any time now

Us adults can't just jerk off to a language because its nice on paper

>Do you hate minimal execution time ?
We actually have to compare things like development time too.
>>
>>45187887
I am... Trying to figure out a way to convert a number of any numerical system into another numerical system. I get an input file which contains the base numerical system, the desired numerical system and the number.
>>
>>45187977
We learned that in the very first semester in the introduction course
>>
I am though. I'm in a machine structures course.
>>
Some times I feel all the hate here for high-level languages is from "autodidacts" with a limited breadth of knowledge sitting in their basements and not actual professionals in the software field.

But nah, that couldn't possibly be true.
>>
>>45188059
But corporate code is SHIT! So we don't want jobs anyway! We know much better than companies so we'll just code for ourselves
>>
File: 1413775162315.webm (3 MB, 1372x756) Image search: [iqdb] [SauceNao] [Google]
1413775162315.webm
3 MB, 1372x756
>>
>>45187977
Maybe in shitty universities. We had pointers in the first year.

>>45187887
>Why aren't you programming in C right now ?
Cause I have other things to do right now.
>Are you afraid of pointer arithmetic?
No.
Do you hate minimal execution time?
But fyi recent JVM implementations come ridiculously close to this. Look it up if you don't believe it.
>Do you hate crafting every bit of your program ?
No, but do you hate security?
>Do you hate the most efficient procedural language ever made?
No C is great for some things but you should evaluate which language you should use for every problem you encounter. And C won't be the best for all.
>Do you hate one of the greatest monument to the glory of the human mind ?
No, i love Dennis Ritchie.
>>
File: 1406803019377.jpg (103 KB, 1280x720) Image search: [iqdb] [SauceNao] [Google]
1406803019377.jpg
103 KB, 1280x720
>>45188078
>Mentions the JVM and security in the same post
>>
>>45188059
This. So hard.
How is it being a NEET OP?
>>
I do use it. Just don't use it for everything because the libraries are shit.
>>
>>45188097
>calling people neets on neet central
out of actual arguments already?
>>
>>45188088
>implying C is more secure than Java
SHIGGY DIGGY DON'T
>>
>>45188028
So ? Do you lack the basic maths to do so ?
>>
>>45188078
The point is not whether you had pointers or not (I can't imagine a class where pointers are skipped), but rather that many people just slip by without really getting to understand how pointers work.
>>
>>45187887

Programming in C++ does this count?

>inb4 c++ is shit
>>
>>45188166
I don't think so, the reason for it not counting is because it's shit.
>>
so I am learning c++, is it a waste of time?
if yes which program should I learn instead, I know i am a fag but help will be appreciated. I have until Jan when the college starts
>>
File: 1378180115685.gif (499 KB, 359x180) Image search: [iqdb] [SauceNao] [Google]
1378180115685.gif
499 KB, 359x180
>>45187887

B-b-but muh objects!

>console text-adventure programs all day err' day
>>
Because my current class uses Java.
>>
>>45188158
Then blame that people for being dumbfucks. Don't say "huurrr durrr your average CS student" cause you know that isn't true.
>>
>>45188140
No. it's done.
>>
>>45188097

I work 2 jobs as a web "developer" (php lol) and an english teacher for financing my CS degree so stop calling me a neet please.
>>
>>45187887
> Are you afraid of pointer arithmetic ?

Pointers are like alcohol; Only idiots and teenagers uses it frivolously.
Rule #1: Use the fucking stack whenever possible, if you need to pass data, use references. Only use heap/pointers when data is too large to comfortably fit on stack, or if you need it to be accessible globally or by threads.
>>
>>45187887
Because I am using C++
>>
>>45187887
>Why aren't you programming in C right now ?

I'm just taking a short break, OP.
>>
>>45187887
Because it's 2014 and 1980 was 34 years ago. Get with the times you autism burger.
>>
>>45188298
So you have 2 fake jobs and no degree.
Looks pretty NEET to me.
>>
>>45188366
Now you can tell this guy isn't a NEET faggot who doesn't actually know how to program. Unlike OP
>>
>>45188366
>Use the fucking stack whenever possible

int a;
int *b = &a;


Pointers on the stack.
>where is your god now
>>
>>45188411
Thats called being a shit programmer.
>>
>>45188431
>le ebic troll :^)
>>
>>45188411
> Actually wanting anonymous data invalidation

Best case scenario: You are now reading gibberish, which may be the data you expected, but it may also be the recipe for a really great pasta sauce.
Worst case scenario: You are now writing data to places unknown. The program will most likely crash, but if you're lucky you just overwrote a portion of the kernel bootcode and will not be able to boot ever again.
>>
>>45188475
>but if you're lucky you just overwrote a portion of the kernel bootcode and will not be able to boot ever again.
Wow, you really are stupid.
>>
>>45188475
We're both looking at the same snippet, right?

>You are now writing data to places unknown.
Actually, just the stack. It's perfectly acceptable to address the stack.

>overwrote a portion of the kernel bootcode and will not be able to boot ever again
This is not actually possible under normal circumstances; on modern systems page boundaries are enforced in the hardware.
>>
>>45188475
>I can't allow myself to have that much control because I might make a mistake!

I'm sorry that you have such a low opinion about your programming skills that you have to hide in a padded room.
>>
>>45187887
Wish there were more jobs in C is all
>>
>implying C isn't inferior to C++ and C# in every possible way
>>
>>45189862
And C++ is inferior to D (and perhaps Rust) in every possible way.
>>
>>45189862
>C# on microcontrollers and small embedded devices

Stop it
>>
File: thompson.jpg (13 KB, 240x333) Image search: [iqdb] [SauceNao] [Google]
thompson.jpg
13 KB, 240x333
C was deprecated by Go.

>inb4 no it wasn't muh no-gc needs

Go has the official Ken Thompson seal of approval.
>>
>>45189966
It doesn't have Dennis Ritchie's.
>>
>>45189995
Ken > Dennis
>>
>>45189995
Ritchie developed an entire OS built on a GC'd language
>>
>tfw can't decide between C, C++, Rust, D and Go
I just want to write cross platform GUI desktop programs. Is that so hard?
>>
>>45190045
GUIs are terrible in all of those.
Use Tcl
>>
>>45190045
Last time I looked Go didn't have any good GUI libraries. I haven't tried Rust, so I would go with C or D.
>>
i'm studying C

really cool that you can do so much from such small pieces

but man it seems like it would be quite tedious and slow to use as a tool for production code

so much work to do
>>
Native GUI is dead outside of mobile. The desktop GUI is the web browser.
>>
>>45190045
Roll a dice.
1, 4 - D
2, 5 - Rust
3, 6 - Go
Also, have you considered a language that is translated to C?
>>
>>45190078

i would say it the other way: "The web browser is the desktop GUI"

you are of course correct
>>
>>45187887
>Are you afraid of pointer arithmetic ?

Not afraid of it, rather, afraid of it's effect on code.

>Do you hate minimal execution time ?

Implying this is relevant in 2014. C++ will get you the same level of optimization.

>Do you hate crafting every bit of your program ?

Why would I loose time with that ? My time is more precious than the machine's time.

>Do you hate the most efficient procedural language ever made ?

It's not because english is the most spoken language that it is the most efficient. Same thing for C

>Do you hate one of the greatest monument to the glory of the human mind ?

That's just...
>>
>>45187887
because i have to do java for college :(
>>
>>45190078
Atom user detected
>>
>>45188075

The autism in that waifu code is incredible.
>>
I'm afraid of shooting myself in the foot. Strings and arrays aren't bounds checked at all.
>>
>>45189966
I really like Go, but it is true that it probably wouldn't be a good choice to write an OS or code for embedded devices in. Absolutely love the standard library in it though, makes pretty much any form of network communication trivial, and goroutines and channels are easily my favorite way of doing concurrency.
>>
>>45190131
I guess you could roll your own safer types
>>
But I attended a university in which the introductory CS courses are all about C. Are you saying this isn't the norm?
>>
>>45189904
Haven't heard of either so can't really give you my opinion on it.

>>45189954
nope, that's not what I was saying.
>>
>>45190148
Then I'd might as well use C++ for the STL types, or C#, since I already know it.
>>
>>45190151
I think Java is the most common intro CS language, maybe Python is climbing up there.

We used Java in first year here and then used C for a hardware course in the second year.
>>
>>45190162
>nope, that's not what I was saying
You said that C# is inferior to C in every possible way, which would include applications on embedded devices. Learn about implications, asshole.
>>
>>45190171

Our introductory language was C++.

And I took the class last year.
>>
>>45187887
But I am.

Ever heard of Tox?
>>
>>45190171
>Starting students (who are hopefully going to be programming for the rest of their lives) out in Java.
But that's completely retarded.
>>
>>45190162
Rust is multi-paradigm language focused on concurrency that is being developed by Mozilla.
D is a multi-paradigm language made by Digital Mars intended as C++ done right. It's more powerful (including a much more powerful meta-programming system), less ugly than C++ and fixes some major flaws (e.g. lack of modules).
>>
>>45190072
Rust apparently has a GTK port.
>>
>>45190194
It's because Java used to be the most employable language and colleges/universities want to use employment rates of their graduates as advertising
>>
>>45189855
You sound like a human sciences graduate.
"But this stuff is REALLY USEFUL! I just wish the employers would get that!"
>>
>>45190199
Okay thanks I'll check em out.

>>45190183
No I said that C# is superior to C in every possible way.
>>
File: neovim-logo.png (131 KB, 1484x428) Image search: [iqdb] [SauceNao] [Google]
neovim-logo.png
131 KB, 1484x428
I haven't written any in few months now.

I am kinda reading code of NeoVim because I'm thinking of contributing.

It's harsh...

C doesn't come in that handy at my current job. As a sysadmin I deal mostly with scripts in bash/perl or chef cookbooks in ruby or web frameworks in python. C is kinda useless for me. Though I still love that language.
>>
>>45190171
Python is number 1 now
>>
Use glib, bstring, and various other libraries. uubmub.com
>>
I see no need to limit myself to C when I could use C++. If I so desire, I can write C-like code in C++. I don't need to use exceptions. I don't need to use virtual inheritance. I don't need to use RAII. I don't need to use templates. But I like to have the choice, since they're useful tools, as long as you know how to use them properly.
>>
File: 1391008087806.jpg (16 KB, 300x303) Image search: [iqdb] [SauceNao] [Google]
1391008087806.jpg
16 KB, 300x303
>>45190171
>mfw my uni uses C# as intro CS language
>mfw reading the news about C# going open source
>>
>>45190360
glib is bloated crap by gnome dev
I rather just use C++ than that shit.
>>
>>45190345
Then don't contribute to the core, stupid. Write plugins for it.
>>
>>45190394

That must have felt good.

Still, C# is shit. At least in me experience when using it to code tasks for communicating with SFTP/Web Services for MS Sql Server Integration Services.

What a fucking nightmare.
>>
>>45187887
>Why aren't you programming in C right now ?
Because i am browsing /g/ atm
>Are you afraid of pointer arithmetic ?
No
>Do you hate minimal execution time ?
No
>Do you hate crafting every bit of your program ?
No
>Do you hate the most efficient procedural language ever made ?
No
>Do you hate one of the greatest monument to the glory of the human mind ?
No
>>
>>45190414

But the core still needs a lot of work. I test current builds of NeoVim evey week and I constantly find small annoyances. Then I try looking into the code to find how to fix them and I'm back to drinking beer and fucking about in no time. That shit is unreadable.

I know this will sound stupid, but I kinda feel like object oriented code would be much more readable for implementing vim-like editors considering how vimscript and vim comments are focused on manipulation of text objects.
>>
>>45190423
epic!
>>
>>45190437
>comments

commands

I blame the booze.
>>
>>45190413
I don't mean gobject
>>
File: 1386227489977.gif (1 MB, 300x300) Image search: [iqdb] [SauceNao] [Google]
1386227489977.gif
1 MB, 300x300
>>45190098
>take data structures and algorithms class
>lots of reference-heavy structures
>they teach it in Java
>>
>pointers
Oh a memory adress, such a complicated concept.

I had pointers in the first semester. I have also built hardware in my first semester. Feels good not to live in Burgerland.
>>
>>45190461
Why? Java only uses references, so it makes perfect sense.
>>
File: Raining-Money.jpg (45 KB, 520x373) Image search: [iqdb] [SauceNao] [Google]
Raining-Money.jpg
45 KB, 520x373
>>45187887
Because I'm a sellout and program in whatever language makes me the most $$. Right now that language is javascript.
>>
>>45187887
>Are you afraid of pointer arithmetic ?
no
>Do you hate minimal execution time ?
no
>Do you hate crafting every bit of your program ?
yes
>Do you hate the most efficient procedural language ever made ?
no
>Do you hate one of the greatest monument to the glory of the human mind ?
That would be lisp
>>
>>45190461
Should use scala
>>
>>45190506
more like
>java only uses references, except when it doesn't

which adds a layer of bullshit on top of trying to teach a simple concept. also it was like the only class taught with java in the whole CS program
>>
>>45190595
JS pays more than e.g. Python?
>>
>>45187887
Because MATLAB is 100x more useful for my job.
>>
>>45190666

You know what pays better?

Knowing both.
>>
C is the opposite of elegant, it's extremely ugly but pragmatic. Which is fine, but call a cigar a cigar.
>>
>>45190676
Actually, that pays shit.
Knowing that plus some technology like Django or Angular pays real money.
>>
>>45190666
If you know angular or backbone, hell yeah
>>
>>45190713

Well, fucking obviously. Who the fuck uses languages like Python without any frameworks? By knowing python I mean knowing Python and popular libraries/frameworks used with it most frequently.

A programmer that knows only vanilla python would be pretty useless.
>>
>>45190738
>Who the fuck uses languages like Python without any frameworks?
Uh, you know that python is used for other things besides web development, right?
>>
B-but I-I'm busy finishing muh b-biology t-thesis...
>>
>>45190747

Sure, but still with libraries that aid with communication/data conversions/multithreading/ipc communication and so on.

There's very few languages that can be useful without any external libraries for real world usage.
>>
>not using Rust
>>
>>45190760
>Sure, but still with libraries that aid with communication/data conversions/multithreading/ipc communication and so on.
Python (cPython anyway) has a ton of standard libraries on it's own (as they say, it has "batteries included").
It's a great tool for automation (and it has normal syntax, not that abomination which all derivatives of sh are) and prototyping.
>>
>>45190798
Rust is tainted with Sepples harmfulness
>>
>>45190823
How?
>>
>>45190823
Pretty sure Rust was made to fix C++.
>>
>>45190815

I know man, I use python every day at work, and developers here use python with django all the time as well.

Python really does have a lot of great stuff built in, true. But when you want to get some things done, and done fast, you will be using libraries like flask, or requests, or gunicorn or whatever. I could do the same things using standard libraries, but it's would be much more painful.

Though I do tend to stay away from installing too much stuff. If I can I stick to the vanilla python.

But I'm talking in general. When I ask someone if they know language X, I'm not asking if they know only vanilla X, I'm also asking about frameworks/libraries they had experience with.
>>
>>45190823
>harmfulness
It's literally designed in its entirety to remove sepples harmfulness.

Unless you consider curly braces to be harmful.
>>
File: 1412921432361.jpg (38 KB, 372x385) Image search: [iqdb] [SauceNao] [Google]
1412921432361.jpg
38 KB, 372x385
>tfw Rust can be low level when you need it
>tfw Rust takes inspiration from functional languages and is enjoyable to use
>tfw Rust practically guarantees that it won't crash if it compiles
>tfw cargo makes dealing with external libraries trivial
>tfw Rust perfect
>>
Because I'm learning C++ after knowing a little bit of C. Is it an error, should I continue with C instead?
>>
>>45190946
Learning C++ is an error in itself.
>>
I'm not programming in C because I prefer competent compiler languages like Rust. Enjoy your segfaults and use after frees.
>>
>>45190908
>tfw alpha software
>tfw it currently relies on gcc
>>
MozillaIDF detected
>>
>>45190968

With great power comes great responsibility.

I'd like to see you write a safe syscall blocking jail for testing external code in rust.
>>
>>45190978
>tfw it currently relies on gcc
And?
>>
>>45190978
I don't even have gcc installed, pleb
>>
I CANT CODE
>>
>>45188166
well, c++ being shit is another question, but it has little to do with c anyway, so no
>>
whats a good book for learning C, OP has inspired me. Im like intermediate level at python rn if that's relevant
>>
I had a C class first year of college and when I look back I think there are no words to describe the idiocity of starting with one of the most complicated language after asm/x86
>>
>>45188059
>tcw professional enterprise java programmer who can't into systems programming
>>
>>45191076
C Primer edition 6th.
>>
>>45187977
This is true.
>>45188037
>>45188078
>We learned that in the very first semester in the introduction course
>Maybe in shitty universities. We had pointers in the first year.
It's not because they were never taught, it's because they never learned it.

Pointers are part of the "Introduction to programming" course in the first semester here. Regardless most of the students still don't know anything. Even the more competent students don't know jack shit about pointers.
That's how they end up doing Java(maybe C#) development and never realizing what are references in Java. They just say they do. I'm not bashing Java here, I don't have any problem with Java/C#. I find C# good for a lot of shit I do. That's just the reason why there are so many shitty Java devs out there, that's all they can comprehend on a level that they won't get fired. Also not much logic is needed for enterprise quality code crunching.
>>
>>45191104
thanks
>>
>>45190958
I disagree. It's one of the most useful languages out there, it's not an error to learn a useful thing.
>>
>>45191175
But why learn C++ when Rust exists?
>>
>>45188166

>>45188171
>>45191067

C++ is mostly backwards compatible.

There is literally almost NO reason not to use C++ other than C today. Anyone who says otherwise is too retarded to step up to the plate and design better software.

FYI - You can still code in C when coding C++, in fact many C++ programmers commonly use C code in their code as well (when it makes sense). It is also common for C++ programmers to not design fully retarded OOP either. They use it, just not extensively. All the best software is like this and anyone who doesn't realize these points have much to learn about programming.
>>
>>45191187
Because Rust's syntax isn't even stable at this point
>>
>>45191191
>muh backward compatible
When will you sepples fans learn this is actually not true and it's a disadvantage of C++ if any, and a fundamental flaw in the design.
>>
>>45191197
1.0 is coming in a few months.
>>
>>45191191
The c compiler I use at work only supports c89, let alone sepples.
>>
>>45191231
And yet, everyone will still continue to use C++ over Rust.

I know I will - Just to piss you off.

In fact - I will never learn Rust. Just because I like pissing your rust buckets off so much.
>>
>>45191264
Not everyone is childish like you.
>>
>>45191259
Use a real compiler. You do realize that G++ is free right?
>>
>>45187887
>Do you hate one of the greatest monument to the glory of the human mind ?
I absolutely love C, but this is definetely not true. C is too outdated, too many things done wrong because the language was never designed properly. Even D. Ritchie himself said that.
>>
>>45191083
did you just call C complicated?
>>
>>45191264
Jeez, did Rust kill your mother or something?
>>
>>45191264
Yes, we all are.
>>
>>45191289
oops - mean to quote:
>>45191273
>>
>>45191276
Pretty sure g++ doesn't target 8051.
>>
>>45191278
Nigga C11 was released 3 years ago
How is that outdated?
>>
>>45191231
I bet it won't be used that much, though. I tried it some time ago and lifetimes just made my life harder. The language is even worse than C++ for beginners and it has literally zero IDE support (very important factor for mainstream use, even if you don't use them).

It was a good try, but honestly, I don't think it's going to replace C++ any time soon.
>>
>>45191283
It's kind of interesting. If there was a language so complex and intricate that it could read your mind and do exactly what you want, everyone would consider it the simplest language.

Likewise, if a language is so simple that it requires you to understand the fundamentals of how computers work, it's considered complicated.
>>
>>45191307
Well, we all have to work within our limitations. You gotta use what you gotta use I guess.

But you are missing out on some really nice new features in C++ these days.
>>
>>45191278
Ritchie admitted there were a few things that could be done better with the language, every language has its flaws, you know
>>
>>45191191
>There is literally almost NO reason not to use C++ other than C today
Bullshit, writing in C in C++ is pain in the ass. When you do alot of low level things your code ends up being full of reinterpret_cast<>, static_cast<> etc. And mix of exception-based code and C-style code with error codes ends is horrible

If you need to write in C, you should write it in C.

>>45191340
But there are too many flaws in C, some even affect its performance. Today we know how C can be improved, it is just easier to continue using C.
>>
>>45191328
It's because people commonly mistake simplicity with brevity.
>>
>>45187887
>Why aren't you programming in C right now ?
Right now? Because the project I'm working on is written in C++ and it would be inappropriate and highly autistic of me not to follow the conventions already used in the code.
>>
>>45191383
>If you need to write in C, you should write it in C.
As a C++ programmer, I agree. C++ written like it is C with classes is a horrible mess.
>>
Because I'm a c++ shitlord.
>>
Call me dumb, a noob, a faggot, whatever you want, but here's the facts:

When i did IB (eu. equivalent of A-levels), we were taught in java because it's much easier to pick up. When continuing through university, we are being taught in java still. Now we've moved away from pure java programming and moved to android programming - and guess what language android programs are written in? java.

I'm not fucked to learn C because it's way too complicated, and to be completely honest, I don't need it right now. Next year i'm doing an internship, and almost none of the one's i've applied for specifically state that knowledge of C is required.

I realize I'm going to have to learn C at some point, it's just not a huge thing on my to-do list right now...
>>
>>45191383
C can be improved by using existing libraries whenever possible. Shit like GLib handles the dangerous parts so you can focus on your project and assume it'll work as well as you can program.
>>
>>45187887
>Why aren't you programming in C right now ?
Because I've already joined the Rust master race.
>>
>>45187887
>Do you hate crafting every bit of your program ?
Yes. I don't feel like reinventing the wheel and implementing half of Lisp in my program before I can actually be productive with it in a time limit.
>>
>>45191453
thats cool, but answer this.

Do you think you truly know how a computer works?

do you think you do or not?
>>
>>45191481
>GLib
>gnome object system
Pig disgusting
>>
>>45191481
Bullshit, glib is slow and handles nothing. And still does not solve many problems.
Some parts can only be improved only by changing the language
>>
>>45191487
stay plen
>>
>>45191453
Imo writing in C is way more fun. Just knowing that you can reallocate 10 GB data array without wasting cpu cycles and another 10GB of memory (something Java can never do) makes it better
>>
>>45191453
>calls C too complicated
>uses Java
Java is much more complicated than C. C is a very simple language.
>>
>>45187887
>Do you hate crafting every bit of your program ?
yes. very much.

i like having stuff already written so all i have to do is join them together and watch the dance as whatever im making works (holy shit it feels so awesome when something finally works exactly as you want it.)

If you had to reinvent the wheel every time you'd never get anything done. And all the softwares you use everyday would take decades to be made.
>>
>>45187887
That beautiful concept of knowing that you code in both C and C++ and have spent many years using both.

Yet years later - I always use C++ because it's better.
>>
>>45191487
Exactly. But some projects just cannot use existing libraries for many reasons. And writing C here is godly
>>
>>45187887
>Are you afraid of pointer arithmetic ?
Not afraid of it, it's kinda cool sometimes, but I don't want to deal with it 24/7.
>Do you hate minimal execution time ?
It's nice, but not always necessary
>Do you hate crafting every bit of your program ?
Yes. I've got better things to do than reinvent the wheel.
>Do you hate the most efficient procedural language ever made ?
No, but that doesn't mean I want to use it for things it's bad at.
>Do you hate one of the greatest monument to the glory of the human mind ?
Wut
>>
>>45191596
>iirc - the only person in this thread who responded properly to op's post.

I like you! I agree with you and you even put it so nicely!
>>
>>45190171
Yurofag here

We learned C in the 1st semester.
ARM ASM in the 2nd semester.
Object Oriented Programming with Java in the 3rd semester + C for explaining some basic OS concepts like threads and the kernel.
>>
File: image.jpg (15 KB, 275x183) Image search: [iqdb] [SauceNao] [Google]
image.jpg
15 KB, 275x183
>There are people on /g/ RIGHT NOW who do not realise that K&R is a memebook.
>>
>>45191647
Easteurepoor:
1st and 2nd semesters: Pascal language (including language grammar) + data structures (all in Pascal), 3rd: C, 4th: OS concepts using C, x86 asm, 5th: little of Java, C#, C++, Delphi (all in OOP course)

I didn't like Pascal, I would like to start with C, but now I think that for most people Pascal is the best choise today. It is sad there is no advanced IDE for it
>>
>>45191647
fer detected
>>
>>45191667
Would post a laughing gif but I got none so take this my man!
>>
>>45187887
i have no reason to program anything using C. That being said, I love c++ and using pointers.
>>
>>45187887
>Why aren't you programming in C right now ?
Because I'm programming in a decent language.

>Are you afraid of pointer arithmetic ?
No more than any other arithmetic, although it is unnecessary.

>Do you hate minimal execution time ?
This is a myth. C feels fast, but that's it.

>Do you hate crafting every bit of your program ?
I dislike being asked to micromanage every little detail. This causes programs to have more flaws and take longer to build.

>Do you hate the most efficient procedural language ever made ?
This is a lie. Once again, it only feels efficient.

>Do you hate one of the greatest monument to the glory of the human mind ?
That would be a language like Algol, Lisp, or APL. C is an abomination made popular in part by a monopoly.
>>
>>45191900
>it only feels efficient

penn_ jillette_trash_meme.jpeg
>>
>>45191957
nice meme
>>
>>45191957
It feels efficient in the same way that crouching in a bathtub and catapulting yourself to your destination feels more efficient than using a plane to get there, even though the plane is faster and safer.
>>
>>45191900
>C is an abomination made popular in part by a monopoly.
>made popular in part by a monopoly.
>in part by a monopoly.
>in part
Whatever you say shill, you know bloody well that it was made popular 100% by a monopoly and suggesting otherwise is just pure faggotry
>>
>>45192080
I just didn't feel like pissing someone off by saying that, but I've pissed you off by not saying that.

But I agree.
>>
>>45191900
>... C is an abomination ...
Kek. C was made popular and is popular to this day because there are engineering problems which require something like C.
Not every thought process dealing with computers have to use a CS oriented perspective on software/math.
There are a lot of other ways too look at software and pieces of math which are used in engineering, actual engineering.
So saying that C is an abomination might be true from some pure software design perspective, but it's not from an engineering perspective.
>>
i can't pointers therefore C is a pile of horse shit.

Java is master race.
>>
>>45188137
C programs are as secure as you make them, but your programming doesn't mean jack shit if the jvm is compromised.
>>
>>45192138
Those engineering problems were already being solved by languages like BLISS.
>>
>>45190026
What?
>>
I actually just put C programming language by K&R on my kobo and am about to install freebsd to learn it on. I thought it would be cool to learn C from the guy who made UNIX on the closest living relative to UNIX. Pretty sweet.
>>
>>45192167
Inferno/Limbo
>>
>>45192152
Thanks. I will looks this up. I took a quick glance and it looks interesting from the looks of it it was aimed at low level system dev.
I guess it's completely gone by today. Is there anything like it still in use today?
>>
I like C.
I don't see much use for it nowadays but I had tons of fun writing code in it.
Maybe I will encounter it more when I head further into the networking path.

  
#include <stdio.h>
char shellcode[] = "\xbb\x14\x00\x00\x00"
"\xb8\x01\x00\x00\x00"
"\xcd\x80";
int main() {

int *ret;

ret = (int *)&ret + <integer>;

(*ret) = (int)shellcode;
}


Stuff like this is just interesting and helps you understand how a machine works imho.

>>45190171
Pretty much the same here
First semester Java, second Assembly and functional programming (SMLNJ wtf), third C or Java in depth.
>>
>>45192269
>Is there anything like it still in use today?
Sorry, but I don't know.
>>
>>45192287
Ok, thanks. :-)
>>
>>45187887
I love C in all it's being, but honestly I use Java way more because of easy of implementation and development time.

Time is money in this industry and if I can finish something 20% faster and still get paid the same for a working product, I can't really see what the issue is.
>>
>>45187887
i really like c but python is easier to get results (less typping)
>>
>>45192275
>Stuff like this is just interesting and helps you understand how a machine works imho.
And will not work on any decent OS thanks to no-execute protection.
>>
>>45187887

Because C (and it's bastard offspring, C++) are not awesome from many angles:

No REPL--I can't quickly test out little snippets of code, build up a workspace, try new ideas, do quick testing, etc.

No decent unit testing--most unit test libraries for C/C++ are shit-tier, and to do them write you've got to write them again from scratch anyways, because that's the C/C++ way.

No native multithreading support--C++14/Cxx have made a bit more progress on this, but older codebases (lol) don't/can't use those facilities.

No clean memory model--super super super easy to fuck up other parts of memory with badly-constructed pointers. And no, you fucking aspies, this is a *bug*, not a *feature*.

No strongly-enforced immutable types--see previous. If I can just take the address of a const var and then overwrite it anyways, it's not really const, now is it?

No sane standard library--C doesn't have easy methods for dealing with tasks we all care about: time in common (8601/3339) formats, file system integration, high-precision time, network communication. C++ is *even worse* about this.

No notion of safe arithmetic--without handling it myself, I can't easily catch when an integer operation would result in an overflow or an underflow, which is fine, BUT THEN YOU HAVE TO DO THIS FOR POINTER ARITHMETIC AND MEMORY ALLOCATION.

No native support for UTF-8--wchars are a fucking lie and a joke.

(C++ only) No sane interface mechanism--mulitple inheritance as defined in C++ is bullshit, prone to error, and just bad. Modern languages accomplished what it went for better with interfaces (Java) or mixins (Ruby) or prototypical inheritance (Javascript) or types (go).

(C++ only) no specified ABI--piece of shit, can't be easily embedded/called from other languages. C++ is garbage to use from other places.

~

I could go on and on, but let's face it: C is a specialized tool for certain types of work, and inadequate for anything else.
>>
>>45187887
Because I'm reading this. C is my favorite language, though.
>>
Well as long as yous are all talking about C, maybe one of you can tell me what's going wrong here. I'm making a menu-based ATM thing for a college assignment, and one of the options is to let the user change their PIN:

 else if (choice == 2)
{
printf("\nTo change your PIN, please enter your current PIN: ");
scanf("%d", &userpin);

if (userpin == pin)
{
printf("\nNow please enter your new PIN: ");
scanf("%d\n\n", &pin);
correct += 1;
}
else
{
printf("\nYou have entered the wrong PIN. You will be returned to the main menu.\n\n");
incorrect += 1;
}
flushall();
}


Thing is, it's supposed to loop back to the main menu when this finishes running, but when the user correctly enters their PIN and then enters their new PIN, it sits there and waits for more input before looping back, and I don't know why. It's not structured any differently than the other if/else statements I have, and they work perfectly.
>>
>>45191720
>It is sad there is no advanced IDE for it
What do you mean by "advanced" that Lazarus or any of these http://wiki.lazarus.freepascal.org/IDE don't cover?
>>
>>45192348

(contd.)

So, for practical work, I prefer Javascript or Ruby, and then call out to C for any performance-critical stuff (usually just numerical stuff I don't want to use Fortran for).

Also, Erlang or Elixir or *waaaaaay* better for reliable systems work. They're easy to integrate with C or other system processes, and they are freaking awesome at bit twiddling.

They're purely functional and are the best implementation of OOP's purpose that I've ever seen.

Basically, Erlang/Elixir are functional languages created by people whose jobs depended on it, and are free of the faggotry of, say, OCaml or Haskell.
>>
>>45192348
7.5/10

Pretty good, but you should read a bit more about C++11/C++14 additions and current library TS's.
>>
>>45192382
>scanf("%d\n\n", &pin);
>>
>>45192382
two carriage returns are needed
>>
>>45192425

What's the issue with it? It works, but there is definitely something in that particular 'if' that's preventing a loop back.
>>
>>45192448
try to remove the newlines
>>
>>45192458

Yep, just copped that there, moved them to a separate printf and it all works.
>>
>>45192382

(erl bro here)

You should write out a state machine for this project--at least showing which pages show up and how you move between them.

So, something you might want to consider is modeling your program as a stack of dialogs, right?

So, at start, you have the login page. Page displays a banner and accepts input. On failure, it doesn't do anything. On sucess, it pushes a new page onto the stack. Similarly, each page can push a new page onto the stack, do nothing, or pop itself off the stack. That way, you get the state transitions you want.

For your specific problem, you have a PIN change page (which prompts for a PIN). On success, it pushes the "Change PIN" page onto the stack. On failure, pushes on the "Failed PIN" page (which in turn will, on next, pop itself and the preceding page off the stack, leaving you at the menu page).

The change PIN page, on success (any input entered), will then change the PIN and pop itself and the preceding page off the stack.

You can do the meat of this with a struct, an array, a counter, and a few function pointers.
>>
>>45190595
JavaScript is programming now?
>>
>>45192405

I have, and opinion stays the same. Even with C++14, the language lacks useful shit for day-to-day programming.

Also, the function/lambda syntax is gross compared to, say, closures in JS (which are in turn made better with generators and promises, but that's neither here nor there).

The problem is that the C++ folks are too busy adding language features when they need to be putting together a compelling standard library. New stuff must interoperate with old stuff, and that is something that everyone seems to be forgetting.

If I'm going to be writing *new* code, I'm not going to do it in a language as large and unhinged as C++.

If I'm going to be writing with *legacy* code, I need to make my code look like theirs because that's proper practice (or nuke it all entirely and start over, which usually isn't a good idea).
>>
>>45192547

Yeah it is.

It's used by more people than your mom, and is actually a nice and compact functional language.
>>
>>45192579
Again, read newer papers. They realized the standard library was ridiculous before C++11 and they are already being studied and proposed for the upcoming standards: filesystem, networking, ranges (similar to streams and generators), higher-level concurrency constructs, auto-parallelization...
>>
>>45192590
That explains why JS is so shitty then.
>let me know when you start Haskell, pleb
>>
>>45192547
It's turing complete
>>
>>45192633

And not a single fuck will be given, because all of that stuff is already being done better by other languages today.

They've known about those problems for *a decade*, and *still* haven't fixed them. In the meantime, we've got a bunch of PL wanking.

I loved C++ as much as the next guy, and put in a lot of time with it for various projects. The fact is that the language is out-of-touch with modern development, and the legacy problem is unbounded.

C at least gets a pass on networking because in a good operating environment--say, Plan 9 or Inferno--you treat the network like a file steam *anyways*.
>>
>using a *nix operating system
>not writing everything in C
Go back to windows.
>>
>>45192769
>>not writing everything in C

>being this autistic/inexperienced
>>
I am. Start programming using C for 2 months, now(Pretty amazing language to start with). The two greatest programs I did was a Chip-8 emulator and a 4chan thread image downloader. Still, I wanted to help open source projects, but any I search for require a fucking huge knowledge of C. It's not for the faint-hearted.
>>
>>45188075
What the fuck is wrong with this code?
>Delphi
Oh.
>>
>>45188181
>>console text-adventure programs all day err' day
wat?
>>
>>45190171
>I think Java is the most common intro CS language
Holy shit, even in Brazil C is the norm.
>>
http://harmful.cat-v.org/software/OO_programming/
>>
>>45193381
bruno pls
>>
>>45187887
>Are you afraid of pointer arithmetic ?
No.

>Do you hate minimal execution time ?
I get that with other languages as well.

>Do you hate crafting every bit of your program ?
Yes. Should I like reinventing the wheel in a bad fashion like it's a thing among C programmers?

>Do you hate the most efficient procedural language ever made ?
Except Fortran has already that place.

>Do you hate one of the greatest monument to the glory of the human mind ?
It's a monument of shame. K&R were such plebs.
>>
>>45188012

This.

One of the best reasons for multiple languages. C is powerful as fuck but I dont want to do everything every time.

Hell Python+C for life.
>>
who /writtentheirownshittyhashtable/ here
>>
because I want to get things done in a reasonable amount of time and not reinvent the wheel.
>>
>ITT: if it's not in the standard library you have to write it yourself
>>
File: C.jpg (15 KB, 260x339) Image search: [iqdb] [SauceNao] [Google]
C.jpg
15 KB, 260x339
>>45187887
I'm actually learning C now, although I kinda jumped in at the deep end as I have very little programming knowledge.

Is pic related a good recourse, it's what I've been working from
>>
File: 1412101940595.png (99 KB, 254x258) Image search: [iqdb] [SauceNao] [Google]
1412101940595.png
99 KB, 254x258
I'm not working with C because I'm working on a compiler that compiles lisp to C++.

>inb4 autism fit
>>
>45188088
>Mentions the JVM and security in the same post
>>
File: moot.jpg (15 KB, 293x399) Image search: [iqdb] [SauceNao] [Google]
moot.jpg
15 KB, 293x399
>>45191014
>you have a problem
>it's your own fault and the fix is trivial
>we're plebs

Is your basement comfy?
>>
Because hacking with lisp is more enjoyable.
>>
>>45194862
>a compiler that compiles lisp to C++
Why would anyone even want to have this
Literally for what purpose?
>>
>Do you hate crafting every bit of your program ?

This. You say it like it's a good thing, but ain't no one got time to reinvent the wheel over and over again.
>>
>>45187977
i thought it was a running joke on /g/, but hoyl shit it's all true.

first semester at college right now, in a terribad Java class (there's no C class, just intro java and the rest is math and algorithms)

three times i've gotten marks off for doing things properly.

>lost marks for "not throwing exception"
>i had a try-catch block that handled it with better error reporting

>lost marks for "incorrect loop"
>she marked an input loop i added to fetch input and check for errors, instead of trusting the input
>she literally could not tell the difference between an error checking loop and an assignment loop

fuck everything, when does school git gud?
>>
File: image.jpg (3 KB, 300x57) Image search: [iqdb] [SauceNao] [Google]
image.jpg
3 KB, 300x57
>>45187887
I am, this thread inspired me to learn C, I am reading Programming in C, Third Edition by S Kochan right now!
>>
>>45197126
>this thread inspired me to learn C
I don't think you were reading this thread correctly.
>>
>>45187887
Lisp was here. C is weak and disgusting.
>>
>>45197300
>not understanding that C + Lisp is the best pair of tools ever

perl can come too, i guess.
>>
>>45197708
is lisp actually worth learning ? i use mainly c/java/perl at work
>>
*tips memory leaks*
>>
>>45188075
>delphi programmers
>>
>>45188075
Who's that girl and what's she from?
I feel like I know her
>>
>>45188475
>you just overwrote a portion of the kernel bootcode

If it was that simple malware programmers wouldn't charge out the ass for bootkits.
>>
>>45191900
>That would be a language like Algol, Lisp, or APL. C is an abomination made popular in part by a monopoly.
C became more popular than these better languages because of implementation simplicity, i.e. pushing everything onto the user.
Good languages take a long time to implement because you need garbage collectors, more complicated type checkers (or type tags for dynamically typed languages), and error checking which you don't need for C.
OSes built around these languages would be very different from Unix too. OSes based on Algol 68 were more like some of the experimental Haskell OSes with trees of strongly typed data objects (including procedures) instead of a traditional file system.
>>
>>45187887
Why do people put a space between the end of their sentence, and its respective punctuation? Is this some sort of foreign (relative to an American) syntax?

I can't see how it would improve parsing in any way.
>>
>Do you hate crafting every bit of your program ?

Yes. I've got shit to do and don't need to re-invent the wheel when other languages have more convenient solutions.
>>
>>45197971
not really, unless you've never been in a functional programming setting, or have issues with recursion, then it's a great way to learn.
>>
>>45187887
>Why aren't you programming in C right now ?
I mostly do .NET at work an home. But now that my windows7 went belly up I am learning Python to keep working on my website

>Are you afraid of pointer arithmetic ?
I am afraid to catch autistic from you

>Do you hate minimal execution time ?
No, I hate writing buckets of code to do anything remotely useful

>Do you hate crafting every bit of your program ?
Well yes, yes I do. Do you Propose I write everything socket-up for my blog?

>Do you hate the most efficient procedural language ever made ?
I hate autism mostly.

>Do you hate one of the greatest monument to the glory of the human mind ?
C is not it. Soviets flying a man into space, or Americlaps landing a spacecraft with dudes on the moon are that maybe but C is not by a long shot.
>>
Because I like to use more advanced technologies such as php.
>>
>>45198303
it's just one language i've never seen in the workplace. but every time i come on /g/ someone's raving about how you must learn lisp.
>>
>>45187887
>Why aren't you programming in C right now ?
Because I have an assignment that I need to do in python.

>Are you afraid of pointer arithmetic ?
>Do you hate minimal execution time ?
>Do you hate crafting every bit of your program ?
>Do you hate the most efficient procedural language ever made ?
>Do you hate one of the greatest monument to the glory of the human mind ?
No.
>>
>>45198054
It's Ana Coppola from Ichigo Mashimaro.
>>
Are you afraid of pointer arithmetic ?
Not in the least.
Do you hate minimal execution time ?
Certainly not
Do you hate crafting every bit of your program ?
Yep. I prefer working with abstractions rather than bothering with extremely low level details.
Do you hate the most efficient procedural language ever made ?
No, but I have no interest in using it. Also in general fuck procedural.
Do you hate one of the greatest monument to the glory of the human mind ?
It isn't even close.
>>
>>45198710
FedoraFactory fedoraFactory = new FedoraFactory(gBoard.getFedoraFactoryParameter());
Fedora myFedora = fedoraFactory.makeFedora(Hat.Fedoras.atheistic);
myFedora.tip();
>>
>>45198280
>Not implementing your own data structures that fit your needs perfectly
Sure is pleb in here.
>>
File: jpeg-the-strongest.jpg (125 KB, 2000x2060) Image search: [iqdb] [SauceNao] [Google]
jpeg-the-strongest.jpg
125 KB, 2000x2060
>>45187887
>no
>no
>actually, yes -- too much effort
>is it?
>is it?

it's nice, I tried to make it my daily language, but I pretty much ended up spending half my time writing library code to get shit done (that being said, I should have used bstring instead of rolling my own string routines, that was dumb)
>>
>>45187887
Because I'm learning to machine learn and it's easier to write the code in Matlab.
>>
>>45198908
loeb :: Functor f => f (f a -> a) -> f a
loeb x = go where go = fmap ($ go) x

This is 70 lines in C.
>>
>>45199047
Somebody has to write your garbage collector, pleb, and it's not going to be written in Java or Haskell.
>>
>>45199102
You mean to say that we use a systems programming language to write low level system applications? That's very intriguing!
>>
>>45187887
Learning a common assembler language is more useful.

At least with that you can truly understand how the computer works at the lowest level you're expected to.
>>
>implying i can keep C from pushing unnecessary things to stack
>>45199209
You learn ASM so you know how a computer works.
You then switch back to C because unless you have Memory/cycle requirements ASM is really inefficient (in terms of time)
>>
>>45199232
>You then switch back to C because unless you have Memory/cycle requirements ASM is really inefficient (in terms of time)
There are actually some cool operating systems that are written in assembler language. It would be cool to help them.
Besides, what if you don't want to trust your compiler?
>>
>>45197043

I would throw an absolute fit.

Also,

>she

Wow, there's your fucking problem.
>>
>>45199251
>writing an OS in asm
I couldnt even imagine
>what if you dont want to trust your compiler
Its made by Autists who Dedicate their lives to Shedding 2ps off fprintf, i trust their ability to code fare better than mine
>>
>>45199289
>I couldnt even imagine
There's already a few. Maybe I'd like to make my own little operating system? That would be fun and a great learning experience.
>Its made by Autists who Dedicate their lives to Shedding 2ps off fprintf, i trust their ability to code fare better than mine
I didn't mean like that. I meant in the whole Ken Thompson's "Trusting Trust" way.
>>
>>45199289
http://kolibrios.org/en/
>>
>>45199257
Thanks for insulting me bro. Appreciate it.

0/10 would not pair program with.
>>
>>45187887
Since I can have far more abstracting languages whose implementation can at least reach the same performance: Why again should I embrace your autism, OP.
Thread replies: 272
Thread images: 19
Thread DB ID: 21345



[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | 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.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.