Showing posts with label web dev. Show all posts
Showing posts with label web dev. Show all posts

Saturday, February 2, 2013

Simplicity in design - friend or enemy?

I have a real soft spot for simple designs - minimalist if you will. The thing I love most about modelling and coding for games is the way the restrictions of the medium force you to omit information, and the way you can construct your design so that the omissions of this information don't detract from the user experience, but add to it. Kind of like when people listen to music to "hear the notes they don't play".

This impressionistic approach to design, wether that be for websites, games or a simple logo, can be a double edged sword. On one hand it means that there is less production work to bring your design to life since there is essentally less information to display, but it also requires a lot of thought and planning to go into the early design stages and sometimes during testing it can all fall down catastrophically. So is simplistic design better or worse than the traditional information spam approach?

Thursday, October 11, 2012

Finding an ideal directory structure

My recent forays into coding have left me with some pretty confusing directory structures. I tend to break up my directories thusly: (I'm talking about web dev for the time being)

[myProj] - project
    [scr] - scripts
        [php and javascript files that store functionality]
    [mod] - modules
        [php scripts that will be include()d and rendered on the page]
    [img] - images
        [pictures and such]
    [css] - style
        [css files]

An avid onlooker would notice that where I can, I name my folders a three letter abbreviation of their full name. This is because I am lazy.

Wednesday, October 3, 2012

How NOT to design a messageboard

Goddammit, everything about MySQL sucks serious sackage. Have you ever googled for a MySQL issue and clicked a link for anything related to mysql.com? The whole site is designed to be incredibly painful and user-hostile.

Nice messageboard, MySQL.
Nice documentation, MySQL
Nice Homepage, MySQL.
Nice forums, MySQL.

DO YOU BASTARDS FUCKING TEST ANYTHING??

Seriously, just because things exist (forums, docs etc) doesn't mean they need to be changed.

Holy fucking shit MySQL, look at what SQLite did! An easy to read flowchart! Clear documentation! Who'da thunk it.

I fucking hate MySQL.

Tuesday, October 2, 2012

Awesome uploading gif generator!

I don't spruik much but I just found this and it's awesome

Loading GIF generator

I am always trying to find decent free loading gifs and that has a selection of pretty much all the ones you ever see on the net. I thought it worth noting down in case I am looking for it again later.

Lazy mysql

I fucking hate MySQL.

is it just me or do the letters 'sql' take far too long to type? They are in complete opposite ends of the keyboard and chafe my ass. Add in 'my' and you now have a word that requires you visit all compass points of your keyboard to type it. What's worse, every mysql function in php has "mysql" at the start of it!

Because I am a lazy bastard I made a little function that eases my pain.

function fetch($str){
    $q = mysql_query($str);
    $a = mysql_fetch_assoc($q);
    if(!$a){
         echo 'e: Fetch() returned an error! '.mysql_error();
         return false;
    }
    else return $a;
}

Now I can just call fetch("SELECT * FROM `my_ass` WHERE `mysql` = 'shit'"); whenever I require an array from a mysql string. I don't have to type "mysql" once!

Seriously, try typing mysql ten times fast.

Tuesday, September 18, 2012

Things I wish I had been told about objects

You can read this in a nice wiki format here

When looking at tutorials and tips, you'll hear phrases like "the objects 'x' method" and "returns an 'x' object". If you're not sure what this means, it definitely helps to get a grasp of the concept of objects when you are programming.

A big problem I had when I first learned about Object Oriented Programming was that tutorials all needed to be so damn correct. Since I was only a noob this lead to confusion and frustration.

This post is not entirely correct, and in some ways just flat wrong. But it serves to bridge the gap between procedural programming and OOP for the newbie. If you continue down the golden path of OOP you'll find that a lot of the stuff I said here was fallacious, but it was a means to an end.

Monday, September 3, 2012

Prototype is so handy

I have been javascripting like a madman recently. I now have quite a bit of experience in the language. Here's a few fiddles I did to get my head around stuff like objects, dragging stuff and AJAX calls:

My JsFiddles directory

Try the cards program, you can upload a picture and give it a name/description. It's supposed to be a jumping off point for making online card games like magic the gathering or w/e.

Friday, December 2, 2011

Reserved words in Mysql

Here's a quick one for anyone who has a query that just won't work (insert and update in particular). Mysql reserves certain words for its own uses. One such word (and the reason for this post) is 'desc'. An oft used abbreviation for 'description', 'desc' recently caused me three hours of confusing, frustrating code rewrites and function restructuring. Turns out naming a column 'desc' is a right reserved for mysql, and if you try it mysql will not tell you about it, just imply a syntax error. Mysql hogs 'desc' and other common names. Seems a bit selfish to me.

Just out of interest, here's a list of mysql reserved words that you should keep handy in case of an insolvable refusal of your query.

I fucking hate mysql.

Thursday, December 1, 2011

Website visual design vs function design

You'd think that as a modeller I'd have a good grasp on the visual side of web design, or at least enjoy it. Well I don't. I find designing the look of a site tiresome and unrewarding. It's like playing tennis. I'm shithouse at tennis and, as a direct product, I hate the game. You need to have a certain amount of success to enjoy an activity. I find more enjoyment in coding functionalities and subsequently wearing out my f5 button testing my multitude of minimal modifications. There's a lot to think about with visual web design. Page lines, unifying texts, colour balance, information weighting and heaps more. This all goes sailing over my head as I tap away at php and jquery functions, so my web designs are inevitably un intuitive, uninspired and ugly.

Monday, July 25, 2011

JQuery and I

I am an avid modeler,

And a not so avid coder. I don't get the same kind of relaxation and fun out of coding as I do modelling. I enjoy myself thoroughly, but it's hard to love cricket when you can't swing a bat. I think it's the learning I like. Working at my job doesn't give me too many opportunities to demonstrate intelligence, and learning stuff helps me fill that gap. So coding isn't so much a hobby as it is a means to an end.

But tonight I found jQuery

And found a reason to enjoy the shit right out of web development. I had been skeptical about using it because I have already had to teach myself php, javascript and the nuances of ajax, I didn't think I was really ready for another language just yet. Man I should have started with jQuery. I have been used to following tutorials for hours to get the basics down, and then inferring stuff and googling and whinging to psi on the wolfire irc and taking a generally monumental amount of time to make any real progress in my code. Tonight I slipped jQuery.js into my head and immediately went shooting across the galaxy on a blazing fireball of solidified awesome.

The reason I picked it up was because I wanted a nice slide effect for a div so I could hide and show it onclick. I found what I thought to be a very ominously unpromising example. 6 lines of code and assigning a few classes/id's. I copypasted it into my js.js, changed a few parameters and refreshed my page, wincing at the thought of the hours of frustration I had just resigned myself to.

It immediately worked just as planned.

Better than planned. My div slid smoothly away to its little hiding spot, and even did a little bouncy bit when it extended. I emptied the contents of my testacles straight into my pant leg. I sat there for a good half hour just opening and closing my div.

Hopefully this is the heralder of some more fantastic functionalities for my future forays into the field of javascript. I'm going to make so many slidey fadey movey divs on my site that you'll think you're watching a remake of Tron.