Begun coding a WordPress theme, it's incredibly easy... Thought it'd be harder.
Begun coding a WordPress theme, it's incredibly easy... Thought it'd be harder.
Fucking around with colors
www.errur.com/newrur/Blue/
www.errur.com/newrur/Orange/
www.errur.com/newrur/Green/
Look, PHP is not my favorite language, it's true that it's practically a mess. But saying that it's not possible to control errors just shows that you can't code PHP for shit.
http://php.net/manual/en/language.op...rorcontrol.php
http://www.php.net/manual/en/language.exceptions.php
No, because if you're making a small project you obviously want it spread out among a shitload of files.
If you're doing something huge, yes, I agree, ASP.NET organizes the data nicely, but for one small script or even medium-sized projects PHP's inline code approach is great, because it's easy to use.
Comparing mod_php to ASP.NET in terms of stability isn't really fair. It is completely possible to crash a PHP FastCGI process with the right code and for that crash to have a huge knock-on effect without something in place to restart it.
I'm sorry, but exactly when did I ever make such an claim? Of course you can handle errors and exceptions in PHP, but the way of embedding your PHP code with your view layer, by default, will make it difficult to cleanly handle an error. This is why I even mentioned a simple solution I've used to get past that in the past.
Let me explain once more: if you have a MySQL query in the middle of your HTML code, and if it fails, the browser will already have received some of your HTML code and then PHP will fail at the query. You can either add error checks to every single query spread in 50 different PHP files, or have an application structure that allows you to catch them all, log them and show the user a "Sorry, something went wrong" page. And this example explains exactly why the PHP way of mixing HTML and PHP is flawed.
By immediately raging at me and saying that "I can't code PHP for shit" you only make yourself look like a total fool and jackass.
Let me give you a real-world scenario here. I wanted to build a simple website where the users of my Android application could fill out a small feedback form.
I used Sinatra, a simple Ruby web "framework". Here's a look at the directory structure:
Exactly how is this "spread out along a shitload of files"? Exaggerating facts is not going to make your case any stronger. Of course, had my app been more than 3 pages big, I could have split the business logic from survey.rb to more files.Code:survey survey.rb views layout.erb survey.erb thanks.erb
No.
Go for the orange one, or change the blue to something like this:
(#14568e)
Or maybe add some buttons at the top to change the layout color?
Ooooh, that fits really well!
I'm just trying out different colors, seeing what fits best.
http://errur.com/newrur/DarkBlue/
Thanks for the suggestion.
Use <strong> instead of <b> and do some margin-top on the box rather than
Other than that, nice job so far.Code:<div style="height:100px;"></div> <!-- Spacing -->
You can do the same in asp.net if you want......
It was constantly (and exactly) 8.0, never changed, which was pretty strange I thought. As the email said, we have a 'limit' of 5.0 per VPS for extended periods of time.
No the problem is that most people don't take the time to write full fledged error handling. If you had output buffering with a proper database class with error handling built in, this wouldn't be a problem.
I must've put it before the "margin: auto;"-segment last time, cause it didn't work then, and it works now.
Thanks![]()
First off, why would you place a query in the middle of your code? To make it harder on yourself?
What if, per say, only one of ten queries failed? Instead of allowing the user to continue using the page if that one particular query wasn't needed in all nine other queries, you would completely strip functionality out of your webpage until you fix that one. And yes, you can log them if you desire it. I've personally never liked error pages, as it strips functionality away from the user, but if you'd like one you could most likely set up a custom error handler that redirects you to an "oops!" page.
Oh, and here's some further information on that subject: http://www.phpfreaks.com/blog/or-die-must-die
This is similar to how I view Java and C (albeit java is OOP), one is compiled on run-time, and one is compiled ahead of time. They both have their separate uses, and are each better at different projects.
As andersonmat said a while back:
Of course not - you can build well-structured applications with PHP: the point here is that the language is flawed and poorly designed (and the design encourages the kind of scenarios I've described). I mentioned output buffering myself as an solution to the example.
I'm sorry, but if your SQL queries are failing, something is wrong with your code and you should fix it instead of ignoring it (and choosing to still proceed with rendering the page to the user might cause inconsistency or other side effects).HeroicPillow posted:
You can apply this same (non)argument to any language: the argument here *is not* that "people write bad code so PHP sucks". You can write good code in any language you consider to be bad.andersonmat posted:
The point is, once again, that the design of PHP is flawed. You can write good code with PHP (and if you use PHP, you obviously should), but it doesn't fix the problems with the underlying programming language.
You're 100% correct. I do not understand why you have PHP code embedded in your interface code.
Edited:
Also; you're saying that only small/unimportant websites use PHP? What about the behemoth that is Facebook?
ooooh
Edited:
I'm going to play with Ruby/RoR for a bit.
No, I'm not saying that - what I am saying is that PHP hasn't really been designed for writing large web apps, but instead for embedding pieces of dynamic code in otherwise static websites (as PHP's history says - Lerdorf created it for trivial things like a pageview counter). Regardless, PHP is used for so many large websites such as Wikipedia or Facebook - however, that is not a valid measure of how "good a language is".
As an example, Twitter's frontend runs on Ruby (on Rails), reddit is Python, Stack Overflow is ASP.NET MVC... I could list tens of great web apps that run on different languages. (Facebook probably uses other languages for their backend, just like how Twitter's queuing runs on Scala.)
PHP is so popular because at the time it was the best option for writing server-side code, and now it is so widely adopted among shared hosts. However, apps such as Passenger are starting to become popular in shared hosts - for example, I can run Rails apps on my Dreamhost package, because they have Passenger installed.
But really, the decision on what language to go with is your choice.
Getting to work on a lot of error handling and security features for PBA.
also ITT: People arguing over how awesome/bad PHP is
My .htaccess is now 44 lines long because I refuse to have PHP work out what's going on when .htaccess is far faster, and just as dynamic. Just got rewrites for each different pre-set page type, with a general 'catch-all' at the bottom.
It just helps save bandwidth and makes it easier really. Still nice of them.
Yeah I stared at that for like a minute.
Edited:
Because it's easier and if you only need to run a query or two there's little than can go wrong. The code is still easy to understand, and a single file is easier to maintain. Having it inline also gives you a better idea of how it's going to look in the actual browser.
And I'm not saying that only small websites use PHP, however people seem to prefer ASP.NET for larger stuff (actually ASP.NET only makes sense to me for larger stuff) for its superior ability with MVC and classes, which, while indeed superior, are more work, which I really don't need if I'm making...say...an URL shortener (I made one a few days ago actually).
Edited:
Ruby appeals to me as well because it seems easy, powerful, and feasible for both small and large stuff. I actually read a bit of _why (<3) 's sublime guide but it never really amounted to anything for me. I'll probably play with it one day though.
Edit:
Heh, Ruby seems to be full of nifty stuff that's of moderate practical use but certainly interesting. http://en.wikipedia.org/wiki/Markaby
What?
What's with the blurred out group descriptions?
Tagged for size
Opinions?
Edited:
Based on this image that a friend did for a school project.
Special features that haven't been announced yet.
Spare time at school leads to:
And that was my day.
I'm gonna look into doin' fun stuff with JS soon, although it's my least favorite language.Code:javascript:var x = 98; function nextBottle() { if (document.getElementsByName('comment')[0].disabled) { setTimeout("nextBottle()", 100); } else { document.getElementsByName('add_comment_text')[0].value = x + " bottles of beer on the wall, " + x + " bottles of beer, take one down, pass it around, " + (x-1) + " bottles of beer on the wall."; document.getElementsByName('comment')[0].click(); x = x-1; if (x > 0) { setTimeout("nextBottle()", 100); } } } nextBottle();
ASP.NET can be used in single pages if you wish, you don't have to setup a whole project in Visual Studio.
Code:<%@ Page Language="C#" %> <html> <head> <title>The Time</title> </head> <body> The time is <%=DateTime.Now %> </body> </html>
It looks fucking sexy.
Cleaned up CodeIgniter's default Debug output for SyncWiki
![]()
Looks nice :)
Been working on Mod Outlet all morning, item pages mainly. Re-worked a few methods of doing things, including realizing each file actually only needs one download.
Setup thumbnail system (well, half of it), now to build the cron which will process the thumbnail generation queue, and my thumbnails should start displaying nicely. Except it might be a manual cron in the end due to PHP execution limits, I may have to have it reload every thumbnail generation, and keep reloading (need to check if that actually works with a cron, it'll probably have to be a cron triggering a web-cron).
Made it nicer
![]()
Why don't you just step through the request in the debugger?
Edited:
Oh wait
Why don't you not post like a fanboy every other post
Speaking of which, how do you do that in ASP.NET?
Same way as you do in any other Visual Studio project.
Click in the bar on the left of the code to set a breakpoint on that line, and when that code is about to be executed, it'll break and you can use step into and step over to debug. You can hover over variables to see values, works really well for objects.
Good places to set a breakpoint are at Application_BeginRequest() in Global.asax or the Page_Load() method of your page's codebehind.
I would post screenshots, but I'm on my iPod
Fly away troll fly awaaay.
Fuck off I'm so tired of you two going on about ASP.NET, give it a rest damn't
Fly away on my zephyr...
ASP.NET fan boys alert.