Hello, all!
My C diving progress is very slow. I want to use C for web development. Could anyone give an advice on how to learn faster? Thanks.
Hello, all!
My C diving progress is very slow. I want to use C for web development. Could anyone give an advice on how to learn faster? Thanks.
There is no shortcut, that I know of. What is it they say? It takes 10000 hours of practice to become good at something...?
But for specific queries, a forum like this one is the place to go.
Good luck on your journey (to understand C)!
"Who cares, wins"
> I want to use C for web development.
C is too low level for this.
If you're just writing client side code, you're just going to be wasting a lot of time on low level details.
Even if you use libraries like curl, there's still a lot of fiddling with detail.
If you're writing server side code, you're just one step away from a buffer overflow and a whole host of other problems which have nothing to do with programming.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I understand that fact but I need a good performance using weak hardware.
What's stopping you from using better hardware or say, cloud computing services? What's the expected bottle neck in the code that you intend to write? (e.g., if network latency is going to dominate, choosing C may be a wrong approach for improving performance.)
Mastering "all C syntax and features of latest standard" does not mean you have what it takes to write efficient and secure C code.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
This may be a dumb suggestion; but, I have read a little by accident about Python to C converters or embedding and maybe that would help the OP.
I have never looked on purpose about doing this task; But, what little I know of Python makes it sound better than C as a text processing solution.
I have never done web development; but, it sounds like a problem with text processing is part of the solution.
Tim S.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
... use C for web development ... Could anyone give an advice ...Code:#include "stdio.h" int main (int argc, char *argv[]) { char *webTitle = "Web Site"; printf( "<!DOCTYPE html> \n" ); printf( "<html lang='en-us'> \n" ); printf( "<head><meta charset='utf-8'> \n" ); printf( "<title>%s<title> \n", webTitle ); printf( "</head><body> \n" ); printf( "Hello World. \n" ); printf( "</body></html> \n" ); printf( "\n" ); return 0; }
WebAssemblygood performance using weak hardware.
Last edited by Structure; 06-10-2021 at 08:09 AM.
"without goto we would be wtf'd"
GitHub - hamsternz/miniweb: A small, lightweight web server - On a Pi 400, 1000 request per second.good performance using weak hardware.
On a laptop 6,000 requests per second on a single core.
Code:Server Hostname: localhost Server Port: 8080 Document Path: /index.html Document Length: 585 bytes Concurrency Level: 50 Time taken for tests: 16.091 seconds Complete requests: 100000 Failed requests: 0 Total transferred: 68100000 bytes HTML transferred: 58500000 bytes Requests per second: 6214.58 [#/sec] (mean) Time per request: 8.046 [ms] (mean) Time per request: 0.161 [ms] (mean, across all concurrent requests) Transfer rate: 4132.94 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 3 Processing: 1 8 1.6 7 17 Waiting: 1 8 1.6 7 17 Total: 3 8 1.6 7 17 Percentage of the requests served within a certain time (ms) 50% 7 66% 8 75% 8 80% 8 90% 11 95% 12 98% 12 99% 12 100% 17 (longest request)