Is being annoyed/bad at C sign that I'm a bad coder or not fit for CS?
I understand the benefits of it for certain applications, like the speed and how "raw" it is, but outside of embedded systems or really low level stuff is just feels like a waste of time.
For one of my classes, the requirement is to write the programs in C, but I would have understood the whole concept of what was being taught no matter the language I wrote it in.
What would take like 10 hours to write in C would have taken 2 hours in python as I don't have to deal with memory allocation, unnecessary use of pointers, array redimensioning, output formatting, segfaulting hard to debug, etc.
C is a pain in the ass until it all clicks, and you start writing it as easily as you would python. What is nice about C programming is that you can call it's functions from within any language, and most libraries are written in C. Once I got good at C it became exponentially easier to find and use existing libraries in my project.
Lincoln Cook
Go bridges the gap between Python and C/C++. It runs 100x faster than Python and takes 10x less time to write than C/C++.
Carter Lopez
Performance is more important than being easy to write. End of story.
Lincoln Myers
I really hate how C and C++ are always referred to as "not portable" when they are literally the most portable languages. What do these retards think their god tier "portable" python is written in itself?
Jace Mitchell
it's python 99% includes?
Luke Jackson
>C is a pain in the ass until it all clicks It's all starting to come together for me except for pointers. I understand the concept of it but it still doesn't make sense to me how some functions need to be passed the "&" even if the declaration states a pointer.
When my program crashes I honestly just change the "*"s to "&"s or viceversa until it magically works.
Jaxon Rogers
You're now an expert C programmer, ready to shoulder the responsibility of having millions of people depend on your code I'm so proud of you
Julian James
>I have never been employed: the post
Matthew Reyes
In this case the point of using C was so that you would learn how to deal with memory allocation, use of pointers, array redimensioning, debugging segfaults, etc in an easy test case so that you know what to do if you ever run into them again.
Asher Flores
Haha I used to do the same thing. When you write programs try to find a reason to use pointers, like if you have to pass a large array into a function dereference it instead. Understanding pointers is best learned through a bit of practice, instead of trying to memorize w3schools. I spent years dabbling with C, but It took a week of trying to build my own game engine to get it all in 'muscle memory'
Did you write less than 100 lines of C total or are you a fucking brainlet? & is for getting a memory address, * is for pointer declaration and dereferencing pointers. C is not fucking C++ for fucks sake, it's a pretty simple language
Logan Jenkins
Performance is the most unimportant thing you could possibly worry about for 99% of programming projects on your personal computer
Robert Cooper
why is python such a whitepsace nazi, it drives me crazy
Sebastian Gutierrez
I understand them but I hardly encounter uses in corporate jobs.
Anthony Diaz
bitch you can't even get that far in the standard library without pointers
Wyatt Mitchell
Another benefit to C and C++: Static executable with no dependencies, whilst you will need a Python interpreter installed on the machine to run your application.
Joseph Phillips
They're used constantly. Even a language that doesn't have explicit pointers still uses them under the hood. A in a simple statement like
int x = 0;
x is actually an implicitly dereferenced pointer to some data. That data just happens to be on the stack instead of the heap. Pointers are pretty much everything unless you're using a language with more stack control like FORTH.
Jose Baker
This C is practically useless without pointers, you can't even use memory outside of whatever you have pre-allocated in the stack by your compiler.
Hudson Lewis
Unfortunately not true. Its about 30%. The solution is to use python AND C.
Brandon Campbell
>Is being annoyed/bad at C sign that I'm a bad coder or not fit for CS?
No, it's not. Many of the CS people I know (including myself) are annoyed by almost any imperative programming language. The language of CS isn't C but Abstraction.
Leo Rivera
>implying braindead CRUD web development for random medium sized businesses isn't 90% of development anyways
Brayden Martinez
That list is dumb. Faster could mean a couple of minutes in C++ is a couple of days with python.
David Martinez
>C is a pain in the ass until it all clicks it's not difficult to understand it's just tedious
Jack Collins
using * and & as operators doesn't help
Cameron Garcia
this
>* pointy star
>& and-dress
Chase Clark
Python is a script language for script kiddies C/C++is a programming language for software developers
Evan Morris
Why does everyone say every fucking interpreted language is portable? You need to install the interpreter, that's a pain in the ass. Java is another one of these: it's not portable, you need a fucking VM to make it run.
The only true portable languages are compiled ones. If you already need to write interpreters for every system why don't you make a compiler for it instead?
Mason Bailey
>C is not fucking C++ This is the problem. OOP fags are literally incapable of understanding anything that isn't obfuscated to hell and behind several layers of programmatic bureaucracy.
Luke Stewart
import btfo
def how will(python[fags,ever]+'recover') never = true
Nicholas Campbell
>It's all starting to come together for me except for pointers So you don't know C then.
Jaxon Taylor
Python is a working languages for machine learning and AI purposes
Henry Jackson
>you can call it's functions from within any language This. Most libs I use in phyton are actually written in C, because phyton is so fucking slow
Parker Ward
>Import btfo >Never use it This is how fags like you write bloated software in a shit language
Juan Ortiz
The best way to use C++ is C with STL, but you don't have to, you can throw in the fuck you want, it supports every paradigm. Of course if you use it like Java you're a moron, and your brain doesn't work anymore because that language taught you even "main" should be an object.
Evan James
Ok kid
Easton Bell
If you ever do any systems programming, you'll learn to like C, or you'll become a fanboy of one of the new systems programming languages that actually stands a chance of competing with C (eg. Go, Rust,) not a language from a different domain that's designed to solve different problems (Python.) You'd also learn that C is more portable than Python, which is obvious, because the Python interpreter is written in C, so C can run on every platform that has Python, and on systems where Python isn't installed, and on systems that the Python interpreter isn't portable to. If you were going to design a new interpreted language like Python, which language would you write the interpreter in? C, probably, because C's portability would allow your language to run on a wide range of platforms.
That said, you should also learn that different languages are suited for different tasks. If you want to write a low-level utility or library, you probably want C, but if you want to do a lot of high-level stuff, like text processing, you're going to have a bad time in C, and you'd want to use something like Python.
I also think you're underestimating how much of programming is "really low level stuff" or requires better performance than Python can provide. Someone has to write the world's language interpreters, system tools, web browsers, video codecs, etc., and for the most part, they won't be written in Python.
>C isn't portable >C is somehow larger and more complex than fucking Python when the entire language is described in seven easy to understand chapters >hard to learn >he's never read K&R C
Christopher James
>It's all starting to come together for me except for pointers Pointers are literally the only parts of the language that need effort to learn tho.
Gavin Butler
not really with a mechanical keyboard you start to enjoy all the typing
Ryan Rivera
Because compiling implies compiling for a specific architecture. A compiled program will not necessarily run properly on different hardware, let alone on different OS. Java solves this with the universal JVM. Interpreted languages don't have this problem. You don't even know what you're arguing about.
Camden Allen
People who learn languages like Python and C# have the behavior obfuscated. I know because I was one of them.
Brody Young
>saying "c/c++" Spotting retards is so easy. Also >5-10 higher programmer productivity lolno. Dynamically "typed" languages give you the illusion of productivity, since you need to write 5x more tests to replace what a good compiler wouls have done. I have unironically had a faster time developing in C++ than Python. Many people say that dynamically "typed" languages save you development time, but in my experience, it's the opposite: statically typed languages actually save you time by preventing you from running code that is ill-formed anyway.
Joshua Sullivan
Wise user.
Luis Diaz
>since you need to write 5x more tests you're missing the point
Hunter Rivera
You should definitely learn C for the lessons in humility it provides. You must be smarter than your tools to use them correctly, and C will force you to understand everything. Taking automatic memory handling and high level data structures for granted without understanding them will make you a poor programmer. This field is not easy, and there are no shortcuts. Hit the books and learn the concepts from the bottom.
The top 0.01% of programmers routinely write memory handling bugs in C, and even after several rounds of peer review these bugs sometimes still make it into huge open source projects. It's more than just a pain in the ass. It's programmer hostile. It very difficult to write actually correct C, and it's very easy to write C which merely appears to work. It's not a good language unless you absolutely need to use it.
Austin Davis
Let's go through that slide
>Faster to learn
This is just barely true in the case of C. C++, this is absolutely true, but C is simple enough that it doesn't take much longer to learn than Python.
>Portable code
Portable C code is doable and really isn't very hard. Calling this a major benefit is an overstatement. Furthermore, when portability is enforced, it can create slower code, and makes it hard to create drivers or anything low-level in the language.
Only if you avoid high-level libraries. C code can be compact if you allow yourself to use the same level of libraries that you would in Python.
>Automatic garbage collection
Ok, but again, this isn't a major benefit
>Easy to find and install 3rd party libraries
This is actually a significant benefit, and although clibs.org/ attempts to help with it, it is still an issue.
>More powerful standard library
This is just a difference in philosophy. It isn't very hard to run `clib install buffer`. However, this is actually a valid benefit.
Leo Peterson
>5-10 times higher programmer productivity
The productivity increase doesn't come without disadvantages, and if you allow the use of libraries in C/C++, the gap decreases.
Nonetheless, this is still a benefit, which is why Python is a good prototyping and scripting language. However, using it for more than that is where the issues arise.
>Faster
Not only did you not create list of pros/cons instead of advantages for each, but you've completely ignored many C/C++ advantages, and understated 'faster'..
C code can, and often is, millions of times faster than Python. The reason for this is simple, for each line of Python that you write, thousands and millions of lines of C are executed. With a good selection of libraries, you can get similar productivity and much better speed.
In case anyone misses it though, all of the positives listed for Python are simply restatements of 'increases productivity'. Why not just leave it at that single point? Because this is quite literally Python propaganda.
Jaxson Sullivan
>The top 0.01% of programmers routinely write memory handling bugs in C
This is actually a good point. Unlike the bullshit in the slide above.
Asher Long
>unless you absolutely need to use it For example when you have to write actually safe software. Your only two options are C and Ada.
David Ortiz
thanks for taking up 3/4 of my browser page with your beyond-reddit spacing
Austin Gutierrez
Sorry about that, it's a weird habit I have. I do it with my code too and people hate it.
Logan Cruz
If I had to read code like that I'd fire you
Michael Johnson
>5-10 times higher programmer productivity Only for write once and never modify code. Evolving a complex project over time as requirements change requires either static typing or 5-10 times more debugging.
Joshua Stewart
I'd hook up a dragon dildo to diff from clang-format. For every byte he'd get a minute of penetration.
Cameron Phillips
No, it's not for everyone, wasn't for me either. It's not a blocker for your career either, just power through it and leave it if you're not interested in it beyond classwork.
Aiden Lewis
>C and Ada No. Just Ada. If you're writing safety critical software in C then you've already lost. Yes, I'm aware that it happens all the time anyway.
Michael Baker
>However, using it for more than that is where the issues arise. No, it's not. Having bad practices and terrible architecture in place is where things go wrong.
Hunter Perez
>If you're writing safety critical software in C then you've already lost As demonstrated by the only safe kernel (down to binary) in existence being written in C.
There was one obscure one that I stumbled upon that was at least aiming for similar verification, I can't seem to find it now though. I think it was also written in C though.
Christian Murphy
Python is handy when used to glue routines written in C/C++.
>Python is handy when used to glue routines written in C/C++. You mean Lua.
Joseph Brooks
Aiming for and being there are different things. C is as viable as Ada for safe software.
Nicholas Phillips
Note 'at least'. I'm not sure how far it got
Joshua Gutierrez
>how far it got Not as far as sel4, since there's nothing on it.
Adrian Bennett
Well if you're going to formally verify your software with external proofing tools then you could write your shit in anything. 99% of your work will be spent in external modelling anyway.
Daily reminder that the L4 was proofed against a design specification written in Haskell.
Go fuck yourself. You know for a fact that safe software where the budget is unlimited vs safe software in the real world are two separate things. Formal verification is exceptionally rare and takes space shuttle levels of manpower to complete. For everything else, there's languages where writing safe code without 5 man hours per line is possible. Do not pretend that you can write seL4 quality code in C. The C written in that project was practically manually assembled bytecode from a high level formal spec. C is as viable as Ada for safe software in the same way as directly wiring transistors together is viable for safe software. It's possible, but there's little reason to do it and achieving a good result will take far more time.
Benjamin Sullivan
I build electromagnetics simulations for a living. Fortran is my main language, but C is also fine.
Python is utterly slow. Numpy is very limited, so not really usable. Mathematica can do way more. It executes faster, faster to program and the library of special functions and plot routines and integration techniques is so far above python that it doesn't make sense.
To me programming in python is worst of both worlds. Slow as fuck, no reliable libraries. However, development time in python is almost the same as in a C or frotran.
Mathematica is also quite slow but development time is very short.
It seems to me that python is one of the reasons that we see so many bad programming today. It abstract many things and gives spergs the idea that they can program well. However, they still don't have to understand how a computer works, so they make all the wrong design decissions.
That being said, as a scripting language it's kind of nice. I think python is just an advanced bash alternative.
Ethan Bailey
On the C/C++ side put down not a dynamically typed nightmare.
Brayden Campbell
>python is just an advanced bash alternative. Redpill of the day.
Chase Fisher
>Well if you're going to formally verify your software with external proofing tools then you could write your shit in anything. Except you couldn't, because good luck proving anything in a nondeterministic environment. >Daily reminder that the L4 was proofed against a design specification written in Haskell. Your point? It's written in C which also has to be proven to implement the spec. >You know for a fact that safe software where the budget is unlimited vs safe software in the real world are two separate things. Budget is never unlimited. seL4 is a real-world project, so is JAS 39. >For everything else, there's languages where writing safe code without 5 man hours per line is possible. None of those are system languages. Ada without SPARK is almost as bad as C is. With SPARK it's about equal to C with FramaC. You still get the benefit of coq with FramaC, unlike the limited possibilities of SPARK. >Do not pretend that you can write seL4 quality code in C. The C written in that project was practically manually assembled bytecode from a high level formal spec. Do not pretend you can write seL4 quality code in Ada. The toolchain they developed for seL4 is, without any doubt, the most astonishing practical result in formal verification. They chose C for a reason, you can read all about that in their earlier papers. >It's possible, but there's little reason to do it and achieving a good result will take far more time. Ada and C are on equal footing when it comes to safety-critical (not even verified, where C is a much better choice to target) ever since FramaC. Plain C is worse than plain Ada, sure, but who uses those in safety-critical... It's not the 90's anymore.
David Jackson
I work in data science. Even here, everything production-facing is Scala or Java. Python is just used for throw away prototypes but even then, anyone with a PhD uses R. I think Python is the most overrated shit of all time.
Kayden Nelson
>The top 0.01% of programmers routinely write memory handling bugs in C, and even after several rounds of peer review these bugs sometimes still make it into huge open source projects. >It's more than just a pain in the ass. It's programmer hostile. It very difficult to write actually correct C, and it's very easy to write C which merely appears to work. It's not a good language unless you absolutely need to use it.
That's the same for all languages that are this close to hardware. I don't think fortran is much better. Assembler is of course way worse.
Higher level languages are of course safer. However, they are also much more bloated. Software written in C or the likes is so fast that it will be close to THE best possible solution. In bloat languages you end up rewriting the same thing. One way of programming is good for one application but bad for another. For example because you have to initialize bloat many times.
Added tot that. Numerical thing in Python are mostly just interfaces to things written in C/fortran.
Henry Ward
>Automatic garbage collection This is a bad thing. >Portable False
Luis King
Why does everyone say every fucking compiled language is portable? You need to install the compiler, it's a pain in the ass. C is another one of these: it's not portable, you need a fucking compiler for the specific architecture and OS to make it compile (+adapt your code because everyone platform has its own quirks. just look at the shitstorm in autotoole needed to compile for every platform).
The only true portable language is assembly. If you already need to write a compiler for every system why don't you make an assambler for it instead?
Bentley Carter
> Faster Apache is easier to learn, for example, but everybody use Nginx, because it's faster. Now, if we're speaking about clients - nobody cares about these plebs and Python is acceptable.
Aiden Walker
Please pay attention to class next time.
Do you even know what assembly is? Do you know what instruction sets are?
Ayden Thomas
Don't school me with your basic shit, boy. I was highlighting his ridiculous argument.
Adrian Edwards
You use pointers in nearly everything... references are just pointers in Java. Same thing in python and javascript. There's some constraints on what you can do with them and some additional syntactic sugar but they're implemented as pointers.
Levi Butler
Is the point writing shit that crashes several times a day?
>learns to randomly switch * and & until something works >gets employed >code now used in xray machines >gives kids cancer learn what you are doing before you hurt someone!
Jason Powell
* - value & - address not hard stuff.
Jace Perez
What operators would you choose?
Jason Lopez
Sure, I don't know what I'm talking about. If you think the JVM doesn't need to be compiled for every architecture as well I don't know how you think computers work.
Colton Flores
Maybe C isn't portable, but it doesn't need 2 programs to run one.
Anthony Carter
So, with what do you implement the JVM then?
Evan Evans
Nothing is really portable if you dig deep enough you fucking retards.
Zachary Thomas
Can you guys please recommend some Python books?
Jacob Robinson
are you literally or actually dumb? please chose your proficiency.
Jace Sullivan
C is a brainlet filter. If you can't master something this simple, you have no business in computer science.
Jason Rivera
this
Dylan King
Yes.
>Also where is usual Python 2 vs Python 3 clash? Normally in print statements, python 2 print was a statement, in 3 it's a function. There are a few others, but in my experience that's the most common issue.
Dominic Collins
>you'd want to use something like python No, you'd want to use a saner scripting language, like lua or bash/grep/sed/awk. Python is unbearably slow for anything outside of programming lessons and the only reason anyone should use it is when they absolutely need the libraries it has
Sebastian Baker
>Python books
lmgtfy.com/?q=python+books
Daniel Torres
>You need to install the compiler, it's a pain in the ass. C is another one of these: it's not portable, you need a fucking compiler for the specific architecture and OS to make it compile
And you need to do the same for something like Python. You need the fucking interpreter, which originally needs to be compiled on a compiler. Get it now, dipshit?
No, nobody is going to do anything in assembly, because C is not like assembly. Your attempt at mocking him is retarded.