Does it make me a bad web developer if I use margin?

Page 1 of 1 [ 10 posts ] 

Madbones
Veteran
Veteran

User avatar

Joined: 7 Mar 2010
Age: 23
Gender: Male
Posts: 777
Location: In the zone

29 Jun 2012, 9:47 am

Hey!
Sometimes in web development I use margin-right or whatever to move things to a perfect position. I try not to use it, but when I do its never needed that much.
Is it bad that I use margin?


_________________
?Sometimes when you innovate, you make mistakes. It is best to admit them quickly, and get on with improving your other innovations.? -Steve Jobs.


kc8ufv
Veteran
Veteran

User avatar

Joined: 27 Jul 2008
Age: 38
Gender: Female
Posts: 762
Location: Toledo, OH

29 Jun 2012, 11:44 am

Not neccessarily. In any form of development, there are structures that are generally considered bad form to use, but are neccessary for certain specific things (GOTO is probably the most universal example). You aren't a bad developer by using these things occasionally, just don't rely too heavily on them as they will eventually cause a problem.



bernerbrau
Yellow-bellied Woodpecker
Yellow-bellied Woodpecker

User avatar

Joined: 7 Jun 2012
Age: 39
Gender: Male
Posts: 73

29 Jun 2012, 11:47 am

A deeper understanding of the CSS box and layout models, and browser compatibility quirks, will help you develop an intuition on when it's OK and not OK to use certain features.

I have a coworker just out of college who uses absolute positioning and pixel-precise values for everything. Sure, it looks pretty, until you try to view it in IE 5, or on my android phone.

In conclusion, CSS blows.



sliqua-jcooter
Veteran
Veteran

User avatar

Joined: 25 Jan 2010
Age: 33
Gender: Male
Posts: 1,488
Location: Burke, Virginia, USA

29 Jun 2012, 3:24 pm

Madbones wrote:
Hey!
Sometimes in web development I use margin-right or whatever to move things to a perfect position. I try not to use it, but when I do its never needed that much.
Is it bad that I use margin?


Does it work? Does it break in any of your target browsers?

As long as it works, and doesn't break in random browser X - you're fine. Constantly obsessing over whether you're doing things the "right" way is a really fantastic way to miss deadlines and tank your productivity. As long as what you implement works, and is the best solution you can come up with, it's right.


_________________
Nothing posted here should be construed as the opinion or position of my company, or an official position of WrongPlanet in any way, unless specifically mentioned.


Burzum
Veteran
Veteran

User avatar

Joined: 26 Apr 2011
Age: 29
Gender: Male
Posts: 1,205

29 Jun 2012, 6:32 pm

kc8ufv wrote:
In any form of development, there are structures that are generally considered bad form to use, but are neccessary for certain specific things (GOTO is probably the most universal example).

Goto is not necessary for anything.



noname_ever
Veteran
Veteran

User avatar

Joined: 25 Dec 2011
Age: 45
Gender: Male
Posts: 500
Location: Indiana

29 Jun 2012, 8:56 pm

Burzum wrote:
kc8ufv wrote:
In any form of development, there are structures that are generally considered bad form to use, but are neccessary for certain specific things (GOTO is probably the most universal example).

Goto is not necessary for anything.


In high level languages this is generally true (although I've seen examples of error handling in an embedded C application where the use of goto made it cleaner). In low level languages like assembly, I'd like to see you do much without jump (goto) instructions.



Burzum
Veteran
Veteran

User avatar

Joined: 26 Apr 2011
Age: 29
Gender: Male
Posts: 1,205

30 Jun 2012, 3:22 am

noname_ever wrote:
In high level languages this is generally true (although I've seen examples of error handling in an embedded C application where the use of goto made it cleaner). In low level languages like assembly, I'd like to see you do much without jump (goto) instructions.

Of course, but since the word goto was used and not jump I assumed it was meant to mean in the context of higher level languages.



kc8ufv
Veteran
Veteran

User avatar

Joined: 27 Jul 2008
Age: 38
Gender: Female
Posts: 762
Location: Toledo, OH

01 Jul 2012, 9:26 am

Burzum wrote:
noname_ever wrote:
In high level languages this is generally true (although I've seen examples of error handling in an embedded C application where the use of goto made it cleaner). In low level languages like assembly, I'd like to see you do much without jump (goto) instructions.

Of course, but since the word goto was used and not jump I assumed it was meant to mean in the context of higher level languages.

I meant it in the broad context, including jump.



kxmode
Supporting Member
Supporting Member

User avatar

Joined: 14 Oct 2007
Gender: Male
Posts: 2,613
Location: In your neighborhood, knocking on your door. :)

02 Jul 2012, 12:07 am

Madbones wrote:
Hey!
Sometimes in web development I use margin-right or whatever to move things to a perfect position. I try not to use it, but when I do its never needed that much.
Is it bad that I use margin?


I've designed websites and converted those designs into frameworks* for the past 13 years. In my experience margins are not bad per say it's more about how your HTML and CSS code is rendered by various browsers. For example Internet Explorer renders margins and padding quite differently than Firefox, Chrome, and Safari. Margins are part of something called the Box Model or CSS Box Model. In Internet Explorer this Box Model isn't rendered according to the W3C spec. The key is to understand how IE's unique Box Model and other browser's Box Models render margins so that the layout ultimately looks the same across modern browsers.

* Recent example http://www.childhoodobesity2013.com/ (web design, HTML & CSS frameworks, font embedding, and jQuery. Notice this site renders correctly in Firefox, Internet Explorer, Chrome and Safari.)



DefKoN
Hummingbird
Hummingbird

User avatar

Joined: 14 Jun 2012
Age: 28
Gender: Male
Posts: 19

10 Jul 2012, 1:00 am

nope it doesnt make you a bad developper if done proper
like:
margin-left:auto;
margin-right:auto;