Clean Code: A Handbook of Agile Software Craftsmanship 1st Edition

Last Updated On Sunday February 28th, 2021
This article contains references to products that we track and research from the Amazon Affiliates Program. We may receive compensation when you click on links to those products. For an explanation to our advertising policy, visit this page.

Prentice Hall

The Price has Dropped! But is this a Good Deal?

TL;DR: - The current price is considered high. The lowest price we've seen on Amazon in the past was on November 17, 2020. It is currenty 39% higher than the cost at its lowest.

Pricing Breakdown: Highs, Lows and Average Price Ranges

For the most accurate current price of this product, please check directly on Amazon. We will look at the historic low, average and high ranges to help you make an informed decision about the current price.

Prices stated in this summary below are approximate and in the past for your reference.

Firstly, the lowest prices we have seen for this product ranges between $25 to $27. The last time the price was low was between November 11, 2020 to November 24, 2020.

When it comes to price, the first thing we consider is whether looking at historic prices is actually worthwhile. For this product, differences can be quite large between the price levels so it will be worth it to watch for a lower price level before buying.

The prices we've seen of approximately $34 to $35 are considered average. Average to low price level differences are 24%. Price differences are moderate and waiting for a lower price can be worthwhile if you are on a budget.

Highest prices are between approximately $37 to $43. High to low are about 34%. This price difference should be considered if meeting your budget is important.

The last time this product changed price was on January 13, 2021. On average, price fluctuations tend to happen every 7 days.

Available on Amazon

  Check Prices
currently high price

1% Drop

Updated Feb 28, 2021
Price started dropping on

Nov 24

In Progress

Highlights

Current price is higher than the price on Nov 28, 2020.
Current price is high in the past 8 months.
Used not available currently.

Price Activity

DatePrice ActionChange %Price Level
28 Feb, 2021Price Drop-1.47%high
2 Dec, 2020On Sale10.01%high
28 Nov, 2020On Sale40.21%high
24 Nov, 2020On Sale7.78%low
16 Nov, 2020Sale End-3.63%lowest
Update on 28 Feb, 2021

Amazon.com price change % swings above and below average price

Showing: Area under 0 show price is cheaper than average. Above 0 shows higher price than average.

Product Details

  • 0132350882 Amazon ASIN
  • Prentice Hall Brand
  • Categories

    Books, Computers & Technology, Programming

Discussion and Reviews on Reddit

Favorite software books [R]

8 months, 2 weeks agochasenyc posted submission on cscareerquestions.
June 14, 2020

I'm going to pick up a few new titles of books.

Which ones do you highly recommend I read especially in regards to software architecture, testing, clean code, microservices, how complex systems work, etc...

8 months, 2 weeks agochasenyc posted comment on cscareerquestions.
June 14, 2020

Don’t have a full list but every single person I’ve recommended Clean Code yo has absolutely loved it. Clean Code: A Handbook of Agile Software Craftsmanship https://www.amazon.com/dp/0132350882

I'm learning C#, I want to continue down the route of ASP.NET, .NET, SQL stuff, anyone can give advice? [R]

11 months agoDreQm posted submission on learnprogramming.
April 3, 2020

I'm 0 starter to programming , 24 years old. It's been a month or more since I've started it. I tried Python, JS and finally decided that I will go with C# because in my country that is the most related lang. for job stuff. I'm reading books and learning stuff and applying however people say just start doing and creating and I'm like create what? Like I kind of got it for becoming a front end you create web sites you design them with HTML , CSS , Java so on. But with C# or back end lang, what do u do for training? Can anyone give me some advices ? I want to improve but It's like I'm looping on the basics. It is kind of good and it is empowering my base structure but I want to really go more yet some says create games, some says do that. Well I want to do things that will take me closer to my target, so what should I do? I'm open and willing to do any kind of task.

11 months agoDreQm posted comment on learnprogramming.
April 3, 2020

First of all learn C# and . NET. Try making a console app that manages stuff, but saves data in memory.

When that's done, learn entity framework. Start a different project to see how it works, and when you're familiar with it, refactor your first app from in memory storage to E.F.

After that, learn ASP.NET MVC, same principle as with EF, start a different project with it to get familiar, the refactor your main project from the console interface to a web app.

Those are 3 basic things to do web app development.

While developing stuff, start reading about clean code,.good entry point is https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882.

I made a fighting game with python.👊👊👊 [R]

11 months, 2 weeks agoryuhphino posted submission on Python.
March 17, 2020
11 months, 2 weeks agoryuhphino posted comment on Python.
March 17, 2020

How my software development has changed in the last 10 years [R]

1 year agofredrikc posted submission on programming.
Feb. 28, 2020
1 year agofredrikc posted comment on programming.
Feb. 28, 2020

Have you read Clean Code during these years? Most if not all of your learning's can be found in that book which I highly recommend!

What is 'beautiful code'? [R]

1 year agobatmassagetotheface posted submission on learnprogramming.
Feb. 20, 2020

Is it compact? Is it about executing a 200-line program with 15 lines of code? Is it understandable? What is it like in your opinion?

I try to make my code easy to read, but often end up making it "my controlled chaos".

Class Organization [R]

1 year agodoodlmyr posted submission on learnpython.
Feb. 5, 2020

Good Evening Everyone,

I was wondering if you could please review this class I made below and let me know if there's any particular flaws with it, if it could be refactored in a better way or if I'm simply missing some best practices. Thanks ahead of time.

from alpha_vantage.timeseries import TimeSeries
import sqlite3
import smtplib

class Stock:
    def __init__(self, ticker: str, key: str = ''):
        self.symbol = ticker.upper()
        # Ability to enter a personal AlphaVantage API key. If no key provided, default is used.
        if key == '':
            self.key = 'WTTQPLFVUWLDDLB'
        else:
            self.key = key

    # The update() method gets the information from the AlphaVantage API.
    def update(self, dataset: str = 'daily', interval: str = '1min', outputsize: str = 'compact',
               export_to_db: bool = False, filename: str = 'stockdb.sqlite3', path: str = ''):

        ts = TimeSeries(self.key, output_format='pandas')

        # outputsize = 'full' - Previous 20 years of data will be extracted
        # outputsize = 'compact' - Previous 100 open market days of data will be extracted
        if dataset == 'intraday':
            data, meta_data = ts.get_intraday(self.symbol, interval, outputsize)
        else:
            data, meta_data = ts.get_daily(self.symbol, outputsize)

        data.rename(columns={'1. open': 'open', '2. high': 'high', '3. low': 'low', '4. close': 'close',
                             '5. volume': 'volume'}, inplace=True)

        # Exports the equity data from the AlphaVantage API's generated Pandas DataFrame to an SQLite3 database.
        def export():
            conn = sqlite3.connect(path + filename)
            cur = conn.cursor()

            cur.executescript('''
                        CREATE TABLE IF NOT EXISTS
                        stock_data (
                        stock_id INTEGER, date TEXT, open NUMBER, high NUMBER, low NUMBER, close NUMBER, volume NUMBER
                        );

                        CREATE TABLE IF NOT EXISTS stock_index (
                        id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, symbol TEXT UNIQUE
                        );
                        ''')

            cur.execute('INSERT OR IGNORE INTO stock_index (symbol) VALUES ( ? )', (self.symbol,))
            cur.execute('SELECT id FROM stock_index WHERE symbol = ?', (self.symbol,))
            stock_id = cur.fetchone()[0]

            data.insert(loc=0, column='stock_id', value=stock_id)
            data.to_sql('stock_data', conn, if_exists='append', index=True, index_label='date')

            cur.execute('''DELETE FROM stock_data
                            WHERE ROWID not in(
                                SELECT min(ROWID)
                                FROM stock_data
                                GROUP BY stock_id, date
                            );''')

            conn.commit()
            cur.close()

        if export_to_db is True:
            export()
        else:
            return data

    # Sets up email alerts when intraday price reaches or is either above or below set target price
    # Currently only support for gmail accounts
    def alert(self, datasource: vars, email: str, password: str, target_price: float, limit_type: str = 'below'):
        server = smtplib.SMTP('smtp.gmail.com', 587)
        server.ehlo()
        server.starttls()
        server.ehlo()
        server.login(email, password)

        subject = self.symbol + ' Target Price Reached'
        body = self.symbol + ' has reached your target price of ' + '$' + str(target_price)

        msg = f"Subject: {subject}\n\n{body}"

        def send_email():
            server.sendmail(
                email,
                email,
                msg
            )

        if limit_type == 'below':
            if datasource.iloc[0, 1] <= target_price:
                send_email()
            else:
                pass
        if limit_type == 'above':
            if datasource.iloc[0, 1] >= target_price:
                send_email()
            else:
                pass

I apologize if it's a little bit yuge.

1 year agodoodlmyr posted comment on learnpython.
Feb. 5, 2020

Looks pretty good to me. Something I'd also like to touch on was said by u/SoNotRedditingAtWork, was the use of docstrings. One of the go-tos for "clean code" is this handbook here:

https://www.amazon.com/dp/0132350882/

The google style python guide is good too (and free):

https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings

MongoDB or MySQL for forum? [R]

1 year agocrab-rabbit posted submission on webdev.
Feb. 3, 2020

I am making a forum site for a niche hobby. It is going to be structured very similarly to reddit (go figure).

I have mostly MongoDB experience, so was going to go with that for my backend database solution.

What would you choose if you were me?

Does anyone feel strongly that MySQL is better than MongoDB for a forum site? I am not so educated on the finer differences between relational and non-relational databases.

UPDATE: based on a lot your comments, I’m going to start learning MySQL. I need to learn it anyway, and it seems like most of you are saying it makes more sense to be relational than document-based.

1 year agocrab-rabbit posted comment on webdev.
Feb. 4, 2020

it clearly made sense otherwise you wouldn't have understood what i meant :)

it's not about whether or not it's possible. the question is whether it's the right tool for the job. of course you can manually implement relational features, but why would you do that? you lose the benefits of both types of databases. it's a decision made out of inexperience, ignorance, and/or stubbornness

After looking at your project, I think you would do you good to take a look at these links:

https://www.python.org/dev/peps/pep-0008/
https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882
https://en.wikipedia.org/wiki/SOLID
https://en.wikipedia.org/wiki/Separation_of_concerns
https://stackoverflow.com/questions/84102/what-is-idiomatic-code

Documentation [R]

1 year, 1 month agobaseball_savant posted submission on learnpython.
Jan. 22, 2020

Hi people!

Can you link me good resources about documentation in python?

I want to upload my work in github so i want my code to look well.

Thanks!

1 year, 1 month agobaseball_savant posted comment on learnpython.
Jan. 22, 2020

Amateur self-taught C programmer - I can't help but feel that I write bad code. How do I learn to write better code? [R]

1 year, 1 month agoslowfly1st posted submission on learnprogramming.
Jan. 17, 2020

So, my level of expertise is basically I went through a "How to code in C..." textbook and did the examples at the end of every chapter. Now, my source code answers work but they're not elegant in the sense that when I ask for help on problems where I get stuff or look at other people's solution to the problem online, their code looks way better than mine and seems to optimize time efficiency or memory usage or some other aspect that makes me depressed that I didn't think of that. I feel bad, almost inept, that my code isn't good enough, considering that my goal is become a C developer. Certain things I try my best to do like good variable naming conventions and going for simple answers. Any advice?

1 year, 1 month agoslowfly1st posted comment on learnprogramming.
Jan. 17, 2020

I suggest to read Clean Code. Improved the "cleanliness" of my code a lot.

Writing maintainable and readable code? Tips? [R]

1 year, 1 month agogeek_on_two_wheels posted submission on webdev.
Jan. 15, 2020

I've been writing React Apps recently but took a break of about 4 days, coming back to lines and lines of code is taking me a while to process what's going on. I understand documentation is necesarry to minus this effect but I also noticed it's very difficult to implement change ? I want to add a hook to the components and I ended up breaking the app to the point I don't even know how to resolve the bug without starting over.

Do pro developers write small concise bits of code or am I missing something?

1 year, 1 month agogeek_on_two_wheels posted comment on webdev.
Jan. 15, 2020

Read Clean Code by Robert C. Martin (aka Uncle Bob).

IMO it should be required reading for all devs.

The best code needs no comments and documents itself because it's written in a way that's easy to reason about. This helps your coworkers understand what you did and helps you when you come back to code you wrote last month or last year.

Edit to add: One of the most eye-opening phrases I've heard about programming is that we write code for others to read, not for the machine. That is, writing a program that does what it needs to is relatively easy, but we should strive to write code that is meant to be read by others.

Learning functional/declarative programming in JS beyond map, reduce, filter: I have created a github project where I will solve a simple programming problem each week in a declarative way. New solution added: Compare the triplets [R]

1 year, 2 months agoArcanisCz posted submission on javascript.
Dec. 15, 2019
1 year, 2 months agoArcanisCz posted comment on javascript.
Dec. 15, 2019

Generally, good resource about good code is https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 (at least first half of the book. Later, it tends to be more Java and OOP)

What's a good laptop for beginner programming/game dev? [R]

1 year, 3 months agoCodeTamarin posted submission on gamedev.
Nov. 25, 2019

Obviously I have an idea for an epic game with big story, blah blah blah, long story short I know I'm not gonna be able to get into it and immediately make the next Mortal Kombat, especially cos I'm gonna be starting from scratch.

So I can't really find any info that pertains to me exactly anywhere, I figured I'd try my luck here.

What is a good laptop, preferably something that's not budget breaking, so someone like me can begin developing stuff for the first time ever?

Also, can someone point me in the general direction of where I can start researching programming for video game devs? I would appreciate any and all help on that matter :)

1 year, 3 months agoCodeTamarin posted comment on gamedev.
Nov. 25, 2019

You always want processing. You may or may not need graphics. I saw you say you liked fighting games. You'll need a decent rig with some capable graphics.

You wanna dev?

First, yes you need a machine, a decent one. Do you want to build it? Yes , but if not then check these out. I suggest getting a workstations because they're built for productivity. However, they're expensive.

Also, I'm not sure you should commit to a desktop. Two words: Game Jams. You might want to take part in communities involved in game making games. For inspiration, mentorship and just overall fun. If you're not familiar, games jams are when developer enthusiasts get together and build a game over a period of time. The games tend to be simple and set around a theme for the event.

In which case, look at some cool laptops. The reason I suggest getting a gaming laptop is that it will have the graphic card you need, it doesn't need to be high end, just good enough to not be a toaster. Also gaming laptops tend to be more powerful.

So from a dev point of view, they're pretty solid. Personally, I prefer workstations. If you asked me, I would get a workstation with a video card, but those are very expensive and maybe when you master your craft you can drop some real cash on it. You're new. So don't spend too much, in case the entire thing doesn't jive with you. Worst case you get a decent gaming laptop to play MK at the coffee shop. (Don't laugh, I used to play Street Fighter at a coffee shop, it's a nice vibe!)

Also, I would also check out Meetup.com. Your city or area might have groups dedicated to building games and maybe you can learn with another person. From a professional point of view, there's a lot of value in learning to work with others.

So you got your hardware, now for software.

You will likely want to start building stuff. But you're going to need some baseline stuff.

So, I say go with Unity, long term. However you need to get to a place to understand unity. So... you're going to need to learn some coding. To at LEAST be comfortable with code. I say learn the basic and intermediate stuff first then jump into Unity. If you're feeling bold you could also do the advanced.

You will need only Visual Studio and make sure during the install you ask to include Unity.

Finally, you should read Clean Code. Write good clean code. Future you will thank you.

Now, you gotta be productive.

Set up time to do what you want to do. One or two hour blocks. Commit to them. Log that time. Also, get open office, or some other equivalent and start organizing your workflow. as a develop you need purpose in your tasks. So outline your tasks. Develop you "method" for working. Maybe you like self imposed crunch where you just throw on music and go. Maybe you prefer small bursts of productivity. Whatever it is, figure it out.

Journal your work. Go back and read it occasionally. Take non-digital notes on important stuff you learn. Writing helps with retention. You have two processes you need to flesh out.

  • Your development process. How something gets built, tested and delivered.
  • Your Creative process. How you come up with a game idea and flesh out if it's good.

You're going to need to get a good sense of how to build a proof of concept. This will help you "feel out" your game's mechanics.

Over time, you will need to explore more advanced idea in computer science like data structures and design patterns... but for now, focus on getting comfortable with code, debugging. Hell, even make a console app text adventure game. Start there. Then get more complexity. The idea here, is to take your time, be diligent and stick to it. Slow isn't bad, not completing is bad. So take your time and good luck!

Technical Books I ❤️ [R]

1 year, 3 months agoameenashad posted submission on programming.
Nov. 4, 2019
1 year, 3 months agoameenashad posted comment on programming.
Nov. 4, 2019

Awesome. How about Clean Code by Robert C. Martin?

Books to fill in the holes of a self-taught dev? [R]

1 year, 4 months agofrenchst posted submission on cscareerquestions.
Oct. 27, 2019

Graduating next year with a couple cool CS projects and internships, got an offer at a company doing web and mobile dev. Feeling very excited and lucky, but also some imposter syndrome because I'm a math/econ major who is self-taught.

Are there some books you guys could recommend to us self-taught types to fill in those gaps? A couple books that somewhat summarize the CS curriculum? I've done leet coding and read CTCI, and picked up a lot from reading and from internships, but could really use some great books!

1 year, 4 months agofrenchst posted comment on cscareerquestions.
Oct. 28, 2019

Three CS fundamental books in the order I'd suggest someone read them if they don't have a background in CS.

Then there are these books that aren't really "CS books", but are geared more twoards practitioners.

Books to fill in the holes of a self-taught dev? [R]

1 year, 4 months agooriginal_evanator posted submission on cscareerquestions.
Oct. 27, 2019

Graduating next year with a couple cool CS projects and internships, got an offer at a company doing web and mobile dev. Feeling very excited and lucky, but also some imposter syndrome because I'm a math/econ major who is self-taught.

Are there some books you guys could recommend to us self-taught types to fill in those gaps? A couple books that somewhat summarize the CS curriculum? I've done leet coding and read CTCI, and picked up a lot from reading and from internships, but could really use some great books!

Yes [R]

1 year, 4 months agoWh0_The_Fuck_Cares posted submission on Unity3D.
Oct. 26, 2019
1 year, 4 months agoWh0_The_Fuck_Cares posted comment on Unity3D.
Oct. 27, 2019

You're kidding right? That's 100% personal preference... It doesn't matter how you place the braces as long as you're consistent.

This: The Microsoft C# Style Guide. It's literally garbage unless you work for Microsoft or a company that also follows this style guide to religiously. They're suggestions by Microsoft on how to write clean code. If you want a real break down on what clean code is read Clean Code or The Pragmatic Programmer and you'll learn what things are actually worth worrying about.

From jobless to junior frontend developer in 5 months [R]

1 year, 4 months agoliaguris posted submission on learnprogramming.
Oct. 16, 2019

[removed]

1 year, 4 months agoliaguris posted comment on learnprogramming.
Oct. 17, 2019

Yeah I have read around 70%-80% of all YDKJS books combined .

By the way just in any case you find anything interesting and helpful (but for also copy pasting this list in the future) here are the books-site tutorials-docs that I am reading-have read-plan to read-follow :

web dev road map

htmldog

www.javascript.info

css in depth (manning)

eloquent js

YDKJS (all books)

HTML5 for masterminds

dom enlightenment

high performance images

web performance in action

reliable javascript

building progressive web apps

http: the definitive guide

learning http 2

cracking the coding interview

javascript data structure and algorithms (be careful,not a good choice, it has a lot of mistakes but I find it concise)

professional git

vs code docs

Using SVG with CSS3 and HTML5

Interactive Data Visualization for the Web

refactoring ui

figma docs

react docs

redux docs

vue docs

webpack docs

clean code

design patterns

web components in action

Inkscape: Guide to a Vector Drawing Program

and many more to come .

How do you learn what "good" code is? [R]

1 year, 4 months agobatmassagetotheface posted submission on learnprogramming.
Oct. 5, 2019

Code can run and still look like trash, be overly complicated (this is the hardest one for me: how do I make this working program simpler?), hard to read, etc. How does someone who's learning to program learn to write good code instead of just "making it do what it's supposed to"?

Edit:

-Functions should only do one thing

-Descriptive variable makes

-Good spacing (you have infinite space to work with, so no reason to bunch everything together)

-Write good comments, again there’s infinite space

-Look at your code again a few months in the future. If it’s easily understandable then it’s pretty decent

1 year, 4 months agobatmassagetotheface posted comment on learnprogramming.
Oct. 5, 2019

I always recommend this book called 'Clean Code'
It details a collection of techniques to keep your code readable and maintainable.
In general use good variable and method names and use more, shorter methods where appropriate

What are your favorite books on general CS concepts/theory? [R]

1 year, 4 months agosamort7 posted submission on learnprogramming.
Oct. 4, 2019

(I went through reddit search to find similar questions, but let's be real, reddit search is ass)

Hello.

I started my first job about 3 weeks ago and I moved cities, so for a while I'm gonna have a lot of free time at night to do what I want.

I like to read a lot and although it's usually limited to fantasy/sci-fi, I feel like I should try to read some books on concepts and theories.

Ideally they'd be books that don't require practical work, and aren't necessarily tied to a specific language.

Does anyone have any good recommendations for books like that?

Thanks!

1 year, 4 months agosamort7 posted comment on learnprogramming.
Oct. 4, 2019

Here's my list of the classics:

General Computing

Computer Science

Software Development

Case Studies

Employment

Language-Specific

C

Python

C#

C++

Java

Linux Shell Scripts

Web Development

Ruby and Rails

Assembly

DEAR PROFESSIONAL COMPUTER TOUCHERS -- FRIDAY RANT THREAD FOR September 27, 2019 [R]

1 year, 5 months agoShadowWebDeveloper posted submission on cscareerquestions.
Sept. 27, 2019

AND NOW FOR SOMETHING ENTIRELY DIFFERENT.

THE BUILDS I LOVE, THE SCRIPTS I DROP, TO BE PART OF, THE APP, CAN'T STOP

THIS IS THE RANT THREAD. IT IS FOR RANTS.

CAPS LOCK ON, DOWNVOTES OFF, FEEL FREE TO BREAK RULE 2 IF SOMEONE LIKES SOMETHING THAT YOU DON'T BUT IF YOU POST SOME RACIST/HOMOPHOBIC/SEXIST BULLSHIT IT'LL BE GONE FASTER THAN A NEW MESSAGING APP AT GOOGLE.

(RANTING BEGINS AT MIDNIGHT EVERY FRIDAY, BEST COAST TIME. PREVIOUS FRIDAY RANT THREADS CAN BE FOUND HERE.)

1 year, 5 months agoShadowWebDeveloper posted comment on cscareerquestions.
Sept. 27, 2019

"oh yeah, that's just how that goes. If you run those one-off they always fail. You have to run the whole suite to make it work."

REQUIRING A SPECIFIC TEST ORDERING MEANS THEY'RE NOT FUCKING UNIT TESTS... HELL, THEY'RE NOT GOOD TESTS IN GENERAL, EVEN INTEGRATION TESTS SHOULD RUN INDEPENDENTLY (BUT MIGHT TAKE LONGER)

I TRIED TO FIND A GOOD CITATION FOR THIS BUT GODDAMN, GOOD DEVELOPERS SHOULD KNOW THIS SHIT

I SUSPECT CLEAN CODE HAS THINGS TO SAY ON THIS SUBJECT, FORCE IT UPON THEIR EYEBALLS

What's the best way to learn to write cleaner more efficient code? [R]

1 year, 5 months agoDisastrous_Internal posted submission on learnprogramming.
Sept. 17, 2019

I've been submitting challenges to code wars and they either time out, or submit. Usually when they submit correctly, there are ways that people write code that is much more succinct. This stands out most significantly is with python solutions. People use lists as keys where I never would have thought to use something like it; that or they write much more "pythonically" than I know how.

Where to go, what to watch and or read that will clean up code for newbies like me?

1 year, 5 months agoDisastrous_Internal posted comment on learnprogramming.
Sept. 18, 2019

for the time out, it's usually because you are using an algorithm not optimal.

As for clean code, some of it is general to any language, and you can ready a bunch of book on the subject (like this one https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 )

but you can also look for clean code in python in particular, follow the pep8, read the official guide https://docs.python-guide.org/writing/style/ and on top of that, maybe look for code style as used in big companies (like this one at google https://github.com/google/styleguide/blob/gh-pages/pyguide.md )

I'm a developer with 1 year of experience repeated 10 times, how do I get better? [R]

1 year, 5 months agoVitate posted submission on cscareerquestions.
Sept. 10, 2019

Like the title says, I feel like I'm a 1 x 10 year dev (except I have 4 years dev experience). Had some interviews recently and bombed them hard despite them not having any Leetcode style questions and being eminently reasonable. One of the interviews I got feedback on said my take home coding sample was poor. Also I've worked in several different stacks for a year or two each but have no depth of experience (jack of all trades, master of none). This seems like an issue since so many companies seem to want 5 years experience in X stack for senior level roles.

For a bit of background I worked for 2 years as a part of a team in a fortune 100 company that was not tech focused and code reviews consisted of "is this person trying to sneak in a back door to break infosec rules?" and mentorship wasn't done. In that job I was using C# doing the frontend for a winforms app.

In my current job (which I've had for 2 years) I work as the only developer in a department at a university doing whatever professors need for research which mainly comes down to building websites and doing data pipelines. I've used a lot of javascript for the websites and python for the data pipelines. Since I'm the only developer I have no one to mentor me (nor have I ever had someone else review my code before which seems to be part of the problem). I want to try to get out to a tech company and be either a fullstack website dev or frontend dev but as I said the interviews haven't been going well.

Interestingly enough I've held the title of Senior Developer for 3 years (In the fortune 100 I was a senior sysadmin before switching to development so they felt inclined to promote me quickly) but I definitely don't feel like one. Should I just leave off senior from my resume and apply for junior to mid level roles?

What can I do to improve? Any tips or suggestions would be appreciated.

1 year, 5 months agoVitate posted comment on cscareerquestions.
Sept. 10, 2019

Much of this stuff is learnable outside of work, too, at least at a superficially-passable level. Trust me.

Pick up a few seminal books and read them with vigor. That's all you need to do.

Here are some books I can personally recommend from my library:

Software Design

Software Industry

Technical

Need book recommendations on security in software development [R]

1 year, 5 months agohealydorf posted submission on cscareerquestions.
Sept. 4, 2019

I want to read a book about things an engineer should keep in mind while designing systems or applications to make it secure. Could you give me recs and a reason why you recommend the book?

1 year, 5 months agohealydorf posted comment on cscareerquestions.
Sept. 4, 2019

As far as engineering practices are concerned: Clean Code, Clean Architecture. A secure app/arch is one that is well understood long after you've stopped working on it.

DefCon has a reading list:

https://www.defcon.org/html/links/book-list.html

If you're looking for a starting point, I'd suggest The Tangled Web. Web/browser security tends to be a good high-level starting point.

You asked for books, but I'd highly suggest participating in some CTFs.

Front end JavaScript. How much do I really need to know? [R]

1 year, 6 months agophpdevster posted submission on webdev.
Aug. 29, 2019

So I'm looking at a career change in the next 2/3 years and I really want to go into web development. I'm fairly comfortable with html and CSS (some googling required ofc). I have started learning JS, I've completed a sololearn course and have been reading through ws3, mdn and now freecodecamp doing some of the challenges. What are the main things that I would be using in front end development? The amount to actually read through is quite overwhelming! Also what other things that are necessary to learn? I'm based in the UK if that makes any difference.

1 year, 6 months agophpdevster posted comment on webdev.
Aug. 29, 2019

You need to build up a foundational set of programming skills. Frameworks and libraries are important to know, but not as important as knowing how to program. The difference between a program/website/webapp that works, and a program/website/webapp that works AND has sensible code, is significant to a company. I've seen the simplest of features take weeks to implement in very poorly written code bases. This is valuable and expensive time that could have been spent building other features.

Companies are sensitive to this because very few companies are immune to the effects of poorly written and maintained code bases, so they are going to ask you code design questions and even have you do live programming challenges to see how think about the problem, and whether the design of a solution is important to you, or whether you're content to just shit out any old solution that works and move on.

To start, with, I would familiarize yourself with the basic mechanics of the language by reading the You Don't Know JS series: https://github.com/getify/You-Dont-Know-JS/tree/1st-ed

Next, I would read Clean Code by Robert Martin. It's based in Java, but the general principles are the same.

Next, I would read Refractoring: Improving the Design of Existing Code (2nd edition - which is JavaScript based). You can read the Java-based 1st edition for free.

Finally, I would read A Mostly Adequate Guide to Functional Programming.

Yes, it's a lot of reading, but these books will help you think about your code design choices, and in combination with practice, will help you write better code. But of course there is no substitute for practice. The more you write code, the better you'll be at it. The resources I linked to are just guides, not magic bullets.

In terms of other things that are necessary to learn, you'll need to learn how to use git (not to be confused with GitHub). Git is basically the industry standard version control system. You don't have to be an expert at it, but you do need to know the basics of it.

You're also going to want to get familiar with the basics of node and npm, because even doing front-end work, you'll be relying on 3rd party packages, and running builds, all of which are managed through node and npm (or yarn).

Need to learn how to make readable code [R]

1 year, 6 months agoRan4 posted submission on learnpython.
Aug. 28, 2019

So I am working on a Sudoku solver and made a function for everything that I wanted. Now my problem is that the code is ugly so I would like help to learn how to make it more readable. If you want to look at that mess here you go : https://github.com/BradyAtkinson/sudoku-solver1 and if not would be glad to have reading recommendation!

1 year, 6 months agoRan4 posted comment on learnpython.
Aug. 28, 2019
  1. Read pep8 - the official python styleguide and format your code according to it. You can run the flake8 tool on your code to get an error report.
  2. Read the book Clean Code by Robert Cecil Martin. It's a classic, and offers tons of great advise.

ELI5: What are arrays in programming? [R]

1 year, 6 months agoCilph posted submission on explainlikeimfive.
Aug. 27, 2019

I have recently started learning javascript and i don't understand arrays. The way how people explain is confusing. Can anyone explain to me in a very very simple way without using words like 'entities', etc.?

1 year, 6 months agoCilph posted comment on explainlikeimfive.
Aug. 27, 2019

It is good practice to have variable names with clear naming that accurately describes what they are for. What you're suggesting results in variables with absolutely no name whatsoever. (array[0], array[1], array[2] are hardly descriptive). Moreover, good programming means dissecting your problem into small easily managed chunks. So small, clear functions or objects. If you have a lot of variables in these, you are doing it wrong.

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

First Minecraft Clone Done [R]

1 year, 7 months agoAnnoraxD posted submission on java.
July 21, 2019
1 year, 7 months agoAnnoraxD posted comment on java.
July 22, 2019

Good job! Copying existing game ideas is a perfect way to learn

Some recommended reads I had saved as bookmarks if you want to dig even deeper into game programming:

Game programming patterns

Goes deep into all the different patterns of writing a good game engine. Written by one of the devs at EA. There is a free web-version if you scroll down on first page.

Game mechanic explorer

Lots of small snippets and explanations on common mechanics, like bullet trajectories etc. Only for 2d games but much easier to digest then the patterns-site.

A* introduction

A* is a fun algorithm to implement

Clean code book

This one is a must, a book you might get the most out of when working with other people but if you wanna get thinking in the terms of maintainable code and what will be expected of you at a real workplace, take the advices it gives to heart :)

And a tip for a potential next project:

One of the first games I did was a clone of Bomberman. The graphics can be pretty simple but you get to dig into cool stuff like (simple) AI with pathfinding and you can make a very simple multiplayer game out of it that isn't that lag sensitive

How valuable is having an internship when you're about to graduate? [R]

1 year, 7 months agoOrionSuperman posted submission on cscareerquestions.
July 11, 2019

I'm a senior CS student who's about to graduate, (currently doing my 1st internship as a software engineer intern at a certain defence company) and I have 3-4 solid projects (one 1st place at a hackathon and the 2 others won awards at hackathons). I really want to land a Big N job either right after graduation or within a year, does having an internship + a few solid projects help with this?

1 year, 7 months agoOrionSuperman posted comment on cscareerquestions.
July 11, 2019

Everything helps with new grads. Internships definitely help, and remember to have listed which technologies and services you used during that time.

If you want to really set yourself apart, take a look at Clean Code. Being able to skip the 'the code works but is entirely unmaintainable' aspect of a new college grad training is a huge plus.

Books on how to write clean maintainable code? [R]

1 year, 8 months agonutrecht posted submission on learnprogramming.
June 28, 2019

Can anyone recommend any language agnostic books that talk about how to structure projects, best practices etc

1 year, 8 months agonutrecht posted comment on learnprogramming.
June 28, 2019

Is there a POODR for Java? [R]

1 year, 8 months agolibrul-snowflake posted submission on java.
June 26, 2019

I am an old f* ... I mean a Senior Dev (the only) in a new team full of freshers. I wanted to get a few of my guys to read on practical OOD and the first book that came to my mind was POODR by S. Metz (Praised be her name!). Only I received a few raised highbrows with a "Wait that's not a Java book!" from the team. So to remove friction I would like to know if there is a book just as good at explaining how to OOD well in Java?

Thanks for any pointers

1 year, 8 months agolibrul-snowflake posted comment on java.
June 27, 2019

How much OOD are you really expecting from the team? Are they legit "never seen java before" kind of devs? do they know the fundamentals? A lot of java programs these days are like a weird mish-mash of functional, oop, and procedural elements. Mastering OOP, for example, won't give them a great grasp of lambda functions, folding, stream aggregates, or other concepts. I'm not expecting Java devs to be busting out UML diagrams with perfect notation at a moment's notice.

I found the Head First book to be really good back in the day for a crash/refresher course: https://www.amazon.com/Head-First-Object-Oriented-Analysis-Design/dp/0596008678

I'm not sure how it's aged in the last 12 or whatever years, and I remember the writing style to be a bit annoying, but it got the message through.

after that I'd probably send them to Clean Code first (https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/).

For just a practical-purpose OOAD, I would bet there are a few articles and online classes you could cobble together for a makeshift training.

Single best book to read to get started [R]

1 year, 8 months agoUnobtrusiveHippo posted submission on webdev.
June 8, 2019

Hey there,

suppose for some reason you register a domain and you don't know nothing of web, which single book would you suggest to read and for what reason?

1 year, 8 months agoUnobtrusiveHippo posted comment on webdev.
June 8, 2019

If you forced me to pick a book: Don't Make Me Think is pretty important.

I would agree you don't really want a book to get started. Things change really fast in the web so the books you want to invest in are going to be more theory based rather than technology based, because the technologies that are being used right now can be phased out in a year or two.

You want to just get something up and running. Once you get comfortable with some basics you can dive deeper.

I like this course for getting ramped up https://www.udemy.com/the-web-developer-bootcamp/learn/lecture/3861606?start=0#overview

Usually these course creators continue to update to keep with the times so you won't learn anything too outdated. He has an "advanced" one also.

Two books I've heard are great but honestly I haven't read yet are: Clean Code and The Pragmatic Programmer

Java intern test..could be useful for you [R]

1 year, 9 months agonhjelle posted submission on cscareerquestions.
June 2, 2019

FOR SAFE VERSION WITH NO DOWNLOADS: https://docs.google.com/document/d/1cXzXEmwybrm7R5bKJJ0Gp5r1bUtKwJeca0R4sftZlOM/edit

might be harder to view, easier to download the below stuff..

https://drive.google.com/drive/folders/1jYt-N0X49-9dO5tEAxfW64SMOgHIJHk4

So this was for the company named 'openmarket' intern test..hopefuly doesnt have my info in it.

I have already failed and wanted to know what i got wrong for future company tests...

my answers: https://drive.google.com/file/d/14Mcb5TjsuKfCr_JDA6EsPSlZ5g0lu0QQ/view

could someone potentially help me out on what i did wrong? it passes all the tests but they said i still failed.

maybe someone here who finds it useful can do it and post the answers for me to compare?

1 year, 9 months agonhjelle posted comment on cscareerquestions.
June 2, 2019

If you're interested in learning more, I'd recommend reading Clean Code: A Handbook of Agile Software Craftsmanship. It will give you a big upper-hand in projects like this one.

Is it normal for production code to have zero comments? [R]

1 year, 9 months agoeggn00dles posted submission on cscareerquestions.
May 30, 2019

I started my first developer job a couple of weeks ago, and they are having me do a code review, which I’ve never done before. The code is pretty complex and has zero comments. How are they expecting me to understand what’s happening in all of the code within just a few hours of reviewing it?

1 year, 9 months agoeggn00dles posted comment on cscareerquestions.
May 30, 2019

ahh hyperbole. always refreshing.

i'm saying to comment your code through clean naming conventions.

have you ever read just code and instantly understood what it did? it's a pretty cool experience.

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr_1_3?keywords=Clean+Code%3A+A+Handbook+of+Agile+Software+Craftsmanship&qid=1559240556&s=gateway&sr=8-3

id rather strive for beautiful explanatory code than crap up the code with verbose and often unclear or misleading comments.

comments can be counter-productive.

Is this programming advice any good? [R]

1 year, 9 months agouzomi posted submission on gamedev.
May 6, 2019
1 year, 9 months agouzomi posted comment on gamedev.
May 7, 2019

Well, when talking about code maintainability it's not the same thing.

It's clear that both of you do not understand the concept of clean code. That's why you guys think that there is some language barrier that does not exist since you guys do not know what concept I'm talking about.

There is some stuff that's very valuable for every programmer to read and I recommend for you guys.

Clean Code

Working Effectively with Legacy Code

The SOLID principles

Those are very good books, give it a try and you might thank me later.

Have a nice day to you too Inukai!

I am losing sense of my code [R]

1 year, 9 months agoNeuromante posted submission on Unity3D.
May 6, 2019

I am working on an RPG. I have an inventory system with over 100 items, 8 different races, merchants, etc. it's all serialized and saved. The problem is my code is starting not to make sense to me. It works and there are no problems but once something does go wrong it can be a pain to pinpoint exactly what is causing it. Or if I want to change something it can be difficult to know what relies on it. Is there an easy way to view which scripts are referencing which instead of manually going through the code and tracing things back script to script? I think that would make my life easier. Any other tips or tricks to keep things from getting too out of control?

1 year, 9 months agoNeuromante posted comment on Unity3D.
May 7, 2019

Welcome to the great world of documentation and clean code writing.

I would start by reading lean Code: A Handbook of Agile Software Craftsmanship. Look for the second edition, though. (Btw, even though it tells in the introduction that is a tough book, it is not, although maybe if you are starting from "zero" on good practices, it will have some hard parts).

From there, learn about UML and use it with (for instance) draw.io to document your code organization. Is the shit, because you need to keep updated the diagramas when you change something, but being able to remember the organization in one look is well worth it.

Applying to jobs as a teen [R]

1 year, 10 months agoShadowWebDeveloper posted submission on cscareerquestions.
April 19, 2019

Hi I'm 17 and I have extensive knowledge of many languages and frameworks. However, many jobs recommend a BS degree in CS. How do I prove my knowledge and skills without having such a degree? Do I need certifications?

1 year, 10 months agoShadowWebDeveloper posted comment on cscareerquestions.
April 22, 2019

Nice! It's a good start, although I can tell that you're a novice developer.

A handful of specific directions you could look into:

  1. Double-down on ES6. It's not going anywhere. let instead of var, arrow functions wherever appropriate (NB, this is not everywhere). await and async are great if you have good reasons to use them.

  2. Testing. Learn you some test-driven development! In Javascript-land, a couple of good tools for this are Karma and Jasmine. The key here is to write the test before the code. This forces you into creating testable code, which, as it turns out, is generally more maintainable code.

  3. I highly recommend reading Clean Code which goes into TDD and many other aspects of professional coding etiquette. It will also give you an idea of how to organize your source code (hint: the business logic probably shouldn't be all under the routes directory).

  4. Consider coding your server in a different language than your client. This is purely to help you expand your horizons a bit beyond Javascript. I recommend Python 3, potentially with Flask.

  5. Find someone else to help with the project! This could essentially double your learning as you'll be forced to understand how someone else might approach a problem (which is often in a different way than you might choose).

Finally, you might consider the CS degree route. I didn't finish my CS degree (although I did have a diploma in computer programming from a community college), and I think it probably pushed my career back a few years. It's certainly doable without the degree, but it's essentially concentrated learning that's well-recognized and can set you up with an initial network for your career. If you go this route, try to do it cheaply; consider community college first and transferring credits, or going to a cheaper state school (unless you can get into e.g. MIT, Stanford, or Waterloo, i.e. a place well recognized by name for CS).

People here will (and so far a few have) say that the CS degree is absolutely necessary; this is because most of them are CS students. I don't think it's necessary, but it helps.

How to get good at naming variables? [R]

1 year, 10 months agoyankexe posted submission on learnprogramming.
April 17, 2019

I can count the number of minutes I have wasted thinking of naming a variable that is either not too long for it be an article of its own or not too short for it to be meaningless and/or otherwise conflict with other variable names in the same class in terms of semantics. Please advise.

1 year, 10 months agoyankexe posted comment on learnprogramming.
April 17, 2019

This is specific to JavaScript but I guess naming variables are the same across all the programming languages. Here's some insights from Clean Code book extracted for JavaScript.

Clean Code Naming Variables GitHub

PhD, too old to be hired? [R]

1 year, 10 months ago00rb posted submission on cscareerquestions.
April 12, 2019

About to complete a PhD in Physics, I'll be turning 40 soon from a top state school. Several publications but nothing impressive enough to get me a professorship job. Coding experience in physics stimulations and leetcode. Want to do data engineering or ML. Can I still be hired at a FAANG or too old? Read a lot about age discrimination in this industry.

1 year, 10 months ago00rb posted comment on cscareerquestions.
April 12, 2019

Refactoring guru is helpful: https://refactoring.guru/

Also, Clean Code: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 by Martin.

As a junior dev you'll have plenty of time to learn as you go. But it would be a big plus knowing the stuff in advance.

3 years experience and no experience with unit testing / best practices [R]

1 year, 11 months agoFarren246 posted submission on cscareerquestions.
March 21, 2019

I'm trying desperately to find a new job because in my current job, where I have been at for three years, I've probably learned no more than six months of actual experience worth. I should have left years ago but didn't have the motivation with I admit is my fault but that's beside the point.

Something that is very challenging for me in interviews is when the interviewer prods a bit any asks me about my experience with stuff like unit testing, agile methodologies, properly "deploying code" and so on.

I have basically never written a unit test before (ive always just manually tested the code I write), I've never engaged in any agile methodologies (my boss just gives me an occasional task and I do it and come back to him when it's done and that's it), and I've never engaged in any best practices when it comes to deployment of software... I basically just move the code from my development environment to where it's supposed to run and hope it works, and change it if it doesn't. Furthermore I have basically no experience working with a team, I do everything independently.

And it probably goes on. I have so many glaring holes in my experience that most people probably learn in their first year.

Is there anything I can do to better navigate these interview questions that (rightfully) expose how inexperienced I am? For example maybe I should buy a bunch of books on some of these topics so I can at least say I'm trying my best to "catch up?" What can i do to get myself out of this horrible hole?

Edit: I'm also struggling to decide whether to quit without a job lined up but I think I'm going to ask that in a separate post, because some more context is needed to properly ask that..

1 year, 11 months agoFarren246 posted comment on cscareerquestions.
March 22, 2019

Step back further from the specificities of "just as it relates to testing" and get to know the idea of working with small, single-function units (in general) with Clean Code:

https://cleancoders.com/

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

Any web devs here with tips & tricks? [R]

1 year, 11 months agokennethdc posted submission on belgium.
March 20, 2019

Hi all,

Any fellow Belgian (junior) web developers here with tips on finding a job and/or companies that are willing to train junior web developers?

I know there are a lot of open positions found on the web, but I found this community very open-minded and I think it might spark an interesting conversation either way.

For skills: JS, CSS, HTML, JQuery. Been only studying for about 3 months (intensely, 2 hours every day) after work, so I do realize it might be too early. But still, what better place to learn than at work? I’m looking to pick up a framework now (probably React).

Cheers!

1 year, 11 months agokennethdc posted comment on belgium.
March 20, 2019

Learn the basics of JavaScript and jQuery and learn them to use them. Once accomplished, start to make use of TypeScript and learn your library/ framework of choice such as Vue.js, Angular or React. No experience with React over here, but Vue.js will be easier for a new programmer than Angular.

Having to do only front-end work is very rare in Belgium. Mostly employers are looking for a full stack developer. Learn a back-end language such as .Net (well the language is actually C#, F# (not advised for our job market, all though it is a fun language) or VB.Net, please don't learn VB.Net though), Python or PHP as well.

Al though it's directly being used less due the usage of object relational models, learn to work with databases and learn SQL.

Learning software patterns is a great plus as well. Design Patterns (often referenced as the gang of four) has withstood time and age and is still relevant. A dangerous part of design patterns is not to overuse them.

Learn your tools, Visual Studio for example, as well. You'll be working in them constantly and they make your life easier with IntelliSense, coding snippets, emmet. A cook can't cook without his knife and spoon, so can't a programmer code without some good tools (well, not entirely true but it'll be a lot slower).

You can ask your employer to help you with getting a degree in informatics via Open Universiteit. While software engineering is something you can learn on your own, many employers still look at your degree so it is still an important aspect.

Some education sources:

Learn to work with source control. Git for example which will be #1 used source control by now. CodeAcademy has a nice tutorial for it. Learn to use it very well so you'll use it immediately in a correct way. Don't code into master/ development branches, but use feature branches! Might sound jibberish for now, you'll understand as soon as you learn it.

Surplus nowadays, work with cloud technologies such as Amazon Web Services or Azure. Not that difficult.

Clean Code should be a mandatory read as well. I love that book.

Another surplus, go to meetings. There are quite some meetings of technologies in Belgium you can attend for free. They're full of people loving to share their knowledge or to help you. The more famous ones such as Techorama cost quite some money if your company isn't supporting you and not worth the money.

And especially, such as every skill, code a lot. Look around you, look for improvements in your life and try to find projects to work on. Attributing to open source (GitHub, GitLab, ... ) is also a great way to work on projects. Is also very good because you'll see other people's code, learn from it and will be able to explore existing projects and to add features or to fix bugs, which you will be doing mainly as your job.

Overall it is more a guide to become a Software Engineer instead of being a web developer. But honestly, which is pure personal of course, software engineering is where the fun is.

Good luck!

How to get out of web development? [R]

1 year, 11 months agoScarface74 posted submission on cscareerquestions.
March 18, 2019

Hi all, first post here.

So I'm a community college CS student getting ready to transfer to University in the upcoming Fall. I've also been interning for the past 10 months at a startup-like company doing basically full stack work ( some frontend , lots of devops/server scripting and some backend ).

And while I've enjoyed it so far, I know for sure I want to move as far away from front end work as possible, and eventually get into more systems programming fields.

They just recently offered me a full time position which I accepted, and I'm going to do school part time and work full time. And while I'm extremely excited about the position, I can't help but feel a bit worried about getting stuck in web development because that's all I have on my resume for professional experience.

This sounds like a dumb question now that I'm actually writing it out, but I guess I just don't understand how people get settled into their respective fields in the work force with respect to how they first got their foot in the door. I'm having a hard time imagining that a fresh college graduate with no professional experience can land their first job doing embedded or kernel development, especially when the amount of available work for those positions don't come close to the amount of web developer positions there are.

I could be wrong but web development seems to have a pretty low barrier of entry ( 3 of 7 engineers at my work are boot camp only with either no degree or an unrelated degree and little prior developer experience ) , while the fields I find myself most passionate about are much more difficult to get into.

So I guess my question is, should I be worried about this? Or is any experience good experience when it comes to applying for CS jobs? Especially since I don't even have my degree yet.

So I know the syntax now, the basics, the rules. Now I need to learn all the rest. Maven, databases, no idea what is needed to create a modern product. What book do you recommend me to get? [R]

1 year, 11 months agoMothulor posted submission on java.
March 12, 2019
1 year, 11 months agoMothulor posted comment on java.
March 12, 2019

Here are some concepts you should try to understand AND apply:

  • refactoring (helpful when adding new features to existing code)
  • test driven design (helpful when starting with only business requirements)
  • domain driven design (especially helpful when working on larger projects)
  • design patterns (always helpful but often difficult to recognize the opportunities to introduce them)

There a couple of good books:

Then there are a couple of frameworks/tools you could familiarize yourself with:

  • Maven
  • Spring (Boot)
  • Junit
  • Hibernate (or another JPA framework)
  • any UI framework but be aware that the Java world still doesn't have a single one that stands out for all purposes

What book made you a better developer? [R]

1 year, 11 months agoLesabotsy posted submission on learnprogramming.
March 10, 2019

If you could choose one book to recommend, what would be it?

Skills needed for new grad SWEs? [R]

1 year, 11 months agoVaricode posted submission on cscareerquestions.
March 9, 2019

I will be graduating this May and will be starting my first ever fulltime job in June.

I know that I will have to earn the skills that I need after I start my first work in my company.

But I wonder if there are some skills in general that are good for new SWEs to have.

I've been leetcoding too much so that my development skills and some practical knowledges in CS got rusty.

I was wondering if something like these would help (OOP Design and System Design course):

https://www.educative.io/collection/5668639101419520/5692201761767424

https://www.educative.io/collection/5668639101419520/5649050225344512?affiliate_id=5082902844932096&affiliate_id=5082902844932096&utm_source=google&utm_medium=cpc&utm_campaign=platform2&utm_content=ad-1-dynamic&gclid=Cj0KCQiA5Y3kBRDwARIsAEwloL49UTuEMIbXDsHlY2E5q9BawgSHpIgOkoRPpbkvj_rxh8-ZkkyiqIMaAms-EALw_wcB#utm_source=google&utm_medium=cpc&utm_campaign=grokking-manual

Since these will be some skills needed in my work and even for the interview in the future as an experienced dev, would these be something worth looking into before I start my job (during my free time)?

1 year, 11 months agoVaricode posted comment on cscareerquestions.
March 9, 2019

New grad SWEs will typically (at least at medium to large companies) be assigned features that don't involve making system design decisions (which is why it's not really a part of the SWE interview until you're going after your 2nd or 3rd (and onwards) employers, or after at least 1 year of experience).

It wouldn't hurt to understand early on, but imo new grad SWEs should be more concerned with making effective/proper commits (this is usually the central goal in ramping up new grads). That being said, Clean Code is a very well-received resource that essentially goes over the best practices in actually writing code.

I have two hours a day where I do nothing in school (hs) how can I use this time to further my learning without a laptop? [R]

2 years agoziptofaf posted submission on learnprogramming.
Feb. 26, 2019

The only access to the internet I have is my phone. At the beginning of the year this was how I did my homework but as a senior nearing the end of the year teachers aren’t giving work and I’m having nothing to do and just wasting time

2 years agoziptofaf posted comment on learnprogramming.
Feb. 26, 2019

Any book that focuses on something else than a specific programming language.

Examples:

How am I meant to "read the docs"? [R]

2 years agodigital_superpowers posted submission on learnprogramming.
Feb. 23, 2019

(I type too much - there's a TL;DR at the bottom lmao.)

Howdy folks.

So I've been teaching myself how to code for webdev over the past few years. I wouldn't call myself "good" at it by any stretch of the word, but I know enough to build a decent backend server in Python/JS, and get a basic frontend up with React/Bootstrap.

That said, I don't think I've ever once read the docs the right way.

Everything I know about code has been through courses like TeamTreehouse, or Udemy tutorials from guys like Steven Grider or Brad Traversy.

This has resulted in me knowing how to build things - but not really how to build things in the most professional way. I still lack a lot of the "meta" of the language.

For example, I didn't learn about .map() until very recently, so I was still dynamically rendering components with a for loop.

I know a decent enough amount of CSS/Bootstrap to build a site that's decent on desktop, but everything I've done thus far is horribly unresponsive, and breaks at smaller screen sizes. (Still trying to figure out how to make the best of media queries, etc.)


TL;DR.

I feel like I know how to build things, but not how to code professionally.

Whenever I bring this up, people often tell me to read the docs - which is very sound advice!

My only question is - how? Say I want to learn the ins and outs of React.

Am I meant to just read the React docs cover to cover? People often say to use it as a reference - but how do I treat it as a reference if I don't know what I'm doing wrong?

Cheers!

2 years agodigital_superpowers posted comment on learnprogramming.
Feb. 23, 2019

Most docs aren't going to tell you how to code professionally. I have found that books are the best bet for this, since they're usually composed with a story in mind. Some of these aren't going to be web-specific. But they're still really great.

For example: Clean code: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

850 dollars to spend on books. [R]

2 years agolemikistu posted submission on learnprogramming.
Feb. 14, 2019

I work at an company as an trainee therefore I have made an arrangement to be paid out in money that I can use for my personal development.
I will be able to get 2 certificates and will be left with 850 USD to spend on books.

The current 2 topics I will buy books for is Python and PowerShell and the rest I honestly do not know.
I am an beginner in programing and want to further my development in programming.

Do you guys have any recommendations for me?

2 years agolemikistu posted comment on learnprogramming.
Feb. 14, 2019

There is many books that you can get. I however would like to recommend particular one because despite really known a lot around good programmers it is not really known by beginners.

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=mp_s_a_1_2?ie=UTF8&qid=1550162739&sr=8-2&pi=AC_SX236_SY340_FMwebp_QL65&keywords=clean+code&dpPl=1&dpID=515iEcDr1GL&ref=plSrch

How to know if my code is clean? [R]

2 years agoziptofaf posted submission on learnprogramming.
Feb. 3, 2019

Hi, I've wandered if I write clean code and have a good architecture. How can I know?

2 years agoziptofaf posted comment on learnprogramming.
Feb. 3, 2019

You buy a book https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 and read it. After reading it you should be able to tell what can be wrong with your code... and oh boy, there are hundreds of code smells possible (definitely TOO many to discuss in the context of a subreddit question).

But in general - to tell whether code is good or not you need other people to review it and see what's their critique on it. VERY, very rough guidelines:

  • non descriptive variable names stink. No, s is not a good name for a variable holding a user object. Neither is "list". Name things so the context is preserved and I can tell what function is doing instantly as if I were reading english. Eg. this is shit:

def check_list(list)
list.each do |e|
  if e.status == 4
    return true
   end
end
return false
end

What does this function do? Nobody knows. It's only 8 lines of code, it's short... and it's shit. Now, imagine if you rewrote it as such:

def cheaters_in_players_list?(players_list)
CHEATER_STATUS = 4 #frankly this should probably refer to Player::statuses[:CHEATER_STATUS]
players_list.each do |player|
  return true if player.status == CHEATER_STATUS
end
return false
end

This code does exactly same thing. It changes nothing in the underlying logic... except now you can look at this function and comprehend what it does without looking at other elements inside system. Furthermore, if this was called elsewhere in code, it would be:

players = get_players_list()
do_something if cheaters_in_players_list(players) 
  • too many nested levels - if you need a 4+ levels for/while loop, it's likely your code is wrong. Refactor it, put branches into separate functions.
  • good functions are short functions. How short? Well, getting average to below 20 lines is a good start (note - sometimes of course you have to make longer ones, these are guidelines, not rules). Oh, and make sure each individual line is not over 100-110 characters long.
  • classes are nice! These too however shouldn't be too long.
  • functions connected to each other should be close to each other (eg. in same file, right next to it)
  • code has plenty of tests and they are all running (that's the most important thing on this whole list frankly). You don't have tests? Your code is shit then regardless of ANYTHING else you do to it.
  • comments should explain your specific decisions and why if it's something unusual. Not how something works - this is explained in code.
  • best function takes 0 arguments. Good function takes 1-2 arguments. If your function needs 3+ arguments - time for refactorings, be it by placing them in a specific structure/class together or using multiple functions in the first place.

And so on and on, I just scratched the surface of the problem for now.

Got my first official offer! [R]

2 years agoArcanisCz posted submission on webdev.
Jan. 30, 2019

I began programming in February of 2018 and just received my first official offer for a junior software engineering position, which I intend to take. It’s a very good offer and I feel like I owe a portion of it to this sub and others related to development. Absolutely ecstatic and just wanted to share my excitement and appreciation for this sub!

For some context I work in the web development space, non traditional developer (aka self taught/no CS degree) and focus on the MERN stack. My offer is for 65k with handsome benefits and I’m a 23 y/o male in NC. I have a Bachelors of Arts degree in a non tech degree field.

Never give up, that’s all I can say.

Edit: it took maniacal effort and upwards of 5-8 hours a day, 7 days a week of hard work

Edit 2: one of the most important words of advice I would give myself looking back, is COMMENT WHEN WRITING CODE. Doesn’t matter if it’s a solo project, write well thought out, coherent/concise comments. Future reviewers of your code will commend you and future you will thank you

2 years agoArcanisCz posted comment on webdev.
Jan. 31, 2019

I would give myself looking back, is COMMENT WHEN WRITING CODE.

Next step for you will be adhering to the principles od the clean code ( https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 ) - to write code which doesnt need comments.

New Programmer Pitfalls [R]

2 years, 1 month agoEvasiveBeaver posted submission on learnprogramming.
Jan. 25, 2019

Among those learning to code, I've observed two dangerous trends.

The first is something I call the "infinite tutorial loop." The aspiring programmer goes from tutorial to tutorial, never breaking out and building something independently. I've seen cases where someone has been coding for less than a year and they are, frankly, more skilled and more knowledgeable than someone who has been doing it for five. This isn't because they're more intelligent or putting in more time -- it's because they've been pushing themselves out of their comfort zone, stretching themselves, and building applications and picking up necessary skills along the way. Meanwhile, the other person has been spending their time going through 75 introductory react courses on Udemy. One has an upward trajectory; the other is stuck in a loop.

The second is simple: the individual does everything related to coding that doesn't involve writing code. They attend every meetup. They share relevant content on LI daily. They're subscribed to every subreddit. But they're never actually creating anything. Zero green squares on GitHub.

If you want to become a programmer, start coding. Think of something you'd like to build and get to work!

2 years, 1 month agoEvasiveBeaver posted comment on learnprogramming.
Jan. 25, 2019

The problem is that to understand clean code they have to be able to differentiate between good and bad design. That insight usually only comes with the experience of having to modify badly written code. I can point them to Clean Code By Robert Martin. But most of it will go over their heads.

I'm ashamed of my code. [R]

2 years, 1 month agosamort7 posted submission on learnprogramming.
Jan. 16, 2019

I've come to a point where I can see how bad my code is. It solves the problem, but it's just sloppy and spaghetti-like.

Are there any resources or approaches I can take to improve its quality?

500€ to spend on books, can you reccomend me some good cs books? [R]

2 years, 1 month agoupforce posted submission on learnprogramming.
Jan. 12, 2019

Here in Italy the State give away 500€ to all the 18 years old to spend in books and culture related things.

I'm going to buy some cs books of all subjects, programming, computer architecture, operative systems, networking, maybe hacking too, anaything that can teach me something about computers and expand my knowledge.

I'm a beginner but know a few things here and there, but I'd like to buy titles that cover almost everything from the start, and maybe some books with theory, and other with some practice so i can try things on my pc.

So, have you guys some good reccomandations??

2 years, 1 month agoupforce posted comment on learnprogramming.
Jan. 12, 2019

Clean code.

One of the few books that I read and actually changed my perspective on how I write some of my books.

https://www.amazon.com/dp/0132350882/ref=cm_sw_r_cp_api_i_6KJoCbXM89XFH

Learning to write simple code [R]

2 years, 1 month agoziptofaf posted submission on learnprogramming.
Jan. 9, 2019

I can code but I get the impression I tend to overcomplicate things, where can I go and what can I do to learn how to improve the simplicity of my code?

2 years, 1 month agoziptofaf posted comment on learnprogramming.
Jan. 9, 2019

Well, there is Clean Code that you might find useful for your needs. However make no mistake - writing "simple" code that remains maintanable and others will be able to read is actually really hard and the only real way to progress at it is working with big projects and reading code written by other people. Not like you shouldn't try to improve before then obviously, just pointing out that your question might be very short but actually finding an answer to it can take years of experience :P

Python - design patterns [R]

2 years, 1 month agotwillisagogo posted submission on Python.
Jan. 7, 2019

I consider myself to be a little bit less than a semi-advanced Python user (Flask and data analysis). I'm halfway through Fluent Python book and I'm thinking about the next one that I'll be reading on Python.

I'm aware of such a concept as design patterns. I thought that it might be the next step on my Python education stuff. I completed a one-semester university course on OOP. I know there's a classical book Design Pattern that has examples implemented in C++ and Smalltalk. I was wondering if I should even bother reading it? What is the recommended reading list for a Python programmer that would optimally enrich my design patterns skills?

2 years, 1 month agotwillisagogo posted comment on Python.
Jan. 7, 2019

it wouldn't hurt but a lot of the design pattern stuff described in that book are largely features of newer languages(iterator related patterns) or are not needed(adapter). You could watch this and get the gist

IMO, books like Clean Code, Code Complete, or Refactoring by Martin Fowler would bear more fruit even though they are not related to python at all, but just general universally applicable programming/design skills.

And again, MY OPINION, learn a Lisp. Even if you don't use it in your daily work will open your mind to new concepts and some of those can be applied to python or any other language.

Try Clojure or Racket

Where can I learn more about more elegant/complex object interactions in OOP (e.g. for simple game development)? [R]

2 years, 2 months ago149244179 posted submission on learnprogramming.
Dec. 11, 2018

I'm working on a D&D combat simulator (I built it for a school project and want to expand it between semesters). Due to deadlines, I ended up with a bunch of spaghetti code, so I want to spend some time refactoring it before adding more features. However, I'm not sure how to improve the structure of the code. D&D isn't very straightforward to program, and I keep running into interesting challenges, and I know that some solid base structuring will help me out in the long run, rather than just continuing to patch my current mess.

In particular, I have a number of .py files imported back and forth into each other, I've got circular references out the wazoo (A is a member of B which is a member of A) preventing garbage cleanup from working, and I don't know how to make conceptually "distant" objects interact (like having a player's weapon damage rolls output to a window in the GUI) without just making everything a member of everything else, which feels extremely bulky and ineffective, particularly when working with many levels of abstraction.

I just learned about object inheritance which will help improve my abstraction, but won't fix everything. I think what I'm looking for is some kind of event handling system that can link different classes and functions together, but I've never built something like that. In particular, I'm looking for good practices rather than just hacking things together until they work. Does anyone know any good tutorials, or just general methods/concepts that I might not have learned yet?

2 years, 2 months ago149244179 posted comment on learnprogramming.
Dec. 12, 2018

Picking up a data structure book or two would give you a solid baseline. Couple recommendations: 1 . 2 . 3. #1 is a personal favorite.

A lot of games use Entity/Component systems.

AI uses a lot of state machines. Animation logic is almost always state machines.

You mentioned Events - Observers, Event Handlers/Listeners. These are likely best for logging like your 'display weapon rolls' example. Whenever some logic does something you want to log/display - have it "publish" that event/data and anyone listening can receive it. Have your UI window "listen" to X,Y,Z and log the data included in those events.

Look into common ways to do logging, that is all your UI display window really is. Logging the result of your dice rolling logic.

Your GUI should has as little logic as possible. Various ways to accomplish this - MVC is a common pattern used to achieve this.

You should google "alternatives to X" for every keyword I said. Probably "pros and cons for X" as well.

Hi im 14 years old I really want to learn code [R]

2 years, 2 months agoPuzzleheadedMagician posted submission on learnprogramming.
Dec. 3, 2018

Hi i started coding a month ago i had alot of motivation in the start but when time go i got pretty unmotivated and maybe it would help if i find a guy buddy to code with because i didnt feel i learn that much and understand what i saw in a tutorial

My English is not the best i come from Denmark If anyone will like to Help me in my coding and all that pls add my Discord Gorm#6305 . Im so thankfull for all youre sweet comments If anyone like me are Very noob at coding xD and wanna get help by people join The discord server it helped me alot! https://discord.gg/eEZ2Ztm

2 years, 2 months agoPuzzleheadedMagician posted comment on learnprogramming.
Dec. 4, 2018

Hi, always nice seeing new people getting into programming. I'm sure you'll find that by necessity this is an extremely helpful and sharing community.

If you are interested in reading any form of material regarding programming I would start with recommending Clean Code by Robert C. Martin. It basically tells you how to make your code more readable for others.

When you have gotten the basics down I would also recommend you read Game Programming Patterns by Robert Nystrom. This one you can read for free on the web and is simply about various patterns used in programming and what they are good for.

I'm from Sweden and currently study game programming. I'll be happy to try and answer any question you want to throw at me. :)

Learn Design Patterns? [R]

2 years, 3 months agoAndrew_Shay posted submission on learnpython.
Nov. 21, 2018

What's a good way to learn python design patterns? I know the language pretty well and have been writing it professionally for over a year, but whenever I'm writing a system of classes or functions, I can't help but think that there must be a better way to do this that's more elegant, extensible, etc.

2 years, 3 months agoAndrew_Shay posted comment on learnpython.
Nov. 22, 2018

The book Clean Code will help with improving your code in general.

Head First Design Patterns is great! But in Java. The patterns still apply to Python though.

Here are patterns in Python https://github.com/faif/python-patterns

Duda a programadores: ¿Cuánto debo aprender antes de buscar trabajo? [R]

2 years, 3 months agoRedScud posted submission on argentina.
Nov. 9, 2018

Veamos, soy de Venezuela y vivo en CABA. Desde hace tiempo estoy interesado en aprender programación y ahora que ando trabajando acá pues aproveché y comencé a estudiar en un curso. La verdad el curso es muy básico y lento para mi gusto pero es lo que me alcanza por ahora.

Estoy estudiando unas 2 ó 3 horas diarias los lenguajes que me recomendó un amigo, estos son Java, Javascript, HTML y CSS. Hasta ahora todo bien, comprendo lo básico pero tengo una duda: ¿Cuánto debo saber para optar por un trabajo en el área?

Aprendo con facilidad e intento repasar todo al menos una vez a la semana pero la verdad no sé en qué punto sentirme preparado y decir "Ahora sí comenzaré a enviar CVs".

Pues si me podrían ayudar con eso les agradezco. También si tienen alguna recomendación a la hora de buscar trabajo con alguna empresa o conocen de algo, tienen un consejo o así también es bien apreciado. Gracias!

EDIT: Me esperaba como dos respuestas a lo mucho. Gracias a todos por la ayuda!

2 years, 3 months agoRedScud posted comment on argentina.
Nov. 9, 2018

Jajaja salta a la vista no?

Comentarios igual te los paso... pero que te encuentres un metodo asi de jeta llamado ersteIndexprufung ponele en vez de firstIndexVerification.

Ya vi cosas como var variavel1 , function asdfg

Ya que hablamos de todo esto:
https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

Self-taught people who landed jobs. How has your code changed since? [R]

2 years, 3 months agojcbbjjttt posted submission on learnprogramming.
Nov. 5, 2018

Hi all,

I'm self-taught in python (...obvious starting place) and I like creating products. However, I am always concerned that I'm not doing things correctly. My code works, but if I was in a professional team, would they allow 5 nested if statements? I'm definitely not doing things in the most efficient way, and I don't know if my code is resilient enough to stand up to users using a product.

I keep learning, watching videos, and do an awful lot of practice/building. What I'd like is a service where a professional dev looks at my code, and just say what's what really.

Anyone else in the same place?

2 years, 3 months agojcbbjjttt posted comment on learnprogramming.
Nov. 5, 2018

I've been programming for 23 years now. I was originally self taught and have worked with many people who are self taught. In my opinion, working with people who are self taught is usually a much better process than someone who has only ever learned from school based assignments. Since you were never told otherwise but you are super motivated to make things work, being self taught can definitely leads to many bad habits.

For example, the very first game I wrote was in BASIC and I didn't know about loops or subroutines. The entire logic of the game was written using a 10,000 line block of if elses which described all possible ways the game could play out. However, I did eventually learn about subroutines and loops and am constantly looking to improve my code. That is the key piece that you need to remember and put forward when working with others. Let them know that you're always looking to improve yourself. Try not to get defensive about your work if it is criticized. Instead, explain why you chose to do something that way and ask for suggestions on improvements.

It sounds like you're on the right track already and that given time, you'll be a top notch hacker. Keep pushing yourself to improve and refactor your code.

Two books that could be useful for you to start with writing / rewriting code to be cleaner and more professional.

Clean CodeRefactoring: Improving the Design of Existing Code

Best of luck!

Self-taught people who landed jobs. How has your code changed since? [R]

2 years, 3 months agonutrecht posted submission on learnprogramming.
Nov. 5, 2018

Hi all,

I'm self-taught in python (...obvious starting place) and I like creating products. However, I am always concerned that I'm not doing things correctly. My code works, but if I was in a professional team, would they allow 5 nested if statements? I'm definitely not doing things in the most efficient way, and I don't know if my code is resilient enough to stand up to users using a product.

I keep learning, watching videos, and do an awful lot of practice/building. What I'd like is a service where a professional dev looks at my code, and just say what's what really.

Anyone else in the same place?

2 years, 3 months agonutrecht posted comment on learnprogramming.
Nov. 5, 2018

My code works, but if I was in a professional team, would they allow 5 nested if statements?

Probably not. I can strongly recommend reading the Clean Code book, it deals with a ton of these kinds of questions. And not just read it; apply what you read too.

ULPT: Just lie about having a college degree. Companies rarely check, and the only consequence if they do is not getting hired. [R]

2 years, 3 months agoElongatedappendages posted submission on UnethicalLifeProTips.
Nov. 2, 2018
2 years, 3 months agoElongatedappendages posted comment on UnethicalLifeProTips.
Nov. 2, 2018

By making things and putting them on GitHub, and then you can link to your GitHub portfolio on LinkedIn. Any company worth working for will care more about the quality of your work than your certifications.

If you're asking how to learn programming in the first place, it has never been more accessible! There are countless books and guides out there for any topic imaginable. So what I told apprentices at the last company I worked was, start by reading Clean Code by Bob Martin, to get a feel for the mindset with which to approach programming.

And from there, just start making stuff-- 'Breakable Toys' we call them. After print("Hello World") the first thing I made was an unbeatable tic-tac-toe game, and then a bunch of other random stupid stuff before I learned to do anything interesting or marketable.

OPINIONATED STATEMENT ALERT: You must make your first project in Elm! :) it's by far the most beginner-friendly language I've ever worked with, and really just an overall delight (even for non-beginners). Even though it's not the most marketable language right now, it's the best intro you could have into programming, and will give you a great foundation to learn other languages!

Looking for resources to improve softeare design patterns and hope to properly structure applications in a more professional manner? [R]

2 years, 4 months agowhereisspacebar posted submission on cscareerquestions.
Oct. 17, 2018

[removed]

What does it say about my coding if I have a difficult time knowing what everything means when returning for an old project? [R]

2 years, 4 months agobatmassagetotheface posted submission on learnprogramming.
Oct. 14, 2018

I know every programmer has trouble getting back to old code he wrote. Is there a way to alleviate this issue?

2 years, 4 months agobatmassagetotheface posted comment on learnprogramming.
Oct. 14, 2018

It means you need to get better at writing clean code.
I think all devs have gone back to older code and it may as well have been written by someone else.
This can be especially frustrating in a professional setting.
What helped me a lot was this book

IWTL: How to structure my code and work like a professioal [R]

2 years, 4 months agoHarkonnen posted submission on IWantToLearn.
Oct. 11, 2018

Hello!

I've been developing some apps for personal use for the last 2 years.

However, my code can get really messy and I never really got around to making documentation and little user guides, so people can understand how they work and how to properly use them.

I've been offered a position working in software development and now I really feel like learning to structure my code properly is a must.

Any tips, links or even books you'd recommend?

Looking for a regular code reviewer for a personal project [R]

2 years, 4 months agohaven1433 posted submission on csharp.
Oct. 8, 2018

Anyone out there interested in doing code reviews for open source C# projects hosted on GitHub? I feel like a competent coder, but I know an outside perspective on code can help increase readability / maintainability. My current project is just getting started, so there's not a ton of code to understand yet.

I'm building a specialized hex editor using C#, WPF, Xaml, MVVM, XUnit, and probably IronRuby.

Edit: Thanks or the interest: As several people asked, here's a link to the GitHub repo. As I said, the project is just getting started: I'm looking for someone interested in doing periodic reviews, not just a single review, and I know that understanding the codebase is always easier when someone jumps on at the beginning of the repo instead of far down the line. Feel free to add a 'Watch' to the repository so you see when I get new features up for review.

2 years, 4 months agohaven1433 posted comment on csharp.
Oct. 9, 2018

Regarding a decent README, I absolutely agree. My thought was that I would add one as soon as I have some of the basic features working. But I suppose that at the minimum I should add some sort of vision statement to a README so that you kind people at least can see my goal for the project.

Regarding comments: I actually agree with Clean Code, that using comments is usually a smell showing that the code isn't clear enough. Were there specific places where the code was hard to read, which made you want comments? Maybe there's some refactoring I could do to make the code more clear.

Python - developing interactive web application like R Shiny [R]

2 years, 4 months agoducdetronquito posted submission on Python.
Oct. 7, 2018

We are a small organization that wants to deploy confidential interactive data sets in the form of a web application in the company's website. Currently, web mathematica is being used to deploy, but we are trying to move away from it, as it is quite expensive.

I am planning to use either R or python and decide which one would be the best fit for this work

Some general requirements and things we have:

  1. The application should be interactive like R Shiny - eg. I should be able to adjust slider bars and the graph should update accordingly

  2. The number of concurrent users are small ( <10 ), so we are not very concerned about scalability, but we want to develop an application that can run for a long time, without having to change the code every now and then, and without much admin support

  3. Security and authentication - we will be linking this application in the company's website

  4. The data should be hosted on site. We are running and maintaining our own server. Cant host on AWS

I have been working a lot with R and Shiny (https://shiny.rstudio.com/) recently, and it seems to be a very good fit - There is also a free way to deploy using https://www.shinyproxy.io/ - which is essentially a replacement of the shiny server pro

What do you think comes closest to R Shiny for python? What are the steps involved in developing and deploying such an application? I have looked into web frameworks such as Django, Flask and Dash (from plotly). Do I also need D3.js to do the interactive components as in R Shiny?

2 years, 4 months agoducdetronquito posted comment on Python.
Oct. 9, 2018

I think you are good to go !

Last advice: even if you are not primarily a developer, try to read how to code well. For example, this book is gold: Clean Code: A Handbook of Agile Software Craftsmanship)

Can some data engineers take a look at my GitHub and give me some feedback on couple of simple self projects I did? [R]

2 years, 4 months agomaxmoo posted submission on datascience.
Oct. 8, 2018

A recruiter told me he’s not sure if my GitHub helps me or not because he’s not an engineer but recommended that I ask someone who is.

Can someone take a look at my GitHub for data analysis including web scraping, and give me a feedback on how it looks & whether it helps me or goes against me?

It’s not anything big. Just a simple web scraping using bs and Selenium, cleaned data with panda and visual with seaborn. I’m trying to get into data analysis and engineering for a path to data science so if anyone can give me some critique I’d appreciate it.

Thanks

https://github.com/spaceguy01/DataScience

2 years, 4 months agomaxmoo posted comment on datascience.
Oct. 8, 2018

Before OP worries about data engineering libraries, I'd be looking to see some more fundamental software engineering skills, i.e. things you might find in https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 like

  • variable names
  • formatting
  • functions(!)
  • tests

Could you recommend a book about organizing project files? [R]

2 years, 4 months agoOct. 8, 2018

[deleted]

2 years, 4 months agoandoril posted comment on AskProgramming.
Oct. 8, 2018

As stated by u/humpier I would recommend to look at other people's projects on Github and how they do it plus looking at popular frameworks in your preferred language and what their standards are.

As you mentioned Wordpress it seems you're more into web development, so maybe you could start with Laravel or Symfony and try to understand their standards.

And I don't know if this may help you and for me it changed how I think about organizing my code but you could take a look at Clean Code by Robert C. Martin. After reading it some things just fell into place for me, which had a lot to do with naming conventions.

Update 'big' Yii1 application [R]

2 years, 4 months agolocalheinz posted submission on PHP.
Oct. 3, 2018

[removed]

2 years, 4 months agolocalheinz posted comment on PHP.
Oct. 3, 2018

If upgrading your application from Yii1 to Yii2 requires a rewrite, then switching to Laravel or Symfony will also require a rewrite.

If you have read Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin, then you might remember the Grand Redesign in the Sky - if not, take a look at What is Clean Code?:

> The Grand Redesign in the Sky > >Eventually the team rebels. They inform management that they cannot continue to develop in this odious code base. They demand a redesign. Management does not want to expend the resources on a whole new redesign of the project, but they cannot deny that productivity is terrible. Eventually they bend to the demands of the developers and authorize the grand redesign in the sky. > >A new tiger team is selected. Everyone wants to be on this team because it's a green-field project. They get to start over and create something truly beautiful. But only the best and brightest are chosen for the tiger team. Everyone else must continue to maintain the current system. > >Now the two teams are in a race. The tiger team must build a new system that does everything that the old system does. Not only that, they have to keep up with the changes that are continuously being made to the old system. Management will not replace the old system until the new system can do everything that the old system does. > >This race can go on for a very long time. I've seen it take 10 years. And by the time it's done, the original members of the tiger team are long gone, and the current members are demanding that the new system be redesigned because it's such a mess. > >If you have experienced even one small part of the story I just told, then you already know that spending time keeping your code clean is not just cost effective; it's a matter of professional survival.

Unless you and the team you work with has already asked and answered these questions, maybe there are more interesting questions to ask, for example:

  • What are the actual costs of a rewrite?
  • What is the business value of rewriting the application?
  • Perhaps the business is better off improving the current system than rewriting it entirely?
  • What can we learn about coupling our application to frameworks from this situation?

One of the devs that does code review for my code keeps bringing this style note up, which I personally disagree with. Opinions? [R]

2 years, 5 months agonotThaLochNessMonsta posted submission on javascript.
Sept. 29, 2018

This is just a simplified version, as an example

My code:

function foo() {
   if (bar) {
      // logic
      return something;
   } else {
      return somethingElse;
   }
}

His refactor:

function foo() {
   if (bar) {
      // logic
      return something;
   }
   return somethingElse;
}

Which do you prefer?

I personally find the first to be more readable. Thoughts?

2 years, 5 months agonotThaLochNessMonsta posted comment on javascript.
Sept. 29, 2018

There are more than 356 people in the programming community. This isn't Mumps.

I agree most of the time that early returns are better. But this isn't proof that "most of the programming community agrees". You realize that there is a substantial amount of developers who believe in only 1 return per function, right? Something that is evangelized in Clean Code.

How to learn "correct" coding practices? [R]

2 years, 5 months agoYuleTideCamel posted submission on learnprogramming.
Sept. 28, 2018

So I have good experience with coding and given a project could come out with code that works. I'd like to participate in the FOSS community to keep myself sharp because my job doesn't require a whole lot of straight coding anymore. However, in researching I've seen a lot of forum posts and such about "correct code". I can code, but how can I take the next step into "correct code"? Also, does "correct code" have something to do with formal verification of code?

2 years, 5 months agoYuleTideCamel posted comment on learnprogramming.
Sept. 28, 2018

Read the book Clean Code. Also look up SOLID principles and unit testing.

I'm a software architect, my job is to lay the foundation so our code is "correct" , "clean" and of high standard. What that means (to me at least), is that the code has the following attributes:

  • It's easy to read and maintain. The structure of the different components should be very easy to grok and intent should easy to discern.
  • Code should be loosely coupled and easily unit tested.
  • Proper design patterns in place to avoid repetition and promote code reuse when it makes sense.

In addition to just learning code, I'd highly recommend learning about CI/CD (continuous integration and continuous delivery.) Learn how to set up pipeline to build and deploy your code in an efficient manner with zero downtime for the users of your application.

How is my code? (JavaScript) [R]

2 years, 5 months agorfinger1337 posted submission on AskComputerScience.
Sept. 20, 2018

So, I just started programming in Javascript (It's what we're learning in school.) and I decided I would begin working on a game in it. (Not what we're learning. We're still in the beginning phase of learning what the commands do.) I just wanted to know if my code is too messy (This is my first time programming if you don't count scratch, and I never really used the comment function in scratch.) https://da.khanacademy.org/computer-programming/pokmon-java-version/6694802345984000 - Link to my project.

2 years, 5 months agorfinger1337 posted comment on AskComputerScience.
Sept. 20, 2018

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=pdlposbs14img0?encoding=UTF8&psc=1&refRID=AEMGS8RSDRVGGBS0TPW9

This is a must read for every developer.

Trying to make mainform async, but causes error. [R]

2 years, 5 months agoJonnyRocks posted submission on csharp.
Sept. 11, 2018

I'm trying to make my MainForm async, but as soon as I add async Task<Boolean> I get a 'member name can't be same as enclosing type' error but if I rename either mainform I get other errors. Relevant code:

  namespace SlideShow
{
static class Program
{
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new MainForm());
    }
}
}

namespace SlideShow
{
  public partial class MainForm : Form
  {
     public async Task<Boolean> MainForm()
     {
     }
  }
}

What should I do here?

2 years, 5 months agoJonnyRocks posted comment on csharp.
Sept. 11, 2018

Don't do that in the constructor. Have a separate method.

Relevant book: Clean Code: A Handbook of Agile Software Craftsmanship https://www.amazon.com/dp/0132350882/ref=cmswrcpapa_GY6LBbAR3DBD8

Case studies/literature on keeping projects maintainable as the codebase/team scales up? [R]

2 years, 5 months agomachuu posted submission on learnprogramming.
Sept. 8, 2018

I've been programming professionally for ~6 years now, including a string of internships while I was at school. One thing that's struck me is that everywhere I've worked, I've encountered a messy, legacy codebase that became hard to understand as it grew.

It seems like this problem is universal, but I haven't found much written on how to mitigate it. I'm thinking about something a bit more macro than just knowing/applying patterns -- more like:

  • standardizing on which patterns to use when
  • coming up with engineering guidelines strict enough to be useful but unobtrusive enough that they're generally followed
  • writing documentation in a way that's efficient and (relatively) easy to change when necessary
  • writing code that helps new engineers learn its structure and how to work with it

I'm on a team now that's scaling rapidly, and I'd like to do what I can to hold that entropy at bay. I have a few vague theories about how to do this, but I'm not sure I've ever really been at one job long enough to see if they hold up. Is there any good, thorough, pragmatic reading I can do on how other people have tackled this problem in the past, what works, and what doesn't?

2 years, 5 months agomachuu posted comment on learnprogramming.
Sept. 8, 2018

Robert "Uncle Bob" Martin has produced a lot of good material on exactly this subject.

You could start with one of his books Clean Code: A Handbook of Agile Software Craftsmanship

He has some other books, and a website cleancoders.com

Clean Architecture by Uncle Bob: Summary and review - CleverCoder.net [R]

2 years, 5 months agoSept. 8, 2018

A clean architecture starts from clean code.

Clean architecture is the latest book by Uncle Bob.

Clean architecture is an architecture following Uncle Bob’s principles.

Some of the pros are: Some of the cons are: So what do you think about Clean architecture?

Clean architecture contains many more topics and examples I can’t cover here for space reasons.

Formalizing My Python [R]

2 years, 5 months agofernly posted submission on learnpython.
Sept. 4, 2018

I'm an electrical engineering graduate who recently started a job where python is the main language our section uses. We create/modify models of radar systems and analyze data from real systems or simulations. As opposed to a CS grad, most of us EE grads don't take courses in software engineering, algorithms, etc. So (speaking from personal experience) our code tends to be less structured, more difficult to maintain, and less user friendly than, say, a software developer's code.

I would like to set my code apart from the typical EE graduate's code, so I started sticking to the pep8 style guide, started trying to write more pythonic code, and isolating independent sections of code into functions (you'd be surprised at how many times I've seen EE peers in school dump all their code into a single main function (I'm not proud to admit I've been guilty of it, too).

So what are some good resources for formalizing my python? Making it more like what a software developer would expect from his peers? Sorry if this question is too vague. I'm not really sure how to even word what I am looking for.

(I use python 3 and the Anaconda environment with the Spyder 3 IDE).

2 years, 5 months agofernly posted comment on learnpython.
Sept. 4, 2018

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

Reading the TOC, I see a lot of good ideas and advice that resonate with my experience.

How do I make large project and succeed on completing and maintaining them for years to come? [R]

2 years, 6 months agoziptofaf posted submission on learnprogramming.
Aug. 19, 2018

(By "large" I mean project with 10k - 100k LoC; large for me but not for real world software)

I've been writing small programs this past 3 years, mostly for my college assignment and some other fun side project. I wonder, if I were to plan for a bigger one, what should I do? Yes, I read about refactoring and so on but it stops there, just a mere theories without any meaningful practice.

The largest one I did is around JavaFX apps with 1k LoC. Yet it is disappointing to look at because I went full retard code monkey on it. I only have one month to finish it, absolutely zero knowledge in JavaFX before, so I google, copy-paste, read what it does with Jetbrains built-in javadoc fetcher, and hope things just works without even care optimizing its data structure; LinkedList everywhere.

I remember there was an OOP class where our mentor gave us sets of requirements to code. The way the problem laid is so UML-like, so I find them easy to turn into code. Is that what I actually need? A huge blueprints on what I'm about to work on, or not? Please help me :/ Thanks before.

2 years, 6 months agoziptofaf posted comment on learnprogramming.
Aug. 19, 2018

Honestly this is one of the things you learn on the job when you see massive applications written by other people and can first hand experience how easy (or hard) it is to unravel how it works and fiddle with it. Theory is one thing but practice is another and frankly there's no replacement for experience when it comes to size.

That being said - the basic "ingredients" to big applications are as follows:

  • up to date documentation - how are elements connected to each other, what they are supposed to accomplish and how.
  • good testing coverage - if you change something, it should cause tests to fail.
  • avoid "god classes", spread responsibility appropriately. Look into architectural patterns like MVC for instance which separates an application into models, controllers and views. Models are a layer of the data and interact with the database and files. Views are responsible for simply showing stuff to user. Controllers are the layer between the two - making sure only valid users can access said resource, answering to user's requests and so on. It's a good idea to look into this kind of pattern since you are almost guaranteed to see it in the real world - eg. if you use Java then it's probably biggest current web framework is called "Spring MVC".
  • establishing policies regarding a given project - these 100k+ LoC ones are generally built by more than one person. You want to be clear on the coding style to use - starting from variable names, allowing or disallowing global variables, deciding on what libraries are fine to integrate and which should not be used, what's the order of operations (eg. maybe tests should be written FIRST before you even get to coding an actual feature using them, this is known as TDD - Test Driven Development) etc. Basically a set of rules so it's easier to understand the codebase later on and ensure that it maintains the same style.

Yes, I read about refactoring and so on but it stops there, just a mere theories without any meaningful practice.

I suggest you find yourself a copy of Clean Code, it will answer a big chunk of your question better than any reddit post could. You can also look at existing open-source environments in your language of choice and see how they are maintained and structured, try adding a test or two for them.

Any good books on general code design? [R]

2 years, 6 months agoAug. 11, 2018

[removed]

2 years, 6 months agoFeelingOffByOneBit posted comment on cscareerquestions.
Aug. 11, 2018

Since you are about to get into an internship, I'd suggest that you take a look at Clean Code.

If you were preparing for one.. I'd say you read Algo Design Manual by Skiena.

Needless to say, if you have enough time at hand.. Read both.

I'll be spending a lot of time away from computers for a couple of months and a need a way to stay fresh. Tips/ideas? [R]

2 years, 6 months agoYuleTideCamel posted submission on learnprogramming.
Aug. 10, 2018

As the title says. I have a travel opportunity coming up that has the both upside and downside of limited access to computers. I am progressing a lot in my programming journey but don't have the muscle memory yet. I was wondering what people do to stay fresh at times like this in their lives. Have you found books to be of use? Does anyone keep a programming journal (I mean, I'm not even sure what that would look like- I guess like class notes)? Flash cards?

Thanks.

2 years, 6 months agoYuleTideCamel posted comment on learnprogramming.
Aug. 10, 2018

Books would be good. Most technical books work better if you can immediately try the examples, but having a bookmark or something to remind you to try later would be good.

Another would be read some books that are programming related but not an introduction to a programming language or such. For example:

Another thing to consider is videos, a lot of online courses allow you to download videos to your phone. Though imo, they are hard to follow on a small screen as they will show code and you'll end up squinting a lot :)

Going through django's session module made me rethink my approach to programming, I think I need help [R]

2 years, 7 months agoziptofaf posted submission on learnprogramming.
July 31, 2018

Recently started a job, due to some requirements and my love for django I had to go through the sessions module. I went through the complete db sessions module. It took me three to four days to get my mind around it. I completed the task. Seeing the design of sessions made me realize how fool proof and elegant it was, I also realize I write classes for the sake of it(after seeing the code). I want to learn how to write,design good object oriented code in python. Any good resources? I can use inheritance nicely,encapsulation no-no just the bare definition, Abstraction just the definition. My Favorite language is python. Even if you have resorures that are not targeted for python users by all means please share it here.

Thanks!!

2 years, 7 months agoziptofaf posted comment on learnprogramming.
July 31, 2018

Two words: Clean Code

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

Just a good book that showcases a proper way to design your code structure.

Creating a program that uses multiple classes! [R]

2 years, 7 months agopantshirtshoes posted submission on javahelp.
July 26, 2018

When creating a program how do people decide what needs its own class dedicated to it, and which methods to put in one class? For example, I’m making a blackjack game using a swing GUI, and I don’t know how many classes I really need. For example does an event handler need its own class? How would I use the code for that class in other parts of the program if it’s all on its own? A deck class and a card class or just a deck class? What methods belong in just the card class and just the deck class? I understand most of the syntax behind what I need to do, but I don’t know how to structure my program effectively which I feel like is the most important part of programming!

2 years, 7 months agopantshirtshoes posted comment on javahelp.
July 26, 2018

Questions like these often have a subjective answer. Who to listen to? You're going to get lots of opinions (some of which will be very good) but in your case, you will benefit from general advice which you can apply to just about any situation. Luckily for you, there are some "standards" which exist that you can use as you grow as a developer. This "advice" benefited me when I was a young optimistic Java buck like yourself.

This book: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

There is also a video version of this. Robert C. Martin is pretty quirky in his video.. He has an odd, nerdy sense of humor. If you can stand it, then there's a wealth of lessons to be learned from this old classic.

[Tutorial] Let's learn algorithms #1 / Data Structures [R]

2 years, 7 months agoJuly 18, 2018

[deleted]

2 years, 7 months agofirecopy posted comment on learnprogramming.
July 18, 2018

Your first code example is not readable (especially to beginners). I would recommend reading Clean Code by Robert C. Martin for ways to improve your code readability. Here is a code snippet that cleanly solves "...[wanting] to print every letter of alphabet in a new line." Notice how both the variable names (and other keywords) do not leave any ambiguity.

<pre>alphabet = "A", "B", "C", ... i = 0 while (i &lt; alphabet.length) { println(alphabet[i]) } </pre>

Notice how this cleaner version of code does not answer the question Why would I want to use a reference type?, indicating that you should probably use another example to explain the purpose of reference types (Data reuse without reduplication, allowing for faster programs).

I don't understand how to write readable code. What are your tips? [R]

2 years, 7 months agocyrusol posted submission on learnprogramming.
July 14, 2018
if (m > 12 || d > 31 || d < 0 || m < 0 || y < 2000 || y>2050|| //check for the limitations
        (m==2 &&((y%4==0 && d>29)||d>28)) //check for February
        ||((m<7 && m%2==0 &&d>30)|| (m>7 && m % 2 ==1 && d>30)) //check for the months with 30 days
        ) error("invalid date");

for example is this readable? It's for a function that checks if the date is valid; that takes m (month), d(day), y(year). How can I make it more readable and prettier. I know that I should name the variables clearer but aside from that what can I do? Maybe I've used way too many || and () but isn't that prettier than bunch of if statements?

2 years, 7 months agocyrusol posted comment on learnprogramming.
July 14, 2018

Read and apply everything from Clean Code, really.

I don't understand how to write readable code. What are your tips? [R]

2 years, 7 months agoFrolo_NA posted submission on learnprogramming.
July 14, 2018
if (m > 12 || d > 31 || d < 0 || m < 0 || y < 2000 || y>2050|| //check for the limitations
        (m==2 &&((y%4==0 && d>29)||d>28)) //check for February
        ||((m<7 && m%2==0 &&d>30)|| (m>7 && m % 2 ==1 && d>30)) //check for the months with 30 days
        ) error("invalid date");

for example is this readable? It's for a function that checks if the date is valid; that takes m (month), d(day), y(year). How can I make it more readable and prettier. I know that I should name the variables clearer but aside from that what can I do? Maybe I've used way too many || and () but isn't that prettier than bunch of if statements?

2 years, 7 months agoFrolo_NA posted comment on learnprogramming.
July 14, 2018

i recommend this book on the matter https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/

give variables meaningful names.

instead of having a block of code with a comment saying what it does, make it a method with a name like:
checkForMonthsWith30Days(){ // code }

Advice for CS-theory people at their first industry SWE job? [R]

2 years, 7 months agoJuly 13, 2018

[deleted]

2 years, 7 months agoArnoldRudolph posted comment on cscareerquestions.
July 13, 2018

> Anyone have advice for "theory people" who can't code all that well starting out in industry?

Casually read one of these (which is how to perform technically):

All you really need is the above info on how to code well and write robust modular code that is tested, the rest is just doing whatever code style you see in your codebase. It also will serve you over any language at any job company... for the most part.

Then consider reading this after for how you should be as a person doing programming (which is non technical important information):

You will pick up frameworks and knowledge of the language as you go, no need to stress over it.

Spend the first year doing front and backend, then after 6-12 months (starting from day 0 of work) specialize in the area you find interesting, such as a framework, or databases, or backend, or microservices, or whatever you find interesting.

Learn to write maintainable code instead of getting shit done [R]

2 years, 7 months agoasdfman123 posted submission on cscareerquestions.
July 10, 2018

I had written Managers/CTOs: Writing high quality maintainable code v/s getting shit done? a week ago. It got a lot of attention.

Initially I was agreeing with pydry's answer (The most upvoted answer):

I have a "tech debt dial" which goes from 0% to 100%.

But then I came across

There's a false dichotomy between "beautiful code" and code that is "fast to write".

Writing beautiful code does not take longer than writing messy code. What takes long time is to learn how to write maintainable code.

I did not agree initially, but then thanks to this expanded version I understood that it is true.

A personal incident at work: I wrote a 1 line fix for a regression. I was about to test it manually but then I realized I should have a unit test for this. I git stashed my changes. I took 15 minutes to understand to the test case and a couple of minutes to write the new test. It failed. Then the applied the stash and the test passed. Another thing needed to work so that the code works in production. Instead of seeing the code, I saw we have a test for that and I had the confidence now my fix will work. It did. I knew the next time I wrote another test, I wont spend time to figure out how to write the test.

Code quality = faster development, end of story.

Hence proved.

It's much easier on the personal morale to believe that things like TDD, code review, CI/CD, integration tests are overkill and "My company doesn't do it, and they don't even need it. It is for the larger companies". But this is just not true. This is the difference between a junior engineer (or a bad senior engineer) and a good senior engineer,

I think everyone should aspire to be the best software engineer they can be. This means learning the tricks of the trade. Once you learn them you'll see its actually faster to write maintainable code, even in the short term. And much much faster in the long term.

2 years, 7 months agoasdfman123 posted comment on cscareerquestions.
July 10, 2018
2 years, 7 months agoFizixMan posted submission on csharp.
July 8, 2018

I have a week of vacation and most of it will be spent on the beach, I was looking for a good intermediate book on C#. Ideally it would be something more conceptual since I wont be at a computer while reading it.

2 years, 7 months agoFizixMan posted comment on csharp.
July 8, 2018

Clean Code by Bob Martin

It's written in Java, but for the most part, it's very transferable to C#. When I was a junior dev transitioning to intermediate, it was pretty worth my while. It's a relatively easy read and doesn't require you to be writing code or sitting at a computer (at least it didn't for me).

Feel free though while reading it to critically question some ideas as to how applicable they are in the C#.NET ecosystem, current best practices, and your day-to-day work. (For example, IIRC, he argues that you shouldn't prefix interfaces with the capital I. I still do that though and I find it worthwhile.)

Many Smaller Functions, or Fewer Larger Functions [R]

2 years, 7 months agoSilverTriton posted submission on learnpython.
July 7, 2018

From a best-practices standpoint, is it better to have many small functions, or a few big functions? I tend to write many small functions as it aids in troubleshooting and readability (large functions can feel overwhelming). But, since some of those functions are ever only called once, I am curious if this is poor design and if I should just put the one-off functions into the larger functions that call them?

2 years, 7 months agoSilverTriton posted comment on learnpython.
July 7, 2018

Smaller functions are generally better. Having functions possessing a single responsibility helps testing when the program scales in scope and size. Adding more code means less stuff can break. Helps readability too. I suggest this. Really good book!

I want to be better at my job - JAVA [R]

2 years, 8 months agoKindadeadguy posted submission on learnjava.
June 20, 2018

Since I started working , I never did serious work with JAVA, I had a couple projects in PHP and some projects in JAVA after but only backend the project wasn't from scratch, I didn't feel like i fully understand some concepts, I just learned from others doing the job. I hate this , I want to know about everything i Need to know , I want to be good at this.

I have great communication skills and my logics are good , and that helped me a lot , (even got me another job offer lately) ,but I w didn't spend enough time to learn and I want to find the best way to learn JAVA EE, The most efficient way, no cheating . a step to step guide.

2 years, 8 months agoKindadeadguy posted comment on learnjava.
June 20, 2018

I can't tell you the most efficient way, but I can recommend you a thing or two to read.
First, how good are you at the collecitons framework? If you know how to use it, but aren't super in-depth on the ins and outs, read up on that.
Secondly, are you familliar with clean coding practices? If not, read clean code (https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 ). It's made me a better programmer, and everybody should read it.
That should keep you busy for a few months. There's tons more, but let's take things one step at a time.

Any guides or collection/tips of best practices? [R]

2 years, 8 months agoNiceOneAsshole posted submission on reactjs.
June 15, 2018

I just really want to know the best practices, my workplace unfortunately lacks experienced React devs.

2 years, 8 months agoNiceOneAsshole posted comment on reactjs.
June 15, 2018

They do a good job trying to cover best practices. Can anything truly cover everything?

Without assuming your prior knowledge, I'd suggest looking through codebases/issues/PR's of large libraries in the react ecosystem. Conversations between maintainers and contributors tend to be very educational. Some good repos to peruse - redux, react-virtualized, react-router. /u/acemarke can also hook you up with his great lists/links that you can peruse.

And of course the ultimate recommendation for best practices - Clean Code.

Top 10 Books of All-Time for Java Programmers - DZone Java [R]

2 years, 8 months agoJune 15, 2018

Today, I am going to share the 10 best Java books that every Java developer should read.

You can easily learn about Java 8, Java 9, and Java 10 changes on other versions once you know Java by reading this book.

In this article, I am going to share some of the best Java books ever written.

Effective Java by Joshua Bloch is hands down best Java book ever.

These are some of the best books for Java programmers.

How to improve your coding? [R]

2 years, 8 months agoworkmike026 posted submission on devops.
June 5, 2018

I recently missed a job opportunity for an SRE position because my coding isn't up to par. I have no formal training in computer science, but have a college degree in IT. I feel very comfortable writing bash and comfortable writing python, but after the interview and feedback from the recruiter it was clear it could use improvement (the exercise was in python).

So in the context of someone coming from an Ops background working in DevOps/Site Reliability Engineering, how would you suggest improving my coding ability? I'm already thinking to do coding exercises for basic data transformations and perhaps taking on a project or two on the side. But do you think it's worthwhile to learn more about algorithms and coding paradigms (words like static/dynamic type mean nothing to me)? Are there other concepts I'm missing out on? Any advice, feedback, or your personal experience with coding is greatly appreciated!

2 years, 8 months agoworkmike026 posted comment on devops.
June 6, 2018

Where and how can I learn good design practices? (design patterns, applying OOP concepts, modular design, etc) [R]

2 years, 9 months agothreechewz posted submission on AskComputerScience.
May 29, 2018

Hey, interview season is upon me now. Final year of college. Need to learn how to write better code, learn code refactoring.

2 years, 9 months agothreechewz posted comment on AskComputerScience.
May 29, 2018

Well, there's the classic, Clean Code, which I haven't read but have seen recommended as a great book on this topic. But, in my opinion, as with anything else in programming, you get better by doing, and that includes writing better code. The more code you write the more you'll see basic patterns crop up and you'll start to realize what does and doesn't work. Does inheritance make sense here or should I use some type of composition. Is it worth refactoring this piece of code out to a more general abstraction. When I write, I try to have the mindset that someone else will be using my code in the future and I should write my code in a way that is as accessible for them as possible.

If you had one month of free time, what open-source project would you study in order to greatly improve your skills as a developer? [R]

2 years, 9 months agoFoolMan29 posted submission on java.
May 26, 2018
2 years, 9 months agoFoolMan29 posted comment on java.
May 27, 2018

This is it correct?

I’m 18 years old and learning web development over the summer? What steps can I take to start earning enough doing that to be able to move out on my own within six months? [R]

2 years, 9 months agospoonraker posted submission on personalfinance.
May 24, 2018
2 years, 9 months agospoonraker posted comment on personalfinance.
May 25, 2018

Self-taught software engineer checking in to add on to this.

Everything u/TOMBRADYSPET_GOAT said is true.

I'll add a few specific resources:

Computer science fundamentals are really scary and overwhelming if you're self-taught. I'd highly recommend reading The Imposter's Handbook to get started with this topic. You'll want more in-depth material afterwards on each of the various subtopics, but this book is absolutely fantastic as a (surprisingly deep) introduction to all the concepts that's framed specifically to get self-taught programmers up to speed.

After you're familiar with the concepts at a conceptual level, and it's time to just get down to dedicated practice, Cracking the Coding Interview will be an invaluable resource. This book exists for the sole purpose of helping people become better at the types of questions most commonly asked during coding interviews. It's not just a list of a bunch of questions with solutions, it actually explains the theory in-depth, provides drill and smaller practice questions, as well as questions designed to emulate specific interview scenarios at real tech companies like Google, Microsoft, Amazon, etc. It'll even talk about the interview process at those companies outside of just the questions and theory behind them.

As a more general resource that you'll reach for repeatedly throughout your career, I'd recommend The Complete Software Developer's Career Guide. This book covers everything. How to learn, how to interview, how to negotiate salary, how to ask for raises, how to network, how to speak at conferences and prepare talks, how to build your personal brand, how to go into business for yourself if you want, etc. and that's just scratching the surface of what's covered in that book. I did't even buy this book until I was 10 years into my career and it's still very insightful.

And lets not forget, being a good developer isn't just a matter of making things that work, it's a matter of writing code that readable, extensible, and a pleasure for other developers to work on. So to this end, I'd recommend any developer read both Clean Code and Clean Architecture: A Craftsman's Guide to Software Structure and Design

How do you scope out a program? [R]

2 years, 10 months agorf032 posted submission on arduino.
May 2, 2018

I've been writing code for Arduino for some time now and have written lots of stuff I'm quite happy with, but I'm not a trained programmer, I'm completely self taught.

Whenever I begin a new piece of software I start by thinking about the variables and what's meant to happen etc and try to keep it all in my head and then start writing code based on that.

I recently tried a different approach where I wrote a series of statements in plain English that described how I wanted the software to function and then expanded on those statements until I had enough to begin coding with.

What methods do you use to scope out new software? Flow charts? stealing code? third party software???? Are there any tricks that could help myself and others with complex code?

2 years, 10 months agorf032 posted comment on arduino.
May 2, 2018

"Clean Code: A Handbook of Agile Software Craftsmanship" is a good reading to improve ur programming skills to organize ur code and make it more readable.

This book adds more levels to my programming skills!

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

[JS]Issue grasping how to structure my code. [R]

2 years, 10 months agoserg06 posted submission on learnprogramming.
April 19, 2018

I have done Git a Web Developer Job & The Web Developer Bootcamp on udemy. Currently working through freecodecamp frontend finished the tictactoe project to work with the features they ask for.

However when I look at my code it just feels wrong even though it works.

Here is the code I have for it. link

Is there a good book that tackles this in more detail or is it just something you pickup on the more you go.

2 years, 10 months agoserg06 posted comment on learnprogramming.
April 19, 2018

Interns and new grads, how much direction and guidance do you get? [R]

2 years, 10 months agoobliviouspenguin posted submission on cscareerquestions.
April 17, 2018

Hey guys,

I secured a co-op this February for a no name late-stage startup. It's been 2 months, and honestly it feels like a 2 month hackathon.

I have to write a webapp in reactjs, and I have never used nor are familiar with html/css/js. Very few people in the company know javascript, and even fewer know the react framework. So I go in and take a shot at it, and there's so much to learn - The weird quirks of javascript and lack of domain knowledge is leading me to search vague questions like "what is npm?", "ES6", "how to create table html", "css tutorial". In my 2 months, I've found that JavaScript is a horribly unintuitive language and I hope that one day it dies painfully.

Anyway, I think I have a basic working knowledge now, and have released the MVP last week, emphasis on the M.

I submit my code reviews to some person who doesn't know react, but has about a year in web development experience. The problem is that she doesn't give much feedback in terms of general code structure, as she likes to address more specific problems in the code, like using a different data structure to store stuff. I'm not concerned about the guidance on the most efficient way to <insert algorthmic problem here>.

I'm concerned about everything else; it feels like I'm just winging it. I'm on a 2 month hackathon: first make it work, then refactor to best of my knowledge. I try to make the code as modular as possible, breaking down complex functions into multiple, easier-to-read functions. But I have no idea what an "ideal" app would be like.

I'm sure I can improve on things such as:

  • my project folder structure is nonexistent
  • I crammed 12 components in 1 file, it's 1200 lines and I need to refactor
  • js best practices (How do you check if an array is empty? why doesn't ![] return true????)
  • how do I properly write unit tests for front end???????!!!!!?????

I'm really trying to make a good product, and I am thankful for the opportunity and amazing salary - it's just that there's no one to guide me on these react/js things, I'm expected to just know them, and if I don't, to ask someone. The problem is that no one really has experience, so I can't ask. It doesn't help that the company is small-ish (~50).

I wonder if this is common. Ive talked to one of my friends about this and it sounds like a dream company environment to him: a company that gives you so much autonomy over your project. For me, I wish I had more mentoring so I can pick up new skills.

So interns and new grads, how much direction do you get in terms of this kind of stuff that they don't really teach in classes? Is my situation normal?

2 years, 10 months agoobliviouspenguin posted comment on cscareerquestions.
April 18, 2018

That sounds pretty normal especially for a small-ish company. A lot of learning comes from reading on your own. Like blog posts, StackOverflow etc. I really recommend Clean Code in terms of the stuff you're talking about. This book is basically a software engineering best practices bible.

Unit testing is something your team should help you with though. If a system is not there, you can also try to do some research and propose a system for your company to use or implement!

> For me, I wish I had more mentoring so I can pick up new skills.

It sounds like you're learning a lot though. You built something that works using a new tech you learned from scratch. That's pretty impressive. It's a pretty unique opportunity to try new things and get paid.

Inefficient code [R]

2 years, 11 months agodoubles07 posted submission on learnpython.
April 3, 2018

Hi everyone. Currently trying to do a beginner's exercise but have written very inefficient code. All I need is to produce from the data:

dat = [(10,20),(30,40),(50,60)]

Are outputs like this:

"For number..." "Result = ...." "Yes/no" I.e. For number 0 result = 0.5 yes

So I have written (I know I'm not supposed to copy code directly but for improvement sake...)

def cal(x,y):   resu=x/y   print('result = ', resu)   if resu < 10:     print('yes')   else:     print ('no')

print ('for number 0') 

cal(dat[0][0],dat[0][1])

print ('for number 1') 

cal(dat[1][0],dat[1][1])

The output not only looks ugly but the code is inefficient in that it doesn't apply the function to the whole data set nor does automatically label the data points. Any pointers on how to improve this? What functions should I look at?

Sorry for the trouble but I'm finding it quite hard to start at.. thanks for reading!

2 years, 11 months agodoubles07 posted comment on learnpython.
April 3, 2018

The book Clean Code was recommended to me by my manager when I asked about writing more efficient code. The author goes through best conventions of naming/organizing/etc for keeping your code base super clean and legible. Other people also recommended the Pragmatic Programmer, but I haven't had time to get to it.

How To Write Code That Will Last Forever [R]

2 years, 11 months ago316497 posted submission on Frontend.
March 29, 2018
2 years, 11 months ago316497 posted comment on Frontend.
April 1, 2018

A couple days late, but this book is a must-read on this topic: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr11?ie=UTF8&qid=1522625510&sr=8-1&keywords=clean+code

Gotta love poorly written legacy code [R]

2 years, 11 months agoNalha_Saldana posted submission on ProgrammerHumor.
March 19, 2018
2 years, 11 months agoNalha_Saldana posted comment on ProgrammerHumor.
March 19, 2018

If you have more than two levels of indentation you should break it into multiple methods. If you want to know more I would recommend reading clean code.

Edit: Before you downvote you should know that this isnt my idea, the Clean Code book is even more restrictive and is one of the most recommended books among programmers and companies out there.

C++ Core Guidelines: More about Control Structures [R]

2 years, 11 months agoGoldFrame posted submission on programming.
March 14, 2018
2 years, 11 months agoGoldFrame posted comment on programming.
March 15, 2018

Mate, you need a slap in the face with— I mean a read of: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882.

Improving my code writing skills [R]

2 years, 11 months agoKevMar posted submission on PowerShell.
March 13, 2018

I am not new to PowerShell but I am looking for ways to write better code, more efficiently, more elegantly,...

I did not follow programming classes while at school and I was wondering if that would be useful for me to spend time reading books about Algorithms, Design patterns,...to become a better PowerShell coder, would you have some links, books, cursus to recommend?

2 years, 11 months agoKevMar posted comment on PowerShell.
March 13, 2018

There are a lot of good answers in there already. Clean Code is one book that I read that I feel really changed the way I think about and write code. It's not PowerShell, but the ideas apply to any language and the code examples are easy enough to read.

Trying to make our team's world a better place to work, but I could sure use some guidance [R]

2 years, 11 months agogsaslis posted submission on devops.
March 9, 2018

I work on a team that up until recently, has just managed everything manually. We are getting to a point where increasing the size of the team is not increasing our through put and definitely not simplifying anything.

We have begun making changes, starting with hiring an Agile coach to help us break out of waterfall, and we are attempting to integrate our QA and Dev teams. We've had big discussions about where we want to be, but it's been largely loose thoughts with spotty implementations so far.

I really want to start thinking in terms of setting up a road map to get from where we are to where we want to be before we go creating too many disjointed new-fangled processes that end up being too difficult to stitch together.

I get to lead this charge, but I have no idea what I'm up against. I've bounced around in all sorts of development roles over the last few decades, but this is a new challenge for me. I'm excited to learn a ton of things, but where do I begin?

I'd love to find a mentor, or even just an open ear. Are there any good resources that I should be looking at?

So far, I've been working on cleaning up our on-prem TFS builds and releases to make them smarter and more robust. I've been working on trying to get our database under some form of source control. I've been trying to get Dev environments and Scrum/Kan Ban boards set up dedicated to each team. and I've been researching containers and CI tools. We are on the verge of making so many big changes, and already I'm starting to see potential cracks and flaws but without a strong enough understanding of how so much of this comes together, I'm afraid to stand on the brake pedal.

2 years, 11 months agogsaslis posted comment on devops.
March 10, 2018

I would recommend the Continuous Delivery book (https://continuousdelivery.com/) as a starting guide for what you need to do on the CI/CD front.

It doesn’t go extensively into testing, which is basically your safety net. The Clean Code book (https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882) is a good start here.

On the whole Agile Software Development methodologies front, it’s important to understand some principles behind each framework. I’ve found this book useful on that regard: https://www.amazon.com/Agile-Good-Hype-Bertrand-Meyer/dp/3319051547

I know this might sound overwhelming, but so is what you’re describing... : )) Reading books is an investment that will pay off on this journey you are setting on.

Good luck!

2 years, 11 months agoParlay_to_throwaway posted submission on learnprogramming.
March 8, 2018

This might be a bit of a long shot, but let's give it a try anyway.

 

So, I recently landed my first full time software engineering job. I've been on the job for a few months and I'm thoroughly enjoying my time there. However, I commute to work by train and often find myself bored while commuting. So I figured a good way to not be bored would be to read some books.

 

I'm not sure what to read though, so I'm looking for some recommendations. However after a full day of coding, I don't feel like reading a really technical book that requires active reading/thinking. I'm looking for a book that is rather relaxing and easy to read, yet will still improve my programming and/or problem solving skills.

 

Thanks for your suggestions!

2 years, 11 months agoParlay_to_throwaway posted comment on learnprogramming.
March 9, 2018

Discussion Thread [R]

2 years, 11 months agoYevon posted submission on neoliberal.
March 8, 2018

The discussion thread is for casual conversation and discussion that doesn't merit its own stand-alone submission. The rules are relaxed compared to the rest of the sub but be careful to still observe the rules listed under "disallowed content" in the sidebar.


Announcements


Introducing r/metaNL.

Please post any suggestions or grievances about this subreddit.

We would like to have an open debate about the direction of this subreddit.


Book club

Currently readingThinking, Fast and Slowby Daniel Kahneman

Check out our schedule for chapter and book discussions here.


Our presence on the webUseful content
Twitter/r/Economics FAQs
Plug.djLink dump of useful comments and posts
Tumblr
Discord

2 years, 11 months agoYevon posted comment on neoliberal.
March 8, 2018

I recommend reading Clean Code if you haven't already.

https://www.amazon.com/dp/0132350882/

Otherwise you need to be more specific about the question and how you solved it.

What is the most concise CS book you have read ? [R]

2 years, 12 months agosweml posted submission on compsci.
Feb. 28, 2018

I've noticed that many CS-related books are huge 1000+ tomes (mostly textbooks, I guess). What is the most concise book you have read ?

2 years, 12 months agosweml posted comment on compsci.
Feb. 28, 2018

Clean Code: A Handbook of Agile Software Craftsmanship it explains how to write elegant code in a simple and clear manner

I'm looking for good resources to learn OOP [R]

3 years agoalpha_hxCR8 posted submission on learnpython.
Feb. 14, 2018

Hi, I'm trying to understand Object Oriented Programming better. Are there any simple projects (with solutions so I can check) that exist online that help teach these concepts?

I'd like to start simple and have something I can work my way up with

3 years agoalpha_hxCR8 posted comment on learnpython.
Feb. 14, 2018

Object oriented programming is a deep topic.

If you are looking for a simple introduction, I found Chapter 8 of this book, which is also used for the MIT Intro to Programming using Python pretty good. https://mitpress.mit.edu/books/introduction-computation-and-programming-using-python-0

If you want to dive deeper, these 2 books have good descripts of OOP and other fundamentals of Programming. However, these are not specific to Python, but are probably the most recommended books in programming:

  1. Clean code: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

  2. Code Complete: https://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670

Getting a job as an Android dev vs. web developer. Can I find employment? [R]

3 years, 1 month agoziptofaf posted submission on learnprogramming.
Jan. 27, 2018

Hello world!

So I suppose I'll start with a little background info. I recently decided that I want to study full time to become a Native Android developer (just started a few days ago) and I'm aiming to do so within 6 months of full-time self teaching. I'm going to be doing a minimum of about 7/hours a day 7 days a week so I should have over a thousand hours of experience by then, I'm also planning on attending local develop meetups to immerse myself in the field a little more.

Anyway, I just had another look on dice.com and realized that there are only 34 listings hiring Android developers within 100 miles of where I live (I live in Florida). Whereas, there are 687 listings for web developers...

My question is: Will I have difficulty getting a job in this field? It seems like there is far less demand for Android devs. Maybe the supply side of things will balance it out?

Any tips, info or suggestions are greatly appreciated!

3 years, 1 month agoziptofaf posted comment on learnprogramming.
Jan. 27, 2018

Firstly - to be fair I think that 6 months is unrealistic. In general expecting anything less than a year with no CS background whatsoever involves a lot of luck.

It's not just time issue (although I commend you for getting ballpark right, 4 digit number of hours is in fact necessary) but also that programming is not really something you even can learn by just sitting 7 hours a day doing it. You need time out periods or you will burn out, there will be concepts that don't sit well with you etc. There will be days when you can spend 8 without problems but sometimes 3-4 and that's it.

Then save for learning you should also have some kind of a portfolio to show off. This also takes time, creating any half decent Android app won't take you few days but more like a month. Polishing it and getting it's code reviewed also requires time (literature like Clean Code exists but you can't really appreciate it until after you have written some code yourself).

As for the market - this works somewhat differently. Android developers = 99% that you are asked about Java and Android SDK. Probably no specialization yet if it's not explicitely mentioned.

With web dev you not only have 3 separate main branches (front-end, back-end, dev-ops) but they are also split into multiple frameworks and languages themselves. So said 687 listings is probably like 50% front-end, 40% back-end, 10% dev-ops. Out of 40% back-end there will be 5% RoR, 5% Java and Spring, 10% PHP (numbers taken from thin air) etc.

Guidance Request for Getting Started in DevOps [R]

3 years, 1 month agohealydorf posted submission on cscareerquestions.
Jan. 25, 2018

I have been working as a full stack web developer on smaller teams for all of my career. But, the past few months I have been very interested in focusing my career on DevOps.

How should I best direct my energy to make this happen?

Context:

  • Age: Early 20s
  • Degree: None, but am 3 classes away from an associates of software development.
  • Location: Ohio

  • Background: went to vocational school where I learned a bit about databases and programming. Interned for 3 years at a research lab working directly under a PhD computer scientist as a full stack web developer.

Then, spent a year at a firm with a small team where I was basically the only software developer. I currently still am here, but I am looking to get out.

I also have a steady flow of freelance webdev work I do on the side that I have been doing for the past year.

3 years, 1 month agohealydorf posted comment on cscareerquestions.
Jan. 25, 2018

Chef has such an incredibly rich set of online tutorials. Step 1 in my org's DevOps team's Chef on-boarding is "go to this website and do the Getting Started and Infrastructure Automation modules".

I don't have experience with Puppet and Salt, but Ansible was easy enough to learn from their docs: http://docs.ansible.com/ansible/latest/playbooks.html

If you don't currently practice TDD, I'd highly recommend Clean Code as your entrypoint.

My FINALLY finished Weather app with requests and BeautifulSoup - no API [R]

3 years, 1 month agophilintheblanks posted submission on learnpython.
Jan. 20, 2018

Hi all,

I finally finished my first Python project from scratch and am hoping for some feedback on it. Enjoy!

import requests
from bs4 import BeautifulSoup


class WeatherApp:

    def __init__(self):
        print("Checking barometric pressure...")

    def weatherman(self):
        zip_code = input(str("Please enter your five-digit zip code to find the forecast in your area: "))
        query = 'search?q='
        weather_statement = '+weather'
        url = 'https://bing.com/' + query + zip_code + weather_statement
        r = requests.get(url, headers={'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'})
        soup = BeautifulSoup(r.content, "html.parser")

        print("\n")

        location = soup.find("div", {"class": "wtr_locTitle wtr_nowrap wtr_ellipses"})
        print("The weather for " + location.text)

        date_requested = soup.find("div", {"class": "b_meta"})
        print(date_requested.text)

        print("\n")

        current_conditions = soup.find("div", {"class": "wtr_caption"})
        print("Current Conditions: " + current_conditions.text)

        temperature = soup.find("div", {"class": "wtr_currTemp b_focusTextLarge"})
        print("Temperature: " + temperature.text + "°F")

        precipitation = soup.find("div", {"class": "wtr_currPerci"})
        print(precipitation.text)

        wind_speed = soup.find("div", {"class": "wtr_currWind"})
        print(wind_speed.text)

        humidity = soup.find("div", {"class": "wtr_currHumi"})
        print(humidity.text)

        print("\n")

        # 10-Day Forecast
         print("Your 10-Day Forecast: " + "\n")

         forecast_element = soup.find_all("div", {"class": "wtr_innerScroll"})
         for child in forecast_element:
            children = child.find_all("div", {"class": "wtr_forecastDay wtr_noselect"})
            for kids in children:
                target = kids.find_all("div", {"class": "vpc"})

                # Weekday Text Pull
                for tar in target:
                    obj = tar.find_all("div", {"class": "wtr_weekday"})
                    for x in obj:
                        weekday = x.find_all("span", {"class": "wtr_nowrap b_promoteText"})
                        for day in weekday:
                            print(day.text + ":")

                # High temperature pull
                for gosh in target:
                    line = gosh.find_all("div", {"class": "wtr_high"})
                    for i in line:
                        high_temp = i.find_all("span")
                        for temp in high_temp:
                            print("High: " + temp.text + "F")

                # Low temperature pull
                for targ in target:
                    item = targ.find_all("div", {"class": "wtr_low"})
                    for d in item:
                        low_temp = d.find_all("span")
                        for tamp in low_temp:
                            print("Low: " + tamp.text + "F")

                # Precipitation pull
                for tim in target:
                    new = tim.find_all("div", {"class": "wtr_daypreci"})
                    for k in new:
                        prec = k.find_all("span")[1:2]
                        for pre in prec:
                            print("Chance of Precipitation: " + pre.text + "\n")


weather = WeatherApp()
weather.weatherman()
3 years, 1 month agophilintheblanks posted comment on learnpython.
Jan. 20, 2018

You will continue to feel that way. Unless you're way different than I am. I definitely feel that a lot. Trick is just to keep writing things!

If you really want to dig into the methodology of it (software engineering), then I highly suggest both Clean Code and Code Complete. For where you are right now, I wouldn't try to "cover-to-cover" them, if you do pick them up. Pick out chapters that sound interesting, or level appropriate, and read through those. Then, and this is the important part, try to write code that fits.

I find that the larger projects that I work on are the most interesting as well. There's no shame in re-implementing something that already exists, either. It's an important experience to see where and why great designers made certain choices.

Good luck, and keep it up!

Mastermind: Play as codemaker or codebreaker [R]

3 years, 1 month agoNowImAllSet posted submission on codereview.
Jan. 17, 2018

Hello, I am a fairly new programmer and was looking for detailed criticism on my first 'large' project. Mainly I was doing problems over at Project Euler but would start to like making games. This is the first game I have produced, it is the Mastermind board game.

Because I have done many numerical coding problems, and not any larger ones, I am unsure of many things about my code. Namely, the formatting, readability, overall data structure, algorithms, how it should be broken up, and container/num types .

Let me know what you think, thanks!

CODE : https://www.onlinegdb.com/By_HqdTNz

3 years, 1 month agoNowImAllSet posted comment on codereview.
Jan. 18, 2018

> I have been trying to make a program utilizing classes

Yeah, I think this was my first major roadblock when I was learning, as well. OOP was a bit tricky to wrap my head around, but once it clicks it is actually pretty intuitive. Not sure I'll be able to help much, but a class is just a way to group related data and functions together. You can think of it as your own custom data type, that has it's own custom convenience functions. For example, I'll try to use your mastermind game. Like I said, I've never played the game, but it appears you have some sort of game board, where pieces are placed and moved. When you think about it conceptually, that game board in the real world is an entity of its own right, that has some general properties. It has a set number of holes for pieces, it has pieces that may or may not be inside the holes and can move around. Additionally, there are things you can do to the game board, such as move a piece, check where the opponents pieces are, etc. All of these properties and actions, then, can be grouped into a class. I've structured a very simple example. It might not even make sense with the game, but take a look. You have some private data members that describe what a GameBoard is, what properties it has. Then you have some public functions (not actually written, just stubs) that provide convenience functions to act on the GameBoard. That, in it's most simplest form, is all a class is. The advantages of this are beyond the scope of what I care to type out, but the main thing is that it allows for a layer of abstraction. After the class is made, you can use it by declaring a new instance of your class, using what is called a constructor. Then, you can access those convenience functions on the instance of that class, called an object. I don't want to bog you down with more details on why, how and what but hopefully that at least helps you understand the underlying concept.

>How do you suggest I break up the code into different subsections? Should this program use 3 files ( i.e. codemaker, codebreaker, main ) or is there another general method used by software developers for single file programs?

Well, classes in themselves usually reside in their own file. So that would solve some of this for you. In the above example, say that Mr. CorporateBoss comes alone and says the rules have changed, the board now is X by Y spaces and the rules for valid movements has changed. You hardly have to think about where that code is, the logic about what was using it, etc. You go to the GameBoard, you change the size of the board_state array, and you change the method called is_valid_movement. However, classes of course are not the only way to structure code and break it into different subsections. I could type a few more paragraphs on that, but I'd end up mostly parroting what you can read about in the book Clean Code, which is a classic and well-revered book on everything from naming conventions to architecture. I can't recommend it enough. But the "too long, didn't read" version is that methods should be short, have a singular purpose and be ordered by layers of abstraction. For instance, say you are making a program to read customer info from a database and get all those who have outstanding balances. You could put this all in a huge main method, but break it into singular pieces. You request info from the database, that's a function by itself. You have a function that formats that data into a meaningful way, that's a function. You have another that filters that data, and then another that then takes the data and presents it to the user. Every function has a singular, sole purpose. Hopefully the benefits of that are clear, but read the book mentioned if you want a deeper, more concise look.

How to become a TRUE programmer? [R]

3 years, 1 month agoJan. 15, 2018

Hello Peeps,

I am a 25 year old unemployed Grandma’s boy. I was working as a physical therapist assistant, but lost my job due to my employer relocating. Since then I’ve been dabbling in CSS and HTML and I find it quite fun (I have a nice gaming computer so I though “why not try”). I understand this is only a markup language and merely the tip tip of the iceberg, but if my interest holds steady then this might be the career for me. However, I’ve read many comments about how there is supposedly an over-saturation of programmers in the market, many whom lack a deep grasp of software development. I don’t want that to be me. I am competitive by nature and more than willing to slog through anything to become an expert in the field. I’m definitely not a spring chicken, so what would your recommendation be on how to develop a broad and fundamental understanding of the tenets required to become masterful in a reasonable time frame. I’ll devote as many hours a week to do so. It’s just puzzling to me on where to start and which progressive steps to take. I have a degree in liberal studies and failed to take any computer science or mathematics courses. If I must go back to school for computer science, then my Alma mater is 15 minutes away from my residence. I’d rather be self-taught, but I want YOUR advice on how to cultivate my path to success as a developer. Thanks!

P.S - I have an interest in web development, but I want to spread my wings and try multiple of avenues. I just want to be able to say, “ I made that” whilst living comfortably.

3 years, 1 month agoDuskyPixel posted comment on learnprogramming.
Jan. 16, 2018

TRUE actually stands for something in programming.

  • Transparent: The consequences of change should be obvious in the code that is changing and in distant code that relies upon it
  • Reasonable: The cost of any change should be proportional to the benefits the change achieves
  • Usable: Existing code should be usable in new and unexpected contexts
  • Exemplary: The code itself should encourage those who change it to perpetuate these qualities

If someone was going to ask me what path I would recommend this is what it would be. Especially for someone who is also interested in multiple things. The first half (java/haskell/design patterns/algorithms/programming principles) sets you up to learn anything. The second half is where you would focus on webdev if that is what you decide you are most interested in. I highly recommend not starting with web development though since its harder to debug while also being easier to actually have bugs. You also will likely learn really bad programming practices since you can do pretty much anything with javascript. If you decide to

Get a free pluralsight account by creating a free microsoft visual dev essentials account.

  • MOOC.fi's Object oriented programming with Java, part 1 - Honestly I did not go through part 1. I was familiar with the basics so I felt I would be okay if I just skipped this step.
  • MOOC.fi's Object oriented programming with Java, part 2 - This course allows you to submit your code to be instantly tested which is very helpful. The later part of the course kind of lower quality but still the early part is more than worth the time.
  • Clean Code: Writing Code for Humans - By Cory House who I have multiple courses listed here. Being introduced to clean code early on will make really following its principles easier later on.
  • Encapsulation and Solid - The first time I went through this course I could hardly understand anything other than I need to understand this stuff eventually. Just pay attention while watching but don't feel the need to understand every word since this stuff will be introduced again.
  • Learn Test Driven Development and start using it - Honestly I skipped TDD since my focus is on gamedev but still I have slowly been trying to test some since its highly recommended by a lot of people. Since I have not really used it I have no courses to recommend.
  • Core Design Principles for Software Developers by Venkat Subramaniam - When I first found this youtube video I was not expecting to watch more than minute. The guy has a bit of an accent but he is an ABSOLUTELY AMAZING teacher.
  • Design Patterns - For this step you need to do repeat this cycle for each design pattern.
    1. Watch design pattern in Christopher Okhravi's Design Pattern playlist.
    2. Google the design pattern and read at least 5 articles about it to see it introduced in many different ways.
    3. Create a UML diagram using UMLet for the design pattern with out relying on the ones from the articles. It's not too important use UML perfectly since the point is just for you to understand how things work together. If you understood the stuff you should be able to make the UML diagram, if not then read some more articles / watch youtube videos while paying attention to their diagrams.
    4. Write your own example code using repl.it implementing that design pattern without looking at example code from other places. If you get stuck on something then you can look but obviously the goal is to make sure you really understand the deisgn pattern and not to just straight up copy.
  • Algorithms 1 from Princeton - Another option is to do the Stanford algorithms at coursera instead of the Princeton ones.
  • Algorithms 2 from Princeton
  • SOLID Principles of Object Oriented Design - Hopefully by now this stuff will make a lot more sense
  • Clean Code Book - Like the Code Complete book this is recommended by everyone.
  • Code Complete Book - Like the Clean Code book this is recommended by everyone.
  • Head First Design Patterns Book - This book is mentioned a lot in the design pattern playlist. When I initially tried it I was put off by its teaching style but it is highly recommended everywhere and once I really tried to grasp every word said I started to see its value. This will further solidify your understanding of design patterns while helping it solidify in your mind.
  • Game Programming Patterns Book - amazing book whether you are interested in gamedev or not
  • Learn You A Haskell - I have not actually gone through this yet but in two weeks I will start it. By this point you will have likely learned some functional concepts like the CQS principle from Encapsulation and SOLID. Being able to trust your code allows you to focus on whats in front of you rather than thinking bout potential side effects while writing code. Both webdevelopment and languages like java have started embracing a more functional style which is proof of how beneficial taking some time to learn Haskell will be.
  • And now... web dev. By this point you will blast through this stuff since you will have a solid foundation to learn anything.
  • The Web Developer Bootcamp by Colt Steele - I have only gone through the front-end section but it has 54,602 ratings averagin 4.7 so obviously its decent. I don't think I would recommend the back-end section until you are at the point where you want to learn back-end.
  • CSSDiner Game - A game that helps you understand css selectors better
  • JavaScript: From Fundamentals to Functional JS - The Web Developer Bootcamp is a great course but it does not teach you some of the more difficult javascript concepts which this will.
  • CSS Animation with Transition and Transform
  • FreeCodeCamp's Front-End Certificate - This should be very easy at this point but its important to actually put your knowledge to the test.
  • Flexbox Froggy Game - I love these little games that teach you this stuff
  • Flexbox Defense Game
  • CSSGridGarden Game
  • LearnCode.academy React - Just do the React parts
  • React.js: Getting Started - Helps solidify the basics of react by making a math game
  • LearnCode.academy Redux & React + Redux - Now do the redux parts
  • Building a JavaScript Development Environment - A second course by Cory House. This will help you get your javascript development enviroment set up while also making the next course easier to follow.
  • Building Applications with React and Redux in ES6 - Another Cory House Course. This is an amazing React / Redux course although it is a bit quick early on since it kind of assumes you have done the Building Applications with Flux course. By this point you should be capable of following though
  • If your aim is webdev then find a top highly rated bootcamp to attend. While waiting for the start date go through these courses.
    1. The Complete React Web Developer Course (with Redux) 4.8 stars with 2,538 ratings
    2. The Complete React Native and Redux Course 4.6 stars with 12,689 ratings
    3. Webpack 2: The Complete Developer's Guide 4.7 stars with 3,190 ratings
    4. The Complete Node.js Developer Course (2nd Edition) 4.7 stars with 10,439 ratings
    5. Node with React: Fullstack Web Development 4.7 stars with 2,966 ratings.

So I've started my game development journey but concerns are rising that I'm missing the fundementals to do it. [R]

3 years, 1 month agoiprobablydisagree posted submission on gamedev.
Jan. 4, 2018

Hi everyone.

I am a UX designer by trade but have dedicated myself to learn how to code in C# for a few years now. Although I can manage to create simple games in unity like pong / tetris, I've never learnt how to code through formal education. What I am concerned about is that I might be missing the basic fundamentals on writing good reusable code.

Should I bother doing a course purely in C# to understand things like queues or event systems in more detail or is it something people learn if and when they need to?

I am the sole programmer on my game project so I want to make sure I do things conventionally in case i need to consult a more skilled programmer at some point.

3 years, 1 month agoiprobablydisagree posted comment on gamedev.
Jan. 5, 2018

This book isn't specifically for C#, and it's a bit dated, but it's still a widely respected book that should teach you a lot about how to write code that other professionals can work with. Some of his guidance is a little controversial, but overall the advice in the book is solid.

EDIT: Specifics of what the book tries to teach (stolen from the internet):

<pre>How to tell the difference between good and bad code How to write good code and how to transform bad code into good code How to create good names, good functions, good objects, and good classes How to format code for maximum readability How to implement complete error handling without obscuring code logic How to unit test and practice test-driven development </pre>

Is there a better "programmer career resource" than John Sonmez (Simple Programmer)? [R]

3 years, 1 month agobig_red057 posted submission on cscareerquestions.
Jan. 1, 2018

I'm curious as to what youtube channels, books, or blogs are out there that cover every aspect of being a software developer (career and code). John Sonmez is the only one I know of now that does that. He has the Simple Programmer blog and YT Channel. I like his stuff enough to keep reading/watching. There's some good advice there, I feel. Still, I have to wonder how much his stuff applies to just him. I feel like I have to "wade" through a lot. Plus, he's almost ALWAYS selling something. On one hand, if it's your medium, you can do what you wish. On the other, it makes me take what he says with a lot more grains of salt.

So I'm wondering if there's better blogs/resources out there that cover the whole "pie" of software development careers.

How do you learn to simplify your code? (C#) [R]

3 years, 2 months agoDec. 24, 2017

[deleted]

3 years, 2 months agoigeligel posted comment on learnprogramming.
Dec. 24, 2017

Less code does not mean it is better. Code should be understandable and maintainable. If this is the case for your code you are fine. If there is a native functionality you can use, then use it carefully so the overall workflow of your code snippet is still understandable.

I can recommend you getting this book: Clean Code which explains how clean code should look like. It is Java focussed but you can transfer the knowledge to any other language too.

Also if you really want to improve your code use divide and conquer. Split out the code into managable parts and optimize from there.

Should I brush up on Exception Handling and Regular Expressions before starting 1st job? [R]

3 years, 2 months agofirecopy posted submission on cscareerquestions.
Dec. 22, 2017

I never used them much in school.

Edit: And what about reading/writing to files?

3 years, 2 months agofirecopy posted comment on cscareerquestions.
Dec. 22, 2017

Ah k, perfect amount of time to read a book or two. I would definitely recommend reading Clean Code by Robert C. Martin. Regex and Exception Handling is something that you can quickly google search when you are at work. Otherwise, enjoy the time that you have from now and start of work!

Where to learn PHP industry practices? [R]

3 years, 2 months agoDec. 18, 2017

I'm learning object-oriented programming with PHP now but am not using any tools or anything extra at all. I don't know where to begin on that, as a lot has changed since I last touched PHP in the previous decade. Can you guys offer some tips on how to learn and understand the tools that professional PHP developers use and the general steps they take with every project in 2017?

3 years, 2 months agoScottBaiosPenis posted comment on PHPhelp.
Dec. 21, 2017

laravel in general and laracasts in specific encourage all sorts of insanely bad practice. i would not take any of their advice seriously in terms of best practices. i would suggest getting a book like clean code (https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882)

Where to go learn after completing MOOC? [R]

3 years, 2 months agoNicholas-DM posted submission on learnjava.
Dec. 20, 2017

I've been learning Java from something called MOOC that the Unviersity of Helenski created (and it's amazing), but I'm guessing the ~150 exercises they make far from cover the extent of Java.

Do the 150 exercises offered with MOOC teach you everything you need to know about the language Java itself? If not, then where can I go to continue learning? If so, is my only option now to start learning more complicated math and theory that I can apply to programming?

3 years, 2 months agoNicholas-DM posted comment on learnjava.
Dec. 20, 2017

After the MOOC, I'd say that you have a solid foundation.

After the solid foundation, there are a few things that you need to learn-- a two pronged approach would be good. Projects/Experience, and Theory.

Projects

Real projects, where you use what you learn. Here is a list for ideas. Do simple ones. https://github.com/karan/Projects

Post them online on Github, like a portfolio, in their own repositories. Or find a different provider. I recommend Github because it has a massive ecosystem and uses Git.

Find some opensource projects and begin doing simple things for them. Start off with contributing documentation, or a small fix, or something else simple. This is absolutely critical; getting involved and actually coding for stuff that is used by others.

Theory topics

  • Source Version Control: If you ever want to collaborate with other people, you want to be able to do so well. I recommend Git, and specifically git on the command line. https://git-scm.com/ -- And for learning how to use it -- https://git-scm.com/book/en/v2

  • Data Structures: How do you structure data, so that you can access it well and easily, for its purpose? You need to learn how to build data structures, and how to use them. Most importantly, you need to learn when and why you want to use a particular one. This seems like a good intro, but googling and self-study will be important here. https://www.topcoder.com/community/data-science/data-science-tutorials/data-structures/

  • Algorithms: How do you perform tasks on your data? How do you sort it? How do you interact with it? Again, not only do you need to learn how to do the common ones, you also need to know when and why. This seems like a good overview, but someone else is likely able to suggest better resources for algorithms-- searching this very subreddit for algorithms is bound to turn up good results. http://www.csfieldguide.org.nz/en/chapters/algorithms.html

  • Clean Code: You probably don't have great style with what you write. That's okay. Most people don't. But being able to write code that others can read is an art. I recommend this book: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 ,

<hr />

Focus on the above. If you need/want more, then go ahead and check out more.

Once you are beginning to feel comfortable-- if you plan to get a job in this field, I recommend applying at places, even as a near beginner. Try to get a few phone interviews. Go in with the idea that you won't get it, and it's just a learning experience-- you'll figure out how interviews work and you'll get some idea of what different places are looking for. Be honest with your interviewers.

If you want something else-- after you have some understanding of the above topics, this is the time to specialise. Do you want to do android development? Game development? Enterprise Software development? Begin looking into what you want to specialise in, learn their tools, and begin getting familiar with it. Above all else, experience is king.

Good luck! Ask if you have any questions, and I'll do my best to answer them.

Learning after Graduating [R]

3 years, 2 months agoDouble_A_92 posted submission on learnprogramming.
Dec. 7, 2017

Hey Guys,

I'm currently doing a Master's in Physics and I have been coding for the past 2 years, I've mostly done python for the past year and that is my most comfortable language at the moment (I've mainly been coding projects such as Galaxy visualisation models and currently I'm doing a Black Hole analysis project). I have done some C and C++ aswell. I really enjoy coding, although I'm good at problem solving I feel as if I'm missing some fundamental components of becoming a good programmer

The concept of AI and machine learning really interests me, as well as making apps and coding in general to create stuff other than scientific research. It would be great if somebody could help me to get some resources to start learning these topics, also I'd love to have a career in coding so any advice in that general direction would be great. I think I need a few projects to do to put on my github to but I'm not sure where I can get access to any ideas for projects. Doesn't have to be free I'm willing to pay for resources :)

Thanks

3 years, 2 months agoDouble_A_92 posted comment on learnprogramming.
Dec. 7, 2017

The cliché is that "scientists" produce very bad code (even if it works correctly...)

Try reading this https://www.amazon.com/gp/product/0132350882/ to see if that applies to you too. :)

Good practises for good and readable code? [R]

3 years, 2 months agoHarpoi posted submission on csharp.
Dec. 6, 2017

Good practises for good and readable code? [R]

3 years, 2 months agogatapia posted submission on csharp.
Dec. 6, 2017
3 years, 2 months agogatapia posted comment on csharp.
Dec. 6, 2017

Read this (Clean Code), a whole book written to answer that one question.

If you like that then there are lots of others, just read anything by Robert Martin, Martin Fowler, Prag Prog, etc.

Clean Code, Industry Standard [R]

3 years, 3 months ago149244179 posted submission on learnprogramming.
Nov. 23, 2017

I can build anything from scratch (web dev -no graph dbs, or big data crazy things) but as I am job seeking and doing interviews, as soon as I deliver any project, assignment or test I am given I get the feedback that I write unidiomatic or inelegant code.

To be honest, I do not disagree. I always overwork myself to the point where I rather finish a feature and have it working as opposed to have it working + properly written.

Any 'straight to the point' resources out there about following industry standards on clean/maintainable code? e.g. naming variables, folder structures, how long should functions be, should you keep abstracting a function until it reaches a specific amount of lines.

I learn easily by watching videos but I definitely take any text resources as well, or even better, an example of a project you feel meets industry standard's criteria!

React, Javascript, Node, RoR and Python.

Looking to supplement my programming knowledge [R]

3 years, 3 months agoMedicalizawhat posted submission on learnprogramming.
Nov. 17, 2017

Hi all! Alright, so a bit on why I'm not just piggybacking on someone's "looking to learn, where do I start" topics...I'm currently in my third year for Computer Science and Application Development. During my AAS, we spent most quarters doing at least one class focused solely on programming (minus the last two). I learned C# fairly thoroughly, and also had a quarter on Java, and two on web development (HTML, CSS, Javascript, ASP.Net, MVC).

Now I'm in the BAS portion of my degree - which the school only just got authorized for and started doing a couple years ago - and it's painfully obvious I'm just paying for a piece of paper now. I'm a couple weeks away from finishing the first quarter, and I have learned positively nothing.

So I'm asking - for someone with that experience - what would you guys suggest to supplement my programming knowledge? Most of the stuff I've found online is 100% geared towards beginners, and has contained very little...I've looked into big O notation, data structures and algorithms in general to help, and plan on using my Summer quarters to get ready to certify in C#, but I would kill for something to do in the meantime that will actually help me prepare for a job, because if I'm being honest...I feel I'm going to be laughably overwhelmed and under-prepared once I start applying.

3 years, 3 months agoMedicalizawhat posted comment on learnprogramming.
Nov. 17, 2017

Read Clean Code and build a non trivial project using the principles from that book. You'll learn a lot.

Maybe read an Operating Systems book, pick a subsystem you find interesting and try to understand how Linux implements it.

Learn about git and source control.

Contribute to open source projects you find interesting.

Try setting up a server and configuring it to do cool stuff.

Basically, identify something that you don't know much about and dive deeper, or just write lots and lots of code.

Senior Python Programmers, what tricks do you want to impart to us young guns? [R]

3 years, 3 months agoNoahTheDuke posted submission on Python.
Nov. 13, 2017

Like basic looping, performance improvement, etc.

3 years, 3 months agoNoahTheDuke posted comment on Python.
Nov. 14, 2017

Read Effective Python and Clean Code, in that order.

These four “clean code” tips will dramatically improve your engineering team’s productivity [R]

3 years, 3 months agojonathan-fulton posted submission on SoftwareEngineering.
Nov. 7, 2017
3 years, 3 months agojonathan-fulton posted comment on SoftwareEngineering.
Nov. 8, 2017

A lot of the tips, including this one, come from Uncle Bob's "Clean Code" book. I recommend picking it up for a much more thorough examination of Clean Code principles. https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

There are times when a 4 line restriction on function length is burdensome, but it tends to be a good guideline. Language also matters. I've found it's harder to adhere to the 4 line restriction in Node than PHP for example just based on typical syntax for the language.

When to stop restarting [R]

3 years, 3 months agowiseman_softworks posted submission on gamedev.
Nov. 3, 2017

Hi Gamedev!

I'm a new game developer (about 3 months at night now) teaching myself Unity and C# as I go. I have done bits and pieces of a Udemy class and also went through Brackey's Tower Defense tutorial which helped me learn a TON. I extended his game a bit and considered that my first shitty game with a friend helping me with art, design, and audio.

Now my friend and I are starting our own game and have followed much of the common advice like limiting scope and trying to be realistic which hasn't been our issue(he is a project manager which helps with that). I keep finding that I look at what I have, or go to extend it, and it's just god awful spaghetti code I've learned to improve as I banged my head against the wall working to that point.

Then....I want to throw it away and start over in a less shitty way. Rinse and repeat. So when do you say okay we're keeping this bad version and moving on?

TLDR: The more I do, the more I learn, the more I hate my work and want to restart. When do I stop restarting?

Thank you in advance for your guidance!

3 years, 3 months agowiseman_softworks posted comment on gamedev.
Nov. 3, 2017

This is kind of a "bible": https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

But frankly speaking not every page of this book is worth reading imo (quite many are, though!).

I would advise to read the first ~2/3rds at least. You will understand all you need to know... And then only good amount of self-correction and practice will help afterwards.

How can I support my husband? [R]

3 years, 4 months agoOct. 29, 2017

[deleted]

3 years, 4 months agotimmyotc posted comment on cscareerquestions.
Oct. 29, 2017

Keep in mind that the feedback received could just reflect one interviewers attitude on that particular day. He might be a perfectly good programmer, but if someone prefers to work a certain way, they'll prefer to hire people that work that way too.

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr12?ie=UTF8&qid=1509315661&sr=8-2&keywords=code+complete

https://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670/ref=sr11?ie=UTF8&qid=1509315661&sr=8-1&keywords=code+complete

These books (that other people have suggested) will ensure that he is writing good code, but it still won't ensure that he'll pass an interview with someone who prefers a certain paradigm of programming.

If he's familiar with the different paradigms, he should just ask, "How do you guys usually write your code? Object-oriented? Functional? Imperative?" It's usually object-oriented or functional these days, but most of the time you can mix and match the two. The issue with you asking on his behalf is that we can't tease the right questions out of him because he isn't behind the keyboard.

Generally speaking, coding challenges shouldn't involve catching exceptions. The interviewers usually prefer that you handle an edge-case explicitly instead of trying to deal with the aftermath of an exception being thrown. The problems are usually small enough that "Truly exceptional" events aren't things that need to be accounted for. Additionally, nesting if's are a bad thing. After 3 levels of indentation, you should break something into a function or at the very least, question if you've done something horribly wrong (Rule of thumb by the creator of a very popular operating system)

How to organize my Vulkan code? [R]

3 years, 4 months agoOct. 25, 2017

All tutorials are either C++ all-in-one-class or are written in C with different modules for each concept. But I want to use object-oriented approach and split things into RAII classes. I can't figure out how to do it properly. Like, should I place logical and physical devices in single class or separate classes? Should queues be members of device class or wrapped in separate class? If the latter, should queue class instance be member of device class (since queues belong to devices) or member of application class? etc.
Could kind people direct me to some examples (comprehensible to beginners) or any helpful information? Many thanks!

3 years, 4 months agokindkitsune posted comment on vulkan.
Oct. 27, 2017

Already tons of repo links but I'll add a few particular ones that exemplify the approach I've found to work best with Vulkan.

Generally, just take each of your Vk object types and give them a wrapper class where it makes sense to do so (more on that shortly). Don't try to combine functionality, yet: keep the classes and interfaces simple. e.g

  • Pipeline layout: Note that it has methods simplifying setup, primarily, and that this of course gives me RAII abilities still. Otherwise, it's simple and to the point.

  • Texture class: it inherits from my fairly simple image class, but here we use templates to reduce common code between the varied texture types:

On the point of splitting logical and physical devices, and/or making a class for a queue: I approached it by thinking if a certain Vulkan object had any need for lifetime management, and if it had unique property structs, Vulkan functions, or other data attached to it.

In the case of the Physical Device, it has a whole bunch of stuff specific only to the Physical Device (memory properties, features, etc). Same with the Logical Device. Split things along functional and use-case boundaries.

I didn't end up creating a queue class, as I haven't had need for it. But, I should be making one: I imagine the best way to do this is to keep it still a member of the device class. use a std::lock_guard to synchronize access to it - and hell, i'd probably construct it to act like a std::lock_guard where a queue is considered "in use"/"locked" once you acquire one then the destructor "releases" the queue or something. This class should be really thin, since there's no need to explicitly destroy a queue: just track usage and keep it thread-safe.

I keep saying keep things thin and lightweight because I've been reading the hell out of Clean Code, and I've found that it's advice about keeping methods small and keeping most classes simple helps tons in making my code more maintainable, easier to follow, and better organized. The documentation for my renderer found here might also help clarify some structure or give you a few ideas.

Lastly, don't worry too much about doing tons of research or getting things right the first time around. I certainly didn't - that's why my project has over 300 commits now! Just keep iterating on your work, seeking improvement in any way you can, and finding new ways to use your project. Having to make mine support all three major platforms, for example, helped me clean up and refactor a lot of my context, windowing, and input handling code.

[D] Those who work in machine learning, what do you spend your days doing, and typically what % of your time is spent doing each of those things (on average) ? [R]

3 years, 4 months agosanity posted submission on MachineLearning.
Oct. 23, 2017
3 years, 4 months agosanity posted comment on MachineLearning.
Oct. 24, 2017

It's hard to do justice to it in a FB comment, but the clarity of the code, the modularity, and simplicity of it, just quite a lot of stuff. Well written code just looks so much simpler. Functions are short and simple, rarely more than 10 lines with 2-4 parameters, rarely more than 4. Classes are short, rarely more than 1-2 screens worth of code. In general, good code keeps the "cognitive load" low. Unit tests are very thorough, and can also serve as a form of documentation.

I highly recommend the book Clean Code: A Handbook of Agile Software Craftsmanship. Its advice is language agnostic. The author also has a number of lectures on YouTube, although his speaking style is "interesting" and may not be to everyone's tastes :)

If you're not sure how good your unit tests are you can look at something like mutation testing to find out, although it's more of a personal thing I like - it's not that widely used.

Don't worry, knowing what you don't know gets you 95% of the way there :)

What's your favorite tip or trick for cleaner/more efficient code? [R]

3 years, 4 months agolockdown6435 posted submission on csharp.
Oct. 22, 2017
3 years, 4 months agolockdown6435 posted comment on csharp.
Oct. 23, 2017

No, I'm really not. https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr11?ie=UTF8&qid=1508779069&sr=8-1&keywords=clean+code

Daily Chat Thread - October 23, 2017 [R]

3 years, 4 months agoDjvacto posted submission on cscareerquestions.
Oct. 23, 2017

Please use this thread to chat, have casual discussions, and ask casual questions. Moderation will be light, but don't be a jerk.

This thread is posted every day at midnight PST. Previous Daily Chat Threads can be found here.

3 years, 4 months agoDjvacto posted comment on cscareerquestions.
Oct. 23, 2017

Probably the same stuff, work on projects, play with new tech, etc. I would also try reading something like Clean Code or The Pragmatic Programmer (I personally like the latter a bit better).

If you read through the Pragmatic Programmer, the whole book is basically a series of tips/lessons, and my copy included a card you can tear out of the back that unfolds to show all the tips in their "condensed" form. If you try to think about how some of these things could have helped previous projects, as well as trying to keep them in mind with future products, you'll definitely grow as a dev/engineer.

"Shift Coders" - a Slack room to offer developers instant, air support [R]

3 years, 4 months agofatboyxpc posted submission on laravel.
Oct. 17, 2017

Shift has given me insight into thousands of Laravel projects. I've been able to identify common questions and challenges developers face when writing Laravel apps.

I pride myself on support and have always answered user emails and questions. Lately I've been trying to figure out a way to reach more developers.

A few months ago I began piloting a private Slack room among a dozen Laravel developers. Today, I'm excited to open the room to all Laravel developers.

Yes, there are other Slack rooms… But honestly their noisy. I wanted an exclusive community of developers focused on solving problems and evolving their skills. That's why I created Shifty Coders.

3 years, 4 months agofatboyxpc posted comment on laravel.
Oct. 19, 2017

> I was under the impression that htmlspecialchars

Even so, why not phrase your question like that to begin with, rather than ask something you can find in the documentation? Part of getting help is asking the right question.

> I prefer to put an html comment containing the file's name into each included file that makes up the html template markup.

That's just not necessary with blade templates. Every blade template that calls an include has a full path to the include and what not.

> I don't yet have the Linux skills to be responsible for my own private server.

That's very fair, and sometimes doing this can actually lead to more problems than it solves, so I get that. However, what's stopping you from learning on your own right now? Servers for Hackers has an excellent series about this stuff.

On top of that, just find a different host. Plenty of hosts will let you run composer, so find a better one.

> We don't have tests. Nobody is going to pay me to make tests.

Bullshit. Tests are vital, especially if you deploy frequently. I suggest you give Clean Code a read. None of the applications I've taken over to maintain have had tests, but I just started adding them and eventually the business saw value from it. The way you win this battle is to write some tests for some known good cases, and when they ask you to edit code, let it fail and show them how tests can catch the problem. Regression tests are a must imo, and not enough developers realize they don't "need permission" to write tests. When you write software, part of doing that is testing it. There are no 'buts'. You just do it.

> There are better things I can do/learn/make with my free time

And now we see the real reason you don't want to write tests: you don't see the value in it. I can't convince you through a textual argument, but I sure as hell could show you if you let me poke around on your app for awhile.

> plain php logic has worked fine for the last 12 years

So this has been 100% bug free for 12 years? I'm doubting that.

> Trying to fudge this format into what I need honestly feels inferior

So here's another "did ya read the docs?" question, because they show other ways of adding validation. That said, after the experience of writing nearly 10 laravel production apps, I much prefer the string syntax because it's very quick and easy.

I have a strong feeling that several of your custom php validators are handled by laravel by default, and a lot of your mess will just disappear if you use something that's built to abstract that stuff away from you.

All of that said, to each their own. You're obviously entitled to your opinion, but know that you made your opinion based off what seems like inadequate amounts of research and poor assumptions.

Also, I PMed you last night offering to help you out, and you seemed to find time to respond to this, but not to that. That has me questioning if you truly wanted help in the first place.

How to progress from intermediate to advanced Python user and able to write production-ready code? [R]

3 years, 4 months agoenteleform posted submission on learnpython.
Oct. 17, 2017

I have been consistently writing Python for ~ 1 year now. I have followed guides, studied MANY Github projects from experienced writers, and tried to take in as much as I can.

I am confident in my abilities to write programs and libraries for me to use, but when I try to turn this into production code I find that it is very difficult to pass off for someone to use. This is due to lack of readability, inefficient code, and not using best practices. I am learning a lot, daily, but want to take it to the next level.

I am writing to ask how to get to the level of being able to write production-ready code that can be passed off to another entity with minimal to no oversight from myself after the code has been passed on.

Additionally, while I understand and can use many libs, I find that I constantly end up Googling/StackOverflowing the same lib to get the exact functions and parameters I need.

To give a reference point, the following is a list of my skills and lack thereof:

Can Do

  • Interact with CSV + SQL + JSON

  • Create classes

  • Use a Makefile (minimal knowledge)

  • PEP8/Flake8

  • Use requirements.txt

  • Write unit tests

  • Docstrings

  • Virtual Environments (minimal knowledge)

Skills I've Seen but Never Implemented

  • Log instead of print

  • Proper project+file structure

  • CI

  • Class attributes

  • Sensitive information management (IE .gitignored file, environment variables, etc.)

I believe that learning the skills in the second list will help me achieve my goal. What additional items would you add to this list? What advice do you have in general to take my knowledge to the next level?

3 years, 4 months agoenteleform posted comment on learnpython.
Oct. 18, 2017

> This is due to lack of readability, inefficient code, and not using best practices.

&nbsp;
Read these books, and you will learn most of what you need to know in order to write (clean | readable | effective | efficient | easy-to-maintain) code:

  • Clean Code - A Handbook of Agile Software Craftsmanship
  • Fluent Python - Clear, Concise, and Effective Programming
  • Effective Python - 59 Specific Ways to Write Better Python
  • Python Cookbook

Need help with basics which tutorials don't cover. [R]

3 years, 4 months agokindkitsune posted submission on opengl.
Oct. 15, 2017

Because system RAM has often much more capacity than that of a video card, should I design my application so I keep copies of meshes and textures around, to avoid having to read from disk more often? If the memory is available, why not use it, right? Likewise, if a mesh is no longer needed but may possibly be needed again in the future, there is no logical reason for deleting its VBO unless there is little room left in VRAM, correct? But there doesn't seem to be an easy way to know how much VRAM is available, so do we just fill 'er up and let the driver do its thing, and only delete buffers which you absolutely know will not be needed again?

Thanks!

3 years, 4 months agokindkitsune posted comment on opengl.
Oct. 18, 2017

Tougher topic, tbh. I mostly use C++ (<3 u C++14/17) which has a different approach to architecture, even, given the more object-oriented approach.

Architecturally, I'm somewhat content with my Vulkan rendering library - maybe it'll give you a few ideas (assuming you're working on a rendering system, that is): http://fuchstraumer.github.io/vulpes-docs/index.html

Otherwise, when it comes to architectural concepts, these can be learned most of the time by using other people's code from open-source projects and "transcribing" it in your words, or using it in your project. In this case, looking for OpenGL rendering libraries that use C on github is probably a safe bet. Books like "Clean Code" also espouse concepts that help with making a clean and functional architecture easier, too (libgen.io ftw, fyi)

What sources could you recommend to learn about the applications of real-world design patterns? [R]

3 years, 4 months agoTonySu posted submission on learnprogramming.
Oct. 15, 2017

Lately, I have been thinking more and more about the structure of a program I am working on. Every time I am thinking about a feature I might want to add, it's like I am hitting a wall and have to rethink everything from scratch. I know designing is mostly about tradeoffs, but I am really after creating a solid base that would be easy to extend.

What I would like to see is a collection of (real-world) problems that developers faced throughout development and how they solved it.

This what I imagined: E.g.: I am designing a strategy game and I am considering the rules I might add. A saving option should definitely be there, so I solve that by this and that. Later on, an AI should be added too, which means I just do this and that. As you see this is a dead-end, so it would be better if we started out that way...

I have also thought about converting github project into uml class diagrams, but there is too much unnecessary code and the pattern would be too difficult to see.

Could you recommend me any book / online source / blog that would help me improving my designing skills?

Thanks in advance.

3 years, 4 months agoTonySu posted comment on learnprogramming.
Oct. 15, 2017

Clean Code and The Pragmatic Programmer are the usual suggestions. Code Complete is a big tome of software development advice, easily the least dollars per kg I've paid for a book.

In your specific case there's really no way to know what features you want except for experience in the field. Things like saving and AI are not problems that can be solved simply by having modular and well tested code. They require fundamental things like a properly tracked state and API for the AI.

It falls under the general advice of property specifying your program before you start writing, this is emphasises in at least one of the above books. But there's specifications are diverse so nobody can teach you how to figure out everything you might want in your specs. Maybe this 4 part blog from the CEO of StackOverflow might be useful:

How do I learn to write very principled non coupled extensible modular clean code. [R]

3 years, 4 months agoYuleTideCamel posted submission on learnprogramming.
Oct. 10, 2017

How do I learn to write very principled non coupled extensible modular clean code.

I have found many guides on learning programming but most are not aimed at what I am specifically interested in learning. I do not want to learn about algorithms, data structures, math, machine learning, etc. After writing 100,000+ lines of trash code I guess you can say I have become a bit obsessed with pretty code, which I think is a pretty nice problem to have. I eventually do plan on learning other things like algorithms but first I want to be able to implement design patterns and follow programming principles as best as possible without that stuff.

I have pretty bad attention problems but I have in the past skimmed through books like Design Patterns - Elements of Reusable Object-Oriented Software, head first object oriented design and analysis, head first java, head first software development, the pragmatic programmer, game coding complete, java how to program early objects, object oriented re-engineering patterns, pitfalls of object oriented design, programming in java, the architecture of massive multiplayer online games, clean code, and code complete. I didn't actually write out any of the code or anything though.

I think I am more of a video learner but I don't think there are many videos on this topic which is probably my biggest problem. I have watched all the video courses I could find on this topic already like Encapsulation and SOLID, Solid principles of object oriented design, defensive coding in C#.

Every time I start learning some piece of material I always end up feeling maybe this is not a good source to learn with. I usually am learning from Udemy courses which means the amount of material in the course is very limited and possibly just wrong.

I am pretty sure there is not a step by step guide to crafting the code I want but I still I want someone to tell me something like go through these 20 books and understand every thing written in each book. Then you will be able to write the best code ever.

3 years, 4 months agoYuleTideCamel posted comment on learnprogramming.
Oct. 10, 2017

Look at the following books:

[Python] Not a question just general warning/advice [R]

3 years, 4 months agoYelluhJelluh posted submission on learnprogramming.
Oct. 9, 2017

I was working with some legacy code today and It wouldn't work (api changes most likely) I went to debug and was met with this badboy

final_price = str(price) + " " + str(round((float(jsondata['data'][0]['balance']) / 1000000000000000000), decimals)) + " " + str(round((float(jsondata['data'][0]['balance']) / 1000000000000000000), decimals) * float(price))

please don't write code like i did, i have not the SLIGHTEST clue what it does, i don't know why there is so many zeros and I want to cry. Don't write shit like this and if you do , comment it.

3 years, 4 months agoYelluhJelluh posted comment on learnprogramming.
Oct. 9, 2017

Reading through a classic at the moment, "Clean Code" ... for shame, op. For shame.

Any book for quick crash course before the interview? [R]

3 years, 4 months agosunballz posted submission on cscareerquestions.
Oct. 7, 2017

Have an interview coming up in a week. I would like to be able to refresh my memories on the fundamentals. I know it should take more than a week but all I have is a week. Would anyone have any recommendation of any book or videos?

3 years, 4 months agosunballz posted comment on cscareerquestions.
Oct. 7, 2017

Crash Course Computer Science on Youtube is pretty good as a high level overview of how computers work and some history. https://www.youtube.com/watch?v=O5nskjZ_GoI

If you are applying for entry level software engineering, you should know how to use Git https://git-scm.com/book/en/v2 , at least one major language (js is popular, but its got so many gotcha's that you might make a fool of yourself. python is best for code samples, easy to read), and understand the principles of Object oriented programming and clean code https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

generally if you can pass fizzbuzz, or some other middle-school-math-based test problem, and get along with the team, you are good enough to at least try out for a few months.

extra credit if you can hold a smart conversation about the tech they use, or if you can ask questions about anything they state on their site.

Found this in G.T.A V. [R]

3 years, 5 months agoWhyattThrash posted submission on ProgrammerHumor.
Sept. 30, 2017
3 years, 4 months agoWhyattThrash posted comment on ProgrammerHumor.
Oct. 2, 2017

> So your point is .... people should adjust their code base in a way that it becomes easily readable...

Yes, that is my point. You should always strive for your code to be easily readable.

> This feels like fighting the consequence instead of the root of the issue.

No, that is exactly what you were promoting by validating this (poor code style) as a solution for having too long functions (poor architecture). Which is fighting technical debt by introducing more technical debt.

What I'm suggesting is to refactor your code so that it makes structural sense, taking ownership of quality and maintainability. If using this is proper code style for you, then great, refactor to use that. But if you're using it as a crutch to not have to refactor otherwise unreadable code, then think twice before committing it.

Recommended reading: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

I know how to code, but how do I create a program? [R]

3 years, 5 months agoTonySu posted submission on learnprogramming.
Sept. 26, 2017

I have a project in mind and feel relatively comfortable on the pure coding side. However, I'm lost as to how to put it all together into a program. I know basics like multi-file programming (and maybe more that I'm taking for granted) but I have never turned big idea into a full-scale program. An anology would be that I know how to read and write in English, but I don't know how to write an essay; I don't need to be taught how to write, just how to put it all together. Do you guys have any recommendations for resources regarding how to put a program together rather than coding it? I wouldn't mind some reading.

I'll be writing in Java if it makes a difference.

3 years, 5 months agoTonySu posted on learnprogramming.
Sept. 27, 2017

You create a program by defining what you want your program does then writing the code that does it. You become a better programmer when you write the code in a way that is safe, concise, reusable and maintainable.

There is no distinction between program and code. A program is series of code, an series of code forms a program. You write a program simply by writing a series of code, there's nothing to learn to go from "coding" to "programming".

You can then read things like Think like a Programmer and Clean Code so the programs you can organise the code in your program better and write better programs in the future.

Reinventing the wheel [R]

3 years, 5 months agoKillerInstinctUltra posted submission on ProgrammerHumor.
Sept. 21, 2017
3 years, 5 months agoKillerInstinctUltra posted on ProgrammerHumor.
Sept. 22, 2017

So, there are tons of opinions on this.

Mine is that you write what makes the code easiest to reason about, read, extend, test, and maintain.

The "performance gains" you might gain for writing terse and cryptic "one liners" and non descript variable names are not even detectable unless you are talking about 100,000 lines of JavaScript and are negligible even at that scale as you should be minifying your code anyway, which makes your code terse and cryptic automatically, meaning that you should write your code so it can be easily understood rather than obsessing over microseconds of performance gain at the cost of ease of development.

There is a Zen to this, you can write too much so that the point of what you are trying to achieve is just as lost as if you crammed everything into one line.

Basically, ask your self what can I extract, is this code doing too much, can I break it down into single responsibility functions and orchestrate them in a delegator function, do my variable name's make sense, should this be refactored, what is using this code, is is this duplicated elsewhere, does this code belong in this file or in a service/repository/on the class/centralized configuration file/ etc.

Learn how to write clean code and whether other coders like it or not (usually if they don't it's because they are not disciplined and don't want to be bothered learning the proper way of avoiding common pitfalls and mistakes or following best practices in general)

Do this and I believe you will be a welcome member to almost any dev team.

How do I start to think like this [R]

3 years, 5 months agonvdnadj92 posted submission on javascript.
Sept. 20, 2017

I have recently been doing the prep course for Hack Reactor and I felt like I was doing really good. It provides a very long gauntlet of programming challenges that build on each other.

I got to a point where they talk about clean coding and provided an example problem.

https://imgur.com/a/CAFFk

As you can see, they defined the problem then showed both an "unclean" and a "clean solution". They called the unclean solution beginner's code (I kind of disagreed with this because I don't feel like Javascript beginners typically have a good grasp of higher-order functions). Of course, the way I would have coded it fell right in the camp of unclean and it really got me to ask myself, how can I train myself to think more modularly.

To be honest, Javascript (as a whole) has been difficult for me to learn as I came from a traditional OOP background (C++/Java). I just haven't had those frequent ahha moments like when I learned Ruby. Because I've never programmed professionally, and always for fun, maybe (probably) I've never leveled out of being a hack. A perpetual level 1 programmer!

I completely get the "clean" solution. I like the way it zippers up, then back down. However, I'm having a difficult time strategizing how I can reprogram my brain to start thinking this way. I imagine it all boils down to practice. I didn't get higher-order functions or recursion at first, but the more I use them, the more confident I have become. The problem with this example is that my existing mental model is deeply rooted.

Before I become discouraged, I thought I'd vent here. Any suggestions or words of encouragement are appreciated.

3 years, 5 months agonvdnadj92 posted on javascript.
Sept. 20, 2017

Just to throw in my two cents here, I learned how to think in terms of "clean code" after watching a set of lectures by Robert C. Martin, AKA uncle Bob. He provides an conceptual framework for how to write "clean code" and is widely accepted as the subject matter expert in the software engineering community.

I highly recommend it -- He goes over things like "how to name variables", "when to split up functions into smaller ones", "how to structure programs", etc. I'm not kidding when I say that those lectures were the most meaningful improvement I have made as an engineer.

He also has a book too!

My program that I've been writing all evening now crashes my whole PC. How can I fix this? [R]

3 years, 5 months agoreturn-zero posted submission on learnprogramming.
Sept. 16, 2017

As the title says, my program now crashes my computer. The reason for this is because it takes up all my RAM and it causes a memory error before my PC freezes and crashes. I've tried using a 64 bit python however this hasn't worked and my program is only 80 lines long. If anyone knows i this can be fixed and how it can be done. <script src="https://gist.github.com/anonymous/8b85c56d6bbab66077d13f0deb16d771.js"></script>

3 years, 5 months agoreturn-zero posted on learnprogramming.
Sept. 16, 2017

hey sorry i wasnt able to help you out in time. glad you figured it out and got some constructive feedback. i had a sneaking suspicion it was due to a while loop. i would highly recommending reading the book clean code. it has a whole section on proper variable naming among a bunch of other stuff you would benefit from.

A collection of (mostly) technical things every software developer should know. [R]

3 years, 5 months agohem10ck posted submission on coding.
Sept. 6, 2017
3 years, 5 months agohem10ck posted on coding.
Sept. 6, 2017

Buy the book and find out.

Seriously though it is highly recommended.

I took a semester of Java Object Oriented Programming and due to being uninterested I learned absolutely nothing a basically failed. Will the Head First Java 2nd Addition help me? [R]

3 years, 5 months agocreate_a_new-account posted submission on learnprogramming.
Sept. 1, 2017

Basically can't seem to get interested in learning by myself from class..and doing the work just from knowledge learned during the lectures was practically impossible..at least to me. Is this a good textbook for object oriented programming that can help if I decide to retake this class? Thanks a lot.

3 years, 5 months agocreate_a_new-account posted on learnprogramming.
Sept. 1, 2017

this book

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr11?ie=UTF8&qid=1504297079&sr=8-1&keywords=clean+code

and this good free course

https://www.udemy.com/java-tutorial/

would be all you need

Bootcamp grad here, in need of critique / advice for landing a developer job. [R]

3 years, 6 months agomearkat7 posted submission on webdev.
Aug. 30, 2017

Hi everyone, fellow webdevs,

The reason for this post is because I've been pretty lost after completing a 6-month bootcamp program recently, and I would appreciate any sort of feedback to improve my chances of setting my foot into the tech industry.

To explain a little bit about myself, I am 25 years old, living in Los Angeles. I graduated June 2015 with a Bachelors in Financial Actuarial Mathematics. After studying for hundreds of hours and passing a couple actuarial exams, I decided eventually that working as an actuary might not be my passion, and so I put a hold on that thought and decided to work for a large international mobile game publisher as a Localization Associate. Essentially I was playing through several prototype builds of their apps, finding bugs, and translating into English, yada-yada. Although this position had nothing at all to do with my degree or what I wanted to do, it sparked my interest in tech industry.

So I quit my job and enrolled in a 6-month Full-Stack Web Developer Bootcamp in Los Angeles.

It took a little bit of courage in deciding to make this post because I had thought it would be easy to land a tech job. But I am becoming more and more terrified at the fact that I haven't gotten a single interview after applying to at least 50+ companies. (through angel.co, Dice, LinkedIn...)

I am starting to feel that maybe the tech scene has already become too saturated, and that as a Bootcamp grad, I might not have what it takes to land a job as a developer.

I know that some of you guys might think 'Oh, you're just another one of those cocky bootcampers that's polluting the scene', and I understand where those sentiments come from. But, I realize now that this is where I want to be, and my biggest regret is that I didn't pursue coding early on. I trully enjoy it and would like to keep learning, growing, and building.

Here's a link to my RESUME

and my PORTFOLIO

Thank you guys so so much for your time, and I would really greatly appreciate anyone's advice, critique, words of wisdom, and encouragement so that I can make some breakthroughs in my job hunting process!

tl;dr -- Recent Coding Bootcamp graduate seeking job hunting advice.

3 years, 6 months agomearkat7 posted on webdev.
Aug. 31, 2017

I'll preface this by saying i've done a little bit of hiring and helped my boss look at candidates so i'll try to explain why interviews might not be coming your way.

Also be wary that i'm bias. I don't really understand the idea of a "boot camp"; You can't leave your job and become a teacher or a lawyer in 6 months, why is a developer different? I guess it just seems a bit offensive to just assume that the field has such a lower barrier to entry that you need next to no training to be work ready.

Ok rant over.

Some tips/advice:

  • Go to meetups. Whether it be a nodejs or an express meetup find what is happening in your area and do your best to get along. You'll meet people and build up a bit of a network which will help gain some respect even if it's within small circles. Many of the people will have jobs and might be able to hook you up
  • You currently don't get interviews because you're easy to discount from a list. If a business gets 20 applicants an easy way to narrow down is by degree/experience. As somebody without either you're just culled while the list is narrowed down so you probably never get past that first step. That's why the above is vital. Also if you're rejected somewhere try to find out why, follow them up and see if you can improve yourself. I know many people who've done comp-sci/programming at uni for 4+ years and still can't get a job, you're going to need to work hard to get ahead of these people
  • Reason 2 people won't give you an interview is you're a big risk/investment. To get you where up to scratch in tech they're going to need to invest time in you, get you mentored, train you and help you which is $$$. The fact that you've dropped your previous degree and done a 6 month course I know my boss and I would raise a red flag at, how do we know you won't get bored in a year and after all the investment you just leave? Not saying you are like this at all but trying to explain what goes through peoples heads when they look at you
  • Not sure what jobs are like in your area but it's probably worth looking at what tech is popular. Is C# the king of your area? Learn C#. Is python the most popular stack? Learn python. People get too caught up in trying to use something cool and current rather than something that will be useful. You can write beautiful code in any language.
  • Read some good books. Most people have done a 3 year degree at uni to get to your position so in some aspects you'll be massively behind. Reading something like clean code(best book i've read on development) will help you get up to speed. Understanding how to get requirements is as important as being able to write the code.
  • Make sure you're applying for the right positions, again I have no idea what you're looking at but you need to be looking as low as possible. Anything without the word junior in it they'll write you off instantly. Call some businesses and see if you can find out what they look for in a junior, maybe they like seeing more side projects etc.
  • Contributing to open source is often a good idea, while some people hold it up as all important I think it's just good as it shows you can work with others and understand the idea of getting issues/features done and have the ability to come into a library/application and understand it enough to contribute.

Portfolio critique:

  • Nowhere does it mention what sort of job you are after(unless I missed it)? It just launches into name then skills, having something like "developer" or "web developer" I think would help me
  • Skills are way too saturated, you can probably remove all the browser images, i'd take away ajax, and depending on your target audience html/css. If you call yourself a dev and can't do html/css you're not worth looking at
  • Personally i'd put a contact form on there, you say "be the next chapter" but don't give me an "easy" way of getting in touch with you, drop a form in so I don't have to do more work
  • All your projects look like assignments from your course(they might not be). I'd try to diversify those because I just assume when I look at them you've had help or have not actually done it yourself and is something i'll often question with our applicants

I finished a computer programming course, and I don't know what the next step is [R]

3 years, 6 months agoAug. 30, 2017

[deleted]

3 years, 6 months agomy_password_is______ posted on learnprogramming.
Aug. 31, 2017

this is a free python book

https://automatetheboringstuff.com/

figure out how to rewrite all the programs to use java

especially chapters 11 through 17

see if you can find an inexpensive version of this book

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

read it, learn it well

How did you improve the quality of your code when working in an job without code reviews? [R]

3 years, 6 months agohealydorf posted submission on cscareerquestions.
Aug. 28, 2017
3 years, 6 months agohealydorf posted on cscareerquestions.
Aug. 28, 2017

If you haven't read Clean Code by Uncle Bob, I would highly recommend it.

Do you have particular pain points you could elaborate on? Co-workers consistently asking "huh" or "whats this mean"? Or are you assuming that because there is no code review that your code will naturally be a hectic mess?

Increase Font Size while Programming [R]

3 years, 6 months agonikrolls posted submission on webdev.
Aug. 22, 2017
3 years, 6 months agonikrolls posted on webdev.
Aug. 22, 2017

I really suggest you read Clean Code. It will change your life as an engineer.

Currently learning python - are there any video courses that focus on naming conventions, clean code and generally good coding behaviour? [R]

3 years, 6 months agoxiongchiamiov posted submission on learnpython.
Aug. 18, 2017

I'm currently learning python by myself, mostly by a mix of online tutorials and 'learning by doing'.

I fear however, that I might fall into the trap of ending up with bad coding behaviours, which one might expect from self-taught programmers (if pyramids of doom, not naming variables and functions according to conventions, documentation, etc.)

I know that 'learning python in a week' is a lot more appealing to most people, and that having fast results is what many wish for, but I personally prefer to learn things the correct way, so I don't later become 'that guy' in a company.

Basically, I want to know if there are any tutorials, which might help me to become a coder that produces code, which will make the least amount of trouble for hypothetical coworkers, or curious people reading through the source code.

If you have any suggestions, I'd really appreciate it.

3 years, 6 months agoxiongchiamiov posted on learnpython.
Aug. 19, 2017

Your comment was removed automatically by the reddit spam filter because you used a Google redirect link instead of https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 directly. Make sure you visit the page first before copying the url, as Google likes to pollute search result links like that.

Beginner project [R]

3 years, 6 months agopi_guy10 posted submission on sysadmin.
Aug. 12, 2017

TLDR: Anyone have good project ideas for a newbie?

In short, I have no idea what I'm doing. I have a lot of interest in systems architecture and its respective maintenance. Recently, I've been fortunate enough to find out a friend has 6 windows-based computers just sitting around. He's giving me free rein to do whatever I want with them. I figured I use the opportunity to learn something.

What is a good starter project for a complete beginner?

Please assume I have a basic python background with zero experience as a sysadmin.

Bonus points: Any good book suggestions?

Edit: Grammar and spelling

3 years, 6 months agopi_guy10 posted on sysadmin.
Aug. 13, 2017

Thank you. Working my way through "Clean Code" by Robert Martin (https://www.amazon.com/dp/0132350882/ref=cmswrcpapi_HcgKzbF6T27B1)

That book will be next on my list to read.

How do I write good code ? [R]

3 years, 6 months agojl1159 posted submission on cscareerquestions.
Aug. 12, 2017

[removed]

3 years, 6 months agojl1159 posted on cscareerquestions.
Aug. 12, 2017

Not sure if it exactly follows this situation, but one of the best books I've read - helped me develop some good habits. Highly recommend.

Clean Code: A Handbook of Agile Software Craftsmanship https://www.amazon.com/dp/0132350882/ref=cmswrcpapi_irVJzb23P5CQ3

Similar books/resources to "The Self Taught Programmer?" [R]

3 years, 6 months agohrastignac posted submission on learnprogramming.
Aug. 9, 2017

Hi all,

So I am about midway through this book, "The Self Taught Programmer", (https://theselftaughtprogrammer.io/) and I can honestly say it has helped my programming. Basically the point of the book is not to teach you a programming language in complete detail (he uses Python), but to show you what fundamental concepts you need to understand to be an effective engineer (OOP, version control, regular expressions, databases, data structures, etc). What I'd like to know is if anybody knows of any similar titles or resources? Not tutorials of "Learn Python in a week", but rather materials that focus on what to do once you understand a language. Interested to see feedback on this!

3 years, 6 months agohrastignac posted on learnprogramming.
Aug. 9, 2017

Clean Code is widely considered (at least in my circles) as a "must read" position for a pragmatic coder.

How do you practice good design? [R]

3 years, 6 months agocrookc posted submission on golang.
Aug. 7, 2017

Hey there,

I am aware that this is probably not the 100 percent correct subreddit for this question but since I am currently working mostly with go and also since my current goal is to improve my design of Go programs I wanted to start here.

So I was watching this wonderful talk Solid GO Design by Dave Cheney and I recently did some of the Code Kata Practices and it made me wonder, is there a way to actively practice good design apart from just spending years in the software development industry?

As a bit of background, I am not new to software development, I spent 10 years doing Java, almost got my CS degree finished, I do know what SOLID and GRASP are and I have a feel for when Code and design is bad. But and this is the key thing for me, at the moment this is mostly a feeling and I have a really hard time to assess designs and more importantly pro-actively make (high quality) design choices before I start coding.

So what I am asking basically is for your experiences, how you work when you design packages or start projects. Do you use checklists, guides or is it more a process that you do multiple iterations of a design? Maybe you have some good resources with practice material to dive deeper into this topic as well?

Thanks and all the best

Edit: After considering all the answers and doing some research I came to the conclusion that the question was to broad and unclear to be answered directly. Design is not one simple thing you do, but depends on so many different variables that you cannot just practice "Design" but you can practice code construction, system design for a specific domain or writing clean code. Overall "good design" is a super vague term and what might be good design in one area might be incredibly bad in another because the requirements are really different.

3 years, 6 months agocrookc posted on golang.
Aug. 7, 2017

Have you checked out Robert Martin's 'Clean Code' book and/or videos?

I've found Martin's material to be very helpful in actually identifying the attributes of clean code (and conversely, code smells). His examples are all in Java, which would be good for you, given your Java background. Despite his focus on Java and OOP more broadly, I think the fundamentals of clean code are language agnostic and there is plenty of carry-over to Go. He starts with rules around naming things and moves all the way through higher level design principles.

Fair warning though -- Martin goes totally overboard with props, green screens, theatrics, and astronomy history lessons in his videos. The book is more concise, but I'm a better visual learner, so after reading the book I started going through the videos.

Has anyone here made the switch to development without a computer science degree? [R]

3 years, 6 months agokvlt_ov_personality posted submission on sysadmin.
Aug. 2, 2017

I have an unrelated bachelor's degree and roughly 5 years of IT experience. I recently got into learning Python because of a hobbyist interest in security and forensics and found that I really enjoyed coding. I also know SQL and Javascript pretty well.

I've kicked around the idea of trying to make the jump to development, but I'm worried that I couldn't compete with your average computer science graduate. I'm worried that without an understanding of more computer science-y subjects (algorithms, Big O notation, etc.) people will be able to look at my code and immediately tell that I'm self-taught.

  1. Has anyone here made a similar career move, and what would your advice be to someone else considering the same path?

  2. Are there any books you could recommend that would help an aspiring programmer from a non-traditional background become more well rounded?

  3. How can you tell when you know "enough" to start applying for development roles?

I know that /r/cscareerquestions exists, but I'm hoping for perspective from someone who transitioned to dev from an IT/infrastructure role.

3 years, 6 months agokvlt_ov_personality posted on sysadmin.
Aug. 2, 2017

Thank you! This is exactly what I was looking for, I appreciate the list of subjects to educate myself on.

As far as well documented, readable code - I ordered this from Amazon and I'm hoping it will help me in those areas: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

Transitioning from solo to team development? [R]

3 years, 7 months agoFeroc posted submission on cscareerquestions.
Aug. 1, 2017

How do I effectively transition from being the only developer on a project to working with a team?

I've been working as a solo developer for the past 3 years, but I've recently accepted a new position where I'll be working with others. How can I make this transition as smooth as possible for myself and my team?

3 years, 7 months agoFeroc posted on cscareerquestions.
Aug. 1, 2017
  • Learn to use the source control they are using and prepare for merge conflicts
  • Be ready to accept different ways of doing things, maybe they are doing TDD, maybe they just have different code styles
  • Clean Code always helps
3 years, 7 months agoYuleTideCamel posted submission on learnprogramming.
July 30, 2017

Why is github important for employers when considering you as a job applicant? What do they specifically look for? How do they make judgements based on your repos, and the number of commits you have made?

3 years, 7 months agoYuleTideCamel posted on learnprogramming.
July 30, 2017

I'm on a hiring panel for a large tech company. Here are things I look for in a github account:

  • How many forked repos vs homegrown projects. A forked repo isn't a bad thing if you contribute to it. But a lot of people fill up their github accounts with forked repos and don't contribute.

  • Cadence of commits / checkins. One large git commit is a bad sign, rather I prefer to see smaller commits to a repo.

  • Code Quality, I look at the style of coding. Basically seeing if the candidate writes Clean Code

  • Unit Tests. For non-forked repos, I look to see if there are unit tests and the quality of the tests.

  • Build Badges . For non-forked repos, I look to see if there's a build badge and an attached CI server. Not having it isn't going to disqualify anyone, but having this set up goes a long way.

  • Readme files. For non-forked repo, did the candidate create a readme file? Does it describe the project, how to install it and run it. Or is it just a dump of code? Having a good readme file that talks about the project and shows how to run it is a very good thing. I will pick a random repo and try to run it from time to time. So if the steps in the readme are wrong, or out of date, that counts negatively against a candidate also.

Learning a language isn't too bad. But how do you learn best practices? [R]

3 years, 7 months agorjcarr posted submission on learnprogramming.
July 27, 2017

Hey all --

I know best practices come with experience and well ... practice but I have an interview in a week and while I know how to code (talking about python specifically) I want to write good clean code. And by that I mean proper modularity, tests, good use of functions/methods and classes ... basically the structures of a good program no matter how big or small it is.

Am I overthinking this for just an interview? I've been reading about TDD but still wondering if there are more resources I need to read about.

3 years, 7 months agorjcarr posted on learnprogramming.
July 27, 2017

> I want to write good clean code

There's literally a (good) book called "clean code":

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

How to become a better dev [R]

3 years, 7 months agoMattyy_Westside posted submission on cscareerquestions.
July 27, 2017

I've been in the industry for 2-3 years and at my current company, I'm pretty sure I'm a diversity hire (as a female). I learned nothing during my first job at a big 4 company, so I switched to a small company to try to have more responsibility and learn more. I've only been there for a few months but I feel like no one wants me here except my manager and he wants me there for diversity reasons since there aren't any other female devs. I keep making mistakes/bugs and it makes my coworkers think I'm even more incompetent. Does anyone have suggestions on how to be a better dev in my situation or is it better to just quit or change industries?

3 years, 7 months agoMattyy_Westside posted on cscareerquestions.
July 27, 2017

Clean Code is also a great book

Good books on programming that aren't about languages? [R]

3 years, 7 months agolmouelle posted submission on learnprogramming.
July 25, 2017

I've been programming a while, have an internship, and have a good grasp on Javascript (primarily), and I like to do C as a hobby. While there are always new things to learn in these languages (always picking up neat tricks from things I read online), I feel like the amount I can learn that is specific to the languages I work with dwindles every day. I can always pick up new languages, but I always find myself relearning the same things in a different syntax.

So, I was wondering if anyone had any good recommendations for books about programming that are language-agnostic? For example, I recently picked up "Applied Cryptography Second Edition", and while the examples are in C, the principles apply to any language and the examples can be translated to any language as well. I have a bunch of other security books which I picked up in the recent CyberSecurity Humble Bundle, and am also reading the HTTP 1.1 RFC so I can make my own webserver.

Do you have any recommendations for interesting programming books which are language-agnostic?

3 years, 7 months agolmouelle posted on learnprogramming.
July 25, 2017

Clean code. read it learn it love it

What can a high schooler do to accelerate his ability to code during the summer? [R]

3 years, 7 months agohugthemachines posted submission on AskProgramming.
July 21, 2017

It is summer break, and I was wondering how could I spend two hours a day learning how to code. I am experienced with Java, Android app development (basically Java), and some C#, C, and Python. However, syntax is easy to learn, but applying syntax isn't. I don't feel like I am well versed enough in being able to recognize complex level problems and figuring out ways how to solve them. How should I practice? What languages should I also try to learn? Lastly, are there any recommendations for websites to try out? Thanks!

3 years, 7 months agohugthemachines posted on AskProgramming.
July 22, 2017

I would recommend reading Clean Code. It is a good, easy-to-read book about how to write quality code. It can help you a bit for all your languages.

Other than that, perhaps you could helpan open source project? Then you get real coding practice.

“My Code is Self-Documenting” [R]

3 years, 7 months ago_dban_ posted submission on programming.
July 21, 2017
3 years, 7 months ago_dban_ posted on programming.
July 21, 2017

Isn't this argument kind of a strawman?

Who says that self-documenting code means absolutely no comments? Even the biggest champion of self-documenting code, Uncle Bob, devotes an entire chapter in Clean Code to effective commenting practices.

The idea of "self-documenting code" is that comments are at best a crutch to explain a bad design, and a worst, lies. Especially as the code changes and then you have to update those comments, which becomes extremely tedious if the comments are at too low a level of detail.

Thus, while code should be self-documenting, comments should be sparse and have demonstrable value when present. This is in line with the Agile philosophy that working code is more important than documentation, but that doesn't mean that documentation isn't important. Whatever documents are created should prove themselves necessary instead of busy work that no one will refer to later.

Uncle Bob presents categories of "good comments":

  • Legal Comments: Because you have to
  • Informative Comments, Clarification: Like providing a sample of a regular expression match. These kinds of comments can usually be eliminated through better variable names, class names or functions.
  • Explanation of Intent
  • Warning of Consquences
  • TODO Comments
  • Amplification: Amplify the importance of code that might otherwise seem consequential.
  • Javadocs in Public APIs: Good API documentation is indispensable.

Some examples of "bad comments":

  • Mumbling
  • Redundant comments that just repeat the code
  • Mandated comments: aka, mandated Javadocs that don't add any value. Like a Javadoc on a self-evident getter method.
  • Journal comments: version control history at the top of the file
  • Noise comments: Pointless commentary
  • Closing brace comments
  • Attributions and bylines
  • Commented out code

How to avoid developing bad habits? [R]

3 years, 7 months agoynot269 posted submission on learnprogramming.
July 20, 2017

So, I should begin this by saying that I'm a 14 year old girl, and I've always had a passion for computers. Around six or seven months ago, though, I decided I wanted to take that passion to the next level by learning to program.

I chose to learn Python because of its simple syntax, and I actually really enjoyed it! Spending hours trying to perfect a program with trial and error and eventually making it work was incredibly rewarding.

Problem is, I feel like I'm developing bad habits. A while ago, I saw a comment (on here, ironically enough) stating that a lot of young programmers have to unlearn their bad habits they formed while young.

The comment mentioned that many young programmers have messy code, which I've seen in my own. I rely on conditionals for nearly everything, rarely use comments and struggle using loops, so I'll end up writing a lot more than I should've.

Thus, I'm facing a bit of a dilemma. Do I continue to teach myself Python, or should I wait until I can take a school course? Advice would be appreciated.

3 years, 7 months agoynot269 posted on learnprogramming.
July 20, 2017

Python is great for intro, I say keep at it. Definitely pick up some books or youtube tutorials if you're struggling with certain concepts.

If you're worried about your code being messy, check out pep8 it's basically a formatting guide for python.

And to take it a step further check out [clean code] (https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882) its a little thicc, but it does wonders for code readability.

Also recommend once you get the hang of python, check out Java. IMO it exposes a lot of those underlying concepts more so you'll understand some of the underlying mechanisms in what you write.

Note that rarely using comments isn't necessarily a bad thing

take a look at this

getdateof_birth(person):

#return the date of birth for a given person

get_date(person):

Which one reads better?

You'll learn this if you read Clean Code, but code is for humans. What you write will be read by humans, it gets compiled down / interpreted into machine language for computers but as far as anyone seeing your code it will be humans.

edit: forgot about md formatting

When have you learned enough to get your first job in a programming role? [R]

3 years, 7 months agoTartarugaNL posted submission on learnpython.
July 17, 2017

hi guys. I've been learning Python for about 12 months now I think. It's been great fun and I'm glad I started. I'm 22 years old and I decided to learn in my spare time (which required me to spend a lot less time gaming which was tough) but I got through it because I enjoyed it. Making things that worked was great.

 

I've applied python to my current job by automating a lot of tedious tasks I had to do that took up a lot of time. I'm very proud of this, although it's quite easy, I'm still happy I've even got this far with it. Looking to the future though, I feel like this is something I'd like to advance in and have a career in being a programmer. My current job doesn't offer any opportunities to do this, infact my boss isn't too keen on me automating jobs for some reason, although they've been fully automated for 6 months now and we've had less mistakes than ever, so there's that.

 

However, I've been looking at jobs and they all seem to require a ton of experience or being a recent graduate. Two things I don't really have. I've made a few little programs but that's it. What should I be doing now? Should I have somewhere to put my projects so I have my own portfolio? I want to continue learning but I'm not sure what part of Python to head into, be it Django, Data Analysis or Software Developer. I don't even care what I'm doing, I just enjoy doing it, but I want to be doing it as a full time role instead of little bits here and there.

 

I guess what I'm wondering is how other people managed to get their first job using python. People that left their old job role to start a new career in programming at a new work place without a degree and 10 years experience. How did you do it? Also what do you do in python in your job. I've seen a lot of jobs in Django but it seems almost... difficult? to learn Django without a proper project. Most tutorials just show you how to set up pages, link them and find a cool theme online and slightly customise it to your liking. I don't think knowing this is enough to land a job using Django...

3 years, 7 months agoTartarugaNL posted on learnpython.
July 18, 2017

This great book hammers the point home that, as a programmer, you are an author. So I'd say your education and teaching experience are an excellent starting point. Read the book and be prepared to reason about why you care about code quality. Any potential employer who cares about the future of their business should pick up on this. Be upfront about your (lack of) experience and show that you want to learn. Work on a portfolio of personal projects: noone expects a newbie to have indepth library knowledge, but experience does count.

Recommend a good non-programming book to help me program [R]

3 years, 7 months agoTangerineWaves posted submission on learnprogramming.
July 17, 2017

Ok, let me start again: I'm looking for book recommendations about programming that aren't manuals or guides to learn a specific language. More along the lines of a book that helps you "think" like a programmer or how to look at a particular problem with the right mindset.

Is there something like this out there?

3 years, 7 months agoTangerineWaves posted on learnprogramming.
July 17, 2017

I like Clean Code by Robert C. Martin.

My problems writing "clean code" in Python [R]

3 years, 7 months agoyawpitch posted submission on learnpython.
July 17, 2017

Hello everybody.

Months ago I started learning Python on codeacademy, then I basically re-learned Python again with other books and Youtube courses, just to have a more solid grasp on fundamentals.

I also started challenging myself with logic and not just syntax with hackerrank and codefights while trying to read a bit of code from other people on github and occasionally ventured a bit on django projects.

My big problem isn't really "solving problems", that's a skill that's influenced more by your logic and will to explore and google and ask rather than bare knowledge.

I can write easy-medium sized CLI programs in Python quite comfortably (wrote an automatic trader bot for Bittrex/Poloniex which is quite complex, e.g.).

But every time I start a new project I end up writing the programs in a very linear fashion, I rarely use functions (just to not repeat myself too often), and pretty much never any classes.

I realize that my code is a mess and no matter how much I comment it maintaining it or fixing bugs is painful.

Another problem is debugging my code. While Visual Studio allows me to very easily debug code with breakpoints and very in-depth tools I can't find something similar for Python.

Could anybody guide me towards writing better code and easier debugging tools?

3 years, 7 months agoyawpitch posted on learnpython.
July 17, 2017

Just gonna say it; if you're not using function and/or class definitions in every file then you haven't learned Python or programming. Not yet.

Most of professional programming is maintaining code, usually in concert with others; you must be using factorization primitives -- in Python that's functions, classes, and modules -- to write code that is even testable, which is the start of being maintable.

I would suggest starting with a book like Clean Code.

PHP Weekly Discussion (July) [R]

3 years, 7 months agofatboyxpc posted submission on PHP.
July 9, 2017

Hello there!

This is a safe, non-judging environment for all your questions no matter how silly you think they are. Anyone can answer questions.

Previous discussions

Thanks!

3 years, 7 months agofatboyxpc posted on PHP.
July 14, 2017

You could read this book, it's a great resource: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr11?ie=UTF8&qid=1500085515&sr=8-1&keywords=clean+code

What is the “cleanest” code you know of? [R]

3 years, 7 months agocyrusol posted submission on learnprogramming.
July 13, 2017

I’ve been reading a lot about writing the clean code. Code that’s efficient, readable, reusable, follows SOLID, all that.

What’s the cleanest code you guys know of? Part of what makes me really want to ask this is the fact that everyone has their own preferences. It’d be useful to see what everyone has in common.

I personally can’t think of a good example myself, but so far I’ve been really turned on by protocol oriented programming (since I’m a swift programmer).

3 years, 7 months agocyrusol posted on learnprogramming.
July 13, 2017

Code is clean if as many as possible of the following points are true:

  • Variables are named in a meaningfully way. The great Clean Code book recommends taking as much time for the naming of a variable as you would take for naming your firstborn child.
  • Sometimes abbreviations are good to not have to read the same word over and over again.
  • Functions/methods should fit in the space that a human can recognize very fast (5-11 lines) - of course exceptions exist but they should be kept exceptions.
  • A thing (program, function, class, whatever) solves one thing and one thing only.
  • No quirky styles such as commas at the beginning of a line to separate elements of for example an array. Just put the commas directly after array elements.
  • Otherwise a consistent style,
  • Another completely subjective thing: It is usually said that comments should not be used to describe what but to describe why you have to do it. I on the other hand would go so far to say that if you have to explain why you have to do something you should probably think about what you wrote and how you can make it understandable by just refactoring, renaming etc. Comments should only be used in case of emergencies. I want to read the code, not the comments.

To me this is about as clean as it can get:

https://golang.org/src/net/http/server.go

Although even here some functions are quite long and some comments are superfluous.

[bate-papo] O que você está lendo? 08/07/17 [R]

3 years, 7 months agodiisiqueira posted submission on Livros.
July 8, 2017

Quais foram suas aventuras esta semana?

3 years, 7 months agodiisiqueira posted on Livros.
July 8, 2017

Terminei de ler o Clean Code e o The Choose Yourself Guide To Wealth, agora comecei a ler o The Go Programming Language. Queria ler alguma aventura, mas pra ser sincero dei uma procurada por cima e nenhum título atual realmente me chamou a atenção.

How to become a better programmer? [R]

3 years, 7 months agorjcarr posted submission on learnprogramming.
July 4, 2017

Whenever I program I always wonder how I can make my code better in anyway shape or form. Should I consider changing the structure of my code, naming conventions or the way I run and tackle errors within my code. Can someone give me some tips on what I should consider when writing code?

How to learn best practises of C#? [R]

3 years, 7 months agogang_s posted submission on learncsharp.
July 4, 2017

Title pretty much says it. I am wondering on how can I know which solution is best for my problem? How should bug be fixed etc.

Does someone know any good sites, books or other material that would teach best practises?

3 years, 7 months agogang_s posted on learncsharp.
July 4, 2017

Personally I'd say it's not about just fixing bugs, but learning to set your code up so that it is easily readable and bugs are easily identifiable. SOLID principles are principles to live by, all of my coworkers recommended the following book by Uncle Bob: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

SOLID concepts aren't easy to grasp especially at first, I am still greatly in the dark on most of it to be honest. But just the few skills and practices like Dependency Inversion and SRP are already making my software easier to maintain and modify

How is Java used in the software engineering industry? [R]

3 years, 8 months agonutrecht posted submission on cscareerquestions.
July 3, 2017

I see that it's one of the most popular languages and I know java is used in android, but how else is it used? I hear that spring framework is used with java, what exactly does it do? And is there anything else that is used with java?

3 years, 7 months agonutrecht posted on cscareerquestions.
July 4, 2017

This book is great for any developer. Especially the focus on clean code and software quality. It's even more important for a "Java back end dev" because in general the projects tend to be a bit more complex than a simple wordpress site ;)

Aside from that, the de facto framework for Java back-end services is Spring. It has very good guides. However; if you're only two semesters in I would advice letting that bit rest for now and just focus on building a lot of applications yourself. That experience is by far the most important bit.

[D] Why can't you guys comment your fucking code? [R]

3 years, 7 months agogarrypig posted submission on MachineLearning.
July 3, 2017

Seriously.

I spent the last few years doing web app development. Dug into DL a couple months ago. Supposedly, compared to the post-post-post-docs doing AI stuff, JavaScript developers should be inbred peasants. But every project these peasants release, even a fucking library that colorizes CLI output, has a catchy name, extensive docs, shitloads of comments, fuckton of tests, semantic versioning, changelog, and, oh my god, better variable names than ctx_h or lang_hs or fuck_you_for_trying_to_understand.

The concepts and ideas behind DL, GANs, LSTMs, CNNs, whatever – it's clear, it's simple, it's intuitive. The slog is to go through the jargon (that keeps changing beneath your feet - what's the point of using fancy words if you can't keep them consistent?), the unnecessary equations, trying to squeeze meaning from bullshit language used in papers, figuring out the super important steps, preprocessing, hyperparameters optimization that the authors, oops, failed to mention.

Sorry for singling out, but look at this - what the fuck? If a developer anywhere else at Facebook would get this code for a review they would throw up.

  • Do you intentionally try to obfuscate your papers? Is pseudo-code a fucking premium? Can you at least try to give some intuition before showering the reader with equations?

  • How the fuck do you dare to release a paper without source code?

  • Why the fuck do you never ever add comments to you code?

  • When naming things, are you charged by the character? Do you get a bonus for acronyms?

  • Do you realize that OpenAI having needed to release a "baseline" TRPO implementation is a fucking disgrace to your profession?

  • Jesus christ, who decided to name a tensor concatenation function cat?

3 years, 7 months agogarrypig posted on MachineLearning.
July 4, 2017

I think this book recommendation might be appreciated on this thread: Clean Code: A Handbook of Agile Software Craftsmanship https://www.amazon.com/dp/0132350882/ref=cmswrcpapi_mkZwzb0VN10HD

[D] Why can't you guys comment your fucking code? • r/MachineLearning [R]

3 years, 7 months agorfinger1337 posted submission on artificial.
July 3, 2017
3 years, 7 months agorfinger1337 posted on artificial.
July 3, 2017

Comments lie, code does not. If you can't name your classes, methods and variables in a way that I know what you are doing, then I'm not going to approve your pull request.

Also, if the pr comes from a junior dev or new hire, I will buy them a copy of this book:

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=pdlposbs14img0?encoding=UTF8&psc=1&refRID=2GRKWCXC0MEEKXJN49HK

which explains, rather eloquently, why comments are not a good thing.

(caveat: rarely, there needs to be a "why I did this" comment, and that's OK. That's not what I am talking about.)

[QUESTION for autodidacts] From "beginner who write a lot of spaghetti code" to "a useful developer"? [R]

3 years, 8 months agojacobisaman posted submission on learnpython.
July 2, 2017

Hello people!

I'm a QA tester/automation who's been coding on Python for a couple of years now. Thing is, I want to become a developer and I tried many times to make the jump I finally realized my problem is I don't know how learn to be a developer, and not just only who writes random functions and scripts with no cohesion whatsoever.

Longer version: I wrote many scripts that do small tasks (a terminal program that returns a "heads-tails" or a random number, another one that shows me the last ten premiered movies on a movies webpage, a script that analyze my movie collection and draws a few plots using matplotlib about genres, years of release, etc., a terminal MAC vendor looker, etc.) but I didn't build any real and useful project, they're just a bunch of scripts, most of which I have less than a hundred lines.

I'm learning Django too, but all my webpages feel boring and just flat out bland. Like, who would use this? What's the purpose of it? There are already better versions of this out there.

So, I think the question(s) are:

  • How did you jump this gap between being a guy who randomly writes scripts to someone who design and write full blown projects?

  • Many people recommend to create interesting projects; problem is, my ideas for projects end up either being simple scripts I write in a few hours or crazy moonshots that I never actually achieve to finish. How do you find the sweet spot?

  • How do you learn the "tangential" skills of writing code? Things like how to structure your projects, how to use git properly and efficiently, how to pack and deploy on somebody else's machine, etc. How did you learn such things?

  • Another thing people recommend me is to read code of other people. Well, I can go to github and search for top projects but I don't understand a word and a half of those projects. So where did you find code that you actually understand but that it serves you to learn new things?

  • Some people also say "contribute to open source projects". Well, same problem as before, I searched for "first-timers-only" projects and I just can't understand where to begin. Advice?

All in all, I feel like I've being in this point of "being able to" but "not actually doing" for too long and I don't know how to progress.

Sorry if it doesn't feel like a serious programming question. Thanks for all the advice.

EDIT: formatting.

EDIT2: Many thanks to those who answered. I'm picking every single advise and I'm going to put it to practice accordingly. Thanks!

3 years, 8 months agojacobisaman posted on learnpython.
July 2, 2017

I would recommend reading a book like Clean Code. It talks about writing high quality and structured code.

These four “clean code” tips will dramatically improve your engineering team’s productivity [R]

3 years, 8 months agoJune 16, 2017

Implementing “clean code” practices appropriately will double productivity in the long run (at a bare minimum) and significantly improve moral on the engineering team.

A couple ago when we identified the problem, we read Robert Martin’s Clean Code as a team and did our best to implement his recommendations and even introduced “clean code” as a core cultural tenant for the engineering team.

In summary, make sure to remember and apply these four “clean code” principles to dramatically improve your team’s productivity: In a later blog post I’ll cover corollary design patterns including immutability, Service/Factory/Value Object (VO) triumvirate and more.

Out of all the ideas we implemented from Clean Code and other sources, five provided at least 80% of the gains in productivity and team happiness.

Today, the overall quality of our codebases are significantly better thanks in large part to a deliberate effort to improve code quality.

Doing a class project for college and this is what i found... [R]

3 years, 8 months agothreedaysmore posted submission on ProgrammerHumor.
June 7, 2017
3 years, 8 months agothreedaysmore posted on ProgrammerHumor.
June 8, 2017

I'll start by saying if you haven't read Clean Code, then it's a great place to see questions like your answered with examples. It gets a little too in the weeds for some people at the end, but the first several chapters are great for explaining how, why, and when to break things up.

What a lot of it comes down to for me (and there are different opinions on what "clean" code looks like or should look like, it's somewhat stylistic) is readability.

No matter what app you're writing, with a little bit of business/domain knowledge I should be able to look at your code without having seen it before and be able to understand what parts of the code are responsible for what logical operations so that if the requirements have changed or a bug was found I should know right where to go.

I made a small example while nomming some lunch (forgive me for typos or obvious errors lol). The example is a Cash Register app that is responsible for totaling the sale amount given a list of items.

<hr />

Here is the orignal code | Here's the refactored Specifically looking at the CalculateTotalSale methods....

So in a small trivial program it's not as easy to see the benefits, but in the refactored version the total sale logic has been broken up into methods. This way, lets say there's a bug in how we're calculating taxes (in a small app like this they're probably wouldn't be, but in an enterprise POS app that's in an international market tax calculation can be a pain) we've made several ways to track down where taxes are being done. We can look at the usages of _taxes to see where it's being modified, and we can look at CalculateTaxes() method since that's where all the tax logic should be. If we find that tax logic is not there, we should either move there, or consider a small change in design to make it flow easier.

Also we've left the CalculateTotalSale method open for extension as well. Noted by the comments, if the business wanted us to write coupon logic we could put it in it's own method and go from there. We've left a pattern for the next person to follow, they'd be able to get into this code and get to work pretty quickly. Patterns do change though, but since we've followed some fairly fundamental designs of class structure it'd be easy for someone to change the pattern if they needed to. They won't have to look all over the code for pieces of logic if we've grouped it well.

All that being said, the first example still works fine and gets the job done, the discussion above is more of engineering vs programming. Just my two cents though! Sorry if I've made any obvious errors or didn't explain this well!

Commenting Etiquette [R]

3 years, 8 months agodesrtfx posted submission on learnprogramming.
June 6, 2017

Hey guys,

I am just about finished with freeCodeCamps Front-End development certificate and hope to apply for jobs in the near future. I figured I would be showing some of the code I wrote and wanted to comment it properly.

Does anyone have any advice or recommended reading on this? I basically just rifled through my code and commented on almost a line by line basis for JavaScript, some really simple stuff in the HTML, and essentially nothing in the CSS.

If anyone wanted to take a look, here is a codepen.io I have with what I imagine is decent commenting. - https://codepen.io/ColtonJD/pen/NgKwaK

If you had thoughts in the actual code as well, I'm all ears!

Edit: Click Change View -> Editor View to see the code.

3 years, 8 months agodesrtfx posted on learnprogramming.
June 6, 2017

There is a book on good code style available (it uses Java, but the actual programming language is secondary). It is basically the reference for proper coding style:

Clean Code: A Handbook of Agile Software Craftsmanship by "Uncle Bob" Robert C. Martin.

I can only fully recommend this book as it is quite an eye opener.

Who is using TDD? [R]

3 years, 8 months agokchojhu posted submission on Angular2.
June 5, 2017
3 years, 8 months agokchojhu posted on Angular2.
June 5, 2017

I'd say if you want to do it right then this book will show how

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr11?ie=UTF8&qid=1496679937&sr=8-1&keywords=clean+code

How do I learn to structure my code in a better way? [R]

3 years, 9 months agoRoboticPotatoGames posted submission on gamedev.
May 31, 2017

I'm currently in the process of making my first serious game in unity.Due to my lack of experience,I relied on tutorials and as a result my codebase is really messy.Before I jumped into gamedev,I had no experience in OOP so I don't really know the best way to fix this.I had some experience in C but that's not OOP based.How do I get out of this situation?

3 years, 9 months agoRoboticPotatoGames posted on gamedev.
May 31, 2017

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

This book. This book honestly has the answer to all of your structural coding questions. You will spend your entire career trying to make code that follows the standards herein, but it's not really possible for a live project. And that's a good thing. You don't really need to look anywhere else.

How to progress? [R]

3 years, 9 months agoKlaireOverwood posted submission on learnpython.
May 31, 2017

So I ve been working on Python for the past few months, learning on the way. My code still looks clumsy. I want to know how to code in a way that is more professional. I am not a developer but want to code like one.

3 years, 9 months agoKlaireOverwood posted on learnpython.
May 31, 2017

There are books and articles on the subject (recommendations welcome).

A good advice is to keep in mind (or imagine) that the code will have to be changed. Maybe in a year, maybe not by you - this is very common in "real life". For example, of you have 128 of something to process or a limit of 128 that appears often, write N = 128 and then use only N, this way, if/when the limit changes, you'll have to change in one place. Keep code as modular as possible: if there is getting data, processing the data and displaying the data, keep these as separated as possible - no processing during displaying. This way, if/when you'll have to display it otherwise or somewhere else, you'll change the displaying code, but the processing will stay where it was: out of sight, out of mind.

Then there's code review, not for the faint of heart, as it's 99% negative feedback, because it lists things that need to be changed and improved and doesn't focus on the good ones. But this is very "real life": you can't get attached to your code, it will be ciritised and it will be deleted, it's a stepping stone and not a work of art. (Take pride in what the project does and the difficulties overcame. It can be a challenge to keep your head up high in this job, since you're always working on the things than need fixing, not the ones that are done and working.) If you want, you can send me a sample to review.

Finally, the appropriate xkcd.

Refactoring with the Advanced Boy Scout Rule [R]

3 years, 9 months agolyotox posted submission on PHP.
May 30, 2017
3 years, 9 months agolyotox posted on PHP.
May 31, 2017

He's probably talking about Uncle Bob's book. https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr11?ie=UTF8&qid=1496214502&sr=8-1&keywords=clean+code

In general, how big should a method or function be? [R]

3 years, 9 months agoMay 27, 2017

[deleted]

3 years, 9 months agodzhv posted on webdev.
May 27, 2017

If you are a person who tries his best to keep his code tidy and readable, I strongly recommend reading this book: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

If I recall correctly, their suggestion is to keep functions as short as a few lines and focus mostly on how you name them. But the general guideline is the same as most of the comments here mention: a function must do a single thing. Similarly to single responsibility principle of a class/module: https://en.wikipedia.org/wiki/Singleresponsibilityprinciple

The book is really well written and has helped me a lot in making my code readable (atleast i hope so :) ).

Is this an acceptable project to put on my resume? (entry-level programmer, no degree) [R]

3 years, 9 months agoYuleTideCamel posted submission on learnprogramming.
May 18, 2017

link

Any advice on improving this project is appreciated. I know it isn't great to look at. Will that be an issue? If so, is it necessary for me to learn a framework like bootstrap to improve the aesthetic? I plan on avoiding design oriented jobs anyways.

3 years, 9 months agoYuleTideCamel posted on learnprogramming.
May 18, 2017

Great job! It's good that you are thinking about this stuff and wanting to have a solid portfolio. I'm on an interview panel for a large tech company. So my feedback is from the point of view of an interviewer:

  • Link to the source code. Put it on github and provide a link. Interviewers will want to easily find the source code and look at it.
  • Make sure you have unit tests
  • Pay attention to the coding standards /best practices. Basically all the stuff mentioned in Clean Code
  • Always link to to you resume/homepage/linked in so employers can learn more about you

A warm welcome [R]

3 years, 9 months agosimonced posted submission on ProgrammerHumor.
May 14, 2017
3 years, 9 months agosimonced posted on ProgrammerHumor.
May 15, 2017

I know right?! I was like that as well, until I had been enlightened.

Here is my new bible: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

@auto_assign_arguments decorator (eliminates __init__ 'self.x = x' boilerplate) [R]

3 years, 9 months agoenteleform posted submission on Python.
May 12, 2017

[removed]

3 years, 9 months agoenteleform posted on Python.
May 13, 2017

The locals approach was included in my experimentation as follows:

<pre>def auto_assign_arguments(instance): localItems = inspect.stack()[1].frame.f_locals.items() vars = {k:v for k,v in localItems if k not in ['self', 'args', 'kwargs']} instance.__dict__.update(vars) class Simple: def __init__(self, arg1, arg2, _private, *args, kwarg1=False, **kwargs): auto_assign_arguments(self) </pre>

However, it did not work for all possible argument combinations, and would have required a similar structure to the posted solution, since my primary goal was to handle all cases.&nbsp; The [locals, positional/keyword args only] approach is definitely more performant, but this code's intention is boilerplate reduction for rapid prototyping.&nbsp; If nanosecond-level performance becomes a concern, you can always go back & write out the assignments manually.

&nbsp;

> Achieves the same thing without mountains of boilerplate

I'd argue that it's not boilerplate at all.&nbsp; It's a decorator, with helper functions, which handles its intended task appropriately.&nbsp; The definition of boilerplate is phrases or units of text used repeatedly; so I find any code that is unabstracted, such as:

<pre>vars = {k:v for k,v in locals().items() if k not in ['self', 'args', 'kwargs']} self.__dict__.update(vars) </pre>

to be actual boilerplate, VS the much more concise/descriptive auto_assign_arguments (whether in decorator or function format).&nbsp; The code behind the scenes is written once; so it is, by definition, not boilerplate.

&nbsp;

> The idea being you ignore args/*kwargs so as not to set off any rm -rf / situations

I'd be interested to see if someone could break the code I posted.&nbsp; To the best of my knowledge (and included tests), it seems like it handles all possible scenarios without fail.

&nbsp;

> I had a hard time reading what you wrote

I've been working through Robert Martin's Clean Code / Clean Coders material, and my current focus has been around the single responsibility (EG: small functions) and descriptive naming principles.

The [execution, high-level overview] of the _assign_args function is at the bottom, after all of the helper function declarations:

<pre>if(KEYWORD_DEFAULTS ): assign_keyword_defaults (parameters=POSITIONAL_PARAMS, defaults=KEYWORD_DEFAULTS) if(KEYWORD_ONLY_DEFAULTS): assign_keyword_only_defaults(defaults=KEYWORD_ONLY_DEFAULTS ) if(args ): assign_positional_args (parameters=POSITIONAL_PARAMS, args=args ) if(kwargs ): assign_keyword_args (kwargs=kwargs ) if(VARIABLE_PARAM ): assign_variable_args (parameter=VARIABLE_PARAM, args=args ) </pre>

which IMO is pretty straight-forward.&nbsp; Each one of those helper functions is only 2-3 lines, so they should be pretty easy to understand individually.&nbsp; They're arranged in that particular order to ensure proper assignment of each type of argument.

I'm asking the JavaScript community for [help]. Perhaps my greatest weakness as a software engineer is my lack of testing ability/experience. Could you recommend resources--be they video courses, books, blog posts, etc.--that could guide my hand through the process and take me from novice to expert? [R]

3 years, 9 months agochachinsky posted submission on javascript.
May 10, 2017

The title pretty well says it all. I am sorely lacking in testing experience. I have written unit tests in Q-Unit and Rspec and have written acceptance tests in Cucumber, but I really suck at test-driven development. I need help badly. What could I do to improve? What resources could you recommend? And, I realize this is a question of personal aptitude, but is it difficult to become expert at test- and behavior-driven development?

3 years, 9 months agochachinsky posted on javascript.
May 11, 2017

If you associate test-driven development (TDD) with learning better code design, it might help fill in any gaps you feel you have. Best to have an understanding of SOLID principles, DRY, and KISS.

Red Green refactor is a good starting point. http://www.jamesshore.com/Blog/Red-Green-Refactor.html

Though its not JS specific, anything by Sandi Metz is awesome, highly recommend her 99 Bottles book. https://www.sandimetz.com/99bottles

Uncle Bob's Clean code is a great resource as well. https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

Whoopsie [R]

3 years, 9 months agoBrocccooli posted submission on ProgrammerHumor.
May 7, 2017
3 years, 9 months agoBrocccooli posted on ProgrammerHumor.
May 9, 2017

Good coding practices? [R]

3 years, 9 months agoramo109 posted submission on cscareerquestions.
May 8, 2017

What are some good coding practices that every new software developer should know?

[Advice] People who are not interning or taking classes this summer, what are your plans? [R]

3 years, 9 months agomseffner posted submission on cscareerquestions.
May 6, 2017

Sorry, if the mods deem this post as inappropriate. Below are my plans.

I had a couple of interview calls but couldn't convert them. I'm going to work on Leetcode questions and I'm currently talking with a couple of professors at school about joining their research groups for the summer. If I fail to get that, I'm looking to work on a open-source project, specifically I'm looking at Apache Spark. I'm open to ideas and possibilities of working together as well.

3 years, 9 months agomseffner posted on cscareerquestions.
May 7, 2017

How to become more than a programmer (what to learn) [R]

3 years, 9 months agoNowImAllSet posted submission on softwaredevelopment.
May 6, 2017

Hello, I am currently a self taught web developer, employed full time and develop e-commerce systems. I can code front end and backend. But that's really all I can do, code. (php, javascript, css, html etc. and learning python)

I would like to learn the concepts of architecture, networking, virtualization, database optimization etc. and all the items that make one a well rounded software engineer / architect instead of a a typical stack overflow based programmer.

Where would you recommend I start? A lot of tutorials begin assuming the reader knows about servers and other items. What steps, resources would you recommend?

3 years, 9 months agoNowImAllSet posted on softwaredevelopment.
May 7, 2017

Disclaimer: I'm an undergraduate and don't know shit.

I think the best way to learn is from the small parts, up. So, first learn a structured (preferably OO) programming language. Python will do, but I'd recommend something with compilation and static typing. Python is great for scripting and has its purpose, but designing and implementing a complex system in Python is a nightmare. After learning that, learn how to write your classes, methods and just generally structure your code better. I highly recommend Clean Code for that. After understanding good class design and code structure, start learning about higher-level concepts on how those well-defined classes should communicate with each other and be decoupled. Important concepts to learn are coupling and cohesion, polymorphism, inheritance, etc. All the basic OOP concepts. From there, you can move onto architecture. The book I used in my courses was System Analysis and Design, but there could very well be better ones out there.

Edit: Oh, and it's helpful to at least be knowledgeable of common design patterns. I really like SourceMaking's approach and explanations, but once again there's tons of good resources out there.

Dropping out of college? Advice. [R]

3 years, 9 months agostefan_kurcubic posted submission on learnprogramming.
May 7, 2017

Hi there, as the titles says, I'm considering dropping out of college.

I'm 22, working full time and studying, I really love software engineering, technology is my passion. To be honest I can't consider anything else to do for a living.

My job is not tech related but I'm working into getting into a field related job.

I learn very fast but for some reason I don't do well in college. I don't feel good in it. I don't feel like waiting 3 years for a degree. I feel like I can learn that from the web and apply it to a project and learn better -faster.


My idea is to start with web development. I have a couple of ideas to create apps, by the way.

I have basic knowledge of HTML, CSS, JS. I have a intermediate knowledge of C++. I know what big-o and algorithm complexity and analysis is. Anyways, it's not like I'm starting from scratch.

I'm confused and scared here, I feel like this decision will define the rest of my life and I don't know if it's really my intuition or what telling me to drop out.

I understand this is not easy, but again -what's easy if you want to do great?

Can you guys give me some advice? People with and without degrees, I would really appreciate your input.

3 years, 9 months agostefan_kurcubic posted on learnprogramming.
May 7, 2017

woah! brave young man right here!

how to be developer 101

oke

  1. listen to your gut and trust it (it knows what it is saying and why) 1.5 find a goal, set schedule and stick to it.
  2. stay healthy. eat regularly, sleep from 10-6, exercise 30min/day (walking is good), drink water
  3. this could be the best thing that happened to you. there is a reason for everything
  4. https://www.freecodecamp.com/ if you devote a year to this. you will be ready for a job and since you know stuff already it is going to take even less!!
  5. discipline!!!!!!!!!!!!!!!!!!! do it everyday think about how you can improve, find out about something new, implement new ideas, your calling is to be PROFESSIONAL webdeveloper ACT LIKE ONE.

  6. mindset - http://norvig.com/21-days.html

  7. fit more easily in a team - https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882
  8. BUILD BUILD BUILD BUILD BUILD BUILD. you learn by doing not by thinking or reading. put everything on github YOU ARE PROUD OF

after you complete FCC http://www.firsttimersonly.com/

or if you are hungry look here https://skillcrush.com/2015/07/14/job-sites-to-find-your-first-developer-job/

write me in a year

Mid way through the program and feel I lost information along the way and feel I'm "sucking". Almost want to quit, but want to try to help myself before doing that. Help? [R]

3 years, 9 months agoTeimoso posted submission on OSUOnlineCS.
May 6, 2017

So, long of the short, I have gotten good grades in my courses and am about halfway through the program. However, I just feel like the classes are now starting to build up on the past courses. Issue is, I feel I honestly forgot a lot of the concepts from past classes. I can't take the courses over and doing a "rush" learning of those concepts isn't realistic.

I just feel like I need a tutor of some kind to help me when I get stuck. Asking questions on a board like piazza or whatever the course is using isn't cutting it as the responses honestly aren't fast enough and its hard to have a back and forth discussion on a board. Like I feel I need real time feedback if I get stuck on an assignment or something else.

I eventually solve the problems, but I can tell if I don't get a helping tutor to make sure I don't go down a wrong path, I'm simply not going to be able to finish future courses. I work too long hours and don't have time to just work on assignments all day like many in this program seem to be able to do (not all of course, but heard many start going full time midway through the program). I need to make sure I'm heading down the right direction, or get actual feedback on my code (aka, be told my code is horrible or maybe try this route instead of the route your taking.)

Can someone recommend maybe where I can find mentors/tutors who can help guide me when I get stuck in real time? Tutors in this program, while I'm sure many are good, haven't been the most helpful. Also, they can't touch the assignments, and that is where I get derailed many times. I'm not looking for answers when I'm derailed, but I'm looking for guides to say, "hey, try heading this way instead of the route your going. Because if you waste 4 days going down the route your going, your going to find out it doesn't work and you will just need to delete your code".

I hope this post makes since. Can someone maybe point me to some helpful resources that could help me? I'm just annoyed because I feel I don't get the help I need that I would get in a brick and mortar school, where I can meet tutors in labs or other things.

ALSO, is there any online learning program that you felt help you solve programming problems? I just feel like there are a lot of "tools" missing from my toolkick to solve problems. I just feel I don't have the tools or background others seem to have to solve topics. Is there some thing or "program" that can be followed that can help one solve any program problem? Like a step by step overview programming strategy that can help one go about solving program problems the "right" way? I just feel that I'm just missing something. I know programming is challenging, but as time goes by, I really feel I'm just "missing" something that others seem to grasp.

3 years, 9 months agoTeimoso posted on OSUOnlineCS.
May 7, 2017

[For coding best practices : ] (https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882) Maybe you don't need to follow this to the T but it's helpful overall.

[For when you are stuck / architecting your program: ] (https://www.amazon.com/Classic-Yellow-Rubber-Ducky-Schylling/dp/B000K21D4K/)

Explain your code/talk through exactly what you are doing to a rubber duck or willing participant. A lot of times saying it out loud and explaining your code will help you find any holes to think about/fix.

I'm the Sole Developer of this app but have to leave notes like this for myself frequently [R]

3 years, 10 months agobluefisch200 posted submission on ProgrammerHumor.
April 26, 2017
3 years, 10 months agobluefisch200 posted on ProgrammerHumor.
April 27, 2017

Please consider reading this 😉

I know you are the sole developer but still...that is just confusing.

PyCopy a Python Script , Need Feedback. [R]

3 years, 10 months agoenteleform posted submission on Python.
April 21, 2017

I recently made a Python script that basically copy various files like music , movies , videos , etc . To their specified folder (like Music files in music folder )

We see a various situation where many files with different files types are in a USB or any other folder and we separately copy by selecting one type files one by one and cut or copy to their specified folder.

To automate that stuff select all files at once and RIGHT CLICK -> SCRIPTS -> MOVEFILES and voila all files go to their specified folder

You can view source code at:

http://www.github.com/himanshuarora97/pycopy

3 years, 10 months agoenteleform posted on Python.
April 21, 2017

+1 for having a descriptive readme.md & GIF demos.&nbsp; Do that forever.
&nbsp;
I didn't look through your code super thoroughly, but I did notice that you're parsing some settings manually from text files.&nbsp; I recommend using PyYAML for improved ease of use, especially as complexity grows (JSON & INI are also common options, but IMO YAML is the most readable & flexible of the three).
&nbsp;
Here's an example:

settings.yaml

<pre>music: extensions: [".mp3", ".wav"] path: "home/jackson/Desktop/music" movie: extensions: [".mp4", ".mkv", ".avi"] path: "home/jackson/Desktop/movie" image: extensions: [".jpg", ".jpeg", ".gif", ".png"] path: "home/jackson/Desktop/image" </pre>

test_yaml.py

<pre>import yaml def load_yaml(file_path): with open(file_path, "r") as file: return yaml.load(file) settings = load_yaml("settings.yaml") print(settings["music"]) # {'extensions': ['.mp3', '.wav'], 'path': 'home/jackson/Desktop/music'} print(settings["music"]["extensions"]) # ['.mp3', '.wav'] print(settings["music"]["path"]) # home/jackson/Desktop/music for file_type in settings: print(file_type, settings[file_type]["extensions"]) # music ['.mp3', '.wav'] # movie ['.mp4', '.mkv', '.avi'] # image ['.jpg', '.jpeg', '.gif', '.png'] </pre>

&nbsp;

<hr />

&nbsp;
Aside from that, I recommend reading Clean Code (the video series is great also, I'm working through it now. Videos 0 & 1 are free).
&nbsp;
The script you shared is small enough to where a random person (and/or your future self) can look at it and figure out what's going on without too much effort, but there are some implementations that would be much harder to manage & understand in a larger project (unnecessary global usage, nested loops, large amounts of abbreviated variable names, functions containing multiple streams of logic that would be better situated in helper functions, etc.).
&nbsp;
The resources I mentioned above cover a lot of common pitfalls that lead to unmaintainable code, along with elegant solutions that will help you to write code that is clean/maintainable/reusable/easy to understand/etc.

[AMA][PQC] Trabalhava em um site de sexo e swing, mudei pra um site de astrologia e agora fui contratado por uma empresa em Berlim, me mudo segunda-feira para lá. [R]

3 years, 10 months agodiisiqueira posted submission on brasil.
April 20, 2017

Sou programador backend.

Titulo bem descritivo. Pergunte qualquer coisa.

Devo ficar por aqui até umas 14h00~15h00 depois disso eu respondo de noite.

edit: Adicionei que sou programador.

3 years, 10 months agodiisiqueira posted on brasil.
April 20, 2017

Cara, reinventar a roda não é ruim! Resolver problemas clássicos é uma ótima maneira de aprender e praticar é a melhor maneira de melhorar em algo. Eu sou o tipo de cara que gosta de aprender as coisas na prática então sou suspeito de falar mas vai lá e desenvolve. Essa minha aposta com meus amigos é justamente para nos forçar a isso, desenvolve qualquer coisa mesmo que seja algo completamente inútil, que é melhor do que ficar parado. Umas semanas atrás, nessa aposta um dos meus amigos desenvolveu um script que calculava se era ecologicamente correto urinar no chuveiro ou na privada, utilidade real do projeto é nula, mas fazendo isso ele já começou a aprender uma nova linguagem e investiu tempo em se tornar um programador melhor. Realmente meu conselho é faça, desenvolva! Uma dica é pegue pequenas coisas do seu dia-a-dia e resolva elas com programação, por exemplo, uma vez eu fiz um script que me perguntava quais ingredientes eu queria em um lanche, ai ele varria o site do iFood e me falava qual era a opção mais barata que eu tinha. Não tinha necessidade alguma de fazer isso, era muito mais rápido fazer uma busca manual, mas na época isso me ensinou a usar a BeautifulSoup e foi super divertido de fazer.

1) Eu sempre tive a visão de que o mercado python no Brasil é bem mais fraco do que em outros países, não sei ao certo de porque, aqui na minha região por exemplo não conheço nenhuma empresa que seja especializada em python. Por outro lado aqui o grande foco das empresas é o PHP, em todos os níveis. PHP é realmente uma linguagem de entrada, por ser muito aberta e deixar a pessoa fazer as coisas de qualquer maneira, acaba sendo muito fácil de tornar uma pessoa capaz de criar códigos funcionais em PHP, depois quando aprendem melhor o paradigma da programação, muitas acabam migrando para outras linguagem.

2) Atualmente eu tenho dois livros que ficam grudados na minha cabeceira da cama, e leio um pedaço todos os dias quando acordo, são eles o Clean Code e o Design Patterns. Tambem to de olho no The Pragmatic Programmer.

My Coworkers do not Comment Their Code [R]

3 years, 10 months agoApril 19, 2017

And they are pretty adamant that they shouldn't have to. Where do you guys stand on this issue? They tell me "code should comment itself" but in practice that just isn't what is happening. It doesn't help that we are writing computational group theory in C basic...

I TA'd for a Python course in college, and uncommented code was rewarded with a zero on the assignment. It just seems so obvious to me that every few lines deserve a comment that motivates the reader.

How can I broach the subject with them without sounding like an asshole? They outnumber me, are more experienced, but spend less time on the project than I do. I wish there was some "source of truth" I could point at but I know that is naive. Just looking for some advice. :/

EDIT: Looks like the answer is to show them specific examples of confusing code blocks, and let the conversation progress from there!

3 years, 10 months agocybernd posted on AskProgramming.
April 19, 2017

Book recommendation:

Chapter 4 is dedicated to code comments and will help you to understand why some people are talking about self documenting code.

I also recommend you to remember the books author. He also calls himself "Uncle Bob" and you will find several good talks from him on youtube. (Warning: they usually start with some minutes of a completely unrelated topic)

If you take developing software "serious" i would declare reading this book as mandatory. The same goes for his talk about "Expecting Professionalism".

General programming advice from your projects [R]

3 years, 10 months agosavagehill posted submission on roguelikedev.
April 17, 2017

Now and then we see some general programming articles, advice and subject-specific questions pop up here, things like how to model your data, which languages/tools to use, how to implement AI/events/whatever. However, I haven't ever seen a post for more day-to-day stuff that aren't covered by those "big topics".

So, if you have any bite-sized (byte-sized?) piece of advice that you're proud of - or some day-to-day lessons that you've learned to do (or to avoid) since you started programming games, let us know! It's a bit of an open-ended question but hopefully you all understand what I'm looking for: good advice that isn't necessarily worthy of having an article written about it but that nonetheless you've learned and applied in your projects after finding out about them or discovering them as you worked on your stuff!

3 years, 10 months agosavagehill posted on roguelikedev.
April 17, 2017

I prefer Uncle Bob's view:

> It is well known that I prefer code that has few comments. I code by the principle that good code does not require many comments. Indeed, I have often suggested that every comment represents a failure to make the code self explanatory. I have advised programmers to consider comments as a last resort.

Other times he puts it more bluntly:

>Comments are always failures. We must have them because we cannot always figure out how to express ourselves without them, but their use is not a cause for celebration.

or

>"Every time you write a comment, you should grimace and feel the failure of your ability of expression."

I know it's not always practical, but I like Uncle Bob's extremely demanding perspective, because I feel it sets a really high bar and struggling to work toward it is something that stretches me.

If this is a wildly shocking view, I highly recommend picking up a copy of Uncle Bob's book Clean Code which I learned about from this IRDC talk. I saw that talk, bought the book, read it, and my views were changed. I now refactor a lot more and comment a lot less.

Uncle Bob's minimally commented code doesn't come cheap though, he spends a ton of cycles after the code works, retooling it specifically to make it readable.

Also, for the record, I ain't no Uncle Bob. Don't misunderstand me as saying I live up to his standards please!!

Learning how to mentor as I move from junior to senior developer. [R]

3 years, 10 months agoYuleTideCamel posted submission on learnprogramming.
April 16, 2017

I apologize if this isn't the correct subreddit, but it didn't seem like anywhere else fit better.

I'm trying to improve my mentoring and teaching skills as I move into a senior developer by writing some blog posts on common struggles of new and junior developers. Also, the one of the best ways to learn anything is to teach it, so I'm hoping I improve my own understanding of software engineering topics in the process.

I'm looking for advice from new programmers on how clear and understandable my post is. I'm particularly worried about it being too abstract. I'd also love input from more established programmers on what concepts they find best to introduce to junior developers first when mentoring them.

My introductory blog post on refactoring.

3 years, 10 months agoYuleTideCamel posted on learnprogramming.
April 16, 2017

Not OP but i can try to answer.

  1. The key here is that OP introduced the extract method tooling. What that does is that it allows you take a block of code and have your IDE move it to a method. That's useful for moving large chunks of code out of a single gigantic method and into smaller methods. In general smaller methods are easier to read and debug, large methods are a code smell (I'll explain that next).

  2. A code smell is basically an indication that something is wrong. The people that came up with the term tried likening it to opening your refrigerator door and smelling something bad. You know some food in there is rotten, but until you start examining everything you won't know which one is bad. A Code smell is similar. It's a sense you develop when you see certain patterns and know the way the code was written is bad and will lead to problems. For example, large functions or methods are a code smell. Variable names with numbers (int count, int count2) are code smell. It's something you develop after a while.

  3. While it does looks weird, it's accepted terminology. People wills say "keep your code DRY" for example. Just think of dry as a short cut for "remove duplication"

In terms of refactoring code (and general best practices) these two books are great:

What is your code writing process? [R]

3 years, 10 months agoenteleform posted submission on compsci.
April 15, 2017

[removed]

3 years, 10 months agoenteleform posted on compsci.
April 15, 2017

I've been coding for a few years and for a while was just focused on getting things to work.&nbsp; Now I'm at a point where I know I'll figure out any given problem with my accumulated knowledge and/or additional research, and I'm noticing that not planning ahead is the most significant (lack of) action that will set me back at this stage in my practice.

&nbsp;
To remedy this, I've been looking into architectural patterns (MVC, MVP, MVVM, etc.), and UML diagramming.
&nbsp;

<hr />

&nbsp;
Architectural patterns were initially difficult to grasp, as many of the explanations available online dig into topics that might not make sense yet if you are inexperienced with architecture.&nbsp; The MVC Java Tutorial by Derek Banas is the best introductory explanation of architectural patterns that I've come across (he also has some great videos on design patterns & other topics).
&nbsp;
Some books that cover code structure & architecture in more detail:

&nbsp;
The author of Clean Code, Bob Martin, has a ton of talks that are a great source of info, and has also produced the CleanCoders series.
&nbsp;

<hr />

&nbsp;
Also check out some Software UML Examples.&nbsp; I find that mapping out an overhead view of your project before starting to code gives you a chance to make sure the majority of relationships, life-cycles, and high-level details are planned out correctly from the start.&nbsp; You'll still have to make inevitable adjustments while coding, but it's much more efficient than figuring it all out from the inside while you're building it.
&nbsp;
yEd Graph Editor is a good freeware option for creating UML diagrams.
&nbsp;
If you find that you really like the UML approach, check out Enterprise Architect.&nbsp; It's definitely worth picking up since it allows you to generate file structures from your UML diagrams, with all of the boilerplate filled out already (class/method/variable definitions, etc.).
&nbsp;

<hr />

&nbsp;
Also related, SourceMaking has some good wikis on:

&nbsp;
(Although their UML material is pretty in-depth and may be overkill if you just want to use UML as a quick way to plan out code.&nbsp; But it's legit if you want to go all-out UML mode)

Matlab program to track stats! [R]

3 years, 10 months agosmdaegan posted submission on Archery.
April 8, 2017
3 years, 10 months agosmdaegan posted on Archery.
April 9, 2017

Yeah, and that's largely the problem when software engineers run into "academic" code -- the conventions used are all mathematical or physics-type nomenclature, but it makes it almost impossible to read/follow for someone that's used to reading code, if that makes sense.

There's a fantastic book called Clean Code that talks about how to just write code better and in a more readable manner. It's pretty readable by people with any level of coding knowledge, and I'd highly recommend it should you ever want to cross into the realm of software as a profession, or as a more serious hobby ☺

Only took Data Structures...best way to learn more "practical" cs topics? [R]

3 years, 10 months agoJosephCW posted submission on cscareerquestions.
April 5, 2017

Sup Guys,

I've just taken Data Structures, and I have experience coding in Java and Python, and I'm looking to start contributing to projects on git. How do I learn the more everyday side to programming though? I don't really know anything about CI, or any of the programming design patterns or concepts used. I'm learning git, but I don't have any experience with writing unit tests either. What approach would you suggest to learn how to write good code? Thanks.

Edit: I'd prefer if you guys could link resources in Python if possible. Thanks a lot!

3 years, 10 months agoJosephCW posted on cscareerquestions.
April 5, 2017

Books and when possible building side projects.

List of Java-related books I've found helpful.

Clean Code

Java 8 in Action

Data Structures & Algorithms in Java

Test-Driven Java Development

The last book (Test-Driven Java Development) briefly introduces different testing frameworks for java. It gives you a good start to work off of on your own.

Ninja Edit: I'm also adding two websites that have rather useful examples/diagrams for different design patterns.

DZone

TutorialsPoint

Refactoring according to company style guide [R]

3 years, 11 months agoDJMattB241 posted submission on ProgrammerHumor.
March 28, 2017
3 years, 11 months agoDJMattB241 posted on ProgrammerHumor.
March 28, 2017

Sounds like Garrett needs a copy of this book.

What is one book all junior people should read? [R]

3 years, 11 months agoMarch 26, 2017

[deleted]

3 years, 11 months agodiablo1128 posted on cscareerquestions.
March 26, 2017

I personally like Clean Code: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

He also has a website where there are videos of the concepts in the book. https://cleancoders.com/

[Code Review Request] Built my first composer package this weekend. Feedback and criticism would be very welcome. [R]

3 years, 11 months agotherealmalios posted submission on PHP.
March 26, 2017

Hello everybody,

I've been working as Web Developer for some time and work mainly with PHP and NodeJS, but for all of the projects we work on we use some kind of framework. Plus I didn't have any open source projects :(. So I decided to spend this weekend to publish my first OS Project which is also my first composer package! It is a really small library to generate plain text tables from PHP. Here is the github link to the repository. It took me only 1 day to develop it but I already feel like I've learned some stuff and improved myself :D

I will be very happy If someone reviews my code and gives me feedback!

Happy Sunday!

edit: formatting

3 years, 11 months agotherealmalios posted on PHP.
March 26, 2017

Hey, thanks for this constructive feedback!

> First thing I did is went straight to tests. +1 for having tests!!! People truly don't get how important it is.

I too really think that tests are critical. My first project that I worked on was relatively large and with no unit tests (it wasn't very testable either)... 90% of the cases I heard "Well, this used to work. Somebody probaby changed something." would be avoided If we had good tests. Though I don't think that I know how to write good tests. Can you recommend some good book on this topic?

> I think a package that you may find useful for your tests is Faker...

Well I considered using it and it could replace many literals from my tests but I don't know how could I test table rendering with it since it generates random data.. any suggestions?

> I would suggest removing comments.

Do you mean the inline or the docblock comments?

> highly suggest reading this book which harps on this topic a lot, it may be one of the most respected books on software: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

I've heard good things about this book but I didn't have time to read it. It's time already, I'll upload it to my kindle tonight!

> You used types!!! Awesome!!!

WE WANT GENERICS!

> I saw some nested if-statements...

I usually have a rule to write maximum 1 nested if (else) statement. And after seeing the tremendous amount of nested if else statements some devs write I used to feel like code qulity ninja :D But maybe it's time to reform my rules^after^I^finish^reading^the^book .

> In your Row.php class (and some other places), you have a "new" declaration. "New is glue,"

Well I used the new keyword to instantiate some data structures. But I don't think that "New is glue" rule applies to data structures. Isn't it like creating new array like $rows = []; ?

[Code Review Request] Built my first composer package this weekend. Feedback and criticism would be very welcome. [R]

3 years, 11 months agosublimer22 posted submission on PHP.
March 26, 2017

Hello everybody,

I've been working as Web Developer for some time and work mainly with PHP and NodeJS, but for all of the projects we work on we use some kind of framework. Plus I didn't have any open source projects :(. So I decided to spend this weekend to publish my first OS Project which is also my first composer package! It is a really small library to generate plain text tables from PHP. Here is the github link to the repository. It took me only 1 day to develop it but I already feel like I've learned some stuff and improved myself :D

I will be very happy If someone reviews my code and gives me feedback!

Happy Sunday!

edit: formatting

3 years, 11 months agosublimer22 posted on PHP.
March 26, 2017

Checking it out...

First thing I did is went straight to tests. +1 for having tests!!! People truly don't get how important it is. I think a package that you may find useful for your tests is Faker...it helps to "generate" data for your tests without distracting the tests with too many literals. Check it out: https://github.com/fzaninotto/Faker

I would suggest removing comments. Comments rot, and looking at most of them, they don't add any value. Your code should be self-documenting. This means to have expressive names and syntax that eliminate the need for comments. Well-written code, and tests, that should be all the documentation you need :) I highly suggest reading this book which harps on this topic a lot, it may be one of the most respected books on software: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

You used types!!! Awesome!!!

I saw some nested if-statements...to me, I usually pull this out into a private function (see self-documenting code comment above).

In your Row.php class (and some other places), you have a "new" declaration. "New is glue," I highly suggest looking into a DI framework, it will make your code more testable and easier to maintain. I have some experience with this one: http://php-di.org/

I think your code is pretty good. Short functions, use of types and namespaces, testing, etc. My suggestions (if you implement them) shouldn't be too difficult.

Knowledge-base about coding on a team for a 100% self-taught? [R]

3 years, 11 months agoMarch 25, 2017

[deleted]

3 years, 11 months agodenialerror posted on learnprogramming.
March 25, 2017

Ah okay. Well I doubt that's what they'll be assessing as part of your coding test. What they might be looking for is that the code you write is readable, clean and maintainable. If you haven't read it and have the time to do so, go through Clean Code and understand what makes code maintainable (although it is fairly dogmatic).

I'd also suggest asking them how they work as a team and what practices they use (agile, scrum, kanban, pair programming, etc.). While they might have concerns in your experience of coding with others, showing enthusiasm to learn how they do it will help.

Real Programmers Write Unmaintainable Code [R]

3 years, 11 months agosample-name posted submission on gatekeeping.
March 20, 2017
3 years, 11 months agosample-name posted on gatekeeping.
March 20, 2017

A friend said he read in a book (I think it was [this one] (https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882)) that you should avoid commenting your code as much as possible because that means the code isn't "clean" enough. If a code is well written, it will be self explainatory what the purpose of the code is. Not saying you should ditch commenting all together, but just that this might be what the gatekeeper is trying to express.

How do you know that your code is well written? [R]

3 years, 11 months agoYuleTideCamel posted submission on learnprogramming.
March 13, 2017

Imagine a case-scenario where you're a beginner (If you are not) and you want to know if your code is well written, if it is good code, for short, without asking somebody, posting for a code review, etc, what are the key-points you have to look to determine if your code is actually good?

3 years, 11 months agoYuleTideCamel posted on learnprogramming.
March 13, 2017

In general yes. good code is easy to read and maintain. When I was a junior dev I assumed code that was hard to read was impressive , but the truth is , it's not.

Here's a few things to consider when looking at "good code":

  • Is it easy to read?
  • Is there a lot of repetition, duplicate or simlar code blocks can be a bad sign.
  • Is it overengineered? are there too many layers of abstraction.
  • Are there unit tests?

Here's a few resources for writing good code:

I'm an engineer who is doing a PhD in computer science but has almost no professional programming experience. Here is what it looks like when I write code. How am I doing? [R]

3 years, 11 months agocastlerocktronics posted submission on coding.
March 6, 2017
3 years, 11 months agocastlerocktronics posted on coding.
March 6, 2017

I highly recommend this book, which kind of contains all that feedback. Don't get put off by the shoe horning of the word Agile into the title, its not really got anything to do with

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

I got it because a place I ended up turning down an offer from gave this and Head First Design Patterns to all new hires regardless of their previous experience. The copy I bought for myself has been passed around my office so much that it hasn't been on my own desk since I about a month after I came in.

Multiple route with the same controller [R]

3 years, 12 months agoStrategyPattern posted submission on laravel.
March 1, 2017

Is it possible to use the same controller for multiple purposes? For example:

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class ProductDetailsController extends Controller
{
    public function select($id){}

    public function edit($id){}

    public function imgupl($id){}

    public function cntupd($id{}
}

And the first function select a product, the second edit a product the third manages the imageupload for a product and the forth manages the count update for a product

EDIT: code snippet formating

3 years, 12 months agoStrategyPattern posted on laravel.
March 2, 2017

With regards to the actual naming of controllers, and the methods within, I'll paste a comment I made on another post:

Your controllers should only ever have one of the seven REST actions: index, show, create, store, edit, update, delete

If you do this for awhile I think you'll find that it produces cleaner and more maintainable code.

So, in this case, in your articles controller just have a method called index which will return all the articles for you. You are free to do the sorting on the controller and then return it if you like, or you can still sort it in the JS.

For reference here's a Taylor Otwell tweet about using only the seven REST verbs: https://twitter.com/taylorotwell/status/735999833102680065?lang=en

And here's a summary of the same point that DHH made in an interview: http://jeromedalbert.com/how-dhh-organizes-his-rails-controllers/

To address the general point: As others have stated, controllers are indeed meant to be used for multiple things. Typically up to the seven things that I listed above, but you can utilize as many or as few of those methods as needed.

Beyond that, it is almost never a good idea to abbreviate function or class names (as /u/Towerful has also stated). If you're interested and have the time and money, I'd recommend that you pickup a copy of Clean Code for some general coding principles.

Also, I think you'd get tremendous benefit from reading the Laravel documentation and/or getting a Laracasts subscription.

Learn on the go [R]

4 years agoYuleTideCamel posted submission on learnprogramming.
Feb. 26, 2017

What do you guys do to learn on the go?

I want to keep learning, coding, or something productive. Has anyone found something that is good to learn on the go or keep practicing code etc....

4 years agoYuleTideCamel posted on learnprogramming.
Feb. 26, 2017

Sure I really enjoy these podcasts.

  • .NET Rocks. Even if you don't do .NET they talk about high level concepts and talk to a lot of smart people on various things. on a recent podcast, they mentioned KataCoda which is an amazing site for learning docker. I had never heard of it.

  • Hanselminutes. Great technology podcast.

  • JavaScript Jabber

  • Ruby Rogues

As for books , here are some tech books I have read and enjoyed:

There's obviously a ton of other books, but those immediately come to mind.

Comments can really be amazing if used right! [R]

4 years agojakeinstein posted submission on gamedev.
Feb. 24, 2017

As game developers programmer, we always have been told to comment our code.
While that exactly what I was doing for the past years, couple days ago I've started taking it to the next level.
Instead of a few words describing the code I am writing, I literally started talking to myself through comments!
This may sound way too much (and sometimes it may be) but you won't believe how much it helps, not only for the future but AS you write code, it constantly remind you of things you may have forgotten.

Things i noticed when adding detailed comments in my code:

  • Your code feel much more readable and comfortable to work with.
  • As you write the comments, you tell yourself what you need to program, which is the biggest benefit in my opinion.
  • Sometimes, while you write the comments, you will remember that you missed something ("WAIT! I forgot that if I do X then I should probably take care of Y")
  • You can leave comments to remind yourself to do / change or fix things later, I always relied on my memory for things like that, which is bad!
  • If you work with another programmer, it will be extremely easy for him / her to read the code, the more you comment, the better.

TLDR: Try to use and write comments like you are talking to yourself and don't be afraid of long comments! they are amazing, you have to try it at least once.

EDIT:
/u/glacialthinker sent a link that basically explain this coding style!

4 years agojakeinstein posted on gamedev.
Feb. 24, 2017

Hi here's the link - https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 it has made a huge difference in how I code. If you can get your hands on the video that's even better. They are hilarious.

Comments can really be amazing if used right! [R]

4 years agospacemunkee posted submission on gamedev.
Feb. 24, 2017

As game developers programmer, we always have been told to comment our code.
While that exactly what I was doing for the past years, couple days ago I've started taking it to the next level.
Instead of a few words describing the code I am writing, I literally started talking to myself through comments!
This may sound way too much (and sometimes it may be) but you won't believe how much it helps, not only for the future but AS you write code, it constantly remind you of things you may have forgotten.

Things i noticed when adding detailed comments in my code:

  • Your code feel much more readable and comfortable to work with.
  • As you write the comments, you tell yourself what you need to program, which is the biggest benefit in my opinion.
  • Sometimes, while you write the comments, you will remember that you missed something ("WAIT! I forgot that if I do X then I should probably take care of Y")
  • You can leave comments to remind yourself to do / change or fix things later, I always relied on my memory for things like that, which is bad!
  • If you work with another programmer, it will be extremely easy for him / her to read the code, the more you comment, the better.

TLDR: Try to use and write comments like you are talking to yourself and don't be afraid of long comments! they are amazing, you have to try it at least once.

EDIT:
/u/glacialthinker sent a link that basically explain this coding style!

4 years agospacemunkee posted on gamedev.
Feb. 24, 2017

This is exactly what I was thinking when reading this. As someone who has been coding and doing code reviews for 20+ years, comments almost always lie eventually. They are an extra point of maintenance and most people don't maintain them when changing code.

As for long functions, your functions should really be doing one thing. A long function is a smell that tells me it is probably doing too much. The more you get into the habit of keeping things small, the more you realize how much easier it is to reason about the code you're writing and reading.

This book by Uncle Bob Martin is pretty great. Am I telling you to change your style? No. But like the person above me, I am imploring you to read more on the subject and come to your own determination.

What is an "efficient" script? [R]

4 years agosuddenarborealstop posted submission on PowerShell.
Feb. 18, 2017

Is it one with least lines?

Is it one with Maximum used aliases to reduce the total number of characters?

What should be preferred? Readability (using Get-content, Set-Location) or Lowest character count (using GC,SL)

Is it better to have a really descriptive paragraph in comments as opposed to 2-3 sentences?

I have recently come to the conclusion that I don't write efficient programs, since in class, I wrote a 2 page code which my friend solved in 7 lines. And since I don't have any more planned scripts, I thought to improve my skill and improve the scripts I have made so far

4 years agosuddenarborealstop posted on PowerShell.
Feb. 19, 2017

aliases == bad. tight code is not flexible and is awful to read and edit. use as many functions as you can. there are lots of books around on code quality. here is a good one: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

do not copy/paste code. ever.

learn how to use blocks/scopes to your advantage. do not leave variables laying around.

use generic collections from.net, learn why they are useful if you are unfamiliar with them

reduce type casting, and ambiguous parameter binding.

limit how much data is returned from external systems or IO. if you are querying SQL or AD, let the remote server do all the work, and reduce the number of fields returned.

exit from functions early with guard clauses.

use rsjobs to really get speed if you need it.

micro-optimise only if you have to.

Best language-agnostic clean code / patterns book? [R]

4 years agoFeb. 10, 2017

[deleted]

4 years ago149244179 posted on learnprogramming.
Feb. 10, 2017

Clean Code is somewhat of a standard.

Any of you involved in software engineering (or similar)? [R]

4 years agojacobisaman posted submission on ISTJ.
Feb. 7, 2017

Hello to all! Fellow ISTJ here, going to finish a degree in Software Engineering sooner than later. I sometimes have doubts whereas this major is a good fit or not for me, as I tend to be slower than my mates (mostly INTx types) at grasping new concepts I can't relate to my current knowledge, facing new challenges or modeling systems. I feel like I'm good at working within the system, but not at actually designing systems. For this reason I don't know if I could be able to succeed in a real job, since these skills seem fundamental but they are not my strengths, at all. Also, I don't know what to specialize in, exactly.

So, what are your thoughts? Do you relate to what I said? Do you work in the field or something related? If so, what is your experience and what do you do exactly? Your strengths and weakneses? What's the most effective learning approach for you?

Everything you could share is welcome, not only for me but also for other ISTJs who would read this as well. Thanks in advance!

4 years agojacobisaman posted on ISTJ.
Feb. 8, 2017

I have been a software engineer for about a year. We use Test Driven Development where I work, and I have found that it really helps me think through the requirements and make decisions about what the software should do one step at a time. I definitely prefer this method to just "feeling it out" like some of the intuitives do.

I have also found it incredibly useful to get familiar with good programming practices and patterns and would recommend stocking up on books and maybe reading them with another person or two for discussion. Clean Code and Agile Principles, Patters, and Practices have been very useful for me. Once you start to get the general patterns down, designing something from scratch isn't such a mind explosion, because you have a general idea of how things should be designed and what "good" software looks like.

Code review? Creating an app for a non profit but haven't touched c# in 2+ years. [R]

4 years agoNugsly posted submission on csharp.
Feb. 6, 2017

I'm an enlisted programmer who was assigned to a program that didn't use the languages we were taught in training (mainly c#). I wanted to get back into it, but had the usual "the hell do I make?" issues.

I was pointed to the Enlisted Heritage Research Institute (non-profit, it's kindof part of the military and kindof not. Weird legalese stuff.) by someone else as a place that could use some basic desktop apps.

The application (desktop, which I also haven't done in over 2 years) will eventually be used to track orders of Memorial bricks. The application will also track where the bricks are placed in a grid, and the data exported to another application on a non-networked PC for visitors to search for a specific Memorial brick of a loved one or a friend.

You can see the memorial bricks around the other memorials in this picture.


Right now I just have the Memorial Brick & Customer create/edit/delete functionality working... but I'm pretty sure It's disgustingly bad.

So if anyone could do even 5 minutes of "you're an idiot, there's a better way to do this", that would be pretty helpful. If this isn't appropriate for this sub, maybe point me to another one?

The Alpha branch is the one I've been working out of. https://github.com/BirdZackary/USAF-EHH-Memorial-Manager/tree/Alpha

Quick note: this is not the final GUI. I know it's shit. It's something to get functionality with so I can actually plan out a usable GUI. The only things I'll actually be keeping are the DataGridViews. The edit/new/delete buttons all work.

4 years agoNugsly posted on csharp.
Feb. 7, 2017

I'm going to start by assuming this may be maintained by another person at some point in the future. First off, naming. Although it is kinda targeted towards Java, the majority is directly applicable to C#. Clean Code. The underscores and you prefixing an abbreviation for the type should be changed. An example would be:

<pre>i_orderID </pre>

Changes to:

<pre>OrderId </pre>

because of the fact that it is a public property, and you've already told us it is an Int when you declared it. Doing this will allow others to maintain your code with less headache. https://msdn.microsoft.com/en-us/library/ms229045(v=vs.110).aspx is an MSDN article that goes over some of it.

Next, spaces in the folder names, you should avoid that for the same reason above, use PascalCase, no spaces, no hyphens, no underscores if possible.

You have no guard clauses in there. An example of adding one in would be (Line 31 'DataObjects.cs):

<pre>if (string.IsNullOrEmpty(displayLine1)) throw new ArgumentNullException("displayLine1"); </pre>

Favor guard clauses over exception handling wherever possible. When you need to handle exceptions, handle them specifically. If the code you are calling can throw an InvalidOperationException, favor catching that over just Exception. Exceptions should be exceptional, not a common occurrence in your code, guard clauses help with that. Another example would be (Line 96 'Program.cs'):

<pre>if (File.Exists(s_directory + @"\Bricks.xml") { ...the rest of the code that uses that file here } </pre>

Use meaningful names. 'displayLine1' as a constructor parameter is ambiguous. Sometimes it makes sense to shorten some of the names as well; 'customerWhoPurchasedId' could just be 'customerId'.

In DataObjects.cs, you are returning '-1' as an error, I would use something more meaningful than a number. If you are going to use a number like that, use an enum so that you can read your code using friendly names, '-1' is ambiguous, but something like BrickSearchResult.Empty is not.

Style out of the way, now let's move on to data. You are a database guy. I would suggest using a database to store the data over an xml file.

Next. You are doing a ton of work in your application's main constructor. Move that code out of there, and let it initialize the app unimpeded. People debugging your code later will thank you. I would suggest using the FormLoaded or whatever the Forms equivalent for WindowLoaded is.

On a general note, follow the principle of having each small piece of code do one thing, and one thing only. Your main class is also responsible for data access, it should not be. You should have separate classes for that, this is called 'separation of concerns'. Your CRUD operations should all be in the same class. Each class should have its own file whenever possible. So 'DataObjects.cs' would be split into 'Customer.cs' and 'Brick.cs'. Keep in mind that you can use folders in your solution as well to keep things a bit more organized.

You are welcome to PM me if you have other questions.

Would this be considered clean or messy code [Java]? [R]

4 years agoromple posted submission on learnprogramming.
Feb. 3, 2017

I am trying to make my code cleaner. I've been told in interviewing my code runs but is messy and isn't up to standards. So I am working on getting to the solution quicker and making my code neater. Does this code look ok or it is still considered messy and if it is still messy, what could I do to improve it?

Given an input string, reverse the string word by word.

For example, Given s = "the sky is blue", return "blue is sky the".

public String reverseWords(String s) {
        if (s.length() == 0)
            return "";
        String [] parts = s.split(" ");
        Stack<String> stack = new Stack<>();
        for (String p: parts) {
            if (!p.equals(" ") && !p.equals(""))
            stack.push(p.trim());
        }
        StringBuilder sb = new StringBuilder();
        while (!stack.empty()){
            sb.append(stack.pop()).append(" ");
        }
        return sb.toString().trim();
    }
4 years agoromple posted on learnprogramming.
Feb. 3, 2017

Well, if I were evaluating this in an interview these would be my thoughts:

I don't like one letter parameters like String s. It's pretty obvious here since there's only one parameter and the method name tells me what's going on, but this can lead to unreadable code for larger methods with more parameters.

The 0 length string guard at the start is nice, although necessary here. Unnecessary code makes things cluttered and less readable.

The if(!p.equals(" ") ... statement is unnecessary. When you split the string it should essentially remove any white space. When reading code a lot of time is often spent on interpreting complicate predicates, so it's good to remove unnecessary ones or abstract it out into a method. Unnecessary code makes things cluttered and less readable.

if (!p.equals(" ") &amp;&amp; !p.equals("")) could easily be a method isValidWord(p), which lets me read the flow of the statement without necessarily reading the innards of what a valid word is. I can do that later, but right now I just want to understand the logical flow of what's happening. Again here, it's fairly obvious, but when things are more complicated and validation criteria are more convoluted these are good abstractions to make.

stack.push(p.trim()); again seems redundant. There won't be any padding whitespace when you split the string to an array. Removing unnecessary code leads us to

<pre> for (String p: parts) { stack.push(p); } </pre>

Also, while we're here, why p and not part? If you're trying to go full on readability, one letter variables are basically outlawed except as indexes.

<pre> for (String part: parts) { stack.push(part); } </pre>

While we're still here, why parts and not words? Words is more descriptive of what the variable represents. You always want descriptive variables. The goal of clean code is generally readable code. Although part could be argued as appropriate here. Word just conveys more meaning to me.

I don't know if you were told not to use existing APIs, but taking advantage of existing abstractions makes code more readable in general. For instance

<pre>public static String reverseWords(String s) { List&lt;String&gt; words = Arrays.asList(s.split(" ")); Collections.reverse(words); String reversedString = "".join(" ", words); return reversedString; } </pre>

Just looking at the above you can pretty much tell what's happening. We have a List of words, we reverse it, then join that list into a string. you can even abstract out more things, but this is probably overboard. But if we go down that route you essentially have 3 lines of code to read to understand what your logic is. Build a list of words from a string, reverse it, then join that list together into a string.

<pre>public static String reverseWords(String s) { List&lt;String&gt; words = buildListOfWordsFromString(s); Collections.reverse(words); String reversedWords = joinListOfWordsToString(words); return reversedWords; } private static String joinListOfWordsToString(List&lt;String&gt; words) { return "".join(" ", words); } private static List&lt;String&gt; buildListOfWordsFromString(String s) { return Arrays.asList(s.split(" ")); } </pre>

Anyway, these are just my thoughts and people will disagree. This is still one of the best books to read if you're interested in writing more readable code.

How do I clean up nasty code? I've looked into the Module pattern. [R]

4 years agoFeb. 3, 2017

[deleted]

4 years agosew-my-eyes-shut posted on learnprogramming.
Feb. 3, 2017

I recently finished reading this and found it to be extremely helpful. The code examples are written in Java but its based more on the concepts of what separates good code from bad code.

Clean Code

REQUEST: Resources in becoming a better problem-solving programmer. [R]

4 years agoYuleTideCamel posted submission on learnprogramming.
Feb. 1, 2017

I am working through the undergrad CS program and I enjoy learning the conceptional material. But when the professor assigns a programing assignment I have a hard time figuring out how to tackle them in a consistent manner. I understand that some of this comes with practice, but does anyone have any good resources that outline the steps one should take in completing a programming assignment? Looking for resources that might focus on programming/problem solving methodology that isn't just a book on a particular language's syntax. For example, one resource that I have found is "Think Like A Programmer"

Any resources (videos, books, thoughts, etc) will be appreciated!

4 years agoYuleTideCamel posted on learnprogramming.
Feb. 1, 2017

Sure, not sure if you saw my edit but sites like CodingBat and Exercism are great resources.

Others would be just technical books and tutorials. For example read the following books:

There are a ton of great tutorials on Pluralsight.

You're not going to find any books specifically on problem solving, but reading through technical books and getting better at specific technologies then applying them is the way to get better at problem solving. I guess what I'm saying is that you're not likely to find a book that says "do this to get better at solving problems", you'll find books that give you technical ideas and when you go use them and run into problems that's how you grow.

The work of a programmer. [R]

4 years agoi_do_floss posted submission on funny.
Jan. 29, 2017
4 years agoi_do_floss posted on funny.
Jan. 30, 2017

The practice of TDD works best for compiled langauges. But even for compiled languages, the experts on the topic disagree on whether test-first is necessary, or if test-later is ok. I've found that test-later works best for me, just make sure you're writing unit tests before you're testing your code through the UI. Generally I build small classes (150 - 250 lines each), then write all the unit tests for the class after I wrote all the code for the class.

You shouldn't write tests for every function. Your tests should exercise every line of code, and every business rule, but the interface that your tests use against your classes should be the same interface that the rest of your code uses against your classes. Writing tests for every function means that you would need to re-write the tests whenever you refactor, which will cause you to move slower.

I would suggest reading this blog post

It shouldn't be difficult to write unit tests against your code. If you are finding it really confusing and difficult, it may be because your function size is too large, or your design is too complicated. Breaking your design into smaller classes, and smaller functions will make it easier to test your code, but ultimately simplifying the design is where most time and effort is saved. You know the design is good when it's very clear how to easily test it. I've found this book to be a good resource in general.

If you're trying to add tests to existing code which has 0 tests, and wasn't designed for tests, I would expect that to take a long time. There's no way around that. Often I find it better to refactor that code, because it's not usually designed well either.

You save time writing unit tests, because it means that you can spend less time testing through the UI. You can test all your business rules using unit tests. When you test through the UI, you're only checking that everything is connected together properly.

The company I work for is similar to the one you described. When I started here, I went against the grain and built things slowly and carefully. My boss recognized the quality of the work I build and now chooses to put me on critical projects, with the expectation that I will spend 2-3x as long as other developers, but also with the expectation that what I build will work well. I've found that this has caused an improvement in quality of life for me, because I'm not in a rush all the time. The reason it takes me longer than other developers is not because of the unit tests though, it's because I refactor code all the time.

Comments [R]

4 years, 1 month agoSolenoidSoldier posted submission on ProgrammerHumor.
Jan. 27, 2017
4 years, 1 month agoSolenoidSoldier posted on ProgrammerHumor.
Jan. 28, 2017

If you're interested, check out Clean Code. There is a chapter on just this. Put simply, you shouldn't be afraid to add length to your variable names, so long as they can concisely describe their function. I know, easier said than done, but it's helped steer me away from using acronym and single-letter variable names.

[Java] Could someone please critique my code structure/commenting? [R]

4 years, 1 month agoJan. 27, 2017

Hello!

This is a link to some code I've recently rewritten. I'm a first-year CS student who is trying to follow best practices and get used to writing clean code well before I get into the industry.

  1. Is my commenting okay?

    I was afraid it'd be too much, but I was looking through the JavaFx source and it often had JavaDoc comments for even small methods.

  2. Is my overall structure/code style good?

    I've tried to write this to be simple and adhere to best practices, but I've only learned these from googling and stackoverflow.

Thanks in advance!

4 years, 1 month agoeru_melkor posted on learnprogramming.
Jan. 27, 2017

Some general advice:

Read this book: clean code. Also, go through oracle's coding standards. The company you will work at might have their own coding standards but they are all pretty much based on oracle's. So try to follow that.

Critics on your code:

  • if you follow oracle's conventions, then your class variables shouldn't start with an underscore. I mean, it is a legal variable naming system, but this is not the convention.

  • The following comment is completely unnecessary. Use comments to describe why you are doing certain things. Don't explain the code. Explain why is it the way it is (if necessary).

/* If no connections, remove connected CSS class */

if (this._model.getConnections().size() &lt;= 0) {

getStyleClass().removeIf(element -&gt; element == "connector_connected");

}

  • The following comment should be a doc comment. The comments above a method should be a doc comment

/* Set GUI behaviour that cannot be defined in CSS. */

private void setDisplay() {

.....

  • THe comments before a class variable should also be a doc comment. This is because when you generate java docs (html documentation), the program that creates the docs will read your source code and look for doc comments

/* Holds connection data for managing non-GUI behaviour. */

private ConnectorModel _model;

edit: formatting

18 months ago I didn’t know how to code, I’m now a self-taught programmer who’s made apps for the NBA, NHL, and schools like Purdue, Notre Dame, Alabama and Clemson. I’m now releasing my software under the MIT license for anyone’s use — AMA! [R]

4 years, 1 month agoWhenDatWeedIsGone posted submission on IAmA.
Jan. 23, 2017

My short bio: While working for a minor league hockey team, I had an idea for an app but didn’t know how to code, and I couldn’t afford to pay someone to program it for me. Rather than give up, I bought four books from Amazon and spent the next few months learning how. A few months later, some of the hockey sales staff teamed up with me to get our prototype off the ground and together we now operate a small software company.

The idea was to create a crowd-sourced light show by synchronizing smartphone flashlights you see at concerts to the beat of the music. You can check out a video of one of our light shows here at the Villanova-Purdue men’s basketball game two months ago. Basically, it works by using high-pitched, inaudible sound waves in a similar way that Bluetooth uses electromagnetic waves. All the devices in this video are getting their instructions from the music and could be in airplane mode. This means that the software can even be used to relay data to or synchronize devices through your television or computer. Possible uses range from making movies interactive with your smartphone, to turning your $10 speaker into an iBeacon (interactive video if you’re watching on a laptop).

If you’re interested in using this in your own apps, or are curious and want to read more, check out a detailed description of the app software here.

Overall, I’ve been very lucky with how everything has turned out so far and wanted to share my experience in the hopes that it might help others who are looking to make their ideas a reality.

My Proof:http://imgur.com/a/RD2lnhttp://imgur.com/a/SVZIR

Edit: added additional Twitter proof

Edit 2: this has kind of blown up, I'd like to take this opportunity to share this photo of my cat.

Also, if you'd like to follow my company on twitter or my personal GitHub -- Jameson Rader.

4 years, 1 month agoWhenDatWeedIsGone posted on IAmA.
Jan. 24, 2017

Is it this one I should buy?

I was just looking at some Valve source code [R]

4 years, 1 month agoTheCluelessDeveloper posted submission on ProgrammerHumor.
Jan. 23, 2017
4 years, 1 month agoTheCluelessDeveloper posted on ProgrammerHumor.
Jan. 24, 2017

Eh... documentation should be an overview of the process. Specifics need to be within the code itself. Self-commenting code + coding standards is a real thing.

I would recommend any developer to pick up Clean Code and learn some of the basics on self-commenting code and how to write easy-to-read code.

How do I really, *really* get better at programming? (LONG IN-DEPTH POST) [R]

4 years, 1 month agobatmassagetotheface posted submission on learnprogramming.
Jan. 14, 2017

It's been at least 5 years now since I've started programming. Probably more around 5.5. But within the last year or so, my skill has started plateauing, really badly.

: - My code is improving slower and slower, if at all- :

Less and less differences are showing up between my semi-old (even up to ~6-7 months ago) code and brand new code, I don't know where to go from here... I mainly work on games and game engines, and some very basic tool programs. The 2 languages I know very well are Lua and C++ (I treat C++ mostly as C with classes avoiding stl for various reasons), but I have messed around in a few other languages like Java. I generally work in them in streaks at a time, not swapping between languages constantly.

: - My code is always terrible compared to everyone else's- :

I find my code is usually so bad compared to everyone else's that I never want to release the code for anything I make because some random forum poster who's been programming for maybe a year or 2 always does it 100x better in a fraction of the time. This is usually revealed after I have to ask a dumb question because I just can't figure out X and then get a perfect response with a great code example way better than I could've done it given weeks or months. I could never imagine myself actually answering a stack overflow question, I've only ever answered two (one of which was my own question, the other one was really basic googling), but I ask them all the time!

No matter what I do, how much I try to learn, how long (anywhere from a few hours to a week or so, depending on the complexity and longevity of the project) I spend researching the proper architecture and optimization and everything else about what I'm about to do before even starting, no matter how many times I do-over (a lot of times!) something... all that doesn't matter...

Why? Because my code is always just crap compared to everyone else's. I can usually make some OK stuff, after I copy paste some code here and there and spend hours trying to debug one little problem. It all eventually turns into a mess and I start all over, again and again.

When I don't start over? I usually fail to finish it because the code becomes so spaghetti (and buggy!) that it's impossible to really do anything in. Death by iteration or death by un-maintainability.

: - Maybe take a break? Maybe learn a new programming language?- :

Some might say take a break from programming. Been there, done that. Learn a new language? Long, drawn-out process of elimination by learning X languages is how I came to my 2 main languages.

I've actually tried learning C recently, but C++ syntax is so ingrained in me that everything I tried to do in C, I basically just re-created classes via structs, and got lost.

Because while I don't have the patience to sit through hundreds of tutorials to learn the same things I already know (commonalities between C and C++) I can't find any resources that explain C to C++ programmers.

So I just ended up going back to C++.

One day I thought, hey, maybe I should stop programming games for a bit and learn how to program other stuff, maybe text editors, other applications like that. Again, same problem, how the heck am I supposed to even learn how to do that?! I could watch programming tutorials for beginners, which is how I started, but it would just be 95% rehash, maybe 5% new stuff. How is a game programmer supposed to do stuff like that? So I gave up on that idea for now.

: - Everyone else's code is like an alien language.- :

And as another note, just as badly if not worse than the above is, I cannot, or at least almost never, understand 97% of anyone else's code, even examples in my most fluent languages. Unless I have a large amount of experience with every function and type used, I am completely lost, which really isn't helping... take for example this video. I can't. I just can't. Think how a noob Python programmer who just started a month or 2 ago would view x86 assembly. That's how I view the code in that video. It's like an actual alien language to me.

On the off chance that anyone at all made it this far, thanks for reading. I just want some advice, any advice at all... I'm really stuck here...

4 years, 1 month agobatmassagetotheface posted on learnprogramming.
Jan. 15, 2017

For a second point I would suggest giving clean code a look.
I tend to recommend it a lot to people looking to write clean and maintainable code.

var or explicit type when declaring variables? [R]

4 years, 1 month agoVenthe posted submission on csharp.
Jan. 12, 2017

I realize this could be boiled down to personal preference, but just want some insight to what seasoned developers use and why, for the purpose of inferring my own choice.

4 years, 1 month agoVenthe posted on csharp.
Jan. 12, 2017

If possible, avoid it. C# already provides you with enough clarity

<pre>public Variable {get;set;} private variable; public SampleMethod(variable){ this.variable=variable; //... } </pre>

Also, descriptive variables are beautiful. Take look at the Clean Code if you haven't had an occasion.

Of course underscore notation is used (sometimes) as could be seen here: http://stackoverflow.com/questions/450238/to-underscore-or-to-not-to-underscore-that-is-the-question/17937309#17937309

Self taught programmer lacking fundamentals and direction. [R]

4 years, 1 month agoAMY_bot posted submission on learnprogramming.
Jan. 11, 2017

Hi all, I am 22 years old and have been programming as a hobby since I was a kid. I went to university and did engineering with an honours thesis on machine learning and now work as an engineering consultant, and my ability to program helped me get the job and probably makes up about a quarter of my workload now.

However I feel like with all my code, while it works for its intended purpose, is very messy and unorganised and probably not fundamentally sound. I almost always program in Python and JavaScript these days but have hobby experience in VB, C, C++, C#. I just feel like my code is hanging by a thread so to speak, and while this is okay for some internal scripts and small web applications I have now made an external facing website (Python, Flask with heavy back end calculations) and it is worrying me quite a bit. I rarely ever use classes, my functions pass a crap-ton of variables and my folder organisation is usually limited to "frontend.py" and "backend.py". Unfortunately I can't give any of these as examples since they're company property.

I see a lot of talk about CS algorithms and stuff and would have no idea about them if quizzed, I have a basic knowledge of data structures from an intro to CS course I took as an elective at uni which was in C.

So basically, I'm wondering what resources would be useful to me? All of the programming tutorials I've found online bore me to tears like CodeAcademy because they're too simple, and most of the little practice projects are too small to require any significant planning or structure and I can get away with my improvisational programming style.

4 years, 1 month agoAMY_bot posted on learnprogramming.
Jan. 12, 2017

For less messy amazon links you can extract the part after "/dp/" in

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr11?ie=UTF8&qid=1484198506&sr=8-1&keywords=clean+code

and make it:

https://amzn.com/0132350882

BEEP BOP

Plz send any recommendations via PM

Self taught programmer lacking fundamentals and direction. [R]

4 years, 1 month agoemmg90 posted submission on learnprogramming.
Jan. 11, 2017

Hi all, I am 22 years old and have been programming as a hobby since I was a kid. I went to university and did engineering with an honours thesis on machine learning and now work as an engineering consultant, and my ability to program helped me get the job and probably makes up about a quarter of my workload now.

However I feel like with all my code, while it works for its intended purpose, is very messy and unorganised and probably not fundamentally sound. I almost always program in Python and JavaScript these days but have hobby experience in VB, C, C++, C#. I just feel like my code is hanging by a thread so to speak, and while this is okay for some internal scripts and small web applications I have now made an external facing website (Python, Flask with heavy back end calculations) and it is worrying me quite a bit. I rarely ever use classes, my functions pass a crap-ton of variables and my folder organisation is usually limited to "frontend.py" and "backend.py". Unfortunately I can't give any of these as examples since they're company property.

I see a lot of talk about CS algorithms and stuff and would have no idea about them if quizzed, I have a basic knowledge of data structures from an intro to CS course I took as an elective at uni which was in C.

So basically, I'm wondering what resources would be useful to me? All of the programming tutorials I've found online bore me to tears like CodeAcademy because they're too simple, and most of the little practice projects are too small to require any significant planning or structure and I can get away with my improvisational programming style.

4 years, 1 month agoemmg90 posted on learnprogramming.
Jan. 12, 2017

Start with this book https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr11?ie=UTF8&qid=1484198506&sr=8-1&keywords=clean+code then read "code complete" and "the pragmatic programmer".

Imperative vs Declarative Programming [R]

4 years, 1 month agowickermoon posted submission on programming.
Jan. 3, 2017
4 years, 1 month agowickermoon posted on programming.
Jan. 4, 2017

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

I'll just leave that here.
Don't know why people have to invent idiotic names for concepts that already existed several years ago...

My Python/Matlab scripts are mile-long unstructured bundles of impulsive code, making them useless (let alone understandable) later. How to improve? [R]

4 years, 1 month agoasync2 posted submission on Physics.
Jan. 3, 2017

Hi /r/physics!

I'm currently currently doing my master's (undergrad?) in physics at a polytech university, and as the title says I could really use some advice on how to improve my code structuring skills.

My Matlab and Python skills are mostly self-taught and I use it all the time to make scripts for common stuff, data visualisation, as well as more complicated data analysis (usually some image analysis).

BUT, my scripts are a mess! I made some relatively advanced things in Matlab for my Bachelor's thesis, but it was very convoluted for my supervisor to make any sense of, and after a month of summer holidays I could barely make it work myself.

I always end up spending loads of time just remembering how it works, or rewriting stuff I've already done. My scripts are basically useless for everyone else, which is a shame as I'd love to share it.

If you have any advice or resources for making more more modular/reusable/shareable, i.e. going from random collections of scripts to more structured programs, I would love to hear it!

(Any good resource for PyQt and GUIs in general is also much appreciated, sometimes it's nice to just share an executable for people without matlab and python)

Thanks!

Edit: So many nice answers! I just want to clarify a bit, as I might have been too vague, and a lot of the answers are along the lines of "Comment your code!" and "Use functions!". I already do! But commented spaghetti is still spaghetti. Regarding functions, I do use them often, but I often end with a mess of small functions with different syntax.

What I'm asking for is more specific advice on when and how those functions should work, and structuring my programs when (before?) they get larger than a single script or two. E.g. for a project in electron holography, I needed to: load images, match each with a reference, perform a series of calculations (fft, filters, phase unwrapping etc), some with user input, then save different versions of resulting images, as well as save some numbers from the calculations. Not a huge project, but it still spiralled out of control, because I was just doing it as I went along like stacking a house of cards.

That said, it's still some very good comments in this thread. Thanks for the help everyone! Honorary mention to /u/bheklilr for a very nice description of how to do

4 years, 1 month agoasync2 posted on Physics.
Jan. 3, 2017

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

Maybe check the clean code handbook. Already the first pages describe what many people do wrong which leads to crappy code. You can also find it on the interwebs.

How to create software using a professional work flow and development life cylce? [R]

4 years, 2 months agoSofaAssassin posted submission on cscareerquestions.
Dec. 27, 2016

Hey all,

I'm currently on holiday from my University doing Computer Science and one thing that annoyed me is that yes they teach you aspects of programming (mostly self taught) but i want to prepare myself for the real life professional environment.

So what i want to ask is i wanted to create a small program in either python or one of the C langauges, but i want to do it from start to finish in a very structured and professional way. What are your tips and tricks, whats the most important to an employer?

I am talking about agile and waterfall development cycles, git repositories etc. Programming isn't the issue for me, but i want to be able to confidently talk like a professional rather than some student fresh out of University (which i guess i am!)

Thanks for reading and any tips will be much appreciated.

4 years, 2 months agoSofaAssassin posted on cscareerquestions.
Dec. 28, 2016

For more foundational stuff, I'd look at:

  • GitFlow - a successful Git branching model - This is pretty much the prototypical Git usage model. I have seen it used pretty much everywhere I've worked that used Git, and a lot of software supports the model by default (Atlassian Stash, SmartGit, Git Tower, and more).

    • Also take note of alternative Git usage models like GitLab Flow and GitHub Flow. They fit rather different use cases, and GitFlow is typically used for software that follows a more old-school release model where releases happen periodically, or you need to support multiple production releases at any given time. GitLab and GitHub flow are geared more toward software that only sees a single version in production at any given time, and very common release cycles (e.g. daily or even shorter).

    Getting familiar with these branching models will also expose you to many commonly-used Git features like branching, squash merging, rebasing, tagging, and history rewriting.

  • How to write a commit message

    No one's really gonna ask you about this, but you should develop a habit of writing great, clear, and concise commit messages.

  • Continuous Delivery and Continuous Integration

    All the rage right now - having real/near-real time building/unit-testing/packaging/deployment of your software once you've made a code commit. Read the articles I linked, play with services like CircleCI or Travis-CI or CodeShip and integrate them with your projects in GitLab.

  • Test-Driven Development and Behavior-Driven Development

    Probably the two most commonly used overarching test-based software development processes. I'm a strong proponent of TDD (when done right), and many teams you work on will probably employ TDD or BDD.

  • Stemming from the last point, know how to write good unit tests and how they differ from integration tests or acceptance tests.

  • Code organization - a lot of this will likely be influenced by the language/toolset you're working in, but you'll be interested in learning about Layered Architecture and software packaging metrics.

  • Generic software design - all sorts of acronyms to read about and absorb, like YAGNI, KISS, DRY, and [SOLID](https://en.wikipedia.org/wiki/SOLID(object-orienteddesign)). Also, the Unix philosophy, which guided a lot of development of software for Unix and Linux these days. There will also be patterns that apply to specific languages or types of software, but the stuff above is rather generically applicable.

Beyond those links, some books that cover a lot of general material are:

  • Clean Code
  • Pragmatic Programmer
  • Mythical Man-Month
  • Software Estimation - Okay, software estimation is really gonna be complex and difficult until you get a lot of experience, and even experienced developers get it wrong. I don't think it's particularly necessary to read this book when you're starting out.
  • Domain Driven Design - I love this book - it's about breaking down complex software designs.
  • Release It! - Nygard is a pretty battle-tested developer, so this book is about approaching software design practically rather than in a vacuum separated from real-world application.

What are some good/interesting computer science books to read? [R]

4 years, 2 months agoNezteb posted submission on cscareerquestions.
Dec. 27, 2016

Hi!

I'm a second semester freshman CS major, and with long winter and summer breaks coming up (this winter break being no exception), I thought I'd go ahead and start reading some computer science books for fun!

Recently I've been wanting explore different avenues of computer science as a whole, from a new language to operating systems, and anything in between. I feel having a knowledge pool stretching across different concentrations in computer science is a great thing.

So, what are some interesting computer science books I oughtta look into? I'm especially a fan of books that take a different yet educational approach to their content, ones such as Grokking Algorithms which uses visual aids to teach data structures and algorithms, or Operating Systems: Three Easy Pieces which has a comedic side to it while covering operating systems (disclaimer: I haven't read these books in its entirety, only a snippet and have heard such things from users on here).

But that's only a preference. There are of course no limitations.

Also, I know this question has been asked before, and that there are literally threads that ask the same question but different wording, but I thought I'd ask anyway and give my "criteria," so to speak.

I'm also happy to list off my current backlog! I just didn't want to make this post any longer than it is.

EDIT: I mainly put down Grokking Algorithms and Three Easy Pieces as types of books that caught my eye, not so much for the length of each. The two I listed introduce new/different ways of educating the audience, either with accompanying visual images or a humorous side to complement the content. My apologies if I guided anyone down the wrong path. All of these books are great suggestions, no matter the length!

Thank you so much! :)

Legacy Web Forms web application issue [R]

4 years, 2 months agophuber posted submission on dotnet.
Dec. 24, 2016

Becoming the new member of a development team for a legacy enterprise intranet (yeah, no internet connection) web application, I asked lots of question to have a proper understanding of the architecture. Here's what I've got respectively:

  • More than 200 projects in 10 solutions, I have no idea about 8 of them.
  • ASP.NET Web Forms purely, based on a framework developed for the application 3 years ago.
  • Framework includes WPF, WCF and other Microsoft solutions to help developing integrated desktop applications that would work on the created ecosystem of web services.
  • No documentation.
  • Only way to add a new module/service/page is to examine old ones and copy the needed ones.
  • No rule book for developers to code in standards, so in 3 years it turned into the ball of mud.
  • Hundreds of clone code! (after I opened the solutions I added static analysis packages from Nuget, which I had to download and move to intranet, then install offline, I analyzed the codebase and I hit the edge of frustration after seeing the results)
  • The motto for new developers: Just do it.
  • No testing environment.
  • TDD is impossible by the nature of the web forms environment. But it would be nice to have MVP pattern applied at least for some of the projects. Edit: It is not impossible to develop a web form application in TDD. It happened to be my lack of knowledge.
  • It is a dangerous thing to refactor things since it's hard to know whether the refactoring breaks some things or not.
  • Since many of the computers on the intranet uses IE11 or older, we have to stick to the old versions of bootstrap, jquery etc.
  • A great database exists out of the application, shared by other old applications, most of them are for desktop. So it's a hard work to learn about the architecture of the huge database in order to begin coding new stuff. And if a change, update or addition needed on the database by means of tables, views etc. not data, it takes a long time to negotiate with the database managers and other development teams.
  • There are some Vbscript codes inside ASP pages using alternative master pages for ancient IE compatibility, waiting to be translated to Javascript or rewritten in C#.
  • Did I mention no documentation? Not even for the database?
  • MVC development is not an option since the codebase is huge and this kind of change can create more headaches.
  • All the old developers are gone, except two. They are working on the project for about one year and still haven't seen most of the code base.
  • Most of the time the job is debugging after bug tickets submitted by the users. Rarely, developing new modules IMMEDIATELY.
  • No documentation.
  • It's web forms and almost all of the sources online are for MVC and Core, which are not options for me. So it will take some time to learn, then to learn the unique framework.
  • When I asked "what if" questions to understand the architecture or the recommended process of developing a new feature, I have the ultimate answer, which is the motto I've mentioned above: Just do it.
  • Hell no, no documentation!

Any advice for this newbie in the ball of mud to survive?

Edit: Some typos.

Edit 2: I'd like to thank you for your help. I have intentions to do things in a new way with help of guys like u/s_mohr and u/phuber. Jeff Fritz's video on Channel 9 titled Modernize ASP.NET Web Forms with VS2015 helped a lot too. And in order to avoid breaking things while trying new stuff in refactoring, I intend to use Scientist.NET by Github. So that I can manage it with as less problem as I can. I need to learn webforms with MVP too, adding to WebFormsTest. I actually have path now. Thanks again.

4 years, 2 months agophuber posted on dotnet.
Dec. 25, 2016

If you are open to it, here are a few good reads to help you on your way. The legacy code book may pay dividends quicker given your situation.

Clean Code: https://www.amazon.com/dp/0132350882/ref=cmswrcpapa_ruhyybGGV0C34

Refactoring: Improving the Design of Existing Code https://www.amazon.com/dp/0201485672/ref=cmswrcpapa_gwhyyb1VRNSKK

Working Effectively with Legacy Code https://www.amazon.com/dp/0131177052/ref=cmswrcpapa_0whyyb3Y604NJ

Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler)) https://www.amazon.com/dp/0321601912/ref=cmswrcpapa_JxhyybA08ZQF8

Can anyone recommend any good compsci magazines or books? [R]

4 years, 2 months agoDec. 23, 2016

[deleted]

Where to learn to write better code? [R]

4 years, 2 months agoNezteb posted submission on compsci.
Dec. 21, 2016

Where/ how did you guys who have been in the industry long learn how to write enterprise quality code?

4 years, 2 months agoNezteb posted on compsci.
Dec. 21, 2016

Some book recommendations:

Others that are great and related but not as "necessary" as the above three:

Unrelated to "better code" but still great:

[C++] Some pointers to a good C++ project [R]

4 years, 2 months agoziptofaf posted submission on learnprogramming.
Dec. 15, 2016

I was wondering, what makes a C++ project good? I mean, from coding convention to directory structure. What would a potential employer look for in any C++ project you show? Also what are the good habits for C++ coding in general?

4 years, 2 months agoziptofaf posted on learnprogramming.
Dec. 15, 2016

Honestly your question is almost irrelevant of programming language. Still, few pointers:

  • Don't mix up database layer with logic and front-end code (if any). Separate them. You can read about MVC for starters. This way you don't end up writing math functions in the same place as you write code that handles a user clicking a button. This ensures your project has a proper structure.
  • Write tests. If you think it's QA department's job to ensure your program is correct (or even worse, if you think that it compiling is good enough) then you are very mistaken. The more tests you write for your program (checking if functions output is correct, if it handles edge case scenarios or invalid input properly etc) the better.
  • Classes are supposed to make code easier to read, not harder and they should be about one specific task. GraphicsHandler that generates a whole 3D grid, has like 20 prototype different shapes you can put on said grid etc is NOT a good class design. Those have to be simple. If you start seeing shitloads of methods in a class to make it work then it means you need two classes.
  • While on the topic of classes - group up your methods by their importance. Don't shove most important ones at the bottom. If you know a method won't modify your arguments then declare it as const. Also - multithreading is a big thing nowadays. If you KNOW your method won't work with it properly and is all but threadsafe then write it down somewhere. Or add a mutex so it can't be ran by multiple threads at once. Especially important if you are writing a library.
  • Be consistent. Nobody cares if you prefer tabs or spaces, just decide on one. Often it's project manager or company policy itself that defines it but as an independent programmer you need to learn those habits by yourself. If you decide to use camelCase notation for methods and functions then don't suddenly write methodslikethis.
  • Practice writing GOOD comments. Often you see programmers either not writing them at all (terrible!) or not understanding the actual point of them (possibly even worse). You really don't need a comment that says "here we loop through an array". But if for example you have a Pixel color in ARGB space defined as a single unsigned int (so you have 1 byte for A, 1 for R, 1 for G and 1 for B) and you manipulate specific colors directly (via bitfields/converting it to char array) then it's a good idea to explain HOW your process works in a comment because it might not be obvious for a programmer if he suddenly sees a union or <reinterpret_cast> from int* to 4 element char array. if what you are doing might not be obvious - write it down too.
  • Also - you have version control nowadays. Don't leave huge commented out parts of your code.
  • Proper naming of your variables. i and j are fine for loop iterations, x and y can make sense for coordinates and a,r,g,b are good names for color values but that's about it. Write all names in a way that means SOMETHING. I very much prefer to see a variable Person newuser("Bob") to Person x("Bob"). Since afterwards I will see a newuser (which makes me think it's probably a User/Person) rather than x (which can be anything, now I need to find a declaration!).
  • Avoid declaring your variables without defining them:

    <pre>int howMany; for (int i=0; i&lt;howMany; i++) { //aaaaaaaaaaaaaaaaaaaargh } </pre>

    In this example it's obvious but often you create a new variable, forget to assign it and 100 lines later try to use it and have no idea why is your code blowing up. Most of the time ANY default value is better than not having it at all.

And with this I explained roughly 1% of what a clean structure means. There are good resources on that, check out Clean Code book.

Tips for cleaning up code for showing to potential employers? [R]

4 years, 2 months agoYuleTideCamel posted submission on learnprogramming.
Dec. 14, 2016

I have a program I wrote in Java that I'd like to post to my GitHub account that I reference in my resume. What can I do to the code to make the employer think "this code looks great"? Including naming conventions, commenting, spacing, anything!

4 years, 2 months agoYuleTideCamel posted on learnprogramming.
Dec. 14, 2016

I'm on a hiring team at a large tech company. Here's what I look for on github projects:

  • Unit tests. I almost always start with looking for unit tests. A good readme file. The repo should have a good description of what the code does, how do I run the code. Any potential issues.

  • Commits. I like to see a lot of small atomic commits. Nothing is worse than a single commit with "project complete" or something. The point of a commit history is to see the changes made over time as you were coding it. Ideally I'd love to see an "initial commit" with a close to blank project.

Commented out code. I don't mean descriptions, I mean large chunks of code just commented out. That should be removed. If it's in source control you can get it back later. But stuff like this is annoying

<pre>public int getFoo(string bar){ //whatever } /* This is the old method before I changed it! public int getFoo(string bar){ //whatever }*/ </pre>

Unneeded common sense comments. For example

<pre>//the counter int counter =0; </pre>

Long methods. I'm a firm believe in short methods and breaking up long methods with calls to other methods. This is a controversial topic and what the correct length is varies. However, we can all agree that a 300 line method is generally a bad code smell.<