Code Like a Pro : Comments | How to Write Code Professionally (With Code Examples)

  Рет қаралды 34,333

Dylan Israel

Dylan Israel

Күн бұрын

Пікірлер: 43
@jozef97
@jozef97 5 жыл бұрын
Meanwhile on computer science courses...
@Heffsta02
@Heffsta02 3 жыл бұрын
LOL yep, they want a whole thesis in your comments
@MobiusCoin
@MobiusCoin 3 жыл бұрын
Really? I didn't know that.
@FishGup
@FishGup Жыл бұрын
Old comment, i know, but it's because the teachers want to see if you actually know what you wrote or if you just copied from somewhere and doesn't even know what the code does
@jozef97
@jozef97 Жыл бұрын
@@FishGup Yeah, but I don't remember them ever actually telling us how commenting should be done in a real project. It was always implied that it was something you should do in general, which is nonsense for the most part
@EddyVinck
@EddyVinck 6 жыл бұрын
I'm glad you spoke about regular expressions in this. Uncommented regular expressions are the worst.
@francomoises7347
@francomoises7347 3 жыл бұрын
Great video. I was looking for a guide because I wanted to add A LOT of comments "the proper way". Now I realize that most of it was not necessary and should be out of the code
@anthonyngooo
@anthonyngooo 2 жыл бұрын
thanks for this video, i'm a new dev at my first position and figuring out how / if comments are ever needed in production and this was really helpful especially wiht the examples. thanks again
@petelouis5085
@petelouis5085 6 жыл бұрын
I suggest you could share same information on medium also. Would be beneficial for learners like us
@TheIllerX
@TheIllerX 2 жыл бұрын
As a general rule I would say that if you have to put a comment in to describe your code structure, you are doing it wrong. However, implementing stuff is not just about code, but about the thing you implement, for example some mathematical model of something. Even i the code itself is super clear, the steps of the mathematical model might need explanation. In those cases it might help with a well placed comment sometimes, even though most of the explantion of the model should be put outside the code.
@zerdnelemo
@zerdnelemo 4 жыл бұрын
Code is wrong in first sample line 11. Where it says "filter( () " it should say "filter((word) " because that is what is using to compare the length: word.length.
@vijayjangid8967
@vijayjangid8967 4 жыл бұрын
Omar you are dirty boy {Disclaimer - these are my thoughts only}
@a_businessman
@a_businessman 2 жыл бұрын
nah, the best way to write comments is "I don't know why, but the code doesn't work unless we keep this terribleness. help."
@melhoresmomentosfutebol7542
@melhoresmomentosfutebol7542 3 жыл бұрын
I like the video when you talk about removing comments but i was working for a company that had a lot of junior developers so when i didn't use comments people used to waste time understanding the logics instead of just do what they had to do. And everything is compiled and all the comments are removed so it's just better put the comments.
@just4funTV72
@just4funTV72 2 жыл бұрын
I always assume that other person who is going to read my code is not an expert in programming. That's how I decide when I should write comment. But for myself, variable/function names normally are already sufficient.
@kristineximeno6739
@kristineximeno6739 2 жыл бұрын
My coworkers who are less experienced love to ask me to add TO-DO everywhere. I told him that's not a good commenting style. My lead just agrees with him. So hard dealing with these bad programmers.
@SethWilson
@SethWilson 6 жыл бұрын
This is all really good and helpful-I learned a lot! Other languages have some other commenting apparatus besides straight-up comments. For example, Java has JavaDocs and Python has docstrings. It’s important to do these, because they can be used for documentation.
@bulzay987
@bulzay987 6 жыл бұрын
can you tell me how did you learn angular, did you study source code, watch docs or courses ? how to learn and understand it properly.? Not just angular any framework
@gideonwiersma2794
@gideonwiersma2794 Жыл бұрын
Which program is this?
@Kim-by5uy
@Kim-by5uy 3 жыл бұрын
I don't necessarily agree with the visual markers. I feel there are certain instances where they would be helpful to easily traverse the code
@techverse8869
@techverse8869 2 жыл бұрын
Larger variable names are harder to work with
@kateiry4719
@kateiry4719 4 жыл бұрын
Though I don't know its formal name, I like the natural language naming conventions, such as longestStringsOf(strings). when you use it, it will look like: if (longestStringsIn(names).contains("bob")) return; and most of the time, it literally can read without all the programmatic symbols, like: if (the array of) longest strings in names contains bob, return. It's fascinating.
@Blast-Forward
@Blast-Forward 2 жыл бұрын
Thank you so much. Most comments add no value, are names of not extracted functions or an excuse for inintillegible or awful code. Rarely they explain WHY something has been done the way it has.
@cory531
@cory531 2 жыл бұрын
Why are you setting the longest string to the value at index 0? Is there something about that array where the longest string will always be at index 0?
@RobertR1611
@RobertR1611 6 жыл бұрын
Thanks, Dylan.
@jk-gn2fu
@jk-gn2fu 2 жыл бұрын
I've been writing JavaDoc comments for an hour😂😂😂
@lunarcomets
@lunarcomets 4 жыл бұрын
meanwhile at valve
@silentobserver9095
@silentobserver9095 6 жыл бұрын
have you seen the new codefights?
@humanrightsadvocate
@humanrightsadvocate Жыл бұрын
So, it's just like the KZbin comments.
@DeathxStrike18
@DeathxStrike18 4 жыл бұрын
Commenting isnt explaining the program to others, its explaining to the computer what your doing to the computer the naming of variables should match your comment. Then explain what you need the code to do. Once code matches and compiles correctly remove the comments that dont explain important things to other programmers or yourself as reminders.
@matthias4748
@matthias4748 3 жыл бұрын
not sure if you know what you're talking about, what's the point of a programming language if you can just exactly tell a computer "hey kill this process", which is impossible because computers basically understand 0s and 1s.
@Metruzanca
@Metruzanca 5 жыл бұрын
// Great tips.
@creativehub2023
@creativehub2023 4 жыл бұрын
i need code that check youtube best comments
@alexandrubitlan6836
@alexandrubitlan6836 3 жыл бұрын
I’ll give a source code from git hub without comments . I bet you won’t fucking get a thing out of it .
@javadziaebrahimi3568
@javadziaebrahimi3568 4 жыл бұрын
😍😍😍😍😍😍😍😍😍😍... awsoomeeeeeeeee realllyyy heelllppppfulllll thanksssssss..........
@svarupshinhchohan7230
@svarupshinhchohan7230 2 жыл бұрын
Khelva magu chu
5 RULES to Write Better Code
16:36
Andy Sterkowitz
Рет қаралды 46 М.
How to whistle ?? 😱😱
00:31
Tibo InShape
Рет қаралды 21 МЛН
If Code Is Self-Documenting, Why Do Comments Exist?
14:23
Thriving Technologist
Рет қаралды 56 М.
Don't Write Comments | Prime Reacts
14:31
ThePrimeTime
Рет қаралды 230 М.
The First Rule of Comments in Code
10:56
Bran van der Meer
Рет қаралды 1,3 М.
Junior Vs Senior Code - How To Write Better Code
22:13
Web Dev Simplified
Рет қаралды 1,1 МЛН
Naming Things in Code
7:25
CodeAesthetic
Рет қаралды 2,2 МЛН
How To Write Cleaner Code - A Practical Example
24:45
Tech With Tim
Рет қаралды 86 М.
3 Tips To Write Clean Code (from an ex-Google software engineer)
17:12
Clément Mihailescu
Рет қаралды 197 М.
How to whistle ?? 😱😱
00:31
Tibo InShape
Рет қаралды 21 МЛН