Miss All Sunday

Suki's things and other stuff => Blog => Topic started by: Suki on October 20, 2011, 11:05:48 AM

Title: Thinking, code monkey and software architecture
Post by: Suki on October 20, 2011, 11:05:48 AM
I have this idea for a mod, a pretty large/huge mod, with some ideas floating around here and there, problem is, quoting Wikipedia (http://en.wikipedia.org/wiki/Code_monkey), I'm a code monkey, that is, unable to perform the more complex tasks of software architecture, analysis, and design.

Supposedly this week was all about this idea, it is Thursday today and I'm still stuck in the database schema and the code structure, with a single basic log file with ideas, a couple of empty Source files and a headache.

I've been there before, unable to perform this or accomplish that, however, a search on either SMF code or complex mods will give me a response, unfortunately, that does no apply for this scenario.

Maybe I worry about this just too much, dunno, its just that I want this idea to be the mod rather than just "one of several options available".


Background.

I've been using the latest mods as some kind of preparation for this idea, facing issues and code implementations.  New things learned and implemented with every mod will be present here so, in a way, this will be a compendium or a summary of  things learned, all things, the good ones, the bad ones and the newbie ones.


Motives.

simple, to know if I can do it, once done, to know if I can improve what I already did, and so on.

Ideas.

A bunch, but I will wait until I have something worth to be published, you never know, all of this sounds all dandy and stuff but there's always a chance for all of this to be either forgotten or just dropped.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on October 20, 2011, 07:58:13 PM
OK, an update,  yes, that soon  8)


I started to work on the Main function, the admin interface and the hooks, somehow manage to avoid any file edits at this point and since the base is done, it is most likely that this mod will be hooks only.

It's not going to use $config_vars  and prepareDBSettingContext() but instead will use its own set of settings on it's own settings table, which means I will have to write a whole new template but thats OK, I don't want to use the admin settings templates, those are limited and aren't exactly what I'm looking for.

Did some research and found some nice tuts and examples for the vast majority of JavaScript things I want to implement, /exelent fortune
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on October 21, 2011, 06:43:57 PM
Another update.

Today was all about finishing the templates for the admin interface, me no like writing templates, it isn't finished yet, but the basics are there.

Started to work on the logic for the logs, logs will be very important for this mod, I want records of everything  :P

Weekends are PC-free for me, so I'll work on this until Monday, I just hope by then I still have the same enthusiasm.
Title: Re: Thinking, code monkey and software architecture
Post by: vbgamer45 on October 25, 2011, 03:47:59 PM
Site looks great, the theme one of the nicest ones I seen in SMF 2.0, the mod site.
A couple things I learned from modding use a base that is what I did for a lot of my projects then adapted it for each other mod so less coding is needing. Check out what other people do but code it yourself.
Keep things simple. I made most of my mods using only a couple php commands and SQL calls and that is really all I need to do to get things done and makes it easier for others to follow your code. Better to get something released early then never to get release at all and you can also patch as needed. Worked for me was able to star at couple million dollar internet companies and allows me to work on many many projects at one time.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on October 26, 2011, 10:02:43 AM
Thank you.  I do like my site  ;D

Yes I do have a base, I have a simple generic package-info.xml as well as a generic install.xml and some language and template files, lately I build a simple class to handle basic queries such as insert, edit, delete, count, update, etc, its still very basic but it has helped me to reduce coding time.

As for looking on other peoples work, I'll do that all the time :P , mostly when I have issues I can't resolve or to see how X mod/mod author handled X thing.  Unfortunately this does not apply for this specific project as I haven't see any similar mods, perhaps the closest one would be ultimate profile mod.
Title: Re: Thinking, code monkey and software architecture
Post by: Norv on October 29, 2011, 07:42:10 AM
I have this idea for a mod, a pretty large/huge mod, with some ideas floating around here and there, problem is, quoting Wikipedia (http://en.wikipedia.org/wiki/Code_monkey), I'm a code monkey, that is, unable to perform the more complex tasks of software architecture, analysis, and design.

I have to reply (oops forgot the quick one, but I'd preview anyway so full reply is fine this time, lol).

I should note first I don't agree with the derogatory accent in that article. I've seen the term used as "doing anything with the code and loving it". (that doesn't imply - at all - that it will be the best thinking for the future, but it doesn't necessarily mean it won't). IMHO. While a certain level of design and architecture experience come in time and will improve the quality of code, they're not the same thing IMHO. I can see how in some cases a code monkey is just great for what they do.

Anyway. This hit home. In inverse sense. I'm not a code monkey even in the second sense, I don't spend as much time with coding itself, as much as analyze and design (anymore, for a few years maybe, or perhaps "a few" means several). But while you can require programmers architecture and design experience in time, and you should require software architects to go to the damned code too, not only create beautiful models in their mind, lol, they're actually, IMHO, two different roles.
In the industry it becomes more often in the late years, to actually have different jobs for programming and respectively software architecture (modeling) or even analysis. It's not a random movement, IMHO, and nothing to feel bad about, when one feels they belong more to one than the other.

/off topic, but it hit home and I had to say it. :D
Title: Re: Thinking, code monkey and software architecture
Post by: Norv on October 29, 2011, 08:16:51 AM
It's not going to use $config_vars  and prepareDBSettingContext() but instead will use its own set of settings on it's own settings table, which means I will have to write a whole new template but thats OK, I don't want to use the admin settings templates, those are limited and aren't exactly what I'm looking for.

I'd be interested to know in which way they're limited, and why aren't they suitable for the purpose. Not saying they should be, I'm simply wondering.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on October 29, 2011, 07:33:59 PM
It's not going to use $config_vars  and prepareDBSettingContext() but instead will use its own set of settings on it's own settings table, which means I will have to write a whole new template but thats OK, I don't want to use the admin settings templates, those are limited and aren't exactly what I'm looking for.

I'd be interested to know in which way they're limited, and why aren't they suitable for the purpose. Not saying they should be, I'm simply wondering.


Is not about been limited per se, its just they are limited for what I'm having in mind, I was talking about the templates itself rather than the functions, I do want to have a custom settings page (with some divs, some javascript, some design, etc) and not just the classic settings page with a couple of check boxes and a save button.

It is true that having my settings in a separate table will generate an extra query in every mod's page, its precisely why I said the code monkey thing, perhaps having a separate table is not the "bestest" ( :P ) thing for performance, I have no idea.

The same thing happens with the database schema, perhaps there is a better way of doing things, I just don't know those ways, I do what I know.


I only knew the "derogatory" way, and perhaps I am mixing terms here, me does not do code for living.

Title: Re: Thinking, code monkey and software architecture
Post by: Suki on October 31, 2011, 07:09:53 PM
OK, today I had some free time, actually, I had a lot of free time :P

Been working more on the basics,  I didn't get to far, blame goes to Dawson's Creek season 6 DVD :P

Logic for admin and logs are almost done, it surely needs improvements but I can't go any further until I have other stuff done, at the same time I can't go any further on other stuff without the logs been completed. This means I need to work on two things at the same time, I don't like that, makes me feel like I don't pay enough attention to neither of them and I always end up losing focus.

Anyway, I decided to go with OOP, I still cannot test it locally so I have no idea if this will work or not.

¡Felíz día de muertos! (http://en.wikipedia.org/wiki/Day_of_the_Dead)  :)
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 02, 2011, 07:14:46 PM
In an attempt to keep me focused, motivated and most important, to learn how to use git  :P  I created a repository for this mod at github: https://github.com/MissAllSunday/Breeze  with all I have so far.

I don't like to type commands, hopefully git for windows have a GUI <- whatever that means :P


So, the secret is not so secret anymore, The initial commit does give a vague idea of what I want and how I want it.

Of course, reviews/comments/ideas/improvements are more than welcome, just keep in mind that this hasn't been tested yet, it will probably change a lot once I Installed it on a vanilla SMF installation.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 06, 2011, 06:40:55 PM
I'm being doing some commits lately, basically changing stuff or adding some ideas for functions,  I was thinking on going with a json encoded array stored in a text field for the "likes", then I realize how painful would that be when editing/updating, I ditched that option and went with a regular table instead.

Apparently you can't call a static method from a string:

$var = 'ClassName::MethodName';

$var();

You can, however, do this using call_user_func()  however, SMF does not use that so I will have to code the admin interface in procedural, not a big deal, also, I ditched the separate settings table and went with a regular $modSettings thing.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 08, 2011, 07:39:31 PM
OK, it seems like I'm on track again, after some doubts on my head regarding mostly ways for handling stuff, it looks like I found some ground.

I still don't quite finish the admin stuff, I don't really like writing admin interfaces, I want to jump straight to the status/comment stuff... way more fun  but I know I need to get the admin stuff done before I start with other things.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 09, 2011, 06:44:58 PM
Another update.

I finally finished the admin stuff, well, of course its not 100% completed but at least its functional, now I only need to refine it, I'm sure I will add plenty of more stuff to those pages but for now its OK.

With that said, I can finally move to the Wall stuff, today I started by setting the general wall template and replace the summary profile page with the one from this mod, I should probably split the templates, one for admin stuff, one for the general wall and one for the user wall.
Title: Re: Thinking, code monkey and software architecture
Post by: Norv on November 10, 2011, 06:49:38 AM
Nice to see how it's all coming together! Great job over there, MAS One.
In particular, factoring and refactoring for a better is unbelievably soothing for the eye. Don't be afraid to try paths, make them work, find better ones, change, move forward. :)

Speaking of general wall... what exactly is a general wall?
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 10, 2011, 02:52:23 PM
Well, according to my head, a general wall will be a standard SMF page (?action=wall) where you will be able to see your Buddie's status and recent activity.  It sounds so fancy in my head :P


I've been been doing more template stuff, my idea was to use css3 and custom color/design, then I realize that its just not possible, people should be able to use this with their own theme. So I went with the default css stuff.

And here it is... the very first screen shot of Breeze mod in action.

Yes I know the css its far from pretty, I just needed a "working" template,  the prettify session will have to wait for now.

[attachment deleted by admin]
Title: Re: Thinking, code monkey and software architecture
Post by: Norv on November 10, 2011, 07:09:14 PM
Ah. I would assume then, that your ("user") wall is for your own messages/statuses... if I understand correctly. If I may put it this way, it's more a la G+ than Facebook (as far as the general description goes) I guess. Afaik on Facebook they're all dumped on the same page with your own status posts. (disclaimer: I'm not really a FB user so I might have missed obvious things).
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 11, 2011, 04:54:31 PM
Well, I don't know how G+ looks like, all my friends use either facebook or hi5 so thats the only social networks I use and know.

I'm not planning on copy facebook features (I'll be crazy if I do :P) I have a vague idea of the features this mod will have, for example who has visited this profile, maybe a buddy list, a recent topics/messages made by this user, dunno, things like that.

meh, this ajax stuff surely is a ride!   the send data to the server/return it its easy, the difficult part comes when I have at least 2 textareas,  1 is the main "post a status" textarea, the other one its the "post a comment", of course it will be one "post a comment" textarea for every status.

Now I can't possibly write a bunch of JavaScript functions for every textarea out there, its impossible since I don't know how many textareas would be and even if I did, its just bad coding.

What I need to do is write a single JavaScript function capable of "knowing" whats the textarea that is been used and send the parameters to the server according to the textarea type(specially the div where the status/comment will be posted), unfortunately, my JavaScript skills aren't up to the challenge, this may take a while to accomplish...

I'm gonna use this:  http://malsup.com/jquery/form/#ajaxSubmit

pretty much has everything I need, I just need to know how to  make it work with multiple textareas.

I need to figure it out how to set the target if the user is posting an status or replying to the status number x.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 13, 2011, 09:38:03 PM
OK, instead of using http://malsup.com/jquery/form/#ajaxSubmit   I think I will go directly with jquery ajax()  it will be easier to return a javascript function on submit with all the parameters I want for each form, I couldn't work on this this weekend, hopefully I will made some progress this week.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 14, 2011, 08:13:23 PM
After struggling with JavaScript I finally was able to make some progress.

I will going to use two main JavaScript functions, one for the status form and another one for handling all the comments forms.

I just finished the status one, after testing here and there now its time to take that data and stored to the database, lots of fun queries to write next!!

heres a screen shot of a very very raw status form, of course its missing the like, the comment and the delete links but it will give a vague idea of how it will look like.

(http://missallsunday.com/dlattach/attach.12/image./blog/thinking_code_monkey_and_software_architecture_59.0.html)

[attachment deleted by admin]
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 15, 2011, 06:09:16 PM
Another date, another update :)

I finished the status code, built yet another class (Breeze_Data) to handle the DB insert and another useful functions like notifications and writing logs.

Even though the mod does not have any permissions checkings or conditionals, the code its getting more and more big, specially on the templates, its becoming a maze... a hazardous zone full of bugs ready to give me headaches...

As always, heres a screen shot of the work I did this day ;)

[attachment deleted by admin]
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 16, 2011, 10:28:16 AM
Today I got a free day from office, which means lots and lots of free time :P

so far I coded some validations for the status box, I'm using this notification system which is pretty cool:  http://www.9lessons.info/2011/10/jquery-notification-plugin.html

Code: (Sources/Breeze/Breeze_Data.php) [Select]
public function Check($value)
{
$pattern = '/error_/';

if (preg_match($pattern, $value))
return false;

else
return true;

}

Code: (js/breeze.js) [Select]
$.ajax(
{
type: 'POST',
url: smf_scripturl + '?action=breezeajax;sa=post',
data: ({content : test, owner_id : ownerID, poster_id : posterID}),
cache: false,
success: function(html)
{
if(html == 'error_')
{
showNotification(
{
message: html,
type: 'error',
autoClose: true,
duration: 5
});
$("#breeze_load_image").hide();
}
else
{
$("#breeze_display_status").after(html);
document.getElementById('content').value='';
document.getElementById('content').focus();
$("#breeze_load_image").hide();
showNotification({
message: 'Show Ajax result message here!',
type: 'success',
autoClose: true,
duration: 5
});
}
},
error: function (html)
{
// Error occurred in sending request
showNotification(
{
message: html,
type: 'error',
autoClose: true,
duration: 5
});
},
});

Code: (BreezeAjax.template.php) [Select]
if ($context['breeze']['validate'] == true)
echo $context['breeze']['post']['status'];

else
echo 'error_';

Breeze_Globals::see('var');  returns error_var  if something is wrong so preg match looking for error_ is enough,  of course it can be more complicated, for example error_breeze_var  in case someone wants to post an status like this: error_something



BTW, that website also provides a solution for the multiple forms and I'm using it on this mod:

http://www.9lessons.info/2009/06/submit-multiple-forms-jquery-ajax.html

quite useful!
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 16, 2011, 08:25:34 PM
-Implemented facebox, now you can click on the user avatar (or the name if they  don't have an avatar) and a nice light box will appear with some relevant info about the user.

-Changed the way jquery is loaded since it was having issues with chrome and firefox not detecting jquery.

-Built another generic class Breeze_UserInfo to handle the, well, obviously the user info :P , is nothing more than a function with an $id parameter, it returns a bunch of html code, it's there mainly because of my laziness and refusal to write duplicate code.

-Some css changes regarding how the user info is displayed.

I  think thats about it :P

As usual, heres a screen shot, this is what you will see if you click on someone else's avatar.

[attachment deleted by admin]
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 17, 2011, 04:38:47 PM
-Done with the comments code.

[attachment deleted by admin]
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 18, 2011, 04:41:28 PM
Done with the deletion code, on both the comments and the status, on to the like/unlike system I go!!

Paste bin url: http://pastebin.com/Ee27NVLN

LOL I forgot about the pastebin BBC, time to use it ;)
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 18, 2011, 06:59:18 PM
I've been thinking, before doing any action, the code needs to check if the comment or status still exist.

This is particularly important in busy forums or where there are multiple users viewing a single profile.

The mod currently does not have the ability to notify actions "on the fly" (and probably will never have such feature) that is, if an user deletes a comment, the other user viewing that comment does not have any idea that it has been deleted until he/she refresh the page, thats why its important to perform a check and see if the comment or status exist.

I'm thinking on a function that will load all the comments or the status,  not the entire data, only the id, store that info in an array as $k => $v   and then perform the check by doing an in_array()  with the id of the comment/status and array_keys(), if found, perform the query, if not, return an error.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 20, 2011, 01:14:56 PM
-Implemented the validation system.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 22, 2011, 05:44:55 PM
-Implemented livequery plugin, some ground for the like system:

https://github.com/MissAllSunday/Breeze/commit/61c4185072cb7f0698fbf4205fca6eb5a0bbe412

Its quite broken at the moment, I still haven't decide how exactly this like system is going to work...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 23, 2011, 05:35:23 PM
re-building the main template, ditched the like system, it just not worth the hassle...

https://github.com/MissAllSunday/Breeze/commit/1cd2665cb2b9536c3e95941457a6564034e67aa1
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 28, 2011, 07:49:31 PM
https://github.com/MissAllSunday/Breeze/commit/b465d1a7a792697f18346c34a9e64b53eb7c8e5a

Built some modules:

-latest visitors
-buddies

I also built the modules system, its pretty simple, a class with several methods, each method returns an array, title and data, then when the class is initiated we load and call every method on to a context array, finally, the template do a foreach and display the title and data with some html.

I'm a little worried about the number of queries  :-\
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 29, 2011, 08:36:18 PM
https://github.com/MissAllSunday/Breeze/commit/09910ea7306450f50bb5a6dd60ba6195c997be53

-Implemented some code to reduce the queries per page.

Thanks goes to emanuele for showing me the correct path!
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 02, 2011, 07:11:10 PM
-Some template changes, xml stuff (package-info.xml), DB schema updated
Title: Re: Thinking, code monkey and software architecture
Post by: Norv on December 02, 2011, 07:31:20 PM
I played quickly with your test installation, MAS One. Nice stuff. You has some comments around there. :)
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 09, 2011, 02:55:03 PM
I've being working on the parser, so far its a simple class:

Paste bin url: http://pastebin.com/AxpCba5S

I still need to modify  "remove" method a little bit to accept an array as the value to be removed, I also need to test the regex for the urls, oh well, at least there are spaces and new lines now.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 15, 2011, 05:27:22 PM
OK, I added the "mention"  thing to the parser, basically it works like this:

on either any status or comment, if some user types {Miss all Sunday}  it will be converted to @Miss All Sunday (http://missallsunday.com/profile/miss_all_sunday_1/)

This will also include some options like to be able to send a pm to the user mentioned (if that user allows it via a user setting)

I'm now heading to the "per user"  settings, for that I wrote a simply form generator class, the class works like this:

Code: [Select]
$FormData = array(
'action' => 'profile;area=breezesettings;u='.$context['member']['id'],
'method' => 'post',
'id_css' => 'test',
'name' => 'test',
'class_css' => 'test',
'onsubmit' => '',
);
$form = new Breeze_Form($FormData);
$form->AddCheckBox('check','1', 'this is a checkbox', false);
$form->AddSelect('select', 'descripcion', $values = array(
'key1' => 'opcion 1',
'key2' => 'esto'
));
$form->AddText('text', 'ohai', 'this is a text description');
$form->AddSubmitButton('submit','Enviar');

and then use $form->Display(); to show the form, it covers the following:

-Text
-Select
-TextArea
-Checkbox
-Submit button

but it it's fairly simple to add more cases as needed.

I'm going to use this class to generate the users form and possible replace the forms for the status and comments.


I've been thinking about adding a token for every form.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 16, 2011, 08:21:15 PM
Been working on the user settings, as I added more options I was changing the form generator class more and more and eventually I moved all text strings to the class so, for example, calling a checkbox went from this:

$form->AddCheckBox('check','1', 'this is a checkbox', false);

to this:


$form->AddCheckBox('enable_buddies', 1, array(
'enable_buddies',
'enable_buddies_sub'
), !empty($data['enable_buddies']) ? true : false);


Here's a screen shot of how the form looks like when it's been used:

(http://missallsunday.com/dlattach/attach.20/image./blog/thinking_code_monkey_and_software_architecture_59.0.html)

Looks pretty much the same as a regular form created by SMF :P

Eventually I will create 3 subpages:  general settings, permissions and modules and move out the different options to its own page.

[attachment deleted by admin]
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 25, 2011, 05:13:18 PM
I Haven't made any big changes lately, I'm just not interested enough at the moment, perhaps I'll get some motivation next year  :P
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 26, 2011, 04:58:38 PM
Should I hijack the buddy action and rewrite the buddy system?
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 09, 2012, 12:36:41 PM
Should I hijack the buddy action and rewrite the buddy system?


Maybe for the next version.


It's been some time now, can't really remember where I was or what I was doing in terms of coding breeze, I got distracted by old mods and then the mod site... I really really want to publish this so, all the other stuff will have to wait I guess...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 09, 2012, 12:48:45 PM
Going back in time and reading old code I realize I need to give much more importance to performance and stop making queries so lightly.

What I was thinking is a sub class to handle the queries, use $context or whatever other variable to store the results and call that variable first instead of directly call the query.

I'm worried about the ajax parts, for example, if an user wants to delete the status (s)he just made, for deleting I use array_keys to make sure the status/comment do exist, however, if I use the data stored in $context I wouldn't be able to use that unless I add the newly created status/comment on the very own class that handles it's creation.


I'm also not so pleased with the way the modules are been handled, there's gotta be some better way to do it.


With that being said, I guess I won't be adding new features, at this point I just want the code to be stable enough for public testing, things like the general wall or even the gallery will have to wait for the next version I suppose.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 15, 2012, 12:58:43 PM
OK, I began with the Query class, in theory this class will include all possible queries needed by the mod, that is, no other method or class should call the DB class anymore.

I'm trying to build it as general as I can and not be so dependable on parameters, it seems I will end up having quite a lot of methods...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 15, 2012, 03:41:07 PM
meh.... is it too late to start over?

I don't want to start over but there is some things that needs to be done in a different way...

Centralizing the queries made me realize I got a bunch of queries everywhere and most of those queries are "custom made"  for specific methods...

Argh!!!  this happens when you don't think things well enough before start to code...

Disappointed?  Yes, very much, because now I have to dump most of the methods or even entire classes and rebuild all from scratch... Wherever file/class/method I see I want to re-build it, damn it! all those months for nothing! 

And what will happen if I start over again, build all the classes again and six months later I want to re-build all over again because the way I wrote it back then is just fugly?

Fuck it, I'm off.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 23, 2012, 12:15:12 PM
OK, I'm going to re-write this again... hopefully this will be the last time.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 26, 2012, 06:45:37 PM
I've been working on the rewrite the past few days, it's been a pain but is been a lot more easier/faster than I thought it would be, still there are a lot of things that need attention but so far it looks promising :)
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on February 04, 2012, 01:35:18 PM
I should make an update about this :P

I've been re-written a lot of stuff and cleaning all the queries (those things are everywhere!) and put those in the main query class, of course written some methods for those queries too.

I removed a lot of stuff (permissions, user settings, modules), but at the same time I want to be able to add stuff later easily, that's why the query class have some methods that won't be used on 1.0 but will help me to build things for later versions.

The ajax stuff is done, the status/comments part is done too, the per user settings page is also done and working, all of this stuff is using the query class already.

The status and comments are now into 2 different arrays, I will place a limit to let admins decide if they want to reduce the array size by only fetching status/comments from last day/week/month even year, hopefully that will help with very big boards.

the Admin settings are also set, so I'm working on implementing those settings and the per user settings on the code, after that I'm planning on adding some improvements to the templates and then some testing with dummy data.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on February 05, 2012, 04:59:09 PM
OK, I finished porting the logs (visit log) to the query class, and implemented a single module (profile visits module)  which kinda works :P

I'm now one step closer to offer an alpha, that makes me happy, I'm still need to implement some permissions (to post new status/comments, to delete any status/comment)  and I need to do some design stuff.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on February 18, 2012, 03:45:19 PM
OK I'm a little more closer to a beta release.

I changed some stuff in the JavaScript to show the notification bar only after the message is displayed.

Implemented a pagination based on an array: http://www.codehive.net/PHP-Array-Pagination-10.html  I rewrote it almost entirely to convert the function to a class and to changed the code style to something more familiar with Breeze and SMF in general.

Implemented the permissions, there are 3 permissions, to post status, to post comments and to delete status/comments  all of them are for external walls, that is, every user is able by default to post comments/status and to delete any post/status on their own wall.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on February 20, 2012, 07:20:59 PM
So far, so good.

I implemented the limit on the queries for both status and comments, that is something I wanted to do for a really long time and now is done, I'm still worried about the size of the arrays, thats why the limit is for, hopefully it will help to reduce the issues on big forums or very limited servers.

Now I will focus on the admin page, specially the feeds one, I haven't setup the boards to fetch the news from on this forum, will do when I publish a beta or something, still, the page needs some work, it's blunt and doesn't have any info on at the moment.

Since I added a check before install, there is no point in showing the php version on that page. gotta decide what to actually put there lol :P  maybe I should relocate the whole "donation" page and move that to below the feeds news.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on February 20, 2012, 07:25:03 PM
oh! and I definitely need to update the install.php file, I've added some new rows and changed a lot of the table's structure.

I also rename all the copyright text from 2011 to 2012 since, well, this will be released (me thinks) on 2012 <- I definitely do not want to change the year again :P
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on February 23, 2012, 09:36:48 PM
So, finally breeze is Beta, 4 months after the first post (http://missallsunday.com/blog/thinking_code_monkey_and_software_architecture_59.msg179.html#msg179) when Breeze was just an idea and I had absolutely no idea about OOP.

Even if this mod is not that popular, I learned a lot, from PHP OOP and JavaScript to git and github.

It's been fun :)
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 04, 2012, 07:25:32 PM
I've been thinking on the notification system, I have no idea on how I'm going to implement it...

I have some code and a few ideas... basically, its a new table with the following:

- ID
- user
-type
-time
- content


Where content is a json string that contains data that depends on the type value.

This values should have short life spans, after all, the notifications will be deleted or perhaps marked as "read" once they are displayed to the user.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 11, 2012, 10:47:49 AM
So far so good.

I made some improvements to the template and do some changes to the js file, it is more stable now.

I have a pretty well defined idea on how the notification system will look like, unfortunately I haven't find the time to actually build this idea :(
Title: Re: Thinking, code monkey and software architecture
Post by: live627 on March 11, 2012, 12:30:58 PM
Time.... something we're all short  of...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 15, 2012, 04:47:30 PM
Ah yes, some people manage that by cutting down sleeping hours, unfortunately I can't do that, I need to sleep my hours otherwise I don't function properly :P
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 03, 2012, 11:36:24 AM
I just realized that Breeze isn't following proper naming and all that stuff, oh dear, there is a lot of changes to do!

On another note, I've been using Aptana Studio 3 for small projects, so far so good, I haven't used any IDE before so this is all new stuff for me I'm dying to try it out with Breeze but I haven't had the time :(
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 05, 2012, 10:06:43 AM
There is still so much I want to do but there is so little time :(  it is frustrating, thing after thing happens and I can't go back to work on this
Title: Re: Thinking, code monkey and software architecture
Post by: Nightwish on April 07, 2012, 10:57:40 AM
I just realized that Breeze isn't following proper naming and all that stuff, oh dear, there is a lot of changes to do!

On another note, I've been using Aptana Studio 3 for small projects, so far so good, I haven't used any IDE before so this is all new stuff for me I'm dying to try it out with Breeze but I haven't had the time :(
Pesonally, I wouldn't go with Aptana, just for the record :)

Looks nice at first glance, but has some major drawbacks. Unless you have a very fast computer, it will get unbearable slow when working on larger projects (and yes, the SMF code base is already a large enough project to bring Aptana to its knees). Also, its refactoring features are rudimentary at best, so you'll not benefit much from using it for your renaming tasks (some search and replace might work almost equally well :) ).

Recommendations?

Netbeans (http://netbeans.org/) (+ PHP plugin), if you need an absolutely free and open source IDE, or Phpstorm (http://www.jetbrains.com/phpstorm/) if you want a full featured IDE for PHP/HTML/SQL/Javascript development. Phpstorm is not free, but you can get a trial and they give out free licenses for open source developers (you just need to show them you're either the owner or a contributor to an active open source PHP project).

All these major PHP IDEs are written in Java, so a reasonable fast computer is a requirement unfortunately. There are more lightweight ones like nusphere PHPEd (it's basically great and lots of people are recommending it, but unfortunately, not a free product).

Some interesting alternatives are online IDEs for PHP, like cloud9 ide (http://c9.io/) - free for open source developers and kinda cool, because since everything happens online, you could even work on your phone or your tablet while you're not at home (yeah, I know, crazy stuff, but still cool). Another cool thing with cloud9 is that you can sign in with your github account and the ide will more or less automatically integrate with all your github repositories.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 07, 2012, 02:56:50 PM
Oh, thanks for the recommendations!

Yes, the more I used Aptana the more I want it to go back to good old notepad++ :P

Yes, I kinda need it to be open source, god money hasn't smiled at me in months :(

And unfortunately I don't have a powerful machine, I manage to do all my stuff on a 1.8GHz laptop with 2GB RAM.

I'm gonna try Netbeans even tough its gonna be slow on my machine, my projects aren't that big yet so I think it will be OK for the moment.

cloud9 sounds interesting indeed, gonna try that as well.
Title: Re: Thinking, code monkey and software architecture
Post by: Norv on April 07, 2012, 05:17:52 PM
I keep hearing about Netbeans the past couple of years, for PHP, and I haven't got around to try it yet again. I've been using it some years ago for Java projects, apart from studying its implementation and architecture as an IDE. I found it quite heavyweight at the time, though that's quite a number of years ago. Should try again sometime. I'm quite surprised by the times I hear about it as some sort of alternative to heavyweight IDEs... or it seems to me suggested as such. My poor ole' memory says the opposite. :D

Personally, I'm an Eclipse addict. (Zend build for PHP http://www.zend.com/en/community/pdt)
However, I cannot exactly recommend it because it can eat up quite a lot of resources, on a machine around these specs (mine are not far from them, either). After a number of plugins loaded and projects opened, it can be quite a hog. But a cool hog, lol.

For a long while, I use Geany in addition (there's a Windows version for it, too). It's presented as a "a lightweight IDE", though that seems an over-statement. Personally I use it practically like a handy and smart code editor only. It's several steps "in front of" Notepad++ in terms of features, though it doesn't get close to the features of an IDE.

I've been giving a try to PHPStorm (at Nightwish's recommendation elsewhere, actually), and I like it. Although for some reason, during a normal work session I seem to have one or two projects in PHPStorm and the other dozen in Eclipse, heh.

I'd be curious how Netbeans works for you, MAS One, maybe I'll beat laziness (and memories lol) one day and give it another try.
Title: Re: Thinking, code monkey and software architecture
Post by: Nightwish on April 08, 2012, 06:25:09 AM
I keep hearing about Netbeans the past couple of years, for PHP, and I haven't got around to try it yet again. I've been using it some years ago for Java projects, apart from studying its implementation and architecture as an IDE. I found it quite heavyweight at the time, though that's quite a number of years ago. Should try again sometime. I'm quite surprised by the times I hear about it as some sort of alternative to heavyweight IDEs... or it seems to me suggested as such. My poor ole' memory says the opposite. :D
Netbeans is ok. It is not more or less lightweight than Eclipse, but the PHP part of Netbeans feels less bloated and generally faster than either Aptana or PDT on Eclipse.

Netbeans has undergone a major redesign a couple of years ago. Older versions (prior to 4 or 5, I think) were horrible, especially in UI design and general user experience, but starting with version 6, it became a much better overall experience.

Quote
Personally, I'm an Eclipse addict. (Zend build for PHP http://www.zend.com/en/community/pdt)
Well, I'm (or better was) an Eclipse addict as well. There is nothing wrong with Eclipse, it's a fine IDE, especially for Java (and surprisingly, for C/C++ with the CDT plugin), but for PHP, it's just lacking. I even tried Zend studio (which is based on PDT) and we didn't became friends, because it was so bloated and unbearable slow, even on a fast quad core machine :)

Personally, I'm a fan of Jetbrains products, mainly because their code editors are years ahead of everything else. IDEA (for Java, PHP, Ruby, Python, Javascript, general web development and much more) and PhpStorm (which is basically a stripped down IDEA for PHP and web development only) are both excellent choices, though IDEA is definitely overkill for someone who only needs PHP and web development features.

Quote
For a long while, I use Geany in addition (there's a Windows version for it, too). It's presented as a "a lightweight IDE", though that seems an over-statement. Personally I use it practically like a handy and smart code editor only. It's several steps "in front of" Notepad++ in terms of features, though it doesn't get close to the features of an IDE.
Well, sometimes, I'm just using vim and a shell and that's enough for a lot of tasks :)
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 11, 2012, 10:43:16 AM
I've been trying Netbeans, so far not so good.

I'm a control freak and I need to know and see the spaces and tabs on each line, I'm using Netbeans 7.1.1 and although they say you cna enable the tabs by going view > show non-printable characters  that's not true, at least for me, it doesn't show neither the spaces or the tabs.

It may seems trivial but somehow not be able to see the tabs just make me uncomfortable and not in the mood for coding.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 14, 2012, 04:27:34 PM
Another thing on using NetBeans, I usually work on files directly located on my local xampp installation, this allows me to do changes and test them right away, when I  finished with some feature or just want to save the work made so far, I copy all the files (or just the files I modified) Breeze use to my folder where I keep the git repository.

By using Netbeans I will have to work on the files in the git repository, meaning that I would need to copy those files to my localhost folder every time I want to test things.

I know Neatbeans can run code, however since Breeze isn't a standalone script I can't really do that unless I load the entire SMF on my project somehow.
Title: Re: Thinking, code monkey and software architecture
Post by: Nightwish on April 15, 2012, 11:18:11 AM
Another thing on using NetBeans, I usually work on files directly located on my local xampp installation, this allows me to do changes and test them right away, when I  finished with some feature or just want to save the work made so far, I copy all the files (or just the files I modified) Breeze use to my folder where I keep the git repository.
You could probably use Netbeans' deployment feature to upload (or copy) files to a deployment directory (which would be the local git copy in your case).

That's how I have setup my environment. I have only one single copy of my project (my local git repo). Whenever I need to sync it with the live site I sync my local repo with my server directly in the IDE and it will upload the modified files via SFTP to my live server.

Quote
By using Netbeans I will have to work on the files in the git repository, meaning that I would need to copy those files to my localhost folder every time I want to test things.
Do it the other way around. Work and edit on the files on your local server and just sync with your local git repo when you're ready to commit, OR edit in your local git repo and deploy the files to your local server - I believe, it's even possible to sync automatically, so when you save the file in the IDE, it's automatically uploaded to the test site.

Here (http://netbeans.org/kb/docs/php/remote-hosting-and-ftp-account.html) is a bit about that feature.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 15, 2012, 08:05:53 PM
Thanks for the tip! :D, I somehow manage to run the code on my local server, there is just a small conflict, although Breeze is mostly hooks only, there is some file edits, mostly in Sources/Load.php and sometimes I need to modify those files but I guest that is a small glitch, I can do the edit on notepad++, test it and then add it to the .xml file, another glitch is that the IDE doesn't copy the files to my local server, thus I cannot test it with a regular user account and when I run the code from the IDE it shows as guest (which is a problem since Breeze isn't intended for guest :( )

I still find it weird not having the tabs, I configured so all the unnecessary spaces and tabs get removed on saving, however I still don't feel comfortable editing code there, too many options :P 

Edit, OK I finally managed to configure it like I like, that is, use tabs, tab size is 4 and do line breaks if the line is too large, it still shows the horizontal scroll bar, dunno why, to me it's just space wasted.

I'm still trying to configure the git thing, I'm still learning a lot of git stuff so I probably will just use the git GUI for now.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 17, 2012, 12:09:35 PM
OK, I made some progress, it seems netbeans cannot copy the files to my local folder but with a batch file I can do that just fine.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 17, 2012, 09:10:10 PM
Some more rants.

One thing that annoys me is the Trailing Whitespace an empty lines with only tabs or spaces, in notepad++ I even created a shortcut for that and I was constantly using it.

With neatbeans I can't find a way to do it (via short cuts) and the option to remove the Trailing Whitespace on save doesn't really do that, I save the file with netbeans, go and open the same file with notepad++ and there is a lot of lines with tabs only :(  for a control freak like me, that isn't good.

On Notepad I had a custom shortcut Ctrl + Alt + q to insert a comment: /* Comment */  and with netbeans there is only a single comment // and the shortcut is weird: Ctrl + /  how exactly could I type / ? I usually do shift + 7 but non of the combinations seems to work.

A list of shortcuts: http://kdelchev.com/2012/02/netbeans-eclipse-pdt-shortcuts-comparison/

funny, the shortcut for comment in eclipse does work on netbeans: Ctrl + Shift + C, however it places the // first, then tabs then the comment when it should be tabs // then comment :(

In resume, I am finding very frustrating the switch from notepad++ to an IDE, the only thing I did on this past week was configuring netbeans...

Title: Re: Thinking, code monkey and software architecture
Post by: Nightwish on April 18, 2012, 06:33:15 PM
One thing that annoys me is the Trailing Whitespace an empty lines with only tabs or spaces, in notepad++ I even created a shortcut for that and I was constantly using it.

With neatbeans I can't find a way to do it (via short cuts) and the option to remove the Trailing Whitespace on save doesn't really do that, I save the file with netbeans, go and open the same file with notepad++ and there is a lot of lines with tabs only :(  for a control freak like me, that isn't good.
I guess, that comes from the auto-indent feature. It may indent empty lines when the previous line was also indented - yes, that's totally stupid and doesn't make sense, but I have seen this in quite a number of other editors as well.

Quote
On Notepad I had a custom shortcut Ctrl + Alt + q to insert a comment: /* Comment */  and with netbeans there is only a single comment // and the shortcut is weird: Ctrl + /  how exactly could I type / ? I usually do shift + 7 but non of the combinations seems to work.

The default keyboard shortcuts are probably configured for an english keyboard where the / key is easily reachable. That's why many programmers prefer to work with an English keyboard layout even when their native language isn't English (like myself, I normally use english keyboard layout for programming, simply because so many important characters like / \ [] {} are much easier to type).

Quote
In resume, I am finding very frustrating the switch from notepad++ to an IDE, the only thing I did on this past week was configuring netbeans...
Well, switching from a text editor to an IDE can be cumbersome, especially when you are doing this for the first time. The main advantages of an IDE is usually not a better text editor, but the overall environment (i.e. code inspection and analysis, code assistance tools like list members/autocomplete etc., integrated version control, tools for building / deploying and debugging projects, project management and much more).

I have not found a single IDE with its editor comparable in flexibility to vim, emacs, textmate (on Mac) or sublime text (which is my personal favorite among all editors). The JetBrains products probably come closest, but they are not open source.

It will take a while, though if you don't like Netbeans and sense a feeling that using it might not be beneficial for your work flow - stop wasting time with it and find something else. A week should be enough to find out whether you like it or not. If you still hate it, it's probably not worth the time :)
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 19, 2012, 09:48:46 AM
OK, I had this idea that the switch was necessary, at this point I don't think I'm using 5% of all the features the IDE provides, mostly because I don't really have any use for them, perhaps is still to early for me to move.

I realize an IDE does make things easy for programmers but for someone who just plays around with code it seems like too much.

I did like the sidebar with all the methods/functions and the tree with all the folders and files easily reachable  and the "go to line" shortcut.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 21, 2012, 08:30:20 AM
OK, slowly moving.

The notifications turned out to be a real pain in the posterior... and I haven't even touched the UI yet...

It feels somehow hackish, loading the user's data every time I need to send out a notification, not to mention the possible combinations between Wall owner, Status owner and comment owner (when sending a notification for a new comment or a new status), that is, a wall owner can also be a status or a comment owner, there is multiple possibilities and a user may end with more than 1 notification for a single event :(
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 21, 2012, 12:15:40 PM
OK, been testing the notifications, there is some flaws on the design, this needs some serious re-write I'm afraid.

First of all, I will not store the hardcoded url on the database, will just store the type, then based on the type, on showing the actual notification I will build the url.

The same for the content, based on the type, I will build the message on showing instead of storing the message on the db.

Basically I have a lot of sprintf() strings with things like: X commented on the status made by Y on Z's  wall.

What I'm going to do is just pass the user ID of the people and build the actual link on showing, avoiding the clutter the message with hardcoded data as much as possible.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on May 12, 2012, 12:19:02 PM
uff!  I finally finished the Query class  I'm pretty sure it is full of errors :P   to bad I created a new branch after I committed some of the changes to the master branch.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on June 16, 2012, 04:24:56 PM
Been doing a lot of changes lately, I almost regret that I did it :(

I'm goign to ditch the whole modules thing, I have no idea on how I can approach this one.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on June 29, 2012, 10:53:47 AM
Finished with the changes already :)

Now what worries me the most is how to load all the Status and all the comments for each status, currently I heavily abuse of the foreach construct, this may work with small sites but will be a server killer on medium to large sites.

I use cache for both the Status and Comments, both are stored as multidimensional arrays with their respective ID as key.

The problem is that both arrays are independent from each other and I need to assign all comments to each status.  And this is how I currently load the comments:

Paste bin url: http://pastebin.com/L9fcVjVp

This arrays may become massive at some point and I have no idea what is the best way to load them. Perhaps loading both status and comments with a single array, dunno.  :(
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on July 02, 2012, 04:14:24 PM
Some more problems.

I did some changes to the way the queries were called to reduce the number of queries per profile page, I also did some changes to only load the comments for X particular profile rather than loading the entire comments huge array, it was until that point that I realize there is some problems with the way I'm calling the comments array.

The first time I see X profile it all displays good, if I reload the page, then the comments array who was supposedly loaded from the cache this time its actually empty, it does use the cache but somehow it doesn't get displayed, I've been trying to figure it out this problem but no luck so far, I already checked the cache name, there are no duplicates, in fact, the cache file looks fine, argh!
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on July 02, 2012, 04:26:57 PM
Some more problems.

I did some changes to the way the queries were called to reduce the number of queries per profile page, I also did some changes to only load the comments for X particular profile rather than loading the entire comments huge array, it was until that point that I realize there is some problems with the way I'm calling the comments array.

The first time I see X profile it all displays good, if I reload the page, then the comments array who was supposedly loaded from the cache this time its actually empty, it does use the cache but somehow it doesn't get displayed, I've been trying to figure it out this problem but no luck so far, I already checked the cache name, there are no duplicates, in fact, the cache file looks fine, argh!

Oh dear lord!!!  it was a freaking underscore!!!  3 hours looking at the code and when I finally gave up and wrote this reply, a few minutes later I found out it was an underscore!!!
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on July 02, 2012, 07:05:36 PM
OK, notifications time.

I was thinking about using json for this, that is, the notifications table will only have 2 columns, ID which is an auto-increment value and "body"  or "content" or some other fancy word. Let's call it "body" as that is easier to type.

body would be a json string containing the following:

         'user' => 'int',
         'type' => 'string',
         'time' => 'int',
         'read' => 'int',
         'content' => 'string',

so far so good, I can query the table and use json_decode just moments after caching the result, but this leads to some problems, for example, the read value, is far more easy and faster to just update a plain and regular in column than going trough the hassle of rebuilding the json string just to update 1 value from 0 to 1 or vice-versa.

At the moment I'm only using json in the last "content" column, this column and everything else is a separate column.

Now, I already had some code for this and it actually was working, but creating the notifications was a real pain in the ass, lots and lots of verbose code. I need to find a way to simplify the process of creating/deleting notifications, to automatize the process as much as I can, to make it relatively simple to add the notification system not only for Breeze but for other forum aspects like new topics, replies, etc.

And, as always, I have no idea on how to do that :P
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on July 05, 2012, 10:38:22 AM
I haven't finished with the notifications stuff, far from it yet, however, I been thinking on changing the way Breeze works.

Currently Breeze is nothing more than a bunch of classes who are lightly connected, each class calls the main class when its needed:

Code: [Select]
$this->_settings = Breeze::settings();
$this->_query = Breeze::query();
$this->_tools = Breeze:tools();
$this->_text = Breeze:text();

That's kinda ugly, it will be better if every class extends the main Breeze class, that way I can freely use $this->text()->getText('string'); automatically and would not have to call every loose class out there.

I will give it a chance, now that I finally figure it out how to work with branches on git :P
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on July 09, 2012, 03:01:31 PM
Next thing to do?  Logs. And perhaps a little bit of UI.

In reality, logs would be pretty much the same as the notifications, makes sense to re-use that table,  I foresee a lot of sprintf and member data usage   :-\
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on July 09, 2012, 03:19:05 PM
Oh, I also need to properly define the CRUD for the notifications as well as the UI which is plain ugly at the moment!
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on July 10, 2012, 02:31:11 PM
meh... I soooooo not want to do the notification stuff for mentions, comments, status, new topics and replies lol  is just too much redundant code... a  lot of building strings with sprintf and a lot of arrays...   meh... I gotta do this one a day where I'm in a very very good mood...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on August 01, 2012, 05:41:52 PM
The mention stuff turned out to be much more difficult than I ever imagined :(  and I haven't even started to apply the notification system to it...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on August 03, 2012, 08:51:08 AM
Well, I end up with this solution:

The mention stuff will of course be done just one time, that class (BreezeMention) will not only handle the notifications but also will pre-format the message so the parse class can take that pre-formated string and convert it to an actual link with no queries involved, the work flow is as follows:

Mention takes the raw string:  {Suki} 
strips down the name: Suki
Make a query to get the real name, display name and ID
Send the notification
convert {Suki} into {1,Suki,Suki}  which is ID, display name, real name
returns the string to be saved to the database

The parse class takes the formated string: {1,Suki,Suki} and converts it to a link: @Suki (http://missallsunday.com/profile/suki_1/) using the data available.

So far it works pretty well and one good thing about doing a query 1 time only is that multiple tags gets automatically removed by the query itself since the query returns an array with the ID as key.

I need to put a limit on the amount of people that can be notified.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on August 17, 2012, 06:25:20 PM
I haven't done much in this last week, dunno why really.

Next September this project is turning 1 year...  1 whole year for something that isn't really that big.

Is still far from finished, in fact, I can say I'm not even half the way, I still haven't done the Source code, the UI stuff is yet another beast and I haven't even touch it.

I posted a WIP at simplemachines.org and I didn't get the response I was expecting to be honest, the people that did got interested wants a Facebook clone, which is an impossible thing to do for a single person.

I dunno, perhaps this will be a never ending project without a proper release.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on September 18, 2012, 01:01:17 PM
Been toying with infinite scroll, found some nice jquery plugins for it.

Again, I have lots of ideas but the source code must be ready and robust before I can play with the UI :(
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on September 25, 2012, 01:00:04 PM
Yet another semi-update on this.

I was thinking on building a whole plugin section to easily add per user options for Breeze, however, I still need to find a good way to do it and even if I found it, I highly doubt it since a plugin generic example is just not possible, I still ain't that comfortable with some OOP properties.

Just for that, I decided to just ditch all of that and just use plain per user SMF options using the themes table, its pretty easy to add them at will, just need to modify m form class a little bit and it also cuts the need to load those options separately or even the need for an extra column in the members table like I have now.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on September 28, 2012, 04:52:04 PM
mmm, got a few hours on a Friday afternoon, gotta push some code to Breeze. Then party all night  8)

I didn't even know SMF have its own form generator code LOL after a few looks at the files I was able to ditch all my custom and ugly code for a much better and cleaner solution.

I was working just fine, then I start to add more options and then it suddenly didn't want to save my options anymore  :o I must have changed something while adding more options, dunno.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on October 10, 2012, 06:20:47 PM
OK, after a lot of time spend on debuggin I realize SMF's own generator form isn't designed to be used by external mods.

But not everything is lose, I can still use the save system and I can still use hooks for it, I will need to do a lot of work and resuscitate my own form generator class but I should be able to add more per user options in the future relatively easy, perhaps even by implementing my own plugin system.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 06, 2012, 01:13:09 PM
OK, I've been working on this on my free time, this makes it much more difficult since I gotta remember what exactly I was doing last time :(  sometimes I left something unfinished and remains that way until I stumble up it weeks or even months later...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 06, 2012, 05:51:54 PM
OK, Breeze now has 8178 lines of code, considering empty lines as well so the "real" code lines should be around 4000...

4000 lines of code and I'm still half way :P
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 07, 2012, 01:30:46 PM
Screw the DB layer...  its doing more harm than good, back to good old $smcFunc :P
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on November 09, 2012, 09:42:36 AM
OK, been doing lots of changes on early process, to my surprise nothing was broken or at least the things I tested wasn't broken by this changes.

I removed the DB class calls and convert the queries back to normal SMF ones, much easier to debug things if the error points out the the exact query rather than the DB class :P

I had to write an small quickQuery()  method on the Query class, this was just for cosmetic purposes, that is, to avoid having queries on the controller and instead put them on the model.  I still need to move a lot of things from the controller to the view and form the model to the controller.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 03, 2012, 10:17:11 AM
K, time for another update/rant :P

Been thinking on how I handle the ajax calls, theres gotta be a better way to send the response back, right now I send a $context var to the template, which is not bad, what is bad is the switch on the template, I want to just pass the var with all the info already (at least the type and a text string) so breeze.js can just print the text string according to the type, for example, if there is an error, the var should be:

$context['something'] = array('type' => 'error', 'message' => $this->text()->getText('some_error_string'));

Of course theres gotta be some control over the types, simplest way is build an array and check that the type we are sending does exists on that array.

So, the subactions array and this new "types" array are the perfect candidates to start adding hooks to Breeze  8)
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 03, 2012, 06:47:27 PM
I end up printing the response as json and let breeze.js handle it, will require people to have at least php5.2 but thats the minimal requirement anyway.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 05, 2012, 03:09:38 PM
I've been doing more replaces, this time I replaced the old confirmation plugin with noty and its been a real pain in the posterior!!!

I'm not too fond of JavaScript and to not know where the exact error is just drives me crazy :(  dunno if the change I'm doing wll solve the issue or create another one :(
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 09, 2012, 06:58:51 PM
Been reading lots of things, mostly about testing code, now suddenly too many ifs are a bad thing and so are booleans  apparently...

Now inheritance is also a bad thing, you need to extract/inject functionality instead or use composition.

You should use polymorphism instead of switch too.

If you wonder what I'm reading: http://www.giorgiosironi.com/

My dear lord, and just when I though I knew PHP...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 10, 2012, 09:27:34 PM
OK, seems like dependency injection is the way to go? I dunno, I dunno if at this point its wise to change Breeze code again either.

I still don't fully understand what dependency injection really is, most blogs I'm reading talks about lots of OOP terminology that I do not really understand. The only thing I did understand was that singletons are evil and I already knew that :P  however, the replacement is some how difficult to understand. Supposedly I should call all the other classes I need (collaborators) directly on the constructor, thus, making inheritance useless...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 13, 2012, 07:02:13 PM
While I still have SMF code on my head I decided to work on Breeze a little more.

The change to a json response is going well, I still need to sent a proper header, unfortunately, the template system doesn't allow to specify a different header other than text/html  or perhaps it does, I haven't checked yet but doesn't seem to be the case since SMF itself prints the response directly on the source file when dealing with rss feeds ::)
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 13, 2012, 08:54:12 PM
Oh, well, for some reason coding went surprisingly well, I'm inspired! :P

I implemented the header, now the response actually send a proper json response back to the browser.
I also improved the way BreezeAjax handles the response, instead of calling  returnResponse() method for each subaction, I simply call it right after calling the subaction:

Code: [Select]
/* Does the subaction even exist? */
if (in_array($sglobals->getValue('sa'), array_keys($subActions)))
{
$this->$subActions[$sglobals->getValue('sa')]();

/* Send the response back to the browser */
$this->returnResponse();
}

And instead implemented a new property: $this->_response

returnResponse check for that property, if its not empty then it means there is a custom response, can be an OK message or an error one, doesn't matter. If its empty then it means something went wrong and we need to display an error message.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 14, 2012, 12:12:40 PM
OK, been digging around trying to find bugs and I didn't even have to go deep to find lots! :P

There was an annoying one where you cannot mention more than 1 person, took me a while to figure it out why since the test I was doing all showed the correct info, in the end it was some weird instantiate issue that I  solved by directly call the already instantiate class rather than doing it again.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 15, 2012, 09:51:31 AM
Is is bad to start planning on the features for 2.0 or 1.1 when 1.0 isn't even close to be ready yet?  :P

I want to have a clear path on the things I will be working on instead of going blind and adding things just because, also, keeps me focused.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 18, 2012, 12:04:56 PM
Ha! looks like I bork Breeze big time while trying to replace those ugly wrappers, seems like SMF doesn't like my way or routing, meh...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 18, 2012, 07:21:15 PM
OK, one more headache... brought to me by SMF old coding in Profile.php:

Code: [Select]
$profile_include_data['function']($memID);

Just awesome, SMF also doesn't like me redirecting the area calls via my own dispatcher abstract class...  more awesomeness!

Now I need to figure it out a way to a void instantiate the main Breeze class to be able to use it on each static functions on BreezeUser, piece of cake, just instantiate the Breeze class for every area, well, WRONG!!! I just cannot instantiate Breeze anytime I want...

Possible solution, separate all the nasty static hooks functions to its own file and call the hooks at runtime rather than on install.

meh... why on earth Profile.php isn't using call_user_func_array() ???

actually, my dispatcher class pretty much uses this old stuff too :(  gotta fix that ASAP!!!
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 25, 2012, 09:08:34 AM
lesson learned I guess...  from now on new features will be added to different branches...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 28, 2012, 04:22:39 PM
About this:  https://github.com/MissAllSunday/Breeze/issues/17

My idea was to load the users as earlier as possible, a nice although hackish soltion was to collect the user's ID on the while after the main query, that is fine and dandy, however, there is an issue with it, the main query gets cached, so, there will be times when I won't be able to collect the user's IDs...

One possible solution will be to collect the users ID regardless of the cache, then create a new cache entry for those ids with the same time length as the query one, yes its a bit hackish but I jut can't find a better solution and I prefer that over the ugly foreach I've been using so far...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 28, 2012, 04:57:24 PM
Oh well, I guess I hav eno option but to run another shorter query only when the cache for the main query is been used.

Another idea, use an static property to collect the IDs and then simply run a protected method on every query method, the static property should hold on the cache time and would allow me to concentrate the actual loading on one single method.

Damn I really don't know how to best handle this situation.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 28, 2012, 05:08:54 PM
Nope, the static var fail miserably once I enabled the cache...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 28, 2012, 05:45:45 PM
OK I end up using the cache:

Code: [Select]
/* Load the user's data */
if (!empty($usersArray))
cache_put_data(parent::$name .'-users'. $id, $usersArray, 120);

else
$usersArray = cache_get_data(parent::$name .'-users'. $id, 120);

$this->tools()->loadUserInfo(array_unique($usersArray));echo '<pre>';print_r($usersArray);

$usersArray gets created when the main query gets executed, problem now is, $usersArray isn't collecting all the usernames or rather it is but its also replacing some values at the same time :( 

Code: [Select]
11111111111111111113112112211111
Array
(
    [0] => 1
    [1] => 1
    [2] => 2
)


The first line of numbers are all the numbers the var needs to collect, the array below is what its end up been collected (after array_unique of course)

meh...
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on December 29, 2012, 07:23:31 PM
K, I solved the issue by storing each row values on a separate array and them merge all 3 of them, it is not pretty but works.

https://github.com/MissAllSunday/Breeze/commit/abc6740633c748e6669d5210a8a94087e46a220d
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 03, 2013, 04:23:34 PM
The more I play with dependency injection the more I love it :D

I've been playing with it for the modsite mod I'm writting for this very own site so I can host all my modifications on a single place: https://github.com/MissAllSunday/ModSite

So far so good, all dependencies are created on demand, on a single place and I don't have to worry about having multiple instances of the same class floating around my entire script :)

Can't wait to finish the modsite and start to implement this on Breeze, I was planning on adding this in the new version, either as 1.1 or 2.0 but its awesomeness pretty much force me to include it right away :P

The mod site doesn't really have that many dependencies, there is only 2, text and query but Breeze is a different beast with lots of dependencies that relies on each other, making it a perfect place to implement Dependency injection, it also has a lot of dependent consumers.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 07, 2013, 09:15:34 PM
OK, there are some issues with converting everything to an object and keep things on a single place. It works great for the 3 actions Breeze adds via BreezeDisaptcher, however, those 3 actions aren't the only things Breeze adds, there is, for example, the headers method which is called  by Integrate_load_theme to publish notifications, this means I need to break the Dispatcher centralization and instantiate a settings and a text class.

There is also the other hooks Breeze uses, all of them only needs the settings and text classes so I suppose I can just use plain $txt and $modSettings vars on those static functions.

An entirely different beast is BreezeUser, I still need to find a way to handle it :(
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 08, 2013, 11:17:31 AM
OK, using plain $xt and $modSettings vars isn't as easy as it might seem, because of how tightly related to each other the classes are, it is difficult to use a single class as a standalone one, in this case, I need to use BreezeNotifications in a purely static context, this doesn't help me at all because currently all dependencies are hardcoded in BreezeDispacher which only allows me to use them on the 3 actions the mod creates.

A possible solution I have in mind is to create a new dependencies class, fully standalone, that way I could be able to use and re-use different dependencies either on static context or in fully object context.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 09, 2013, 10:45:35 AM
OK, so far so good :)

With the new controller class (I dunno about the name, not really sure if it really is a controller anyway...) I'm able to use dependencies as a stand alone at will without the worry of having instantiate classes everywhere.

The only downside is, I had to go back to old fashioned globals for all the static methods and the main method for users walls, it is a small price to pay but the advantages overcome that anyways.

Now comes the fun part, debugging, I was expecting lots of broken things, surprisingly, that was not the case, mainly a few remaining bits of inheritance here and there but nothing too serious. In fact, it helped me to organize things and to have consistency on all files and classes.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 11, 2013, 11:18:14 AM
Been doing some test, you know, testing things around to see if anything fail miserably :P

The vast majority of things looks OK or at least it doesn't "bork" the entire script so now it is time to merge this to develop branch.

I promise this is the last "mayor" feature to add, the features factory is officially closed for 1.0 windmill, from now on is all about UI, bugs and minor things I still need to implement like permissions :P
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 13, 2013, 10:08:12 AM
I wish I had discovered the observer pattern sooner, anyway, another thing to re-factor for the next release, use the observer pattern to handle notifications, will make things a lot more easier.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 13, 2013, 06:48:21 PM
eww, I completely forgot I actually have to write a page where you can see all your notifications and delete or mark as read them...

I assume people will also want to sort them like they do with other list in SMF, thing is, it is a pain in the ass to build something like that, creatList() is something that I rather prefer not to touch :(
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 15, 2013, 07:47:06 PM
meh, I cannot find a good way to pass parameters to jquery .click()

This will be solved quite easily if using onclick()  but dunno why I kwwp using jquery...

Thing is, I need to pass several values to .click, for example, for comments and status I made lots of trickery to get this done:

Code: [Select]
var element = jQuery(this);
var Id = element.attr('id');
var commentBox = jQuery('#textboxcontent_'+Id).val();
var loadcommentImage = '<img src="' + smf_images_url + '/breeze/loading.gif" /> <span class="loading">' + ajax_notification_text + '</span>';
var status_owner_id = jQuery('#status_owner_id'+Id).val();
var poster_comment_id = jQuery('#poster_comment_id'+Id).val();
var profile_owner_id = jQuery('#profile_owner_id'+Id).val();
var status_id = jQuery('#status_id'+Id).val();
var loadImage = '<img src="' + smf_images_url + '/breeze/loading.gif" /><br /> <span class="loading">' + ajax_notification_text + '</span>';

Which is fugly, can't believe you cannot pass variables like plain onClick func:

<button id="1" onClick="reply_click(var, var2, var3)"></button>
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 22, 2013, 08:10:49 PM
OK, I started to look for the ultimate details, when I was reviewing the code I realize that a lot of things are done in a rather unpractical way and could be done a lot more better... however, if I start yet another full code refactor then I will never gonna release this...

It's nothing too major, mostly things that could had been coded a lot better, things that I coded 2 years ago now they seems fat, old and overcomplicated.

Perhaps I should take a note and build a list of things that needs a refactoring.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 22, 2013, 08:15:40 PM
Also, did I already mentioned that the whole idea of "modules" was ripped off?  well it is, mostly because I haven't think of any good idea to implement them.

Also, I was reading the ultimate profile support topic and there are a few request about how to add stuff to the ultimate profile template, I need to add a rather simple way to add more stuff to the template without actually have to edit it (because it is a mess :P)
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on January 23, 2013, 09:59:17 AM
I'm definitely obsessed with modularity :(

I want to use and re-use methods at  will. BreezeQuery should only have generic methods that are completely independent from the ones that will eventually call them, they don't need to know who is calling them, they should be satisfy with the params that were sent to them and do what they need to do.

Things like delete for example, the delete part is so generic, being deleting a status, a comment, a like, a mention or whatever, the process is still the same, deleting...

The delete method should only need to know 2 things, the ID of the thing to delete and from where it will be deleted.  The cache must not be cleaned on the query method, it must be cleaned on the actual method that called the delete one.

OMG! there are so many things I want to improve :(
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on February 26, 2013, 09:38:25 AM
OK, yet another front I need to be worried about: JavaScript.

Breeze relies so heavily in Jquery and it's JavaScript is so weak... I'm afraid this is going to be a pretty annoying issue if this ever gets released.

It wouldn't be that hard to re-write all the JavaScript, the core is just plain jQuery ajax calls that can be modularized, one single function for posting, dealing with status or comments, a single function for deleting, actually, I already have that, and lastly, move more template embedded stuff to Breeze.js
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 07, 2013, 10:52:53 AM
mmm, turns out the whole mention issues wasn't a bug :P  it was because I set up a setting to let admins decide how many people can be notified on a single message/status at once.

Turns out I had that setting to 1 so no matter how much I tried, only the first person was notified LOL

I gotta create an error system to let the users know about this error, something like "you can only tag X people per message" without interfering with the process of course. I have no idea how to do that :P

Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 07, 2013, 03:56:07 PM
Tabs are done, well, at least the source code, there is still a lot of UI stuff that needs to be done.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 14, 2013, 10:40:04 AM
Mentions.

Currently it works just fine using {username}  However, people are too spoiled (thank you twitter!) and then want to use @username, what they don't know is that for a system like SMF that happily accepts spaces in usernames, having a @username approach can be a real pain in the ass...

My JavaScript knowledge is not exactly the best so coding a system from 0 is out of the equation, using the SMF autosuggest system is also out of the question.

Only viable option would be using a jquery script, yes I know it will create more issues as Breeze already heavily depends on several jquery implementations, each of then requires or only work with an specific jquery version :(

I found this one: https://github.com/ichord/At.js  which seems flexible enough.

Problem is, it requires that you provide a hardcoded list of possible members, luckily, it has support for calling a json file via ajax to get that list. What I have in mind is query the database to get a list of active users, get their names and IDs, of course store the result in the cache, and send the response as a json file. Then the mention script will output this:  {username, username, ID} which is the format the mention system uses.

The problem resides in finding a way for the mention script to output that specific format.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 14, 2013, 04:16:56 PM
OK, somehow I got https://github.com/ichord/At.js working ont he status textarea...

The downside is, I couldn't get the ajax response to work, so I need another way to print or fetch an JavaScript object array.

At first I wanted to use json response, it would be pretty easy to set up another ajax call that returns data in json format, the problem is, I couldn't understand how exactly the ajax callback on the mention script actually works and even if I do, it doesn't support multidimensional arrays...

So, I was forced to work with the bare minimum, luckily for me, the script accepts this kind of objects:

var data = {1:'Suki', 2:'mazanita', 657:'LOL',};

So I can print that var by calling some method, problem is, the var can be huge, not to mention the query to get all members and their IDs can be an expensive one :(

Oh well, at least I know this can be done, now I just have to make the ajax example to work  :'(
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 16, 2013, 06:39:26 PM
I'm so glad I used a branch for this.

As pretty and useful as it seems to be, I cannot make the script to work with my ajax request and printing a possible huge array is just too nasty so for now the mention stuff has to wait.

One last possibility would be creating a js file that only contains the array/object I need, thing is, it would be complicated to find a reliable way to create a file, there are so many different servers and configurations and SMF (because is free) is always installed on the most crappy ones... would be a nightmare.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 16, 2013, 07:33:28 PM
Back to the dev branch.

The way I built the notifications to be showed isn't exactly modular or convenient, the actual text that is showed to the user is build right before actually sending the notification to JavaScript, this makes it difficult if you ever need to show the actual text some place else, like in the actual notifications page...

Oh well  :-X
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 17, 2013, 05:20:10 PM
Meh, there isn't a good way to show the actual message, at least not without creating it all over again.

As for the mentions, I couldn't find a reliable way to create files, SMF does have a function for it (really really hidden on a packager manager file), I suppose I could copy/paste it, modify a few things like the actual path where the file will live and try it out, it would be better than having a huge array printed on every profile page.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 22, 2013, 08:07:00 AM
Since my "fuck everyone else" rant, I've been working a lot on this, this is perhaps my greatest period of activity since I started with this.

Not only do I solved the mentions stuff, but I also squashed some of the most annoying bugs.

Oh, I almost forgot, since a few days ago, I'm uploading the latest commit to this site, just to test it on  a real server.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on March 23, 2013, 12:13:21 PM
Been working on supporting users without JavaScript, I thought it was going to be a lot more difficult but so far its been pretty easy.

The real pain in the ass is applying a message system to let the user know that their actions went good/wrong, I took the lazy way and appended a lot of params to the url where the users are redirected after the process is done and set some divs on the template.

So far its working good, I can post new status an comments with a browser that has JS disable, the real question is, what will happen with a browser that does support JS?  what process will take the lead and priority, the plain http request or the ajax one? what will happen if a browser takes both as valid?
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on April 22, 2013, 11:57:39 AM
I forgot I used to use this topic as some kind of journal, official daybook or dossier, whatever.

There hasn't been than much action, support for non JavaScript users is now complete, it is not pretty, it requires template edits, the ajax class is now utterly cluttered and extending it is not as easy as I would want it to be.

These days is all about UI, I had always said it, I do not like to write UI stuff, mostly because I have a weird taste for this kind of stuff, I usually like and do things in a way others may see as redundant, thus, I always end up with something that doesn't satisfy neither of both ranges, the newbies and the "I know it all and better than you" guys.

Wait, I just realize, the source back is not completely bug free, while I was fixing a bug, I borked something else, yay for having to go back and fix things over and over again.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on May 21, 2013, 09:11:39 AM
eww, there is a lot of places that needs some new code, seriously.

The way notifications are fetched is just not really practical in any way.

I gotta stop relying on generic getter methods, they do have their place no doubt about it but sometimes it is better to have unique methods for unique actions, it doesn't matter if I end up having a bazillion of method that looks the same with only a few differences.
Title: Re: Thinking, code monkey and software architecture
Post by: Suki on May 24, 2013, 10:27:55 AM
Time for another rant: Tabs.

I have seen literally a bazillion of different jquery Tabs scripts, virtually every single one of them assumes you want to have your control buttons on the same div where your tabs would be and nothing else, unfortunately, for the SMf profile page that i simple not the case.  Others needs you to only have one list and nothing else otherwise it brokes, Breeze works with multiple nested list so all those scripts will miserably fail...
I'm utterly tempted to just write one myself, even though I'm not very fond of JavaScript/jQuery.

It would be extremely simple, the only thin I really need is the ability to have the buttons anywhere in the HTML and not necessarily inside the same div that holds the tabs.