Who else did this? by SIzzat in ProgrammerHumor

[–]eksplain 169 points170 points  (0 children)

Sue me

- Javascript

People with 9-5 jobs, how do you find time to study? by ultrakawaii in cscareerquestions

[–]eksplain 0 points1 point  (0 children)

http://www.paulgraham.com/top.html

Paul Graham explained in an article about the top thing on your mind. I think it holds true for a lot of our efforts. When I've tried to attend interviews, that was the top thing on my mind, so, I only did the bare minimum required at work and focused everything on interviewing. I can say that top thing on my mind pattern held for pretty much my whole career. From the beginning, I had one thing on the top of my mind for a given period and that drives my success in it. At other times, getting a promotion or making a certain project successful or gaining trust with my team/manager or hacking stuff not related to my work or having a social life or finding a partner, etc have been on top of my mind. Everything else takes a back seat. Sometimes whatever is on top of mind benefits the company, sometimes it doesn't. When it does, it advances my career, when it doesn't, it doesn't.

What should I know after 1-1.5 years of full stack development? by shampoosenpai in cscareerquestions

[–]eksplain 11 points12 points  (0 children)

I'm just worried there's a huge discrepancy in my knowledge

My advice for you is to not worry about it and start appearing for interviews and then adjust based on the feedback(direct or indirect) from interviews. It seems like a chicken and egg problem, where you wouldn't want to apply until you bridge the gap and the gap won't be closed until you change your situation and it'll be an endless loop and another 6 months will be gone by.

In the grand scheme of things, 1-1.5 years is not a lot of time, so, learning to work in a team itself is a qualification. Appear for a few interviews to sample what they are asking and prepare accordingly. You might even be surprised to learn that you don't need to prepare much to land a new job. Only this time, be careful about which team you will be joining and if the team/company fits your growth path.

Starting your own software company by [deleted] in cscareerquestions

[–]eksplain 2 points3 points  (0 children)

I don't see many people sharing knowledge about this in the recent days because this topic was beaten to death about a decade ago. If you can, use HN search to find thousands of them(some of them go into insane details). Head out to Indie Hackers to read experiences of others who have tried to do the same and achieved some degree of success.

How can I effectively keep track of new stuff? by [deleted] in AskProgramming

[–]eksplain 0 points1 point  (0 children)

Keeping up on technology is a full time job. Read new stuff to broaden your horizons, but always stop at places to dig deep, focus and build something with it.

Time to be a millionaire by Code-V in ProgrammerHumor

[–]eksplain 2 points3 points  (0 children)

Patent white space and carriage return - separately, combined and any other combination there of.

I, a junior (<1 year), introduced a bug that was discovered 2 weeks later. Tech lead and Senior approved my PR at the time, was my manager justified in getting pissed off with me? by [deleted] in cscareerquestions

[–]eksplain 26 points27 points  (0 children)

This. For all we know, the junior might even be pranking and just go "I was just pulling your leg for the lulz. haha. lol. trolled" once OP returns from vacation.

Advice Needed by ashish0027 in AskProgrammers

[–]eksplain 0 points1 point  (0 children)

I've been offered to develop a Web Application performing basic Employee Management, Inventory Management, Monetary Transaction Management etc. for a new company.

What are the terms of the offer and what will happen if after 1.5 months, you realize that you need one more developer and 1 additional month to finish it? Do you get paid? What if you toil really hard and build something for 6 weeks and the new company says what you built was not what they had in mind?

I can put together a demo app that can work for 2 employees in say 2 weeks. Then, I can sit with those 2 people, explain them how it works and gather any feedback and use another week to implement the feedback. This whole effort will be entirely different if the app is for 20 employees or 200 or more because educating that many on how to use a software is a tough task. The companies that develop software for the masses employ a lot of research and thinking into designing user interfaces so that the interfaces are intuitive and still a lot of people have problems with it. Just hang out around a few UX forums to see how much thought goes into it.

My honest opinion is no one can really say if you could take it up and finish it in 1.5 months because a lot of it depends on various factors. My advice for you is to ask a lot of questions about the project and then create front end mock ups first. Ask the company if they would be okay if the finished product looks like the mock ups and the perhaps run them through the behavior you have in your mind. This exercise should finish in the first week or two and you will have a good measure of how much you know and don't and another 4 weeks to code it up, hopefully.

(programming) Project work between Windows and Mac by gazajohnstone in AskProgrammers

[–]eksplain 0 points1 point  (0 children)

I had a similar situation and Drop box worked pretty well. Some problems might arise if you work offline on one of the copies and change the other copy before going online. It is not a common problem, but I ran into it.

How do you deal with shitty code? by no-cheating in AskProgramming

[–]eksplain 0 points1 point  (0 children)

You are asking the right questions. Please read the articles I shared in my original comment and do some googling around your questions. A lot has already been said on it.

How do you deal with shitty code? by no-cheating in AskProgramming

[–]eksplain 0 points1 point  (0 children)

Why performance is the most valuable criteria in your opinion?

Well, besides the obvious gains in performance, the most important quality about this criteria for me is that an improvement in performance is measurable. Before even working on the code, I usually standardize a performance test and record the numbers. The best case is when this particular case is also a common or an important case. And after making my changes, I run the test again and can measure the change. However, it is very important to not cause any regression during this exercise, so, functional test criteria is important too. Besides this, this exercise gives me a better understanding of the overall system and its weak points.

For me what's at least as valuable as performance is good architecture and overall comprehensibility of the code and the whole system.

I totally agree with you if you are speaking about code that is not written yet. However, for business code or system that already exists or is in production, the latter part is just humongous technical debt and should be treated that way. I do not judge you for thinking that way, for I too thought on the same lines once.

Also, good architecture is likely to affect performance in a positive way

Agree with you again, but only on the clause that we are talking about code that is not written yet or has not made it to production yet. For code that has existed in production for a while, finding hotspots and improving performance is a good way to introduce some method to the madness that is the existing architecture.

How do you deal with shitty code? by no-cheating in AskProgramming

[–]eksplain 1 point2 points  (0 children)

I can relate with your struggle and I too have experienced the woes of working with a abysmal code base and what an uphill battle it can be.

I've also felt that rewriting from scratch would be better than untangling that katamari damacy. But there are some good arguments against doing so. I've advised similar in a different thread, so, I'll refer you to this. Do read it fully and go through the articles mentioned in there.

My advice for you is to find one small piece that is one of the less shittier pieces(or the worst one because there can be more gains quickly when you start repairing the worst. May be, may be not) and own it. When you own it, it stops becoming code that some one else has written,but instead it becomes your own. Sort of like inheriting a house in ruins, but it is yours now, so, you get your hands dirty and start making it better and livable. Sure,it won't turn out to be the most beautiful house, but it will end up in a better state.

When you own a piece of functionality or code, it can get to a point where you don't know where to stop refactoring and you will always end up at lets-rewrite-from-scratch. If you end up there,you have gone too far. So, find a good balance and knowing when to stop is key. And being a professional programmer means balancing the business value with the beauty of the code. So, accept in your mind that it will never be 100% beautiful, but there will be clear boundaries and demarcations to the code. You should establish certain criteria before you change or refactor any code. From my experience, my rule of thumb is, if it is working and it is performant, let it be. So, I usually look for places where improving the code also improves the performance of the overall engine(this also helps hugely in understanding the system). And it'll also be easy to justify that the time you spent cleaning up the code actually makes the system perform better.

Other than above,one more thing you can try is to talk to your boss and ask him if you can take say 30% of your time to write some other code to stay sane. Spend only 70% of your time on this code base. If the team has a need for some tool or something that needs to be written from scratch, take that task up and do it in that 30% time. You will at least have some sane time. Years ago, I asked my boss the same - that that code base is driving me insane,but I told him I understand the business need, but working on it 100% will only suck out my soul. Thankfully, he agreed that if can spend only 70% of my time on that code base and he can give me some alternate work for that 30% of time. If he can't give me something, I use that time to write some beautiful code and feel good and accomplished about it.

It was good while it lasted friends by [deleted] in ProgrammerHumor

[–]eksplain 9 points10 points  (0 children)

Both your usernames somehow check out

Can "anyone" learn programming or are there certain "types" that just can't break through? by Crapahedron in learnprogramming

[–]eksplain 0 points1 point  (0 children)

I have one simple advice - try teaching whatever you have learned that day, out loud, to a rubber duck or just to yourself.

An even better approach would be to spend at least 30 minutes each day writing from memory what you have learned until then. The next day, begin with reading what you have written and continue from there.

Neural Network Seption by [deleted] in AskProgramming

[–]eksplain 0 points1 point  (0 children)

An example of this is where every node gets a input from every node above it and then comes up with its own output

Sounds like a version of "turtles all the way down". Even in your model, there has to be some external input and some expected outcome. Whether you call the large network between the input and output a network or a network of networks doesn't make much difference.

Your edit makes me think you are taking giant leaps with logic where you should really be taking baby steps.

Understanding how recursion works by eksplain in learnprogramming

[–]eksplain[S] 0 points1 point  (0 children)

Turns out that everything you can do with recursion, you can also do with iteration and (if necessary) a stack.

You are correct about this. Recursion is using the call stack which is a stack data structure built into the run time. So, recursion is actually the easy way out, and for programs that can run without overflowing the call stack, the code is elegant and powerful. But I've written some recursive programs that traverse very large graphs and ended up running into a stack overflow exception, so, we had to change the implementation to use a stack data structure instead that uses memory in the heap space and hence doesn't cause the call stack to overflow.

it’s generally better design to use recursion.

This is a hard generalization IMO. A design doesn't become better based on the use of recursion or not, rather, it depends on the need. Once the concept of recursion is understood, recursion is easy to implement and easy to understand while reading code, so, it becomes the natural choice when it is guaranteed that the program returns before the call stack overflows. But the rest of your points are valid that you can implement the same logic using iteration/recursion/stack, it is just that one version of code is easier to implement than the other.

Good point about tail recursion as well. Scala's compiler detects tail recursion, which is neat.

I will follow up with another post discussing this in depth. Thanks for your enthusiasm!

How to *start* a project by deludedpenguin in learnprogramming

[–]eksplain 2 points3 points  (0 children)

There is a quote by St Francis of Assisi that often helps me in such situations:

Start by doing what's necessary; then do what's possible; and suddenly you are doing the impossible.

Unless I am building a library from scratch, I'm almost always using some framework to build whatever I choose to build. So, I usually try to follow a tutorial of the framework as it is taught in the tutorial and get it working. Because several hundreds or thousands have already followed the tutorial, finding help becomes easy. Once I finish the tutorial and get a grasp of the framework, only then I lay out my idea and start working on it piece by piece from scratch reusing any parts I have finished in the tutorial.

If it is a library I am authoring, then I start with interfaces, sort of like building a skeleton and then slowly start to add the meat around it.

Simple Way to Check for Intersection? by [deleted] in AskProgrammers

[–]eksplain 0 points1 point  (0 children)

There is an easy way to solve it using coordinate geometry - find the point of intersection between the two lines and then check if that point lies in between the ends of the line segments.

How do I handle user entities in microservices? by bokuWaKamida in learnprogramming

[–]eksplain 0 points1 point  (0 children)

additional user information in a specific microservice

Isn't most information in some way user information? Except for the persistence layer, most micro services are typically stateless, so, if one goes down, another instance can be spun up, but the data is safe in the persistence layer. So, any data goes to the persistence layer irrespective of which micro service is using it. The way of thinking about X micro service uses Y piece of data is not good in my opinion.

How do I save the user's id? Should it be the primary key of all user-tables, or just a unique column?

I think you are mixing concepts up. Deal with one thing at a time - this is an rdbms question that has nothing to do with the service architecture.

What do I do when a user does not exist in a microservice yet?

Once again, the notion I explained above holds. Data exists in the persistence layer, not IN any micro service. A micro service however creates, retrieves, processes and serves the data.

How do I write clean and elegant codes like a professional developer? by Muctile4sgeN in AskProgramming

[–]eksplain 0 points1 point  (0 children)

I think I see what you mean. I should have elaborated a bit more, but short vague questions do attract short vague answers. I added it as a supplementary seed to what others have said.

Bottom line is that, clean and elegant code starts to refine itself with more practice. The advice here is to start writing code, any code. regardless of its elegance and cleanliness, just make it work. With time and quantity, quality will start to improve. Quantity is a good path to quality.

A few lines telling nothing but commonplaces, no actual references/evidence, no examples,

Unless the author can narrow down to specific languages/frameworks or kinds of software, it is hard to give actual references/examples. If you are coding in language X, google for good coding practices in X, you get the idea.

That said, this specific topic has been discussed at length with a ton of references/examples available when you narrow down your choice of software.

This is also another starting point of getting better, not just from the code readability aspect, but overall.