Details
-
Skillsphp, linux, apache, nginx, sql
-
LocationThe Netherlands
Joined devRant on 5/12/2016
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
Couldn't agree with you more. I hate it when I tell other programmers I usually work in PHP, just because they might think less of me. (Even with a CS degree from a university).
Personally I think PHP as a language has grown a lot in the past few years, if you compare it to PHP4. What I'm still missing are generics. From a design point of view, without generics some structures are difficult to set up without breaking SOLID. In the end, you usually end up doing runtime time validations. -
Just type php.net/memory_limit, it will take you directly to the function reference and/or directive ;)
-
Just did a deployment 1 hour before my 2 week vacation 😁
-
@Wack depending on the code we cannot see the code might return the rows matching ID 0. Using auto increment values in MySQL staring at 1, the 0 should normally not exist. They can manually be set to 0, which could result in a security flaw. Otherwise, I can not see how this would impact system security. It could still be a bug, be not related to security.
-
@Wack That's way I said, assuming, it is an in integer :) Not like a PHP string type integer, but a real integer.
-
I would recommend to always use prepared statements, as others have already pointed out.
However, in this case it is not that bad. One variable is cast to an integer and, assuming, the other ID is also an integer no SQL injection should be possible.
If, and if, OP is a beginner, I still think the coding style is very consistent. I've seen far worse than this, even from guys with years of experience.
Ontopic: I don't think this has a specific name, because I think this code will execute. A decent editor will probably give you warnings though (I think PHPStorm does, but not sure). -
She does know, and to be honest she is proud of what I do.
-
Using coding standards here. Bitbucket doesn't allow us to merge branches if there are any violations.
-
I'm wondering, how many alternatives do you guys know for pornhub and how many alternatives do you for SO, of the top of you head? ;-)
-
We could have used you skillset a few weeks back 😁
On a Friday night a cluster of 4 hosts lost their iSCSI paths to a old storage array (although, it seemed like it, I'm just a stupid PHP developer). -
@Cultist well, being sued by other companies happens from time to time, but we never had any real problems with in (we lack a legal department, but this doesn't mean we don't check anything at all :))
Maintaining, supporting and documenting shouldn't be a problem at all. All of our internal projects are properly maintained, supported and documented as well. Beside the documentation, all of the projects have strict guidelines on coding standards, test cases, code coverage and code quality. And this is just for the projects the world will never see. I think we will be fine :)
One of the motivations for releasing the project open source is our image. All packages are PHP libraries (not end user software). PHP can be written very well and very shitty. Those packages should show we are capable of writing good code. -
@Cultist well, we don't have a legal department. But doesn't an open source license cover those situations?
-
@Bubbles not at all, I'm responsible for all things IT related at work. Publishing those packages is ultimately my decision, as long as I can explain why it is good for our company that I published them (will published them on a company github page though, not my personal account).
-
@Bubbles True! I even want to make some our companies packages open source. We've got some great packages for running async jobs and some other package for DNS stuff. Especially the async job packages work really well, they have been integrated in all of our own projects and I really couldn't live without it anymore.
-
That's why I yell at our CEO every opportunity I get.
So far, he's given me some shares in the company. -
Feels good, doesn't it!
I fixed a bug in the PHP code coverage package a while back. Merging multiple code coverage results did not yield same result as them same test cases being run in a single process. I was a little bit proud to contribute to a package which is installed so many times. -
@codefreak Run like your life depends on it!! Before you know it you will be stuck in a dead end job which is holding you back.
"...but it works, let keep it like this" is my number one reason (and almost only reason) to get me mad at a coworker. -
@C0D4 Generics have been proposed for PHP, but no implementation has ever been written. Wouldn't it be awesome if we started a project on devRant to write the implementation?
-
@C0D4 Yeah, I know the feeling. It's not like everything is perfect here (look at my latest rant, it should pretty much explain it).
But 2 or 3 years back we took some time to setup a private packagist for composer packages with some libraries we have written for ourselves (ranging from coding standards to libraries for scheduling and running async jobs). For those packages we really validated every single class and method signature against SOLID. Since then we have been using those packages in multiple projects without any problems at all.
Offtopic: But again, generics would have made things soo much easier. Image you have JobHanders which can handle specific jobs types only. The handle method on the JobHandler accepts a JobInterface, but you still have to check if it is actually a Job which this handler can run. Generic would have made the design of the package so much more elegant. -
@C0D4 I think I might be lucky as well, although most of the time I'm more or less thinking about a proper OO design than about data structures.
Sadly, PHP is missing generics. If you validate your design against SOLID principles, generics are sometimes an unmissable tool in a language. -
What @unsignedint said!
I know most of the (simple) data types and algorithms as well from college. I use them sometimes, but most of the time they are already written for you. A while back I had to implement Bin Packing into a custom e-commerce solution. I think that was the last I really wrote an algorithm.
Knowing the most basic data structures an algorithms can really help sometimes. Applying them in the right situation is far more important than writing them. I think the last time I wrote one of the basic structures like LinkedList was when I was still in college. -
@Codex404 my hard copy is in the office I think (coworkers might me burrowing it at the moment). Most of my book are in my office "library".
This book is actually one of the few I read till the end in the past few years. -
@Codex404 It's more a "roman" story then some boring facts. It could have been any other fictional story, but this actually happened. The story was not written by Ali himself, but by a writer who had regular meetings with him before the project even started (if I remember correctly, it has been a while since I read the book. The book actually explains it :))
-
@Codex404 Just found it at the same time you commented, should have looked better I guess :P
-
@Codex404 True! Bunq was founded by the same person who founded TransIP (a large Dutch hosting provider). They started as a tech startup trying to become a new bank between the large "old school" banks which have been around for years. It really has been an great accomplishment what they achieved (even getting a banking permit).
"Breken met Banken" is a Dutch book describing what they encountered during their first few years. It is a really great read and a great inspiration for those working in IT or starting companies. (Sadly I couldn't find an English version of the book). -
Bunq fan here! And it don't think people in the Netherlands don't like foreign payment cards. In The Netherlands we have iDeal for online payments, which really has it benefits for shop owners (amount is immediately added to your account instead of waiting for a week. And you don't pay a % fee over the transaction, but like 25 cents).
For offline payments the debit cards work the same like any credit card. But again, you don't have to wait for a week and don't pay a variable fee but a few cents for a transaction (I don't know the exact amount).
Personally I think the Dutch payment system is far superior than most other countries. Why would they follow the rest of the world? Maybe the rest of the world should follow the Netherlands?
New European laws (PSD2) force European banks to all implement an online payment system which does not depend on CC. Because CC are expensive for shop owners. And you know what? Dutch banks already have their systems ready 10 years before the law existed. -
Zend Expressive. A stripped down version of Zend Framework, it just implements PSR middleware, routers and dependency injection. Multiple routers and DI frameworks are available. (View) renderer is optional, but again, multiple options are available. I never use them, instead I return JSON response.
-
Did that for 2 weeks straight. Me and my gf got food poisoning (salmonella). We couldn't get out of bed for 2 weeks. And worst part is, after 2 week almost eating nothing at all your body feels just empty. It takes another 2 week to get back to full strength.
-
I haven't seen a single correct answer. Mostly because @PokerJack asked for a number between 1 and 10, not between 0 and 9 😋
Suggestion: (PID mod 10) + 1
But yeah, I think you scared her a little bit. -
Code review is not only a tool to improve code quality, but a tool to improve yourself as well :) You can learn from reading other people's code. But of course this all depends on who you are working with...