PHP is Wack. (Coding in a Random Language Every Day)

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024
  • Advent of Code 2023 is UPON US! What better way to spend the holiday season, learn to program, and test your skills against your friends. This year, I've decided to try something kind of insane. I'll be choosing a language off the wheel every day.... let's see what happens.
    🏫 COURSES 🏫 Learn to code in C at lowlevel.academy
    📰 NEWSLETTER 📰 Sign up for our newsletter at mailchi.mp/low...
    🙌 SUPPORT THE CHANNEL 🙌 Become a Low Level Associate and support the channel at / lowlevellearning
    🔥🔥🔥 SOCIALS 🔥🔥🔥
    Low Level Merch!: lowlevel.store/
    Follow me on Twitter: / lowleveltweets
    Follow me on Twitch: / lowlevellearning
    Join me on Discord!: / discord

ความคิดเห็น • 370

  • @dominick253
    @dominick253 9 หลายเดือนก่อน +279

    Php = Lambo.

    • @1337Munkey
      @1337Munkey 9 หลายเดือนก่อน +12

      Personal Home Page.. More like Pretty Hacky Programming!!

    • @reed6514
      @reed6514 9 หลายเดือนก่อน +16

      ​@@1337Munkey😂 it can be very hacky, but these days we have strong property typing, return types, dynamic properties disallowed by default, enums (idk why it took so long to get enums).
      Variables are still not typed, but editor tools alleviate that problem, and that's most always in a limited scope, so its not so bad for maintainability.

    • @WhiteDoppler
      @WhiteDoppler 9 หลายเดือนก่อน +1

      I do pcp in my php lambo

    • @illegalsmirf
      @illegalsmirf 9 หลายเดือนก่อน +4

      If you are trying to get better at Rust, PHP probably isn't your thing. The latest and greatest in the world of Javascript is more like it for you. Just don't forget to die your hair a bright luminous color, get a nose ring, and make your gender and sexuality fully fluid.

    • @illegalsmirf
      @illegalsmirf 9 หลายเดือนก่อน

      Basically you'd got all the boilerplate and crap that you've got in Java and C#, why not just switch to one of those languages if that's your bag?@@reed6514

  • @d0rban
    @d0rban 9 หลายเดือนก่อน +48

    the bro just set up a whole web server instead of just using the interpreter 💀

  • @peppybocan
    @peppybocan 9 หลายเดือนก่อน +511

    You know you can run PHP in a CLI and you don't need to run it as a webserver, right?

    • @soniablanche5672
      @soniablanche5672 9 หลายเดือนก่อน +64

      you can even use PHP own's development server

    • @Lelende
      @Lelende 9 หลายเดือนก่อน +159

      Channel is called low level learning not unsafe server side programming learning.

    • @peppybocan
      @peppybocan 9 หลายเดือนก่อน +20

      huh? Doesn't matter.@@Lelende

    • @mitchelline
      @mitchelline 9 หลายเดือนก่อน +50

      @@Lelende What he is doing in the video is equally unsafe as running it in the terminal. The difference is, in terminal he can use '
      ', and he won't need a web server. It's just easier

    • @jolynele2587
      @jolynele2587 9 หลายเดือนก่อน +14

      you know he clearly states his speciality as "low level" and not a web language right

  • @Car0linaPh03nix
    @Car0linaPh03nix 9 หลายเดือนก่อน +35

    "Ah fuck, this is a regex challenge."
    "Nah, fuck it, I'm doing explode."
    "Actually, fuck it, I'm going back to regex."
    "Nevermind, fuck, back to explode."

  • @mandokir
    @mandokir 5 หลายเดือนก่อน +5

    Not only could you run PHP CLI, you could just set the content-type to "text/plain". PHP is not the problem; you are.

  • @musdevfrog
    @musdevfrog 9 หลายเดือนก่อน +55

    "Regex is powerful"
    "I don't wanna do it"

    • @walrusbyte263
      @walrusbyte263 9 หลายเดือนก่อน +7

      A regex moment

    • @nikolthomas2544
      @nikolthomas2544 9 หลายเดือนก่อน +12

      step1: Have a problem
      step2: Decide to solve the problem with regex
      step3: You now have 2 problems

    • @Mlataza
      @Mlataza 3 หลายเดือนก่อน

      Me everytime considering regex

  • @Finkelfunk
    @Finkelfunk 9 หลายเดือนก่อน +165

    As someone who does the AoC in Haskell I can tell you that doing it in Haskell has no ill side effects.

    • @ChungusTheLarge
      @ChungusTheLarge 9 หลายเดือนก่อน +27

      Would love to see your whitepaper!

    • @Stroopwafe1
      @Stroopwafe1 9 หลายเดือนก่อน +4

      So all your solutions are *pure*? /j

    • @mattjax16
      @mattjax16 9 หลายเดือนก่อน

      @@ChungusTheLarge lol

    • @perigord6281
      @perigord6281 9 หลายเดือนก่อน

      Same, parsing is a breeze

    • @kacperuminski1547
      @kacperuminski1547 9 หลายเดือนก่อน

      Yep, solutions thus far have been rather simple. No more than 20 lines...

  • @artik15xfilm
    @artik15xfilm 9 หลายเดือนก่อน +97

    Please setup a timer so we would see the total time that it has taken for u to code that :D

    • @Zendo909
      @Zendo909 9 หลายเดือนก่อน +6

      Let the man fail in peace.

  • @marklonergan3898
    @marklonergan3898 9 หลายเดือนก่อน +51

    It's funny seeing different variable naming conventions. For your MinRed, MinGreen and MinBlue, you're obviously looking at it from the final perspective (i.e. the minimum amount of each required). I would have named them MaxRed, MaxGreen & MaxBlue on the basis that the variable is storing the max value observed.
    Not saying either approach is worse / wrong, i just find it interesting.

    • @pmmeurcatpics
      @pmmeurcatpics 9 หลายเดือนก่อน

      Yeah I think the most pedantic way to name these variables would be something like "CumulativeMax"+ColorName

    • @Zendo909
      @Zendo909 9 หลายเดือนก่อน +1

      Seems like engineer's vs theoretician's perspective. You @marklonergan3898, with a theoretician's approach, are focused on exploring the system's limits, while LLL, with an engineer's mindset, is concentrating on determining the minimal requirements essential for the system's functionality.
      I, myself, am much more a theoretician.

  • @MDMAviation
    @MDMAviation 9 หลายเดือนก่อน +32

    As a PHP dev, watching you use parentheses in echoes, double quotes instead of single quotes, str comparsion with that, not tripple equals, true in uppercase, or even comparing something to true to return true and evaluate it wou...
    And there are constants in PHP too

    • @reed6514
      @reed6514 9 หลายเดือนก่อน +7

      Watching him write PHP was so painful. And I'm surprised he's not friendly with regex. It's long been a love of mine.

    • @edgeeffect
      @edgeeffect 9 หลายเดือนก่อน +8

      This is one of the real problems with PHP... the web is overflowing with half-assed examples, hints and tutorials written by people who have absolutely no idea what they're doing... if you do what any newbie would do in any language and Google for help, with PHP, your chances of striking garbage are SO high.

    • @reed6514
      @reed6514 9 หลายเดือนก่อน +1

      @@edgeeffect yeah, i started out writing very bad php partially bc of that. But php was also very bad when i started lol. It's also a benefit though, because the "bad" php is probably an easier way to get your foot in the door of programming.

    • @MDMAviation
      @MDMAviation 9 หลายเดือนก่อน +3

      @@reed6514 Even tought PHP was "bad" in the past, not bad but a scripting language more than a serious lang, doesn't mean it wasn't possible to write good code.
      In fact, for me PHP in the origin was similar to Python, that's why I think Python is bad, thanks god PHP is evolving to a typed language.

    • @TurboXray
      @TurboXray 3 หลายเดือนก่อน +1

      @@MDMAviation PHP and Python are nothing alike. Need I remind you the absurdity of triple equals.

  • @spicynoodle7419
    @spicynoodle7419 9 หลายเดือนก่อน +23

    Bruh you don't need Nginx to run PHP. Do you need Express to run JS?

    • @adampatterson
      @adampatterson หลายเดือนก่อน

      But it perpetuates the stereotype that PHP is bad when you can toss HTML in the code so that you can see it in your browser.

  • @phpannotated
    @phpannotated 9 หลายเดือนก่อน +17

    Always fun to see how people that don't know PHP write PHP 😂 Great video!

    • @brunoggdev6305
      @brunoggdev6305 2 หลายเดือนก่อน

      IKR?! also aways fun to see u in the comments =]

  • @dave7244
    @dave7244 9 หลายเดือนก่อน +47

    Nothing wrong with PHP. Fed up of people saying it is rubbish.

    • @Mlataza
      @Mlataza 3 หลายเดือนก่อน +7

      I feel like the people saying PHP is rubbish have skill issues.

    • @TurboXray
      @TurboXray 3 หลายเดือนก่อน +6

      @@Mlataza I feel like people defending PHP have no clue

    • @ThePoke151
      @ThePoke151 3 หลายเดือนก่อน +8

      Any language that has more than a thousand in-built functions, which are not namespaced or anything, and from which a good portion is obsolete because they are insecure deserves more than a little bit of hate, imho.
      It's a nightmare to use.

    • @andrew_ray
      @andrew_ray 3 หลายเดือนก่อน +8

      The implementation of the ternary operator in PHP is wrong. In every other language on earth (except for Go, which banned ternary conditionals because "they can be abused"), you can write something like this:
      first_option ? 1 :
      second_option ? 2 :
      third_option ? 3 :
      fourth_option ? 4 : 5;
      But in PHP, you need to write a bunch of parentheses because the language spec screwed up the associativity of the operation:
      first_option ? 1 :
      (second_option ? 2 :
      (third_option ? 3 :
      (fourth_option ? 4 : 5)))

    • @brunoggdev6305
      @brunoggdev6305 2 หลายเดือนก่อน +1

      @@andrew_ray but then It ain't ternary is it? for this use case a match or at least a mapping sounds way more suited.

  • @thisisnotok2100
    @thisisnotok2100 9 หลายเดือนก่อน +20

    Why did he do it as a server and not just do it from the command line like you would with python 😭😭😭

  • @pokefreak2112
    @pokefreak2112 9 หลายเดือนก่อน +29

    PHP is the C of scripting languages. Imperfect and ugly in many ways, but somehow still the best solution for the problems it's trying to solve.
    Your PHP setup was kinda overcomplicated, you could've just ran your php file from the CLI without needing a web server.

    • @eptic-c
      @eptic-c 9 หลายเดือนก่อน +1

      Also he could have used the integrated dev server if he really wanted it on the web or enable error debugging in nginx instead of making nginx display 500 error pages. Most people will think that is the debugging experience of php when in reality PHP is really helpful at debugging code and knowing where the code crashes ( compared to other interpreted languages anyway ).

    • @pokefreak2112
      @pokefreak2112 9 หลายเดือนก่อน

      @@eptic-c I think it's because PHP has a culture of working in prod where you don't wanna turn on stack traces. Imo working without errors is a nice skill to get decent at (forces you to internalize the syntax and libraries), but proper errors are also essential when working on complex systems

    • @vladimmi
      @vladimmi 9 หลายเดือนก่อน +3

      @@pokefreak2112 "I think it's because PHP has a culture of working in prod" - it doesn't.

  • @TheMasonX23
    @TheMasonX23 9 หลายเดือนก่อน +29

    Thanks for inspiring me to use this Advent of Code to get more familiar with Rust. I've been playing around with it for a few weeks but was looking for a project to really get to know it and this seemed like the perfect fit!

  •  9 หลายเดือนก่อน +23

    Is it Lua considered in the language wheel? I think is a ligth and powerful scripting language suitable for this kind of challenges :)

  • @gustavodill3819
    @gustavodill3819 9 หลายเดือนก่อน +15

    I love that almost all the coding videos i watch are about making it relatively efficient, readable and reusable.
    Low Level Learning showed what truly ends up happening.
    *"If it works, it works!"*

  • @skeleton_craftGaming
    @skeleton_craftGaming 9 หลายเดือนก่อน +11

    I'd rather program in PHP than JavaScript. (I say as someone who has written both recently)

    • @climatechangedoesntbargain9140
      @climatechangedoesntbargain9140 9 หลายเดือนก่อน +2

      why?

    • @ajzack983
      @ajzack983 9 หลายเดือนก่อน +1

      me too

    • @edgeeffect
      @edgeeffect 9 หลายเดือนก่อน +1

      Funny... I would say exactly the opposite.

    • @TurboXray
      @TurboXray 3 หลายเดือนก่อน

      as much as JS is hot garbage, I have to disagree

  • @BeautyMarkRush
    @BeautyMarkRush 4 หลายเดือนก่อน +1

    I'm so used to PHP 8.2 by now that I automatically thought of using a match instead of a chain of if's. lol

  • @caduhidalgo4996
    @caduhidalgo4996 9 หลายเดือนก่อน +37

    The disappointed face of lll as soon as it showed it was PHP was remarkable hahah
    Nice video!

  • @damian007567
    @damian007567 9 หลายเดือนก่อน +23

    You can run PHP in a CLI.
    You can also use the pre tag to render CRLF.
    In all honesty php is probably the best language to challenges like this besides python. (Not even kidding)

    • @AndrewTSq
      @AndrewTSq 9 หลายเดือนก่อน +1

      I will try tomorrows challenge in PHP then :) I used Javascript so far, and it have worked great also.

    • @reed6514
      @reed6514 9 หลายเดือนก่อน +1

      Yeah, I thought this looked super easy to do in php, buut tbf I've been devving php for a decade.& he doesn't even know he can make a cli script lol 😂

    • @hovnocuc4551
      @hovnocuc4551 9 หลายเดือนก่อน +7

      Facts. PHP has extremelly rich stdlib. It's not particullary consistent, but you can get very far without installing a single dependency. It's just the tutorials talking basics around the web are written by indians running XAMP for 20 years and still doing something horrible on every other line.

  • @illegalsmirf
    @illegalsmirf 9 หลายเดือนก่อน +11

    PHP is just grand. Syntax is nearly identical to C. Indeed, you could say PHP is like C for web programming.

  • @JS-jh4cy
    @JS-jh4cy หลายเดือนก่อน +1

    The better experienced programmers can make shit into something useful or usable, just hard work and deeper knowledge

  • @MECHANISMUS
    @MECHANISMUS 9 หลายเดือนก่อน +7

    I first thought that this is some kind of standard problem called "red jacks", but then realized it's only how regex is in fact pronounced by the natives.

    • @reed6514
      @reed6514 9 หลายเดือนก่อน

      😂😂 I will forever pronounce the hard g.

    • @PhysiKarlz
      @PhysiKarlz 9 หลายเดือนก่อน

      You probably then pronounce Jack incorrectly too, like djäcks/djecks, if you think jacks sounds like gex in regex. Very different sounds.

  • @jomy10-games
    @jomy10-games 9 หลายเดือนก่อน +6

    Can’t wait for Objective-C++

  • @__abd__
    @__abd__ 9 หลายเดือนก่อน +7

    I did it with regex just in a diffrent way, i had a pattern for each red green blue "(\d+) red" and then got all matches and summed group one

  • @kauemiziara916
    @kauemiziara916 9 หลายเดือนก่อน +3

    I'm doing a similar challenge and today's language was Lua. As far as Stack Overflow, Google and GPT told me, the only way to split strings is using "patterns", which are basically simplified regex ='(
    At least Lua's patterns are way better than pure regex, so I wasn't forced to give up on the second day.

  • @john_hawley
    @john_hawley 9 หลายเดือนก่อน +5

    Not sure why you created a whole web server? Maybe that's a common misconception about PHP.

  • @NOT_A_ROBOT
    @NOT_A_ROBOT 9 หลายเดือนก่อน +11

    you should indicate in your title that this is episode 2 of the series

  • @eptic-c
    @eptic-c 9 หลายเดือนก่อน +2

    You know php cli does exists right? And is the default of the language. Also, nginx or apache is not required as you can start a server if you really want a web environment from php directly.

  • @ItsCOMMANDer_
    @ItsCOMMANDer_ 9 หลายเดือนก่อน +7

    if he gets one wrong, he should replace it with malboge.

  • @GDNachoo
    @GDNachoo 9 หลายเดือนก่อน +19

    1. PHP error reporting was off the entire video...
    2. Your kid's first language should be Scratch, actually, it's way more appealing and teaches you code basics more than HTML

    • @enkiimuto1041
      @enkiimuto1041 9 หลายเดือนก่อน

      tbh if you're going with scratch instead of much simpler drag and drop things, might as well pick gml.

    • @GDNachoo
      @GDNachoo 9 หลายเดือนก่อน

      @@enkiimuto1041 I repeat: it's way more appealing, you ain't gonna get a young kid into coding with GML, and i mean 7-years-old young, at least that's the age i picked up scratch by myself, you get to see results of your code really quickly and it's insanely simple

    • @PalladinPoker
      @PalladinPoker 9 หลายเดือนก่อน

      ​​​@@enkiimuto1041gotta disagree, my high school used Scratch to teach the initial principles and it was far more intuitive than the abortion of a language we had to use afterwards. We could make games in it with only a handful of hours.
      Dim xArr(1 To 3) As Integer = {1, 2, 3}
      If you know you know

    • @Bozebo
      @Bozebo 9 หลายเดือนก่อน

      If it wasn't abusive to keep a kid isolated from the world. I'd get them started on assembly, they'd just take it up naturally without knowing better and then you have a genius on your hands xD

  • @lpanebr
    @lpanebr 9 หลายเดือนก่อน +3

    You didn't have to use html.. you could ran it on the cli. Blaming the language for that is lame. 😂😂😂

  • @alitahboub493
    @alitahboub493 9 หลายเดือนก่อน +8

    i enjoyed developing in php

  • @science_trip
    @science_trip 6 หลายเดือนก่อน +2

    disaster because you don't know PHP. I saw bigger disasters in other languages too, but I continue my life. I didn't blame any language that all TH-camrs / noobs are doing

  • @MrKasenom
    @MrKasenom 9 หลายเดือนก่อน +4

    I love how Pascal is in the same category as brainfuck for him 😂

  • @Ferrohh
    @Ferrohh 9 หลายเดือนก่อน +8

    I literally found out your channel yesterday and I already fell in love with your content. I'm also trying to do this challenge but I'm able to code well only in like 4/5 languages.

    • @LowLevelLearning
      @LowLevelLearning  9 หลายเดือนก่อน +14

      I can code in a lot of languages, but no one said it was good ;)

  • @seanvogel8067
    @seanvogel8067 4 หลายเดือนก่อน

    I didn’t think part one was going to work because I didn’t see you account for the fact that you can have multiple entries for each color. However, it is kind of hard to follow the code on the iPad. And apparently it did work. 😬

  • @adampatterson
    @adampatterson หลายเดือนก่อน

    I'm confused, why is type casting really bad in PHP? What language is really good for type casting?
    You also don't need to cast a string to an int when the string is a number.
    "100" + 1 = 101

  • @patrickoberholzer4278
    @patrickoberholzer4278 9 หลายเดือนก่อน +1

    Love how at the beginning Haskell was put in the same category as Brainf**k.

  • @soundzthevibewalker
    @soundzthevibewalker 8 หลายเดือนก่อน

    It's interesting how stereotypes about php are still stuck in the heads of people. But the most interesting thing is that your code feels old. I get that feeling about c and c++ code a lot. It always feels like it was written about 20 years ago

  • @elzabethtatcher9570
    @elzabethtatcher9570 9 หลายเดือนก่อน +1

    10:10 this poor dude believing he needs to cast string to int in php ;)

  • @raptoress6131
    @raptoress6131 9 หลายเดือนก่อน +3

    Y'know COBOL is not so bad as long as you don't try to do anything that requires dynamic memory allocation.

  • @GaymerJenn
    @GaymerJenn 9 หลายเดือนก่อน +5

    This is my first year doing Advent of Code, so maybe this is a dumb question, but how do people solve both challenges in 2-3 minutes without cheating somehow? On day 1, someone got the first star in 12 seconds. I can see someone really experienced finishing both in 5-10 minutes, but you can't even read the challenge in 12 seconds!

    • @LowLevelLearning
      @LowLevelLearning  9 หลายเดือนก่อน +12

      This year it honestly could just be AI. Like, you're not supposed to do that, but people could setup prompts before hand, copy paste the prompt and their data, and get a solution quickly.

    • @spicywe1ner
      @spicywe1ner 9 หลายเดือนก่อน +2

      a few people record their entire session. I think the person sitting in 4th is using python to do it. but 12 seconds is a little insane.

    • @orterves
      @orterves 9 หลายเดือนก่อน +5

      12 seconds seems too fast even for an AI to generate and submit the answer - seems more likely they found an exploit to get the questions (or answers) early

    • @esiarpze7908
      @esiarpze7908 9 หลายเดือนก่อน +1

      There are few techniques that you can use to solve very fast, like using string parsing libraries and knowing the ins and outs of your language, and basically only reading the sample input/output and guessing what needs to be done. The first day was quite easy as you just needed to get the first digit from one end and you can repeat the same logic by reversing the string. Competitive programmers are really good at these stuffs, so I’m not surprised by the 12 seconds.

    • @orterves
      @orterves 9 หลายเดือนก่อน

      @@esiarpze7908 well, fair enough, I could just be massively underestimating their skills and the approach they take to the solution - I'd love to see it done live

  • @playtimeplay4518
    @playtimeplay4518 9 หลายเดือนก่อน +6

    why does it seem people always dislike regex? regex has always been the easy route if I can't figure out anything else.

    • @reed6514
      @reed6514 9 หลายเดือนก่อน +2

      I love regex, but it IS tricky & its a very different mental model than traditional programming language. I never have gotten good at lookarounds though & I'm sure there's other gaps in my regex knowledge

    • @minilathemayhem
      @minilathemayhem 9 หลายเดือนก่อน +1

      Regex gets a lot of hate because of how quickly it can become complicated. Like, if you're doing something simple like checking a pattern, it's pretty easy, but when you start adding in things like capture groups, back references, and more complicated search patterns, it gets really confusing and difficult to follow really quickly.

  • @TheBoBuilder
    @TheBoBuilder 2 หลายเดือนก่อน

    There's a lot I don't understand but the few parts I did had me laughing. Awesome! But hasn't PHP improved with Version 8?

  • @thisisnotok2100
    @thisisnotok2100 9 หลายเดือนก่อน +6

    If you actually have to use brainfuck, it might be easier to write the solution in another language then write a brainfuck code generator 😂

  • @daniels-mo9ol
    @daniels-mo9ol 9 หลายเดือนก่อน +1

    One liner: 'sudo apt-get install php-cli -y' done.

  • @minilathemayhem
    @minilathemayhem 9 หลายเดือนก่อน +8

    PHP is great! It just depends on what version of PHP you're using

  • @AJMansfield1
    @AJMansfield1 9 หลายเดือนก่อน +3

    Interesting that you didn't pick up on the fact that there's no functional distinction between the comma and semicolon in this specific challenge.

    • @Rockyzach88
      @Rockyzach88 9 หลายเดือนก่อน

      Same goes for another popular coder I watch on youtube. Maybe we need to make our own video series! lol

  • @basedbulgarian511
    @basedbulgarian511 3 หลายเดือนก่อน

    You can send a content type header to the browser and tell it that the PHP output is type text/plain. Then you won't have to use HTML line breaks

    • @keyjayh
      @keyjayh 3 หลายเดือนก่อน +1

      Also has the option of use as CLI.

  • @Tordhaugs
    @Tordhaugs 9 หลายเดือนก่อน +2

    Why not do Fortran. If someone watches it and become a programer in it they have safe work out there life. And would be very fun

  • @ericmp1199
    @ericmp1199 9 หลายเดือนก่อน +2

    u know u can call php in command line... ? lol

  • @asdfghyter
    @asdfghyter 9 หลายเดือนก่อน +1

    I honestly don't mind regex at all and haven't regretted when I've used it. sure it can grow in complexity quickly when the problem is even the slightest bit tricky, but it can be really nice when the problem is fairly simple

    • @Daniel_WR_Hart
      @Daniel_WR_Hart 3 หลายเดือนก่อน

      From my experience regex is like recursion: at first it's really confusing and you wonder if it's even worth learning, but once you get the hang of it, it's a very powerful/convenient tool in the odd cases where it's not strictly necessary but is very fast to write and easy to read (for other people that also learned it anyways)

  • @drivers99
    @drivers99 9 หลายเดือนก่อน +2

    gforth
    I did the first couple days in that last year. But only after doing it in another language (python) first.
    The funny thing was forth works by letting you define words, so I defined a handful of words that let me execute the input for 2022 day 1 as a program lol

  • @Elesario
    @Elesario 9 หลายเดือนก่อน +1

    I feel like regex has been overly maligned. If you struggle then you just haven't learnt it well enough; perhaps we should add Perl to your code wheel ;)

  • @arturtwardzik5528
    @arturtwardzik5528 9 หลายเดือนก่อน +8

    Actually, you've inspired me yesterday to pick up the AoC challenge, but I modified the rules slightly for my personal usage. I chose randomly languages (with the huge amount of weird ones like Fortran, Ada, Basic or Assembly ARM). It's gonna be fun xD
    Btw. Rust is my main language and I think you're going to love the simplicity and clarity of doing such challenges :P

  • @Dygear
    @Dygear 9 หลายเดือนก่อน +2

    I feel like I should give something back to this channel and so you some of the cooler parts of PHP. You’ll be amazed.

    • @reed6514
      @reed6514 9 หลายเดือนก่อน

      And we even have enums and strong typing now!
      I was reluctant to get on board with strong typing and now i just think that was really dumb of me lol. I thought of PHP's dynamicness as a feature, but not any more ... unless I'm prototyping. It's nice to prototype and not worry about types and stuff.

    • @Dygear
      @Dygear 9 หลายเดือนก่อน

      @@reed6514 Oh, I hopped right on the strong type train. Very happy to see that around. You can still prototype very quickly, but when you go to production you can have the strictness needed for a sane working environment. But even things like match statements coming to PHP was super nice. Used them a lot in Rust and it was so nice when they came to PHP as well. Enums and backed enums are also awesome, but kinda toothless when it's compared to their Rust counterpart. You can't for example build a Result Enum, or an Option Enum because the enums themselves can't carry an arbitrary value of T. They can only be Strings or Ints. This hamstrung their Enums in PHP, but it's still nice to have a saner option for building up interfaces with known types and values.

  • @PoProstuLatanie
    @PoProstuLatanie 9 หลายเดือนก่อน +3

    Add x86 assembly onto the wheel, i dare you

  • @tobiasaddicks9695
    @tobiasaddicks9695 9 หลายเดือนก่อน +2

    Perfect timing, I finished the challenge myself and now get to see how someone else solved it

  • @roberthickman4092
    @roberthickman4092 9 หลายเดือนก่อน +1

    You can run php on the command line you know :)

  • @0x636f6d70696c65
    @0x636f6d70696c65 9 หลายเดือนก่อน +1

    You should do one with the god's blessed language TempleOS HolyC

  • @bloodynoobtubename
    @bloodynoobtubename 9 หลายเดือนก่อน

    As someone who writes parsers for SIEM log ingestion at work, I don't blame you for avoiding regex.

  • @codecaine
    @codecaine 6 หลายเดือนก่อน

    php naming convention is all over the place

  • @konstantinsotov6251
    @konstantinsotov6251 9 หลายเดือนก่อน +12

    Since you've said that Brainfuck and Haskell are banned, I would suggest something that kinda combines them
    Mathematical description of turing machine that solves the problem

  • @AssasinZorro
    @AssasinZorro 9 หลายเดือนก่อน +2

    I'm very confused as to why you have such a strong negative opinion on regular expressions.
    Do you have a video where you elaborate on that?
    I've been using regular expressions for years and I've been happier because of it

    • @edgeeffect
      @edgeeffect 9 หลายเดือนก่อน

      Write only programming.

  • @Rockyzach88
    @Rockyzach88 9 หลายเดือนก่อน

    Maybe I should make my own videos. All you need to do is check what the number is before the letter 'r', 'g', 'b' for each line. You don't even need to parse the game ID as you can use a counter because the gameIDs are sequential. Also, I just subtracted bad games from the sum(1 to 100) = 5050. Because you only need 1 bad pull and the series of pulls is bad.
    EDIT: I do commend you on getting the answer correct the first time though. I usually have to miss a few times and tinker my way to success.

  • @EraYaN
    @EraYaN 9 หลายเดือนก่อน +2

    Didn’t have to do html, could have just done php CLI

  • @m1geo
    @m1geo 9 หลายเดือนก่อน +1

    Some languages.
    Arm Assembly
    X68 Assembly
    VB6 (for the nostalgia)
    C#

    • @SurvivalGamingyt
      @SurvivalGamingyt 9 หลายเดือนก่อน +2

      F#

    • @m1geo
      @m1geo 9 หลายเดือนก่อน +1

      I also had Pascal/Delphi and Fortran, but his threats scared me!

  • @janAkaliKilo
    @janAkaliKilo 9 หลายเดือนก่อน +1

    This regex bit at the end is no joke. You know how many billion dollars companies lost because of regex and how many programs are running in production with regex bombs waiting to explode.

  • @MrPeercraft
    @MrPeercraft 9 หลายเดือนก่อน +2

    I wanna see Fortran so bad.

    • @konstantinsotov6251
      @konstantinsotov6251 9 หลายเดือนก่อน

      "How to say that you are 40 years old without saying that you are
      40 years old?"
      jkjk

    • @MrPeercraft
      @MrPeercraft 9 หลายเดือนก่อน

      @@konstantinsotov6251 actually I'm a student that has to do some Fortran for some calculation software. Honestly, it's not so Bad as long as you want to do number crunching. If you want to use it for anything else you'r in for a miserable time.

  • @ZotyLisu
    @ZotyLisu 8 หลายเดือนก่อน

    tbh it's not PHP's fault that you decided to do this without getting info on what errors are throwing

  • @chri-k
    @chri-k 9 หลายเดือนก่อน

    Language suggestion: [C]
    ( and you actually have to use object-orientation as much as possible )

  • @etiennez0r846
    @etiennez0r846 9 หลายเดือนก่อน +1

    you could’ve write nice php code with print command and running it from console instead of a web server with a bunch of echos br tags 😢

  • @Macaroni_King
    @Macaroni_King 9 หลายเดือนก่อน +2

    Bfk is silly but COBOL, amirite? 😎

  •  9 หลายเดือนก่อน +1

    You inspired me to take the AoC challenge. Could I sugegst to add PowerShell script language to the wheel? ;)

  • @yothebob8162
    @yothebob8162 9 หลายเดือนก่อน

    Its cool to see how other people confronted this challenge, I broke it out in chars and had match triggers on r, g, b and numbers.

  • @imqqmi
    @imqqmi 9 หลายเดือนก่อน +1

    I don't think there's anything wrong with regex, though regex is often hard to read. It usually can do with some comments as to what it tries to accomplish or a reference to the work item in a backlog manager. Regex can also have performance issues so sometimes it pays to do things with string manipulation.
    The input file (unless it was a requirement) could also be in a database, pre split or just as an array in the code if hardcoded isn't a problem, or as a config file with better formatting.
    When working with a set of rules I usually put this into comments first and then work out the programming steps, sometimes it's a jumble to keep track where you're heading. And using a debugger and stepping through will allow you to quickly spot problems.

  • @GeekRedux
    @GeekRedux 5 หลายเดือนก่อน

    6:08 Pushing the big button for all the "HTML is not a language" folks, there, I see.

  • @YouHaveTrouble
    @YouHaveTrouble 3 หลายเดือนก่อน

    bro typing 2005 PHP and complaining it's bad 💀

  • @christophfriedrich5092
    @christophfriedrich5092 9 หลายเดือนก่อน +1

    Wondering why not using PHP in CLI mode on the commandline instead of a webserver...

  • @boston.boston
    @boston.boston 9 หลายเดือนก่อน

    I've done the last two days in Nim, there's some really neat solutions. Hoping you land on Nim this month.

  • @codecaine
    @codecaine 6 หลายเดือนก่อน

    Nim needs to be on the wheel :)

  • @chinoto1
    @chinoto1 9 หลายเดือนก่อน

    Treating `echo` like a function bothered me more than it should.

  • @ayoubelmhamdi7920
    @ayoubelmhamdi7920 9 หลายเดือนก่อน

    the idea of random language is genius, but these challenge need to prove online, not with video editing ❤😂

  • @jongeduard
    @jongeduard 7 หลายเดือนก่อน

    I haven't touched PHP in years, but this was clearly not the best code ever. :P
    Regex is great by the way, I have solved so many problems with regex in the years, in many different situations and many different languages, it's really a worth to learn it.
    However the parsing here does have to be done with regex, if you do this job with a bit of functional programming in Rust for example, it's quite trivial to split, map and collect everything into a data structure. Main level is the split at the semicolons, inside that you have the comas end eventually you simply split at space, all in a nice flow of code.
    Not a single loop needs to be written.
    Especially great if you make enum and struct fields for the color names and numbers.

  • @LandonEmma
    @LandonEmma 8 หลายเดือนก่อน +1

    ah... I love PHP, the coding for forums...

  • @Loki-
    @Loki- 9 หลายเดือนก่อน +1

    Haskell is probably as complex to me as brainf***

  • @zlsKeksia
    @zlsKeksia 9 หลายเดือนก่อน

    "this is a regex challege..I have to do regex"...
    "fuck regex"
    nice!

  • @Ali-Aljufairi
    @Ali-Aljufairi 9 หลายเดือนก่อน +1

    The way you code today is 😂 way differenet than yestedary where you had error handling and stuff

  • @c.j.hatton
    @c.j.hatton 9 หลายเดือนก่อน +1

    Does this guy know that PHP has a cli?

  • @Tyler-Kearney
    @Tyler-Kearney 9 หลายเดือนก่อน

    Someone put C# on that wheel!!!!!

  • @m1geo
    @m1geo 9 หลายเดือนก่อน +2

    You know you can just call php on the command line? You don't gave to generate and serve HTML 😂😂😂

  • @glowiak3430
    @glowiak3430 9 หลายเดือนก่อน +1

    FreeBASIC deserves a try, it will make you cry.

  • @mossawirtech2531
    @mossawirtech2531 7 หลายเดือนก่อน

    i am just pissed when FULL stack says he hates one particular language. he actually hates English as well :D

  • @paulchamberlain7942
    @paulchamberlain7942 8 หลายเดือนก่อน

    I never learned grep, can i take your review to mean its still not worth learning?

  • @AnthonyBullard
    @AnthonyBullard 9 หลายเดือนก่อน

    Is COBOL off the table for suggestions? That would be infotainment at its finest

  • @j.r.r.tolkien8724
    @j.r.r.tolkien8724 9 หลายเดือนก่อน +1

    I wish you'd stream this a day later so I could watch live after having taken the entire day to solve it myself 😂

  • @KnightMirkoYo
    @KnightMirkoYo 9 หลายเดือนก่อน

    I am super surprised there's no APL or J or something on the board :D