« first day (543 days earlier)      last day (4405 days later) » 

12:00 AM
I need a little help with a while loop control structure. I'm pulling my brains out.
 
@FrankieDoodle do you have a simplified example?
 
@will
@willoller yes, i did post to forum here.stackoverflow.com/questions/10098061/…
 
12:17 AM
@FrankieDoodle To do a threaded reply hit the little arrow to the left d.pr/QmbU
 
@willoller like this?
 
@FrankieDoodle yepper
 
@willoller thanks
 
I can't stand wordpress
code like that makes me gag
 
Tek
@ircmaxell I know that feel
So question guys, is it ok to pass an object factory to a mapper if it needs to build a certain object?
 
12:24 AM
WordPress is like your girlfriends parents. It's best not to ask a lot of questions from them, be quiet around them and suffer.
 
@Tek absolutely
 
Tek
@ircmaxell Great, thanks.
 
morning
 
Tek
@tereško Good day
 
Woot, my PHP Sucks post is now my #1 post of all time
in a mere 4 hours...
which is impressive. I love hacker news
 
12:27 AM
Who doesn't.
 
Tek
@Chris I don't, considering I didn't know about it until earlier today : )
 
If you didn't, you don't read a lot. If you don't read a lot, you ain't got much knowledge. If you ain't got much knowledge then what are you doing here?
 
@Chris why be quiet around them? I call them out for what they are: garbage
 
That's a whole new level of bluntness. My brain can't handle that.
 
Tek
@Chris Don't you think it's a bit arrogant to say a huge assumption like that? My point being hacker news aren't the only news on the internet... : )
@ircmaxell lmao
 
12:35 AM
:-P
 
@Tek It sure is arrogant and your right, it is not. But if you haven't even heard of it and yet you've made it as far as Stack Overflow's PHP chat, well, that makes me assume.
 
Tek
I'm pretty sure a lot of gurus out there (including the PHP core developers) haven't heard of that site.
 
That being said, my views on everything are completely biased. So, carry on.
 
Tek
:p
 
I didn't hear about it until fairly recently
 
12:38 AM
I've been reading it for, umm, 1+ years. I have no memory of it's discovery however.
 
Tek
Next question, on raw SQL queries, what do you guys think of building an object that carries table and column names instead of having static text in case those tables/columns are renamed?
 
eiw
 
Tek
Thoughts?
 
See, your way smarter than me and you haven't heard of hacker news? I don't get the logic behind that fact.
 
Tek
@Chris Maybe us 'smarter' folk use the time reading php instead of news ;D
Joking aside, it's partly true, I do have more important things to do than read news most of the time.
 
12:42 AM
@Tek That explains quite a lot.
 
Tek
Still, I like the layout of the site and I'll be bookmarking it
 
I visit Hacker News once or twice a day and if I do, I usually waste an hour per visit.
Incredibly unproductive.
 
Tek
lmao
 
I have my feed reader for that
 
Tek
Well, some things can be useful...
@ircmaxell Going to elaborate on that 'eiw' or was that not for me?
 
12:44 AM
@Tek that was for you
hard code your table names. It's in your data mapper, so it's only one place to change
otherwise you're going to build a half-assed query builder that will be FAR more trouble than it's worth
yay, 700 twitter followers
 
Tek
@ircmaxell In what way? I mean it'll just be holding text, not sure how that can get complicated.
 
try it
it will get complicated
or pointless
one of the two
 
Or both.
 
Tek
@ircmaxell Are you telling me you'd manually change each hard coded line if there's a change in the database?
 
yes
because if my data model is really changing, I'm going to need to touch those lines anyway
 
Tek
12:50 AM
@ircmaxell I guess I'll try it, as a learning experience. Sounds to me like one of those preferences like... Raw SQL or ORM, they both have their pros and cons
Thanks for your suggestion though, I'll ask it some other time and see what other members have to say about it
 
user895378
@Tek At a certain point you'll have to stop with abstraction and write code that's specific to your application. I know I've personally wasted a lot of time recovering from ORMs. I would advise against them and other extraneous abstractions in your model layer in favor of simple data mappers.
 
they do
I'm averaging about 1 page view per second on the blog right now
pretty good
 
user895378
It's funny how the Internet works. Personally, I found your technical debt post to be infinitely more useful in scope (as well as across programming languages).
 
user895378
But, that's how people work. We like the reality TV and mud fights.
 
I agree
and my favorite post is quite low ranked (Good vs Good Enough)
 
user895378
12:56 AM
So when one person slams a language and people respond it gets way more attention
 
user895378
If it were me, I'd get the old PrtScn button lubed up to capture that one :)
 
user895378
@ircmaxell I haven't read that, though I have a sneaking suspicion I could benefit tremendously as I have a bad habit of never finishing and improving things forever.
 
user895378
Programming is like the worst kind of arcade game where you can get exponentially higher scores but you can't ever win!
 
user895378
1:01 AM
Code can always be better, faster, more efficient, etc.
 
user895378
And it drives me nuts because I need things perfect :)
 
@rdlowrey It can be, but it's not worth while (diminshing returns)
 
user895378
Oh don't I know it. I'm in recovery though I still have relapses.
 
lol
 
user895378
1:04 AM
I can see the lure of academia in that regard. There's definitely a draw to being able to think about problems all day long and write papers about minutiae that isn't relevant to the real world in search of the elusive goal of perfection.
 
user895378
> "Either you have common sense, or you don't. And if you don't have it, I'm sorry but you're in the wrong industry."
 
Sam
@rdlowrey I've got a question about building PHP applications with classes
 
user895378
Nowhere is that ^ more apparent than SO questions.
 
user895378
@Sam shoot
 
user895378
Before you ask, let me say that object oriented programming is not the same as using classes. I personally had to fumble my way through writing some really awful code using classes before I started to understand OOP methodologies and why they made sense ...
 
1:11 AM
@ircmaxell, #2 on Hacker News, not bad.
 
@Charles Was #1 for a few hours
http://www.meteor.com/screencast Forget about #SQLInjection, let's just give direct DB access to the client! #FAIL
 
Sam
@rdlowrey ok......building a PHP app class-style, what is the normal order of file arrangement?
 
4 hours ago, by Matt McDonald
user image
 
user895378
@Sam Well it's really up to you but I basically do something like this ...
 
Sam
I already know about auto_loaders, but how does everything fit in together
ok....listening
 
user895378
1:15 AM
/
  myapp/
    src/
      MyApp/
        Class1.php
        Class2.php
    test/
      ...
    vendors
      ...
    webroot
      index.php <-- front controller

    bootstrap.php
 
user895378
Where the classes exist in the MyApp namespace
 
Sam
ok.....and every request calls the bootstrap file?
 
user895378
Yes.
 
user895378
Though in a web application I usually route everything through a front-controller so there's only one file.
 
user895378
You don't have to use a front-controller, and I don't always.
 
Sam
1:17 AM
routing, as in url-rewriting, right?
 
user895378
@Sam That's the most common use. Of course you could put actual files in the webroot directory for each HTTP resource and forego the front controller altogether.
 
Sam
@rdlowrey ok.....care to explain more about the front controller? I have an abstract idea of its meaning, but I can't translate it into usable information
 
user895378
@Sam A front controller is a popular method for using your application to route requests by their URLs. So, with an Apache web server, you'd have an .htaccess file that routes all requests to the front controller file. It's then the front controller file's job to parse the request URI and determine what internal code it should use to render and respond to the request.
 
user895378
That's in contrast to having separate files for each type of resource like:
 
user895378
doh.
 
user895378
1:24 AM
webroot
  users/
    index.php
  widgets/
    index.php
 
Sam
@rdlowrey the index pages usually act as the controllers, right?
 
How fitting
 
user895378
@Sam that's just an example, but you could say that. The above directory structure provides the "routing" because the file system is already structured in such a way as to make the URLs map to the appropriate code.
 
PHP: A fractal of bad design (veekun.com)
666 points by daeken 22 hours ago | flag | 437 comments
 
user895378
@ircmaxell hehe
 
Sam
1:27 AM
@rdlowrey thanks for the information.........will start implementing OOP codes from now on
 
user895378
@Sam Well, get started using classes to structure your code. Just remember, just because you use classes it doesn't mean your code is object-oriented. That's an approach you'll learn over time.
 
Sam
@rdlowrey alright.....advice well heeded
 
user895378
As long as you commit to continue educating & improving yourself you'll be just fine :)
 
user895378
> "Meteor provides something called 'Latency Compensation'"
 
user895378
Uh, you mean normal javascript?
 
user895378
1:34 AM
I don't understand why framework writers try to make code that appeals to the most inexperienced and unskilled developers.
 
user895378
"Look, you just click two times and your application writes itself!"
 
@rdlowrey , two reasons
1. it helps with advertising
 
@rdlowrey because it's shiny
 
2. it's an interesting challenge
ehh ... here is something what would illustrate how crappy is the code i have to work on today
a JS file , 4500 something lines of jquery madness ... removed almost 2000 lines .. nothing changed
 
user895378
@tereško That sounds like drudgery.
 
1:42 AM
lol
 
That's an awful lot of lines considering it's jQuery.
 
My latest application is nearly 7000 lines of JavaScript... and 6000 lines of PHP
 
is there some secret school where they teach this ?
 
If I ever make it there, I'm not sure I'll make it with my sanity.
 
how can people produce shit at such quantities ?!
 
user895378
1:44 AM
Maybe they get paid per line of code.
3
 
user895378
It would certainly explain a lot :)
 
My app is pretty heavy OOP javascript
 
thing is , i know that they don't
 
Or maybe they learned 5% of the language and thought they're good enough to get a job at it.
 
about 20 classes and a lot of interactions. Only about 200 lines of "jquery" code
 
user895378
1:45 AM
@ircmaxell Sounds like it. I haven't ever done anything that intense on the .js side -- I guess the entire UI is JS?
 
I was that stupid, thought I knew all there is to know .. I got a job, I got fired, I learned.
 
"my" app looks like it has been written by 4 different people
 
Yeah, actually all authentication is done client side
so the entire app switches states on login, logout and register dynamically.
It's not going to go live for another month or two, sadly (it's passed QA, but we're holding deployment until we fix something else on another site)
 
at least one person who has touch this codebase wouldn't pass the Turing test
 
The worst I've ever had to lay my hands on was a WordPress powered site that used mysql_query to get posts.
 
user895378
1:48 AM
@tereško lol
 
@Chris lol
 
user895378
@Chris You had me at WordPress. If I had a choice between customizing a WP install and going hungry ... well I heard skinny is in these days.
 
user895378
I have a baby seizure every time I see some sort of "Powered by Wordpress" message on the site of a major publication.
 
@rdlowrey The funny thing about it is that the theme, where you can use WP's documentation to loop posts etc, used mysql_query to get menu elements, posts, comments, everything was custom fetched and yet identical (in a really negative way) to what the built-in functions did.
And I'm not even going to discuss mark-up nor css of it.
 
user895378
I have a mental picture of mysql_query being called over and over inside a loop to get the filename of an icon to display 20 times on the main page of a blog next to each post headline.
 
1:52 AM
Yes, it was also used for post_thumbnail();.
 
Actually, writing that much javascript made me realize how pathetic jQuery is for OOP development
 
user895378
@ircmaxell How do you test that?
 
test what?
 
user895378
the javascript. what's your workflow for unit testing it?
 
console.log after each action for me.
 
1:55 AM
Well, being classes, we just used raw js files to test it. Nothing really fancy
 
there are unittesting frameworks for JS
 
@tereško Very few good ones though
 
true
 
I actually extended console quite significantly and wrapped it in a debug layer. It will actually dynamically load firebug lite on browsers that don't have console (in dev)
 
@ircmaxell .. for such things Mootools can be helpful , if you are not too good with prototype based languages
 
1:56 AM
Yes, I would have liked Mootools (I've built large OOP apps with it before)
but we had a rule, jQuery is the only major library (because of support constraints)
 
Everything is a framework these days. I dislike that.
 
I'm going to do some more work on my jquery OOP concept
because there's a lot that can be done better (just look at the boilerplate that's required in most jQuery plugins, like github.com/jquerytools/jquerytools
 
i tend to act like it is an external library , not a framework
 
10 years from now; "Hey, you know any good frameworks for outputting text?" - "Yeah, use Echo Framework by Yahoo!"
 
the only part of jQuery that I've found really helpful is $.extend(), $.Deferred() and $.trigger()
even though I completely wrapped the event system to make it applicable to classes...
 
user895378
1:59 AM
@Chris Well, one good thing about so many people working with frameworks is it stunts their growth in terms of coding. It should make devs who can actually create things from the ground up more valuable :)
 
@rdlowrey Perhaps, but then again more and more agencies would hire idiots, because, well, an idiot can also code with a framework (All tho' one would question the code's quality).
 
project managers like the pretty lie of "make website by writing two lines"
 
And an idiot doesn't want a lot of money.
 
@Chris Which makes people like me much more valuable, since they would need to pay me large sums of money to come in and fix it afterwards
 
user895378
Yep. The money is in after-market fixes. Car dealerships learned that a long time ago :)
 
2:02 AM
That's a good point, @ircmaxell
 
I actually was in a side meeting today (went to lunch with a former co-worker and a manager from his company)
 
i think this project i am working on will need an "after-market rewrite" ...
 
and they wanted me to do some dev work for them on the side (a few hours here, a few hours there)
I told them my freelance rate, and they didn't even blink
which took me by surprise...
 
you know how rare i to find developers who actually know how to write algorithms ?
 
I'm guessing it's a three character number.
 
2:04 AM
programming languages are easy to learn , programming , on the other hand , is hard to learn
 
I for one don't know anything of algorithms but I can assume they are not for me to write.
 
user895378
@Chris lol I would hope so. You can barely hire delivery men for manual labor at less than three figures.
 
user895378
I'm going to ignore the strangeness of saying, "A three character number" :)
 
@Chris $850 per hour...
 
are you serious ?!?
 
2:06 AM
Comparing to my 20 eur per hour ... Well, I .. I just don't have anything wise to say at this point.
 
yes
However, I'm not worth that
 
user895378
Sounds perfectly legit to me.
 
user895378
Not to mention, if a company gets to the point that they need after-market scalability adjustments they likely have deep pockets.
 
I hate doing freelance work. So I set my rate quite high, in that if someone really wants to pay me that much, I'll bite my tongue and do it...
 
They won't even hire Einstein in this country for that money. Top notch programmers around here ask 40-50 eur per hour.
 
2:07 AM
@ircmaxell , well .. do you think that most of people on the wall street are worth what they get paid ?
 
user895378
@Chris Define "top-notch"
 
user895378
You're worth whatever someone will pay
 
@rdlowrey Those programmers to whom I look up to and because they're intelligence is superior to me, I can't really define it in any other way.
 
user895378
I don't know ... I got into coding so that I could create my own projects ... spending all the time learning and educating yourself just to work for soul-crushing customers who want their wordpress install tweaked sounds awful.
 
@tereško not in the least
@Chris where's here
 
2:10 AM
@ircmaxell Ex-Soviet Estonia.
 
Ahh
I was going to say, I've had job offers from central Europe for more than that...
 
he's like 200km up north from me
 
Ahh
Hey there @Eevee
 
user895378
Any of you guys ever been to Ireland and can suggest some touristy things to do (besides getting hammered)?
 
@rdlowrey I've been into coding for a bit over 2 years (front-end development) and now I'm doing PHP. Fixing shitty-ass-broken-pieces-of-garbage-wordpress-powered-sites for 20 an hour is a start. Also, I love things I don't quite fully understand.
 
2:12 AM
@rdlowrey there's more to do than drink?
 
ha. somehow i missed that SO even had chat.
 
hehehe, yeah, this room is one of the more active ones
 
user895378
@ircmaxell Not really. My little sister's getting married and everyone in the family thinks it's a disaster. It's going to be a drinking holiday of the highest order for me :)
 
@Chris , just do not learn anything from wordpress .. world is already a ba place , dont make it worse
 
nice
@Eevee: nice blog post by the way. I know I came off a little bashing in my reply, but I think as a whole you were spot on the money
 
2:14 AM
@tereško Don't worry, I hate it with all my heart. I prefer doing things from scratch (granted that I'm not even remotely good at it as of yet).
 
thanks
 
user895378
Which reminds me. I'll be at 94 consecutive days in my progress towards a Gold badge for 100 straight days when I leave. Who's definitely writing a cURL script for auto SO login? This guy.
 
@rdlowrey login isn't enough
 
user895378
@ircmaxell spider? maybe browse some of my answers?
 
user895378
:)
 
2:16 AM
lol
 
damn .. i have been derping here for almost half an hour
 
user895378
@tereško Yeah, I've wasted a lot of time in chat today. Productivity index: low to quite low.
 
I just finished coding something incredibly stupid just because I have no idea how to do it differently and am afraid to ask anyone because of my insecurity. Sometimes your own mind can be your worst enemy.
 
wasted? nah
 
my day has only begun now (have been awake for hour or so )
 
2:18 AM
@Chris the best way to learn is to teach. The second best way is to fail
3
 
+1
 
user895378
I don't think people realize what an unbelievable learning mechanism it can be to answer questions. SO made me smarter. In the very least it forces you to be absolutely sure you know what you're talking about and develop confidence in what you're saying so you don't get downvoted into oblivion for a bad answer.
 
user1385191
I'm reading the GitHub source for the top story on HN
 
user1385191
sloppy stuff
 
All right, well, basically I have way too many if()'s for if there's X slashes in a string do a certain action. I'm 99% it can be done with foreach, but I have no idea how. Perhaps with $count++ .. hmm ..
 
user895378
2:21 AM
@Chris Why not post some code :)
 
user1385191
kind of funny that a bunch of MIT grads can't write decent JS
 
@MattMcDonald , not really , no
more like sad
 
@rdlowrey I like to stay mysterious. Or mysteriously retarded. Take your pick.
 
user895378
@Chris Well, since present company knows you aren't a help vampire, any criticism will be constructive and you'll likely learn something. But do whatever :)
 
user1385191
it seems like yet another API where 3 months are spent on the presentation and one week is spent on the code
 
2:23 AM
@MattMcDonald My experience is that most MIT grads can't write decent code in general. Great algorithms, great concepts, but crap code (and I've reviewed code from at least a few with PHD's from MIT)
 
user1385191
well, that's something to relieve my depression from going to a crappy college
 
granted, I've only seen code from about a dozen, so a generalization isn't in order, but none of them had what I would call clean code
then again, that doesn't mean their code is bad, so...
One thing was funny, a group from MIT came to present to my current company a "breakthrough" around TCP they came up with, looking to sell it to us. I was lucky enough to be invited
 
user1385191
the guy who wrote HTMLPurifier has a perfect GPA at MIT
 
user1385191
he wrote the thing in high school
 
user1385191
crazy
 
2:25 AM
2 minutes after the presentation I asked a question about security, and they gave a quick answer
then I realized the answer was wrong, and went to the white board to prove it and sent them back to the drawing board. That was satisfying
 
user895378
And then said, "BOOOYAH!"
 
user895378
(I added that last part)
 
user895378
The more code I write the more I think success comes from an ability to make the correct tradeoffs in your code, not from an ability to eliminate the necessity for them with a dazzling algorithm.
 
Well then, I shall show you some code; gist.github.com/2356458. Go ahead, laugh, it's okay.
 
nah, I was respectful. It was just funny how I was dismissed at first, then had them asking me how I saw that...
 
user895378
2:27 AM
@Chris Before I look, what exactly is it trying to do.
 
user1385191
I think success comes from an insatiable hunger to learn
 
user895378
@MattMcDonald That too.
 
@rdlowrey get everything after url/ and/or url/index.php/ regardless of being in root, subfolder or a folder inside a subfolder.
 
@MattMcDonald amen to that
 
user895378
@Chris Is there a particular reason why you're counting the number of slashes?
 
user1385191
2:31 AM
you're doing far too much with one variable
 
@rdlowrey That's the stupid part. I need to know whether or not it's in a subfolder and if it is, I'd remove the subfolder's name from the array so it would only leave me with everything after url/
 
user1385191
I'm trying to think if PHP can do a decisions table
 
@Chris , is that some sort of routing mechanism ?
 
somesite.com (3 slashes, root). somesite.com/subfolder (4 slashes, subfolder, unset first result of the array as it's a subfolder's name).
@tereško It sure is sir!
 
then $_SERVER['QUERY_STRING'] might be a better starting point
 
user1385191
2:33 AM
if this is any indication, you can do a decisions table:
 
ummm. absolutely it can
 
also , @Chris , why are you overwriting $uri four times ?
 
That's actually just a simple state machine
 
@tereško I don't like a lot of variables. But that's just me.
 
2:35 AM
 
user895378
@Chris You might find that reusing the same variable like that gets confusing. And if you don't, it certainly makes it difficult for other people to understand what's going on.
 
no , i mean , what you are trying to get is already in the $_SERVER variable
 
user895378
(or what's supposed to be going on)
 
you do not have to make it up on your own
 
i definitely don't understand what's going on :)
 
2:36 AM
magic =/
also .. why the static method call ?
 
gist: 2356458, 2012-04-11 02:26:12Z
public static function uri()
{
	/**
	 * A lot of fuzzing around to get to where we want. 
	*/
	$uri = parse_url($_SERVER['REQUEST_URI']);
	$uri = $uri['path'];
	$uri = trim(str_replace(basename($_SERVER['SCRIPT_NAME']), '', $uri), '/');
	$uri = explode('/', $uri);

	/**
	 * Count how many slashes there are in the base URL.
	*/
	foreach(count_chars(\Rawr\Rawr::get_config_value('url'), 1) as $i => $val)
	{
		if(chr($i) === "/")
		{
			$slashes = $val;
		}
	}

	/*
	 * Get rid of both index.php if it's in the request and/or subfolders
	 * I'm dumb and hence I have no idea how to make this shorter and sweeter. Maybe in the future.
	*/
	if(\Rawr\Rawr::get_config_value('index') === "")
	{
		if($slashes === 4)
		{
			unset($uri[0]);
		}

		if($slashes === 5)
		{
			unset($uri[1]);
		}

		if($slashes === 6)
		{
			unset($uri[2]);
		}
	}
	else
	{
		if($slashes === 4)
		{
			unset($uri[0], $uri[1]);
		}

		if($slashes === 5)
		{
			unset($uri[0], $uri[1], $uri[2]);
		}

		if($slashes === 6)
		{
			unset($uri[0], $uri[1], $uri[2], $uri[3]);
		}
	}

	/**
	 * Shabam!
	*/
	return array_values($uri);
}
@Eevee and consider that a good thing
 
you already have a namespace .. what is the point of slapping on a static class which would act like another namespace !?
 
@tereško I have no idea. I'm still learning the vocabulary.
 
i am talking about code like this : \Rawr\Rawr::get_config_value('index') .. its bad
dont do it
 
user1385191
so here's a simple decisions table:
 
user1385191
 
app objects rather than global state imo
 
user1385191
if you're passing data, you just need to ensure that each decision takes the same amount of params
 
user895378
@Eevee +1 for OOP over class oriented statics
 
I'm clad I joined this chat and kind of sad, too, but thank you is in order I suppose?
 
Yeah, we're rather against that here. it's a STUPID violation (specifically tight coupling and untestability)...
 
user895378
2:41 AM
@Chris If you're just trying to eliminate index.php from the URLs why not just use URL rewriting?
 
my cgi is rust; what ends up in SCRIPT_NAME, the entry point?
 
@Eevee the actual file executed
 
@rdlowrey Because URL rewriting is from the 90's. I don't want to use $_GET.
 
user895378
@Chris I'm confused ... I didn't realize you were looking for query string variables
 
> Contains the current script's path. This is useful for pages which need to point to themselves. The __FILE__ constant contains the full path and filename of the current (i.e. included) file.
 
user895378
2:42 AM
9 mins ago, by tereško
then $_SERVER['QUERY_STRING'] might be a better starting point
 
@rdlowrey , that's why i said that he is going at it from wrong end
 
user895378
Yeah, you're right. I see that now.
 
I already acknowledged what @tereško said and am working on it based on your advice :)
On all of your advice that is.
 
btw, to split that thing in parts , you should use preg
 
Why not use explode? (No need to explain, but if you can, please)
 
user895378
2:44 AM
Also, avoid static "helper" functions (as was mentioned). Those should fit in somewhere as methods of an object.
 
$pattern = '/(?:\/(?P<controller>[a-z]+)(?:\/(?P<action>[a-z0-9]+)(?:\/(?P<data>[^\/,;?\n]+))?)?)?/i';
preg_match( $pattern, $this->uri, $matches );
var_dump($matches);
this might be useful
 
Chee, thanks for reminding me that I need to learn the monstrosity that is regex.
 
@tereško in dire need of some /x
 
user895378
/x is for weenies. If it's remotely comprehensible it's not a good regex :)
 
user895378
hehe sadly, I think people actually believe that.
 
2:48 AM
somewhere on SO is a genuine HTML parser written almost entirely in a single Perl regex
someday i want to fix that "almost" bit
 
@Chris , actually in my case that regexp is generated from '/:controller[/:action[/:data]]' notation
 
Why I'm so bad at PHP? Because I've been wasting time with this nonsense: dribbble.com/chrisveto
 
@Eevee I haven't seen a single regex. I've seen multiple (a group of about 6)
 
@ircmaxell the one i'm thinking of is a whole program by tchrist, but the majority of it is one core regex
 
@tereško I just figured there's no better way to learn PHP than to try to write what I don't like - A framework. End goal is to have a fully functional one that's not dead-on-ugly and then delete it.
 
2:53 AM
Ah, ok
 
user1385191
you can learn without writing a framework
 
user1385191
most of my JS tutelage came from reading comp.lang.javascript
 
user895378
I'm going to assume this monolithic regex HTML parser was written in response to the pony, he comes
 
Yes, but with writing a framework I seem to learn way more functions than with breaking existing things.
 
2:54 AM
@Chris sure ... write one .. then read the PoEAA book , and then write another one that is better
 
user1385191
^^^
 
Also, I may or may not have to learn some code architecture (or engineering, or whatever it is)
 
no , you must
 
Yes, I just tried to make my failure sound a bit funnier.
 
user1385191
in fact, I've waited until I'm fully confident in my skill before writing an API
 
2:57 AM
well , the company i work in for , there are few "rails programmers" .. the do not even know what LoD is
.. and no , its not a Diablo2 expansion
 
LoD sounds to me like some illegal drug and Diablo2 sounds like a game.
 
Law of Demeter
ehh ...
 
Explain that to me when I finally have mastered the skill to write at least remotely decent PHP.
 

« first day (543 days earlier)      last day (4405 days later) »