I unironically liked PHP better than C (c.php Ep.02)

Поділитися
Вставка
  • Опубліковано 18 жов 2024

КОМЕНТАРІ • 76

  • @fivefoottwelve2789
    @fivefoottwelve2789 Рік тому +19

    I loved this project as an April fools joke, glad to see you revisit it.

  • @anon_y_mousse
    @anon_y_mousse Рік тому +8

    Most surprising part of this video is learning that Menuet is still under active development and still has a floppy image distribution. Looks like it's time to spin up qemu and test the CD based version.

  • @stewartzayat7526
    @stewartzayat7526 Рік тому +10

    20:00 it actually does because argv, array of null-terminated strings, is itself null-terminated, so you can determine the number of arguments in linear time.

    • @eboubaker3722
      @eboubaker3722 Рік тому +1

      explain

    • @stewartzayat7526
      @stewartzayat7526 Рік тому +3

      @@eboubaker3722 argv[argc] is guaranteed to be a NULL pointer, so you can loop over the argv array until you hit the NULL pointer and that's how you can know you hit the last argument. For example:
      int get_num_args(char **argv) {
      int arg_count = 0;
      while(*argv++) {
      ++arg_count;
      }
      return arg_count;
      }

    • @SENTRY456123
      @SENTRY456123 Рік тому +1

      What's the advantage of null-terminated array?
      For example, if you want to store 3 pointers, you either go
      void *array[] = {p1, p2, p3};
      size_t array_count = 3;
      or
      void *array[] = {p1, p2, p3, NULL};
      The former one uses 32 bytes of memory and the latter also uses 32 bytes of memory. (Assuming that a pointer uses 8 bytes of memory)
      But when we want to get the lengh of the array, the former is way faster.

    • @alexpyattaev
      @alexpyattaev Рік тому +4

      The advantage is that it hurts your brain more, obviously. Programming in the 80's was very different.

    • @anon_y_mousse
      @anon_y_mousse Рік тому +3

      @@stewartzayat7526 Clearly performance is not your top concern here, but for other cases where you need to scan forward it would be useful to remember not to increment two variables at the same time and instead the code should be:
      int get_argc ( char **argv ) { int argc; for ( argc = 0; argv[argc]; argc++ ) ; return argc; }

  • @yjk_ch
    @yjk_ch Рік тому +3

    14:04 While macOS does use FreeBSD components as far as I know, the OS itself is not based on FreeBSD.
    macOS is basically the next version of NeXTSTEP(after Apple bought NeXT), which itself is based on Mach microkernel and BSD userland.

  • @azomich
    @azomich Рік тому +3

    Thanks a lot for great video!
    Concerning the problem with dynamic language and the fact that some errors are only caught during runtime. You can use static analysis tools like Psalm or PHPStan.
    Probably it will catch most of the potential problems.

    • @TheRafark
      @TheRafark Рік тому

      You HAVE to use a static analyzer. Like seriously, especially if you use it with your ide or text editor (using LSP).
      I installed psalm with sublime a few months ago and development has been extremely smooth. It’s night and day. I won’t touch a single line of PHP again if it’s not analyzed on site. It makes writing code very enjoyable. My Productivity has gone up by a lot and my frustrations have been reduced to basically 0.

  • @darioabbece3948
    @darioabbece3948 Рік тому +3

    Imagine that a random guy from Greenland figured out programmers need break 2; and nobody after him followed his footsteps

  • @UlrikMcArdle
    @UlrikMcArdle Рік тому +6

    If you want it to work with new line on all platforms, you should use the constant PHP_EOL instead of

    • @pratikbhujel
      @pratikbhujel Рік тому

      That's just more letters then
      .

    • @jaimelannister141
      @jaimelannister141 2 місяці тому

      @@pratikbhujel But it's platform independent. Some files on Windows use
      instead of just
      .

  • @juanc.6851
    @juanc.6851 Рік тому +1

    Hello from Argentina! Since php 7 you can now define arrays, you can use it to define the platforms.

  • @isoljator
    @isoljator Рік тому

    @55:08 - 56:11 The commentary on engineers being essentially forced to cope w writing slow code in many corporations incl Twitch was pretty spot on imho

  • @chaqua1559
    @chaqua1559 Рік тому +10

    Every 5th line:
    exit(69)

  • @FGj-xj7rd
    @FGj-xj7rd Рік тому +94

    Everyday, we stray further from god.

    • @RenderDragon
      @RenderDragon Рік тому +12

      And getting closer to becoming gods

    • @blastygamez
      @blastygamez Рік тому +6

      @@RenderDragonI believe the word u are looking for is: *doom*

    • @hedlund
      @hedlund Рік тому +1

      About damn time.

    • @FDominicus
      @FDominicus Рік тому +1

      Ha,ha,ha

    • @sixbutton9
      @sixbutton9 4 місяці тому

      i am

  • @bEndRloVe
    @bEndRloVe Рік тому +1

    Thank you for your effort.❤

  • @Pi7on
    @Pi7on Рік тому +4

    Watched half of the video, came back, and saw the new thumbnail. Lmao

  • @rafagd
    @rafagd Рік тому +3

    I'm going to take a month to get this one, but I'd like to register I was really aggravated by the php logo with asm written on it. Properly upset. Please bring it back.

  • @vhaangol4785
    @vhaangol4785 Рік тому +6

    Bout to get more money with those $ signs 💸

  • @claudiusraphael9423
    @claudiusraphael9423 Рік тому

    ChatCCP. Instant like! And the "Brainwashers Gold"-Selection of Creative Commons Background-Music is elegantly hideous applied - great Tennis!

  • @slavsquatch7
    @slavsquatch7 Рік тому +7

    Why do you do this to yourself you absolute madman? 😄

  • @ilyasabi8920
    @ilyasabi8920 Рік тому +2

    There's at&t syntax and intel(flavors) exists for assembly.

  • @Littletsu
    @Littletsu Рік тому +2

    It would be funny that for target platform argument list you would make a function that defines the constant and returns it and you would just use that in array()

  • @volkr6755
    @volkr6755 Рік тому +4

    rip old thumbnail

  • @naymon357
    @naymon357 Рік тому +8

    You should compile c to php using php xD

  • @thecomputerfreak
    @thecomputerfreak Рік тому +1

    You could have used getopt() for the command line options parsing

  • @ayoubbelatrous9914
    @ayoubbelatrous9914 Рік тому

    hey tsoding why did you stop doing the car horn sound when there is a sub.

  • @Mirko_ddd
    @Mirko_ddd Рік тому +5

    I love gasm only as second possible choice. Guess why 😂

  • @keremardicli4013
    @keremardicli4013 Рік тому

    You don't need curly braces for case statements.
    And for multiline strings you can use nowadoc

  • @vivekpal0x
    @vivekpal0x Рік тому +3

    Your ChatCPP also uses GPT 3.5 😅

  • @katekyy7
    @katekyy7 Рік тому

    Is that the real zozen? Or did the Vim and PHP demons finally got him?

  • @MrOboema
    @MrOboema Рік тому +6

    @37:10 😮😢

  • @ЭролСезгин
    @ЭролСезгин Рік тому +2

    also dont use define for constants =)
    in your particular case it doesnt make sense.
    (it make if you WANT to define a const at runtime , and you dont )
    ---- use this---->

  • @Neuer_Alias_erstellen
    @Neuer_Alias_erstellen Рік тому +1

    you could stream on UA-cam

  • @icephonex
    @icephonex Рік тому

    and do you unironically like vim more than emacs?

  • @ayoubbelatrous9914
    @ayoubbelatrous9914 Рік тому +5

    wasm yasm fasm or gasm(gas)

  • @koishikisskogasa
    @koishikisskogasa Рік тому

    AYAYA

  • @semihkaplan
    @semihkaplan Рік тому +1

    NOOO, you can't be serious

  • @norndev
    @norndev Рік тому +1

    I love php ngl, dodgy free host and cron jobs 👀

    • @TheRafark
      @TheRafark Рік тому

      Modern php It’s a solid language.

    • @TheRafark
      @TheRafark Рік тому

      *is

    • @lucass8119
      @lucass8119 9 місяців тому

      It's a fantastic system scripting language. Great replacement for bash IMO, and stupid easy to write quick GUIs where needed.

  • @mrl9418
    @mrl9418 Рік тому

    I unironically prefer assembly

  • @no-ld3hz
    @no-ld3hz Рік тому +1

    remaking porth in php
    phporth

  • @ЭролСезгин
    @ЭролСезгин Рік тому +11

    as php developer. my eyes hurt to read this. Bro this code smells like my granny.
    Super old style. Id say 15 years old, no one writes like this=) unless they see PHP first time in their life=)
    AND use types for variables! they are checked at runtime .

    • @norndev
      @norndev Рік тому +4

      To be fair most documentation online is extremely outdated

  • @nekoill
    @nekoill Рік тому

    I'm waiting for a video with a title like "I LITERALLY DIED 😿"
    😹

  • @eboubaker3722
    @eboubaker3722 Рік тому

    i think you should start using composer and using some libraries to help you out. for example commandline parsing.

  • @ot44eto
    @ot44eto Рік тому +2

    This is werid. :D

  • @IBelieveInCode
    @IBelieveInCode Рік тому

    PHP and C do not fulfill the same purpose at all.

  • @blastygamez
    @blastygamez Рік тому +3

    Wtf is wrong with php is one of the worst coding languages ever for me and c is the best programming language.

  • @ProgTari
    @ProgTari Рік тому +2

    Two Questions : ⁉⁉
    -What's your major ?
    -What's your roadmap to get this huge knowledge ?
    Thanks for sharing wealth. 🤍🤍

    • @SimGunther
      @SimGunther Рік тому +1

      1. I think he majored in Pogging
      2. Find what's cool and get together with other people to write software projects y'all like to make while refreshing yourself on basic data structures and operating system concepts every now and then