1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

CSS layout. hand coded or copy and paste?

Discussion in 'CSS' started by tummytom10, Mar 10, 2015.

  1. #1
    I'm new to web design and have been studying for a little while making simple sites. I've been watching a couple of different tutorials and seen different ways to code. I've seen ppl hand code their sites in the videos and then I've seen people copy and paste from sites such as getbootstrap. So my question: is it better to try and hand code everything from scratch or is it better to copy and paste different parts because it's more efficient?
     
    tummytom10, Mar 10, 2015 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    That depends what you want to do. Personally, I always recommend hand-coding, as it means you have 100% control of all aspects. However, there's no reason not to copy stuff that works, but copying CSS will only work if your HTML-code is the same as well (or at least fairly similar) - hence it might not be feasible to just copy bits of CSS. The important bits would be to create a proper HTML-page FIRST, THEN style it using CSS (which usually means handcoding).
     
    PoPSiCLe, Mar 11, 2015 IP
  3. serialentre

    serialentre Member

    Messages:
    123
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    30
    #3
    Handcoding for sure! Like you - I started learning thinking that I don't need to learn everything. Copying and pasting might do the trick. But I've learnt that if you do so, some codes MIGHT conflict with each other. And you might face code bloat too. For example, having 3 classes and 1 ID in ONE div element. It's something that Deathshadow often mentions.

    Handcoding from scratch lets you learn more, and like what PoPSiCle say - you have 100% control of all aspects.

    From what I have learnt so far, computers are just about the dumbest things. It does EXACTLY what you tell them to do. If you can see that, the onus is really on you to learn the syntax and vocabulary of scripting languages, AND tell the computer what to do. You may not be very sharp at the start, but practising will make you better over time.

    To add on: I've met fantastic pple in this forum who have helped guide me along each step of the way. Because of them, I've learnt that frontend scripting is NOT that difficult if you understand what each thing does. Putting it together, of course, will take some time.
     
    Last edited: Mar 11, 2015
    serialentre, Mar 11, 2015 IP
  4. COBOLdinosaur

    COBOLdinosaur Active Member

    Messages:
    515
    Likes Received:
    123
    Best Answers:
    11
    Trophy Points:
    95
    #4
    You should absolutely use cut and paste if you want to avoid learning anything except bad practice. If you actually want to do professional level work then you start by learning how to screw things up with your own hand coding. You will never learn much using third party crap. That is not to say you should not grab the code for a well written rule that does something special, but don't just cut an paste. play with it, customize it and create your own version. That is how you learn. That is how you get better. That is how you get good enough to deserve to call yourself a professional.
     
    COBOLdinosaur, Mar 12, 2015 IP
  5. tummytom10

    tummytom10 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    I'm all for learning as much as I can through experience. I've just noticed a lot of cut and paste in tutorials I see. And it makes me wonder if its just for time management or if its a bad habit to try and avoid?
     
    tummytom10, Mar 12, 2015 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #6
    One of the big things you have to ask yourself is "what am I building the website for?" -- the only correct answer is "to deliver content to users". How does code written by other people help you do that? IT DOESN'T! They don't know what YOUR content is, and that's why copypasta of scripttardery and halfwit mouth-breathing dumbass nonsense like "frameworks" are some of the most pointless time-wasting BS out there.

    Many of these ignorant steaming piles -- bootcrap for example -- even defeat the entire purpose of even using HTML and CSS in the first place; the separation of presentation from content. You end up slapping endless pointless PRESENTATIONAL classes into the markup just bloating out the page, start out with 100k of code before you've even started adding your content, and end up writing more code just to support "their way" of crapping all over your content. They actively promote layout concepts that are the antithesis of accessible design, and then have the giant pair of donkey brass to claim that said sleazy, broken, dumbass methodologies ARE accessible design. Herpafreakingderp.

    I will never understand how adding something ELSE to learn, that makes you write more code, that destroys any chance at accessibility or graceful degradation is "easier".

    As I repeat time and time again, <copypasta>take your CONTENT or a reasonable facsimile of future content, put it into a flat text editor and arrange it in a logical order as if HTML doesn't even exist, mark it up semantically, apply your CSS to style said content for all the different media non-query capable targets using elastic, semi-fluid design, further enhance it with media queries to make it responsive, and then once you have a working site add any scripting as desired to enhance the functionality without supplanting it. It's called progressive enhancement, which gives you graceful degradation and a site that is useful to as many potential visitors as possible.</copypasta>

    Anything else is 100% grade A farm fresh Biff Tannen's car filler.

    But don't tell that to the sleazeball scam artists crapping out nube-predating BS at the various whorehouses like ThemeForest or TemplateMonster, or the dirtbags vomiting up books filled with nothing but ignorance, apathy and wishful thinking. It might upset them.

    That said there is SOME code I re-use, but in total it barely adds up to 1k... from the simple CSS reset and common definitions I use:
    http://www.cutcodedown.com/for_others/screen.css

    To the baseline markup I plug that content into the BODY tag of once it makes sense:
    http://www.cutcodedown.com/for_others/template.html

    That's about the limit of what I copy/paste for a new page... but again I don't waste 50k of markup doing 10k's job or 200k of CSS on doing 20k's job; and don't load up on the "gee ain't it neat" scripttardery that adds NOTHING of value to sites and usually just makes them less useful and harder to use. see 99.99% of the crap people use jQuery to do.
     
    deathshadow, Mar 13, 2015 IP