Thread: What is the fastest way to master all C syntax and features of latest standard?

  1. #1
    Registered User
    Join Date
    Sep 2018
    Posts
    40

    What is the fastest way to master all C syntax and features of latest standard?

    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.

  2. #2
    Registered User
    Join Date
    May 2021
    Posts
    19
    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"

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,712
    > 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.

  4. #4
    Registered User
    Join Date
    May 2021
    Posts
    19
    Quote Originally Posted by Salem View Post
    > I want to use C for web development.

    C is too low level for this.
    Yes. You could write web apps in C, or even in Assembly language, but there are quite a few modern languages that are much better suited.
    "Who cares, wins"

  5. #5
    Registered User
    Join Date
    Sep 2018
    Posts
    40
    I understand that fact but I need a good performance using weak hardware.

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,345
    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.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    4,068
    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

  8. #8
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    339

    Post

    ... 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;
    }

    good performance using weak hardware.
    WebAssembly
    Last edited by Structure; 06-10-2021 at 08:09 AM.
    "without goto we would be wtf'd"

  9. #9
    Registered User
    Join Date
    Sep 2020
    Posts
    291
    good performance using weak hardware.
    GitHub - hamsternz/miniweb: A small, lightweight web server - On a Pi 400, 1000 request per second.

    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)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ IDE features
    By czy11421 in forum Tech Board
    Replies: 4
    Last Post: 09-11-2006, 06:48 AM
  2. Replies: 17
    Last Post: 05-07-2006, 06:11 PM
  3. Replies: 2
    Last Post: 09-09-2004, 12:57 PM
  4. ios::nocreate and the latest standard
    By Magos in forum C++ Programming
    Replies: 6
    Last Post: 12-07-2003, 10:53 AM
  5. ADT features
    By Mhk in forum C# Programming
    Replies: 0
    Last Post: 03-05-2002, 03:21 PM

Tags for this Thread