6 ms·
PHP Dark Arts: Sockets
- spooneybarger 16y agoI don't mean to be snide, but in what universe is basic socket programming considered a 'dark art'? Has programming as a whole really fallen that far? Socket programming isn't deep or complicated, it is pretty straightforward and most anyone with a vaguely decent amount of programming experience ( 1 year at most from my experience ) should be able to pick up the basic right away.
- maxawaytoolong 16y agoIt's a dark art if you are doing it in PHP...
- InclinedPlane 16y agoa: it's in PHP b: the overall skill level of programmers ranges across several orders of magnitude, amongst the group of folks who are "programmers" or software engineers by job description only a small fraction of them are capable of socket programming without getting well in over their head quickly.
- spooneybarger 16y agoIf b is true then I've apparently lead a sheltered life. Every programmer I've worked with, even the ones I could call 'not so good' where able to do socket programming.
- kellishaver 16y agoI've had a few occasions to do socket programming in PHP and I agree, it's a pretty basic, and when you're talking programming in general, a fairly common thing, but I don't think it's something the average PHP developer does very much of.
- bhiggins 16y agoPHP Dark Arts: doing something beyond <p>hi there <?php echo $username ?></p>
- deleted 16y ago[deleted]
- petervandijck 16y agoI know I'll get flamed for this, but that's actually beautifully elegant.
- pornel 16y agoand insecure. Correct version is: <?php echo htmlspecialchars($username); ?>
- petervandijck 16y agoThat's so incorrect I don't even know where to start.
- pornel 16y agoI'd like to hear what's incorrect about it. Do you think values should be escaped before output? Or that usernames don't include chars that need escaping in HTML? Or perhaps you'd add extra filtering to ensure that page cannot become ill-formed due to encoding error? Or perhaps it's incorrect to use PHP at all? ;)
- bhiggins 16y agowhoa, dark art alert!!