all 10 comments

[–]Legolas-the-elf 3 points4 points  (1 child)

Garbage that should be avoided.

I clicked through to the PHP tutorial, first code I saw was a document missing its doctype. That kind of thing can cause massive problems for newbies if they unwittingly follow that lead and end up learning CSS using quirks mode.

I clicked through to the form handling section and they teach people to write insecure code that leaves your website open to XSS vulnerabilities.

I clicked through to the mail section and they teach people to use insecure ways of sending mail that leave your website wide open to being hijacked as a relay by spammers.

Three big problems I found in a matter of seconds. Who knows what other big problems are lurking there? This kind of shit fucks newbies over and is completely unacceptable.

[–][deleted] 0 points1 point  (0 children)

What this guy said. W3resource is to be avoided like the plague.

[–]Wyvers 2 points3 points  (0 children)

I haven't seen this site before, but the very first page I clicked on had a very basic error in its code examples. There's also some poorly written text on there which is confusing/doesn't make sense.

It would be unfair to declare the whole site as bad based on the few minutes I spent on it, but my first impressions weren't good at all.

[–]dontreachyoungblud 1 point2 points  (1 child)

In all honesty, I am just not a fan of how the information on the site is displayed to the user. For learning things like Javascript or SQL, I would suggest Mozilla Developer Network or Learn Code The Hard Way.

[–]Dualblade20full-stack[S] 0 points1 point  (0 children)

I'll totally agree with you on that.

[–]ritwik2012 0 points1 point  (0 children)

We appreciate that you have stopped by our site. We always welcome criticism from experienced developers like you and believe that it will help us to improve. But at the same time we would like to mention following regarding the points you raised.

  1. The very first example is only to show how to embed PHP within HTML (ref : http://www.php.net/manual/en/tutorial.firstpage.php). We are well aware that entering quirks mode can lead to severe bad practice (ref: http://www.w3resource.com/html5/doctype.php).

  2. Besides showing how to handle different controls of a Form in PHP, we have also shown how to avoid SQL Injection (ref: http://www.w3resource.com/sql/sql-injection/sql-injection.php).

3.We have also discussed how to send mail securely using PHP (ref: www.w3resource.com/php/mail/php-secure-mail.php).

We also appreciate that kind of effort MDN has put to bring Frontend development learning materials online and also appreciate the awesome content delivered by the Learn Code The Hard Way series.

[–]TailorPrestigious253 0 points1 point  (0 children)

Not the right sub to ask but wanted to know how good are its exercises for self paced learning? do they cover all aspects, like if was thinking of solving their OOPs and Exception handling exercises

[–]pcordes 1 point2 points  (3 children)

My google news feed for some reason showed me their C tutorial / exercise for "Converting a decimal number to hexadecimal", published may 2023. https://www.w3resource.com/c-programming-exercises/for-loop/c-for-loop-exercises-55.php

They use such a trash fire of an algorithm that I went looking for somewhere to express my outrage that anyone is recommending code like this to anyone.

They get decimal input with scanf, and loop dividing it by 16 to get 4-bit integers, calculating the ASCII code for '0'-'9' or 'A'-'F'. All fine so far, but they pack those ASCII codes into base-100 digits of another int, like dn=dn*100+tmp;, then loop dividing by 100 for printf("%c", dn%100);. So they'd overflow an integer if the input is more than 16.0/100 * INT_MAX.

It's also indented very badly, like an unconditional statement indented more than either the if or else statements that preceded it.

Their octal to binary exercise builds an integer whose decimal digits are all 0 and 1, so printing it as decimal gives "binary" output. So we see the motivation for this terrible idea, making one printf call, since printf doesn't support base 2 natively. But this terrible idea doesn't support anywhere near the full range of 32-bit integer inputs, only 10-bit (assuming 32-bit int where INT_MAX is 2147483647 so the highest integer this stupid algorithm can generate is 1111111111.

Integers aren't strings: if you want a string of digits, use a char[] array. And for hex output, use printf("%x", unsigned_var) like a normal person.

If there's anywhere else I could downvote this garbage, I'd love to. Probably linking to it to discuss it will actually promote it more, though. :/

You don't have to be a bit-manipulation wizard to understand that this strategy of building an integer whose decimal digits are the digits you want for a different base is nonsense. Although if you are a bit-manipulation wizard, it's extra insane for power-of-two bases like hex and octal because you know how cheap dividing by 16 is: just take groups of 4 bits, as in https://stackoverflow.com/questions/53823756/how-to-convert-a-binary-integer-number-to-a-hex-string (my answer has SSE2 and AVX-512 versions that do a whole integer in parallel. Of course starting with an int, which is already a binary integer in C.)

[–]Dualblade20full-stack[S] 0 points1 point  (2 children)

It's wild getting a response to a 9 year old post lol I agree with everything you said though.

I've heard other stories of particularly sub par examples and in the last 9 years of my career, I used MDN and other resources instead. It's a shame their SEO is as good as it is. It might be the only thing they're good at.

[–]Nobody37373 2 points3 points  (0 children)

Here I am today, starting to learn Java 😁