HN user

frogcoder

410 karma
Posts5
Comments57
View on HN

Yes, there are many plus sides if USA were taken over by China.

1. You will see no protest on the street.

2. You will see no homeless on the street.

3. You will hear no more school shootings or any shooting.

4. No more tech companies conflicting with the government.

5. No one will sue the government because it's perfect.

6. All bad people will disappear.

7. Everyone sings praise of the government.

This is better than Utopia, you should pursue it.

I've been organizing my python projects starting with package folders.

Say I name my package "foo", foo is the top level folder for the source code. Inside foo there is a "main.py" file as the project's start point, and other various modules, let's have one called "module1.py". Now, add another package under "foo", the obvious example name here would be "bar", and add another module under "bar" called "module2.py".

The project structure looks like this:

  - foo/
    |- main.py
    |- module1.py
    |- bar/
       |- module2.py
To reference "module1.py" in "module2.py", just write
  import foo.module1
To reference "module2.py" in "main.py", do as follows
  import foo.bar.module2

There is no problem importing from any level.

To start the program from command line, enter:

python -m foo.main

Well, again it depends on the culture. Some boss wouldn't take any disagreement from subordinates well. No matter what the result looks like, if the boss doesn't declare the project failed, than that's not a failure. Even if it failed, the subordinate takes the blame, it's less serious than bringing up issues early because the boss's order is faithfully carried through to the end.

This service is lacking a major feature and too complicated!

Almost half of the time, I need to know if a number is even. Why doesn't it provide an end point for that?! Don't even tell me about the 409 status code. Am I suppose to know it's an even number when it returns an odd number to me? I only recognize status code 200, all other are errors, don't make this so complicated!

Start with something you can handle. Which language doesn't really matter but keep in mind that are so many possibilities. When you are comfortable with your first language, try some other, preferably with a different paradigm. It's totally fine using one language for development most of the time, just remember there are so many ways to accomplish one task.

The age does not matter as long as you can sit down and code. You don't see many old people doing programming because it's simply not many there. Computing is relatively new. It's obvious most people entering this field would be young, older people might require a change of career hence less incentive.

Disclaimer: I was never at any position close to like Sr. Director at a fortune 100 tech giant, maybe your company is different.

I use to act as if I own a large stake of the company I worked for, regretting it much later when I realized I was doing too much and knowing too little.

I was just kidding myself pretending as an owner of the company therefore investing too much emotion and work into it. Why would I pretend something that is not true? It's not like fake it until you make it thing.

I do not know how much you know about your company, but I was an outsider that knew nothing about the inner workings and secrets about it. I thought I knew, that's the kidding myself part.

Unless you are a real owner, you are just a cog in a machine. If you perform well, you will be rewarded well as a cog in a machine not as an owner. Most decisions you make would not affect the overall situation. Just do your job well and try to spend time with something else you care after work, not something you have no control of.

Guess the author thinks Confucianism is bullshit (fart). I APPROVE!

The sample image of the first feature is Confucianism surrounded by the fart character. The feature highlight only one found entry per line. That is what you get when you search for fart.

Most of newly graduates of any subject don't know much about real world jobs. You are just one of many, but you care to ask about this on HN, that's something.

And a warm welcome to this imposter syndrome help group, we are always afraid of missing out on some tech. Accept it, everyone is missing out on most of the tech.

When I was studying CS in college, I always wondered why the classes don't teach us about the hot Windows programming thing. All we did were tiny console C programs. I realized that very late, CS classes are meant to let you know about the fundamentals. You probably won't use these skills directly at work, but you will have ideas about how the languages and systems work internally. That pays in the long run.

Just go explore and make mistakes, you will be alright.

W3M Rocks 4 years ago

Just curious, what are the advantages using w3m instead of eww?

I used to love ORM, I used it everywhere. Writing another language in the language I am coding is wrong. ORM simplifies my programs.

No, ORM does not simplify coding! It's a big complex adapter which does not fit many cases.

RDBM itself is complex enough, let's put another complex abstraction above it so we can forget about the tables and columns and joins and foreign keys. Complexity added upon another complexity does not make a polished interface.

If you want to use ORM, you have to learn both SQL and ORM with some depth at least. When problems occur, you have to debug both.

20 years in, I am still learning about RDBM. I still hate to compose SQL in code, but there is no better way.

Databases are used in every situation. Want to store data? Database. Want to communicate between processes? Database. Want to store logs? Database. There are different solutions for different scenarios, but as long as the DB chugs along, why? Sometimes it's sickening.

So 20 years in, the ROI of learning SQL is great. Please don't avoid learning about RDBM by using an ORM. Just learn it.

Actually, I'm not without ORM now a days. Light-weight ORM like Dapper serves well, it does not abstract out the concepts of RDBM, but make things easier.

After giving some more thought on it. I just realized it was python got me into FP. Although the majority my projects are in C#, Linq never had me interested in FP.

You are right, C# and JS use FP sparingly. I think I expect more from Python because I enjoy writing in Python and my functional adventures were rooted in Python.

Personally, lambda expression is painful to look at. Many times I have deliberately avoided it. It's possible to make improvements, but it seems the FP part just stagnated. Looking forward to pattern matching though.

Well, the BDFL is probably the only dictator we all love.

Any decision he made is infinitely more than I could. Because I am just a python user, and an outsider in any decision making process. So for me, he's right all the time. That's a perfect definition of a dictator :)

But I do have wishes. It's like I love my parents but I do want to stay up late sometimes.

Yeah, I totally missed the part he removed reduce from builtin. Sorry about my memory. map, filter, or reduce, it does not matter. As I stated, some problems are better solved functional way. Because Python is such a friendly language, if it includes functional paradigm properly, it would make the functional part more readable than other functional languages.

FP is scary not because it has evil syntax to keep people at distance, it's just an alien paradigm to many. Lot's of non functional languages has functional support, which doesn't make them less readable. E.g. C#, JS. I suspect these languages have helped many understanding FP more. Python could make the jump by including more FP, but not turning into a full-fledged FP.

BTW. I'm still glad reduce is kept in functools.

Yes! List/Dictionary/Generator comprehension is one big plus for Python, it probably came from the functional world. I use it whenever I can.

But even the lambda keyword isn't so bad, you can create a dictionary of expressions to call by name, a lot more compact them declaring them the usual way imo: https://github.com/jazzyjackson/py-validate/blob/master/pyva...

lambda keyword is better than nothing, it definitely can be improved. Just imaging using javascript syntax in your example.

To your point, I only recently learned there's a Map function in Python, while in JS I'm .map(x=>y).filter(x=>y).reduce(x=>y)ing left and right.

I think with the introduction of list comprehension Guido saw map function was no longer needed, that was why he wanted it removed. I don't deny it, but using map and filter sometimes are just easier to read. Say [foo(v) for v in a] vs map(foo, a).

I strongly think Python should have more functional programming support. Functional Programming Languages are usually scary to look at for many programmers. Python would not only be a good FP introduction to them, it would also benefit greatly.

Years ago I found out the Guido wouldn't let tail recursion included, and even tried to remove map function from built in functions. Therefore I got the impression that python wouldn't have further support in FP. I really wish that is not the case. With the coming pattern matching in 3.10, My hope is high again.

I have very high respect for Guido van Rossum, I'm not here to discredit him. He's one of the authors in PEP 634.

I wish python would have simpler syntax for lambda which is currently using the lambda expression, even JS is doing better on this. A built-in syntax for partial would also be great. It could be even better if we can have function composition.

Some problems are better solved the FP way. It could even make the program more readable which is one of the strengths of Python.