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.
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 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; }
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.
@@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; }
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.
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.
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.
@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
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.
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()
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---->
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 .
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
I loved this project as an April fools joke, glad to see you revisit it.
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.
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.
explain
@@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;
}
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.
The advantage is that it hurts your brain more, obviously. Programming in the 80's was very different.
@@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; }
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.
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.
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.
Imagine that a random guy from Greenland figured out programmers need break 2; and nobody after him followed his footsteps
If you want it to work with new line on all platforms, you should use the constant PHP_EOL instead of
That's just more letters then
.
@@pratikbhujel But it's platform independent. Some files on Windows use
instead of just
.
Hello from Argentina! Since php 7 you can now define arrays, you can use it to define the platforms.
@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
Every 5th line:
exit(69)
Everyday, we stray further from god.
And getting closer to becoming gods
@@RenderDragonI believe the word u are looking for is: *doom*
About damn time.
Ha,ha,ha
i am
Thank you for your effort.❤
Watched half of the video, came back, and saw the new thumbnail. Lmao
New video every time Pog
Pog
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.
Bout to get more money with those $ signs 💸
ChatCCP. Instant like! And the "Brainwashers Gold"-Selection of Creative Commons Background-Music is elegantly hideous applied - great Tennis!
Why do you do this to yourself you absolute madman? 😄
There's at&t syntax and intel(flavors) exists for assembly.
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()
rip old thumbnail
You should compile c to php using php xD
You could have used getopt() for the command line options parsing
hey tsoding why did you stop doing the car horn sound when there is a sub.
I love gasm only as second possible choice. Guess why 😂
Fasm or gasm?😏👀
You don't need curly braces for case statements.
And for multiline strings you can use nowadoc
Heredoc?
Your ChatCPP also uses GPT 3.5 😅
Is that the real zozen? Or did the Vim and PHP demons finally got him?
@37:10 😮😢
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---->
you could stream on UA-cam
and do you unironically like vim more than emacs?
wasm yasm fasm or gasm(gas)
gachigasm
orgasm
Wasm basm fasank you masm
AYAYA
NOOO, you can't be serious
I love php ngl, dodgy free host and cron jobs 👀
Modern php It’s a solid language.
*is
It's a fantastic system scripting language. Great replacement for bash IMO, and stupid easy to write quick GUIs where needed.
I unironically prefer assembly
remaking porth in php
phporth
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 .
To be fair most documentation online is extremely outdated
I'm waiting for a video with a title like "I LITERALLY DIED 😿"
😹
i think you should start using composer and using some libraries to help you out. for example commandline parsing.
This is werid. :D
PHP and C do not fulfill the same purpose at all.
Wtf is wrong with php is one of the worst coding languages ever for me and c is the best programming language.
Two Questions : ⁉⁉
-What's your major ?
-What's your roadmap to get this huge knowledge ?
Thanks for sharing wealth. 🤍🤍
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