What is even the point of higher level languages...

What is even the point of higher level languages? All they do is try to improve accessibility while decreasing flexibility, although most of them fail to even increase accessibility. C is literally perfect, there's no need for Java or C++ or Python, and it was a mistake for companies to move away from C

Attached: The_C_Programming_Language_logo.svg.png (1200x1276, 77K)

Other urls found in this thread:

developer.gnome.org/glib/2.26/glib-Hash-Tables.html
techbeacon.com/35-bad-programming-habits-make-your-code-smell
exceptions4c.guillermo.in/
github.com/ThrowTheSwitch/CException
stackoverflow.com/questions/6622524/why-is-haskell-sometimes-referred-to-as-best-imperative-language
youtube.com/watch?v=uqsZa36Io2M
en.wikipedia.org/wiki/Big_O_notation
twitter.com/SFWRedditGifs

The secret is that most of Jow Forums can't actually program. Anyone who can has made their own libraries for making C behave like a higher level language when necessary.

because people pay businesses to use Java and universities teach java

>Spaghetti is the perfect pasta. Why would anyone get penne?

The problem is that you're looking at shitty languages like c++ and java that limit expressivity rather than embrace it. try haskell or a lisp.

Why get either when you have pasta dough that you can form into exactly what you need?

C is a high level language.

Because C is hard

I said "higher level languages", as in languages higher than C. Sure you could argue that Assembly would give you maximum freedom, but at the dramatic cost of accessibility. C achieves the perfect balance

Its actually a lot simpler than Java. It just requires more writing on your end

>All they do is try to improve accessibility while decreasing flexibility
C++ is the complete opposite of that. It increases flexibility while decreasing accessibility.

C was once considered a high level language

Times change, and now we have 50 MB websites

I don't get it. When you need "flexibility," can't you just use your higher-level program to call a C program? You can do that, right?

you're fucking a nigger in the deep ocean, you've got no idea what's underneath you

how about you write some C code for me that does this:
myStuff = [1, 1.3, "hi", "Douche"]
hmmm = {}
hmmm["you"] = myStuff
hmmm["can't"] = {"I" : ["like", "this"]}
hmmm["do"] = (1, "x")
hmmm["this"] = [hmmm["can't"], hmmm["do"]]

print hmmm

output:
{'this': [{'I': ['like', 'this']}, (1, 'x')], 'do': (1, 'x'), 'you': [1, 1.3, 'hi', 'Douche'], "can't": {'I': ['like', 'this']}}

I think what you mean is there is no need for anything other than lambda calculus. It's literally perfect.

Attached: church.jpg (480x480, 38K)

You forgot that imperative (Including OO) is fucking garbage.

as we all know c is pretty close to asm anyway
all this is is a clusterfuck of abstraction.

come on c fanboys, how about this one....

>>> csNightmare = {"hello": "world"}
>>> for i in range (0, 7):
... csNightmare = {i: csNightmare}
...
>>> print csNightmare
{6: {5: {4: {3: {2: {1: {0: {'hello': 'world'}}}}}}}}

boy am i missing out, i wish i could do that!

And here I thought I was programming to make solid, fast software, but now I realize all I wanted in my live was to do shit like so that I can feel smug on Jow Forums!

I unironically like working with object oriented languages more. I can work with C but I just enjoy working with OOL more.

you act like dynamically allocating memory is useless, but it's super useful if you're trying to get a problem sovled, instead of being a code grind who has a spec in front of them and tries to implement it in the most optimized way possible

this is why academics and data scientists use python. we can do magical things thanks to python -- maybe the code takes a factor of 5 to 10 times longer to run, but it takes a factor of 10^6 less to write, and for actually getting the job done, it makes up the difference many times over

>you act like dynamically allocating memory is useless
are implying C programmers prefer static allocation?

>but it takes a factor of 10^6 less to write, and for actually getting the job done
just get a library with all sorts of datastructures and algorithms, it wont be particularly different from your python code

there's this thing called a struct

i guess what i mean is dynamically creating arbitrary structs without any sort of declaration

but that’s exactly what python is. it’s implemented in C, don’t forget

no, thats totally not the same thing, user

okay, then find me some C package (easy but still impossible mode: C++ package) that can do my two code snippets above in a similar number of lines.

you realize you can put an unlimited number of c statements in one line right

Attached: 1528480307607.jpg (500x332, 35K)

fine, wrapped lines

what's his point? why are brainlets so proud?

there are no packages for C or C++, only libraries

if you want dictionaries, try this developer.gnome.org/glib/2.26/glib-Hash-Tables.html

>this gokart with a lawnmower engine gets 2 mpg but it only took me a weekend to build it

imagine being so lazy that you need a language over 3x slower in order to have a pre-implemented array of structures

yeah, that's why every company with a data science department employs a few data scientists who solve the problems with algorithms implemented in python, then they hand off their code to the C/C++/Java grinders to rewrite and optimize.

it's like the architect vs. the construction worker. the brainy guy makes a model prototype and the worker bees make it marketable

it's fine if you want to be the guy figuring out how to improve someone else's code, be my guest, but i'd rather do the rapid R&D for prototyping brand new stuff

nah mate

if you can't actually write real programs just be thankful to be employed

Attached: glaugh.jpg (500x370, 59K)

Error handling in C removes all its beauty.

>real programs
i bet you're the kind of guy who's like "if it's not written in C then it's not a real program!"

well Twitter was written in Ruby on Rails and _stayed in that framework_ until 2009! now the guys who wrote their Ruby on Rails demo webapp are billionaires, and some grinders have rewritten it for java servlet containers.

you're not innovating if you're worrying about the nuts and bolts of memory management, unless you happen to be Linus Torvalds. but the vast majority of tech-industry startups get valuations of multi-millions before hiring engineers to refactor the code for optimization

C and Assembly are practically high level languages these days. We aren't on PDP-11s anymore.

get out

Fact check status: True

yes I will write a graphics driver in 'ruby on rails' and get back to you with how that goes

>hurr durr abstractions bad

friendly reminder that C compiler research is done using higher level languages :^)

friendly reminder that nobody actually wants to use an optimizing compiler that butchers your code

>it was a mistake for companies to move away from C

If companies moved away from C and to other programming languages, obviously there was incentives to do so. Like, better abstractions OOP abilities, faster to write code that is more efficient, etc.

So, you don't want your executable to be faster?

I do, but i'm not a retard so I write C that I know will execute fast.

i said, i'm fine with people being the code monkeys in the back office who do stuff like writing video drivers according to the spec they have in front of them. somebody needs to do that.

but writing drivers for the video card is not what i'm into. i'd be more into designing the video card than writing the drivers for it, if i had to make that choice; but in terms of programming, i'd rather be doing R&D on data analysis and designing new algorithms to solve problems, than implementing some protocol according to some spec that some pocket-protector VHDL-loving EE wrote

Interesting. Any good resources on writing fast and efficient C code?

how about thinking about how many cycles something will take

experience

you're retarded.

>What is even the point of higher level languages?

How difficult of a concept can it be? The vast majority of reasons why we use computers is to solve a problem. High-level languages have their applications, like low-level ones have theirs.

If I need to do some data analysis task, why the bloody fuck would I start looking C or Assembler? Why the fuck would I care about memory efficiency, pointers, and ultimate speed? I'll write a script in whatever high-level language in a day, run it the second day, and never touch the fucking thing ever again, because I got my answer and am moving on. Sure I could do the same in C, take 5-10 days to write it up efficiently, it'll run in 10 seconds instead of 2 hours - but I've lost 5-10 days making it efficient. So what's the point?

techbeacon.com/35-bad-programming-habits-make-your-code-smell

this.

you can state my job as 'designing new algorithms to solve problems' or you can call me a code monkey. That's your prerogative, but on my end of things I don't suck any nigger cock and I don't care to see people encouraging others to do so.

Poster is spot on.

we're talking about software development and that isn't really software development.

Wow. Nice way to just sweep his argument underneath the rug.

>ctrl-f
>development
>2 results

Wait a second, are you trying to fool me, buddy?

This

I love C but error handling is its fucking bane.

admittedly i don't know what goes into writing video drivers, but i imagine it amounts to figuring out how to write a program to adhere to some communication protocol dictated by the video card's firmware. and probably the defining principle is "do it by the specs" right?

i'm sure there are coding challenges in meeting the specs and adhering to the protocol, fine. and it may be fun for some people. but i'm not sure it really amounts to much more just "let me get my computer doing what this board's specs demand", analogous to how lots of guys worked really hard on getting 28.8k modems worked out until that got made obsolete.

Holy shit I fit into this category.

>not checking whether something went wrong or not

The absolute state of C programmers.

it sounds like you think there's one abstraction layer and we basically get a pdf full of flow charts that tell you exactly what code to write. Fair enough, I've seen jobs that are like that.

If you want to write good software in C you have to use goto. That fact alone prevents something like 80% of programmers from using it well, because they were taught "goto is bad" and follow that mantra uncritically and unquestioningly.

>80% of people listen to jewish propaganda
it's funny that you think it's only 80%

try catch blocks just work really well compared to C cheking if a value means there has been an error everytime you call anything that could have an error

guess which one has less overhead

Sure but unless you are aiming for ultra optimization it's negligible

the one with the least branching

It depends on how likely it is that an error is encountered. Exceptions may be zero cost on the happy path but as soon as one is thrown the performance tanks.

Haskell is extremely restrictive relative to other languages. Haskell is very forceful about how things have to be done (functionally), while most languages allow you to use multiple paradigms as you please. C is a pure imperative-procedural language, but it has de facto functional and object-oriented capabilities, respectively implemented through function pointers and "struct+struct constructor" idioms. These methodologies allow the user to treat variables and functions in C in a functional/object-oriented manner. In Haskell, you are restricted solely to the functional paradigm, regardless of implementation or syntax. While Haskell is certainly one of the cleanest implementations of the functional paradigm, it makes huge sacrifices in flexibility in order to get there.

this might be the case in some places, but isn't even vaguely similar to how it works in my industry. In industrial automation/connectivity, I am in charge of my part of the project form start to finish. If I'm the one writing firmware, I write the fucking firmware. I have never re-written any of my coworkers' code unless I'm tweaking it when they asked me to review it.

You can add error handling yourself if you want, but imo it defeats the purpose of C (sacrificing safety and stupid-proofing for the sake of speed and size).

If you're interested in C error handling utilities:
exceptions4c.guillermo.in/
github.com/ThrowTheSwitch/CException

Attached: 1527400721216.png (400x832, 371K)

C is not perfect. All the "flexibility" you're talking about is UB. We're stuck with C the same way we're stuck with javascript; it's fucking everywhere.

I'm not sure what you're talking about here.
if(error_code){} obviously doesn't enter if there's no error

Haskell is the best imperative programming language in existence today.

>x86 is not perfect. ALL the "flexibility" you're talking about is UB. We're stuck with x86 the same way we're stuck with C; it's fucking everywhere.

it still has to check error_code

Every cmp and every branch slows you down, user.

I really don't know the beef people have with "check if it failed for shit that can fail"
Just pass a pointer to some error struct to every function that can fail.
Or do it the other way around and always return the error struct.
Check the content of the struct after the function call.
Really fucking simple and straightforward. The single best error handling paradigm.
Multiple returns make it a bit better.
Don't tell me error handling in functional languages like Haskell is better, because in my experience it essentially boils down to the same shit.
There are some rare cases where it can save some writing, but it's mostly the same.
There is just no way to escape checking for failure.
And if you think try and catch is good, I'll murder you.

Think before posting next time.

If only nested functions and closures were supported in C. Without those features I can't take anybody claiming C is functional seriously.

Dmitri, no needs of error handling if no error.

Haskell is a declarative language, which is the literal antonym of imperative

again, C isn't a functional language, but it has ways of creating pseudo-functional syntaxes. It's like how Java has lambdas, but they're fucky.

Attached: tumblr_p26oei4clz1trm1foo1_1280.png (757x937, 275K)

stackoverflow.com/questions/6622524/why-is-haskell-sometimes-referred-to-as-best-imperative-language
also see youtube.com/watch?v=uqsZa36Io2M if you have an hour spare

And that takes what?
1 cycle? The errorcode is already in the nearest cache, maybe even a register if the compiler does everything right, so it takes no fucking time at all.
Branch predictor will predict correctly too if the common case is no failure.

Meanwhile look at the generated code for try and catch blocks.
It's a mess.

Yep

if your exception is thrown underneath the stack frame of you catch block (which it always is, that's the point of using 'exception handling') then it takes the thousands of jz instructions you would have used otherwise (if you were a white programmer) and fucks you in the ass with them

Haskell is better because it won't let you forget to check.

Fuck's sake, are you actually using exceptions for ordinary control flow?

If that only happens 1% of the time then it doesn't matter. Using exceptions for exceptional circumstances is perfectly reasonable, and so is optimizing the most frequent code path at the expense of the least.

no, I don't use ceepusspuss.

I'll have to watch that video later, but that's actually pretty neat. It's not much more/less hacky than C's functional/oop syntaxes. Thanks user, I stand corrected.

Attached: 0a5.png.jpg (409x419, 18K)

the video only touches briefly on imperative programming on haskell, but you might find it entertaining nonetheless for all the shitting on python that it does

Learn about this for every function/data structure you use: en.wikipedia.org/wiki/Big_O_notation