Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Root797755yBest advice:
read good quality source.
Distant second:
ask for code reviews.
Very distant third:
code. the more practice you get, the better.
Extremely distant fourth:
read books on clean code.
Everything else is past Jupiter. -
Root797755y@Afrographics
Pick a library or framework or open source project. If it's open source, you can read it.
The Linux kernel, Ruby's source, Ruby on Rails, jQuery, Haskell's GHC (compiler), ...
Almost everything will teach you something. -
@Root I disagree. Pop reading about clean code [at least patterns] to the top and only then dive into reading good code. W/o knowing what a pattern is and how is either pattern structured it's hell of an overwhelming task to understand why the fuck is that code written the way it is. And why is this class called a Visitor.. And so on.
It's like reverse-engineering an application and only then reading its docs -
Root797755y@netikras The best way to learn to write well is to read -- and to read everything you can. Reading only books on writing is a dead-end and gives no practical perspective. In fact, those books are probably the least effective way to learn how to write, and some absolutely do more harm than good.
I firmly believe the same applies to coding.
However, if you are not skilled enough to understand the source you are reading, then absolutely return to (or start with) the basics. -
@Root my point exactly :) only theory is not enough. One needs practice as well. To do practice one should know the theory and have seen what a good example is. In my exp it always helps to observe good examples while learning the theory. Just watching someone do smth can teach you to be a monkey at best if you do not understand all the WHYs. Hence the theory.
-
p0s1x935yBe hands on: Implement a project , for example a Rest api that connect to a database. By utilizing clean architecture. There are many example on github that give both guidance on theory and code construction for clean architecture/ clean code (SOLID) implementations.
-
One huge tip: Don't put one-liners in it that perform ten unrelated actions at once.
-
Write modular
Make sure you comment reasons for checks
Documentation, documentation, documentation
Dont code while drunk
Inheritance is your friend
Documentation
Try your hardest not to crunch
Limit your stack to as few components as necessary
Only use whats needed
I swear to God if i see another static web app in a container I'm going to throw a fit
Only use whats needed
Documentation -
Whenever you think "holy shit that's smart when i do it like this it works, even though it shouldn't" - stop.
-
Drekel7335yUse Descriptive Names
Give Each Class/Function One Purpose
Delete/comments Unnecessary code
Comments/documents what you think would be really hard to understand
Write code like a blind man is going to read it -
p0s1x935y@Afrographics here a guide that i’ve used to mentor my teammates on REST API (REpresential State Transfer)
https://s3.amazonaws.com/tfpearsone...
You could also googled it.....
REST API’s is a communication interface where frontends communicate with to Create, Read, Update and Delete data, otherwise know as CRUD. Google CRUD... -
As a rule zero, be open to feedback and critique and be critical with yourself.
I HATE those goddamn stupid mofos who can pray and preach every stupid coding guideline without having any common sense... It leads to the worst imaginable code... -
@p0s1x after having traversed 16 pages of your manual
It's like restAPI is the name given to the way that data are transferred between client and server.
Am i right or completely out of point?🙈 -
p0s1x935y@Afrographics yeah, kind of. Basically it is a concept that descibes how to use HTTP verbs and uris to construct a uniform interface to communicate with for example with a frontend. Rest Apis are also developed by twitter / facebook ect. They have their own api. Try to find the api documentation of the twitter, facebook, stripe ect to build a better mental model.
Then try to setup / hack your very first api, choose a simple framework, for example nodejs. Keep it super simple, badically a hello world for rest api’s Goodluck! -
matt-jd10095yI thought the book clean code helped me with my code style, try giving it a read and learn about different patterns
Please, give me tips to write maintainable source code
(Long term)
random