20

I’m a devRant virgin and also a new dev so...
Anyone got any general tips for a newbie? For example, what are some bad habits that newbie devs should avoid picking up? Good habits?

Comments
  • 4
    Comment everything in our code. Every line, every variable, just everything. So when others read your code, they understand it.
    Welcome to devRant, you will like it. 😇
  • 6
    If you ask someone for help, don't just go do it your own way without even trying the other person's idea.
  • 7
    Learn to test early and do it often
  • 10
    git push origin master --force
  • 10
    Don't comment everything you write. Just pick meaningful names for variables, functions etc so we won't have to read your code and your comments.
  • 10
    Use protection
  • 1
    @ramen thank you
  • 4
    Learn how to debug
  • 5
    Welcome to devRant. :)
    Use version control. Try to have a good fun/frustration ratio when coding. Talk to ducks.
  • 9
    There are two things a dev should do/know. The first one is to stay DRY and the other is to always KISS.

    DRY = Don't Repeat Yourself
    If you write something twice, with just different "parameters", make a function out of it.

    KISS = Keep It Simple Stupid
    Don't over engenieur things. Remember the java joke: "you have a problem" - "you decide to solve it with java" - "you have a problem factory now" (not much hate against java ;)). But honestly if there's a simple solution, that respects the DRY principle go for it.

    In general: don't reinvent the wheel. For most things, there's a library/package/gem/binary whatever out there. Don't spend hours implementing something that is already out there.
    However, if you try to learn stuff, do reinvent the wheel. Invent it and then take a look at others solutions, compare it, try to understand why they did it that way.

    And most important don't forget your side projects. Nomatter if you're a student or work for a company, the joy is where you can build whatever you like without any pressure!

    So gl, hf (good luck, have fun)
  • 3
  • 5
    Be curious. If you search for something and find a snipped of code that does what you want, don't just copy / paste it blindly, try and figure it what that code really does, and how it does it.
    Documentation is your friend.
  • 1
    C++ bitfields are evil
  • 2
    Learn about version control (most likely git but hey there are alternatives if you really want) as there is no greater relief than doing a major screw-up in a project and realising you can get to an earlier, happy place where everything was still working.

    Comment your code, getting back in to a project after a while (you or someone else) and having to figure everything out again just sucks.

    Never stop learning, always challenge yourself to improve as the world of coding is for most parts a really fast changing world.

    That's my 3 cents 🙃😉
  • 3
    If you work somewhere every one will hate to work on the legacy code. The legacy code will be by there words awfule. However dive into it, and compare it to the real code you and your coworkers write now. That way you understand what the reason was back then and why it's not done that way anymore.
  • 3
    Don't use frameworks until you know the language
  • 2
    @iamgio @ramen ++
  • 3
    Looks like everyone has told you everything except use TABS over SPACE. 😁 By the way, welcome to devRant and enjoy your stay.
  • 3
    @suprano we don't start wars on newbies profiles!
  • 0
    @Wack haha. Letting her know which side she has to be on when she sees such war on here.
  • 2
    Well... I mean... I'm a simple guy.... There are 3 thruths
    Tabs over spaces,
    only russians are prejustices
    And ghe third one I've forgot
    But honesgly. If given the chance tabs are king, but then again I really dont get the fuss (python devs excluded from discussion!)
  • 1
    @Wack haha easy on yourself man. It's just a joke. I personally prefer tabs but I don't give a crap of whatever someone else uses.
  • 1
    own your mistakes and shortcomings in your code as well as personality. be open and honest about them instead of trying to hide them or blame them on someone else. it helps you to learn faster, and helps your bosses to place you better, give you the tasks you are better suited for, and generally makes stuff easier and better for everyone.
  • 2
    Damn, this community is nice. Thank you all!
  • 1
    @wokeRoach haha, got it!
  • 2
    @wokeRoach and also, 1 tab = 4 spaces. Not 1, not 2 and most impotant not 8!
  • 1
    @bearcode wait till you read @practiseSafeHex posts about his co-workers.
  • 1
    @Wack the C style guide for the Linux kernel says 8 spaces
  • 0
    First of all welcome to devRant! :)

    What's your favourite programming language?
  • 0
    @404response Only used Java so far since I’m a newb so I can’t have an opinion. But I want to start learning another soon.
Add Comment